• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

plugins/views_plugin_style_grid.inc

Go to the documentation of this file.
00001 <?php
00012 class views_plugin_style_grid extends views_plugin_style {
00016   function option_definition() {
00017     $options = parent::option_definition();
00018 
00019     $options['columns'] = array('default' => '4');
00020     $options['alignment'] = array('default' => 'horizontal');
00021     $options['fill_single_line'] = array('default' => TRUE);
00022     $options['summary'] = array('default' => '');
00023 
00024     return $options;
00025   }
00026 
00030   function options_form(&$form, &$form_state) {
00031     parent::options_form($form, $form_state);
00032     $form['columns'] = array(
00033       '#type' => 'textfield',
00034       '#title' => t('Number of columns'),
00035       '#default_value' => $this->options['columns'],
00036       '#required' => TRUE,
00037       '#element_validate' => array('views_element_validate_integer'),
00038     );
00039     $form['alignment'] = array(
00040       '#type' => 'radios',
00041       '#title' => t('Alignment'),
00042       '#options' => array('horizontal' => t('Horizontal'), 'vertical' => t('Vertical')),
00043       '#default_value' => $this->options['alignment'],
00044       '#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.'),
00045     );
00046 
00047     $form['fill_single_line'] = array(
00048       '#type' => 'checkbox',
00049       '#title' => t('Fill up single line'),
00050       '#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.'),
00051       '#default_value' => !empty($this->options['fill_single_line']),
00052     );
00053 
00054     $form['summary'] = array(
00055       '#type' => 'textfield',
00056       '#title' => t('Table summary'),
00057       '#description' => t('This value will be displayed as table-summary attribute in the html. Set this for better accessiblity of your site.'),
00058       '#default_value' => $this->options['summary'],
00059     );
00060   }
00061 }

Generated on Sun Feb 26 2012 12:52:52 for Views by  doxygen 1.7.1