| 1 |
<?php
|
| 2 |
// $Id: comment.views_default.inc,v 1.6 2008/06/10 21:30:43 merlinofchaos Exp $
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Contains the grid style plugin.
|
| 6 |
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Style plugin to render each item in a grid cell.
|
| 10 |
*
|
| 11 |
* @ingroup views_style_plugins
|
| 12 |
*/
|
| 13 |
class views_plugin_style_grid extends views_plugin_style {
|
| 14 |
/**
|
| 15 |
* Set default options
|
| 16 |
*/
|
| 17 |
function option_definition() {
|
| 18 |
$options = parent::option_definition();
|
| 19 |
|
| 20 |
$options['columns'] = array('default' => '4');
|
| 21 |
$options['alignment'] = array('default' => 'horizontal');
|
| 22 |
|
| 23 |
return $options;
|
| 24 |
}
|
| 25 |
|
| 26 |
/**
|
| 27 |
* Render the given style.
|
| 28 |
*/
|
| 29 |
function options_form(&$form, &$form_state) {
|
| 30 |
parent::options_form($form, $form_state);
|
| 31 |
$form['columns'] = array(
|
| 32 |
'#type' => 'textfield',
|
| 33 |
'#title' => t('Number of columns'),
|
| 34 |
'#default_value' => $this->options['columns'],
|
| 35 |
);
|
| 36 |
$form['alignment'] = array(
|
| 37 |
'#type' => 'radios',
|
| 38 |
'#title' => t('Alignment'),
|
| 39 |
'#options' => array('horizontal' => t('Horizontal'), 'vertical' => t('Vertical')),
|
| 40 |
'#default_value' => $this->options['alignment'],
|
| 41 |
'#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.'),
|
| 42 |
);
|
| 43 |
}
|
| 44 |
}
|
| 45 |
|