source: sipes/modules_contrib/views/plugins/views_plugin_argument_default_raw.inc @ 65dadeb

stableversion-3.0
Last change on this file since 65dadeb was 65dadeb, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agregaron los archivos de la nueva version del modulo

  • Propiedad mode establecida a 100644
File size: 990 octetos
Línea 
1<?php
2/**
3 * @file
4 * Contains the raw value argument default plugin.
5 */
6
7/**
8 * Default argument plugin to use the raw value from the URL.
9 */
10class views_plugin_argument_default_raw extends views_plugin_argument_default {
11  function option_definition() {
12    $options = parent::option_definition();
13    $options['index'] = array('default' => '');
14
15    return $options;
16  }
17
18  function options_form(&$form, &$form_state) {
19    // Using range(1, 10) will create an array keyed 0-9, which allows arg() to
20    // properly function since it is also zero-based.
21    $form['index'] = array(
22      '#type' => 'select',
23      '#title' => t('Path component'),
24      '#default_value' => $this->options['index'],
25      '#options' => range(1, 10),
26      '#description' => t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'),
27    );
28  }
29
30  function get_argument() {
31    if ($arg = arg($this->options['index'])) {
32      return $arg;
33    }
34  }
35}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.