You are here

function views_plugin_argument_default_ancestor::argument_form in Node Hierarchy 7.2

Same name and namespace in other branches
  1. 6.3 includes/views/views_plugin_argument_default_ancestor.inc \views_plugin_argument_default_ancestor::argument_form()
  2. 7.4 includes/views/views_plugin_argument_default_ancestor.inc \views_plugin_argument_default_ancestor::argument_form()

File

includes/views/views_plugin_argument_default_ancestor.inc, line 12
Contains the node from URL argument default plugin.

Class

views_plugin_argument_default_ancestor
Default argument plugin to extract an ancestor node id of the currently active node.

Code

function argument_form(&$form, &$form_state) {
  $form['default_argument_ancestor_depth'] = array(
    '#title' => t('Ancestor Depth'),
    '#type' => 'textfield',
    '#default_value' => isset($this->argument->options['default_argument_ancestor_depth']) ? $this->argument->options['default_argument_ancestor_depth'] : -1,
    '#description' => t('Specify a the depth of the ancestor to use. You can specify from the top of the ancestor chain with a positive integer or from the bottom with a negative integer. For example: 1 would be the top level ancester, while -1 would be the current node\'s immediate parent.'),
    '#process' => array(
      'views_process_dependency',
    ),
    '#dependency' => array(
      'radio:options[default_action]' => array(
        'default',
      ),
      'radio:options[default_argument_type]' => array(
        $this->id,
      ),
    ),
    '#dependency_count' => 2,
  );
}