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

plugins/views_plugin_argument_default_raw.inc

Go to the documentation of this file.
00001 <?php
00010 class views_plugin_argument_default_raw extends views_plugin_argument_default {
00011   function option_definition() {
00012     $options = parent::option_definition();
00013     $options['index'] = array('default' => '');
00014 
00015     return $options;
00016   }
00017 
00018   function options_form(&$form, &$form_state) {
00019     parent::options_form($form, $form_state);
00020     // Using range(1, 10) will create an array keyed 0-9, which allows arg() to
00021     // properly function since it is also zero-based.
00022     $form['index'] = array(
00023       '#type' => 'select',
00024       '#title' => t('Path component'),
00025       '#default_value' => $this->options['index'],
00026       '#options' => range(1, 10),
00027       '#description' => t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'),
00028     );
00029   }
00030 
00031   function get_argument() {
00032     if ($arg = arg($this->options['index'])) {
00033       return $arg;
00034     }
00035   }
00036 }

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