You are here

function sheetnode_plugin_style::options_form in Sheetnode 7

Same name and namespace in other branches
  1. 6 views/sheetnode_plugin_style.inc \sheetnode_plugin_style::options_form()
  2. 7.2 views/sheetnode_plugin_style.inc \sheetnode_plugin_style::options_form()

Provide a form to edit options for this plugin.

Overrides views_plugin_style::options_form

1 call to sheetnode_plugin_style::options_form()
sheetnode_feed_plugin_style::options_form in views/sheetnode_plugin_style.inc
Provide a form to edit options for this plugin.
1 method overrides sheetnode_plugin_style::options_form()
sheetnode_feed_plugin_style::options_form in views/sheetnode_plugin_style.inc
Provide a form to edit options for this plugin.

File

views/sheetnode_plugin_style.inc, line 21

Class

sheetnode_plugin_style

Code

function options_form(&$form, &$form_values) {
  parent::options_form($form, $form_values);
  $form['expansion'] = array(
    '#type' => 'radios',
    '#title' => t('Expansion of results'),
    '#description' => t('You can specify whether view results should be expanded horizontally or vertically.'),
    '#options' => array(
      SHEETNODE_EXPANSION_VERTICAL => t('Consecutive rows'),
      SHEETNODE_EXPANSION_HORIZONTAL => t('Consecutive columns'),
    ),
    '#default_value' => $this->options['expansion'],
    '#weight' => 97,
  );
  $form['use_template'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use template'),
    '#description' => t('Check this box to use the spreadsheet below as template for your view.
                           To place view results in the template, use the following syntax in the cells:
                           <ul>
                           <li><code>${field_label}</code> to indicate that this cell and subsequent ones should be filled with values of this field.</li>
                           <li><code>${FUNCTION(@field_label@, $field_label$, @cell_reference@, ...)}</code> to indicate that this cell and subsequent ones should be filled with a calculation.
                           <code>@field_label@</code> are replaced with the corresponding cell references, and <code>$field_label$</code> are replaced with actual field values.</li>
                           <li><code>$[FUNCTION(@field_label@, @cell_reference@, ...)]</code> to indicate that a calculation should be placed in this cell.
                           <code>@field_label@</code> are replaced with the corresponding cell ranges.</li>
                           </ul>'),
    '#default_value' => $this->options['use_template'],
    '#weight' => 98,
  );
  $id = 'edit-style-options-template';
  $form['template'] = array(
    '#type' => 'hidden',
    '#attributes' => array(
      'id' => $id,
    ),
    '#weight' => 99,
  );
  $this
    ->render_inject($this->options['template'], $id, $form['template'], '#prefix');
}