|
Server IP : 10.2.73.233 / Your IP : 216.73.216.223 Web Server : Apache/2.4.59 (Debian) System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : www-data ( 33) PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/ilpnowa/../baltic/web/modules/node/../views/plugins/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* @file
* Contains the grid style plugin.
*/
/**
* Style plugin to render each item in a grid cell.
*
* @ingroup views_style_plugins
*/
class views_plugin_style_grid extends views_plugin_style {
/**
* Set default options
*/
function option_definition() {
$options = parent::option_definition();
$options['columns'] = array('default' => '4');
$options['alignment'] = array('default' => 'horizontal');
$options['fill_single_line'] = array('default' => TRUE, 'bool' => TRUE);
$options['summary'] = array('default' => '');
$options['caption'] = array('default' => '');
return $options;
}
/**
* Render the given style.
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['columns'] = array(
'#type' => 'textfield',
'#title' => t('Number of columns'),
'#default_value' => $this->options['columns'],
'#required' => TRUE,
'#element_validate' => array('views_element_validate_integer'),
);
$form['alignment'] = array(
'#type' => 'radios',
'#title' => t('Alignment'),
'#options' => array('horizontal' => t('Horizontal'), 'vertical' => t('Vertical')),
'#default_value' => $this->options['alignment'],
'#description' => t('Horizontal alignment will place items starting in the upper left and moving right. Vertical alignment will place items starting in the upper left and moving down.'),
);
$form['fill_single_line'] = array(
'#type' => 'checkbox',
'#title' => t('Fill up single line'),
'#description' => t('If you disable this option, a grid with only one row will have the same number of table cells (<TD>) as items. Disabling it can cause problems with your CSS.'),
'#default_value' => !empty($this->options['fill_single_line']),
);
$form['caption'] = array(
'#type' => 'textfield',
'#title' => t('Short description of table'),
'#description' => t('Include a caption for better accessibility of your table.'),
'#default_value' => $this->options['caption'],
);
$form['summary'] = array(
'#type' => 'textfield',
'#title' => t('Table summary'),
'#description' => t('This value will be displayed as table-summary attribute in the html. Use this to give a summary of complex tables.'),
'#default_value' => $this->options['summary'],
);
}
}