HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/www2/modules/views/plugins/views_plugin_argument_default_raw.inc
<?php
/**
 * @file
 * Contains the raw value argument default plugin.
 */

/**
 * Default argument plugin to use the raw value from the URL.
 */
class views_plugin_argument_default_raw extends views_plugin_argument_default {
  function option_definition() {
    $options = parent::option_definition();
    $options['index'] = array('default' => '');

    return $options;
  }

  function options_form(&$form, &$form_state) {
    // Using range(1, 10) will create an array keyed 0-9, which allows arg() to
    // properly function since it is also zero-based.
    $form['index'] = array(
      '#type' => 'select',
      '#title' => t('Path component'),
      '#default_value' => $this->options['index'],
      '#options' => range(1, 10),
      '#description' => t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'),
    );
  }

  function get_argument() {
    if ($arg = arg($this->options['index'])) {
      return $arg;
    }
  }
}