You are here

function views_pdf_plugin_style_grid::options_form in Views PDF 7.3

Options form

Overrides views_plugin_style::options_form

File

./views_pdf_plugin_style_grid.inc, line 104
Grid PDF style

Class

views_pdf_plugin_style_grid
This class holds all the funtionality used for the grid style plugin.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $attached = array(
    'css' => array(
      drupal_get_path('module', 'views_pdf') . '/theme/admin.css',
    ),
  );
  $form['#attached'] = $attached;
  if (empty($this->options['info'])) {
    $this->options = $this
      ->option_definition();
  }
  $form['info']['columns'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'type' => 'number',
      'min' => 1,
    ),
    '#size' => 4,
    '#title' => t('Grid columns'),
    '#default_value' => $this->options['info']['columns'],
  );
  $form['info']['column_space'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'type' => 'number',
      'min' => 0,
    ),
    '#size' => 4,
    '#title' => t('Column spacing'),
    '#default_value' => $this->options['info']['column_space'],
  );
  $form['info']['rows'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'type' => 'number',
      'min' => 1,
    ),
    '#size' => 4,
    '#title' => t('Grid rows'),
    '#default_value' => $this->options['info']['rows'],
  );
  $form['info']['row_space'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'type' => 'number',
      'min' => 0,
    ),
    '#size' => 4,
    '#title' => t('Row spacing'),
    '#default_value' => $this->options['info']['row_space'],
  );
  $form['info']['col_wise'] = array(
    '#type' => 'radios',
    '#title' => t('Layout order'),
    '#options' => array(
      'Row-first',
      'Column-first',
    ),
    '#default_value' => $this->options['info']['col_wise'],
  );
}