View source
<?php
module_load_include('inc', 'views', 'plugins/views_plugin_style_list');
class views_plugin_style_sgrid extends views_plugin_style_list {
function option_definition() {
$options = parent::option_definition();
$options['type'] = array(
'default' => 'ul',
);
$options['class'] = array(
'default' => '',
);
$options['wrapper_class'] = array(
'default' => 'item-list',
);
$options['row_length'] = array(
'default' => '4',
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['type'] = array(
'#type' => 'radios',
'#title' => t('List type'),
'#options' => array(
'ul' => t('Unordered list'),
'ol' => t('Ordered list'),
),
'#default_value' => $this->options['type'],
);
$form['wrapper_class'] = array(
'#title' => t('Wrapper class'),
'#description' => t('The class to provide on the wrapper, outside the list.'),
'#type' => 'textfield',
'#size' => '30',
'#default_value' => $this->options['wrapper_class'],
);
$form['class'] = array(
'#title' => t('List class'),
'#description' => t('The class to provide on the list element itself.'),
'#type' => 'textfield',
'#size' => '30',
'#default_value' => $this->options['class'],
);
$form['row_length'] = array(
'#title' => t('Row length'),
'#description' => t('How many items should be displayed before a line break ?'),
'#type' => 'textfield',
'#size' => '2',
'#default_value' => $this->options['row_length'],
);
}
}