You are here

function menu_reference_plugin_argument_default_menu_trail::options_form in Menu Reference 7

Provide the default form for setting options.

Overrides views_plugin_argument_default::options_form

File

views/plugins/menu_reference_plugin_argument_default_menu_trail.inc, line 20
Views plugin for argument default value.

Class

menu_reference_plugin_argument_default_menu_trail
Default argument plugin to return current page menu trail.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['allowed_menu'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Allowed menus'),
    '#options' => menu_get_menus(TRUE),
    '#default_value' => is_array($this->options['allowed_menu']) ? array_filter($this->options['allowed_menu']) : array(),
    '#description' => t('Determine menu reference only in selected options. If you don\'t choose any option all available menus will be used to determine active trail.'),
  );
  $form['depth'] = array(
    '#type' => 'select',
    '#title' => t('Depth'),
    '#options' => array(
      0 => t('0 (only current item)'),
      1 => 1,
      2 => 2,
      3 => 3,
      4 => 4,
      5 => 5,
      6 => 6,
      7 => 7,
      8 => 8,
      9 => 9,
    ),
    '#default_value' => $this->options['depth'],
    '#description' => t('Set how deep in active trail should be menu reference determined. (Default: <em>9</em>, up to deepest level in menu hierarchy)'),
  );
  $form['include_front'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include front page link in active trail'),
    '#default_value' => $this->options['include_front'],
    '#description' => t('Check this option if you want to include front page link in active menu trail to determine menu reference.'),
  );
}