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

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

se actualizo la version del modulo views

  • Propiedad mode establecida a 100644
File size: 2.6 KB
Línea 
1<?php
2/**
3 * @file
4 * Contains the fixed argument default plugin.
5 */
6
7/**
8 * @defgroup views_argument_default_plugins Views' argument default plugins
9 * @{
10 *
11 * Allow specialized methods of filling in arguments when they aren't
12 * provided.
13 *
14 * @see hook_views_plugins
15 */
16
17/**
18 * The fixed argument default handler; also used as the base.
19 */
20class views_plugin_argument_default extends views_plugin {
21  /**
22   * Return the default argument.
23   *
24   * This needs to be overridden by every default argument handler to properly do what is needed.
25   */
26  function get_argument() { }
27
28  /**
29   * Initialize this plugin with the view and the argument
30   * it is linked to.
31   */
32  function init(&$view, &$argument, $options) {
33    $this->view = &$view;
34    $this->argument = &$argument;
35
36    $this->convert_options($options);
37    $this->unpack_options($this->options, $options);
38  }
39
40  /**
41   * Retrieve the options when this is a new access
42   * control plugin
43   */
44  function option_definition() { return array(); }
45
46  /**
47   * Provide the default form for setting options.
48   */
49  function options_form(&$form, &$form_state) { }
50
51  /**
52   * Provide the default form form for validating options
53   */
54  function options_validate(&$form, &$form_state) { }
55
56  /**
57   * Provide the default form form for submitting options
58   */
59  function options_submit($form, &$form_state) { }
60
61  /**
62   * Determine if the administrator has the privileges to use this
63   * plugin
64   */
65  function access() { return TRUE; }
66
67  /**
68   * If we don't have access to the form but are showing it anyway, ensure that
69   * the form is safe and cannot be changed from user input.
70   *
71   * This is only called by child objects if specified in the options_form(),
72   * so it will not always be used.
73   */
74  function check_access(&$form, $option_name) {
75    if (!$this->access()) {
76      $form[$option_name]['#disabled'] = TRUE;
77      $form[$option_name]['#value'] = $form[$this->option_name]['#default_value'];
78      $form[$option_name]['#description'] .= ' <strong>' . t('Note: you do not have permission to modify this. If you change the default argument type, this setting will be lost and you will NOT be able to get it back.') . '</strong>';
79    }
80  }
81
82  /**
83   * Convert options from the older style.
84   *
85   * In Views 3, the method of storing default argument options has changed
86   * and each plugin now gets its own silo. This method can be used to
87   * move arguments from the old style to the new style. See
88   * views_plugin_argument_default_fixed for a good example of this method.
89   */
90  function convert_options(&$options) { }
91}
92
93/**
94 * @}
95 */
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.