[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views/plugins/ -> views_plugin_style_grid.inc (source)

   1  <?php
   2  /**
   3   * @file
   4   * Contains the grid style plugin.
   5   */
   6  
   7  /**
   8   * Style plugin to render each item in a grid cell.
   9   *
  10   * @ingroup views_style_plugins
  11   */
  12  class views_plugin_style_grid extends views_plugin_style {
  13    /**
  14     * Set default options
  15     */
  16    function option_definition() {
  17      $options = parent::option_definition();
  18  
  19      $options['columns'] = array('default' => '4');
  20      $options['alignment'] = array('default' => 'horizontal');
  21      $options['fill_single_line'] = array('default' => TRUE);
  22      $options['summary'] = array('default' => '');
  23  
  24      return $options;
  25    }
  26  
  27    /**
  28     * Render the given style.
  29     */
  30    function options_form(&$form, &$form_state) {
  31      parent::options_form($form, $form_state);
  32      $form['columns'] = array(
  33        '#type' => 'textfield',
  34        '#title' => t('Number of columns'),
  35        '#default_value' => $this->options['columns'],
  36      );
  37      $form['alignment'] = array(
  38        '#type' => 'radios',
  39        '#title' => t('Alignment'),
  40        '#options' => array('horizontal' => t('Horizontal'), 'vertical' => t('Vertical')),
  41        '#default_value' => $this->options['alignment'],
  42        '#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.'),
  43      );
  44      
  45      $form['fill_single_line'] = array(
  46        '#type' => 'checkbox',
  47        '#title' => t('Fill up single line'),
  48        '#description' => t('If you disable this option a grid with only one row will have the amount of items as tds. If you disable it this can cause problems with your css.'),
  49        '#default_value' => !empty($this->options['fill_single_line']),
  50      );
  51  
  52      $form['summary'] = array(
  53        '#type' => 'textfield',
  54        '#title' => t('Table summary'),
  55        '#description' => t('This value will be displayed as table-summary attribute in the html. Set this for better accessiblity of your site.'),
  56        '#default_value' => $this->options['summary'],
  57      );
  58    }
  59  }
  60  


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7