Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/plugins/views_plugin_access.inc
17 17
 * The base plugin to handle access control.
18 18
 */
19 19
class views_plugin_access extends views_plugin {
20

  
20 21
  /**
21 22
   * Initialize the plugin.
22 23
   *
23
   * @param $view
24
   * @param view $view
24 25
   *   The view object.
25
   * @param $display
26
   * @param object $display
26 27
   *   The display handler.
27 28
   */
28
  function init(&$view, &$display) {
29
  public function init(&$view, &$display) {
29 30
    $this->view = &$view;
30 31
    $this->display = &$display;
31 32

  
32 33
    if (is_object($display->handler)) {
33 34
      $options = $display->handler->get_option('access');
34
      // Overlay incoming options on top of defaults
35
      // Overlay incoming options on top of defaults.
35 36
      $this->unpack_options($this->options, $options);
36 37
    }
37 38
  }
38 39

  
39 40
  /**
40
   * Retrieve the options when this is a new access
41
   * control plugin
41
   * Retrieve the options when this is a new access control plugin.
42 42
   */
43
  function option_definition() { return array(); }
43
  public function option_definition() {
44
    return array();
45
  }
44 46

  
45 47
  /**
46 48
   * Provide the default form for setting options.
47 49
   */
48
  function options_form(&$form, &$form_state) { }
50
  public function options_form(&$form, &$form_state) {
51
  }
49 52

  
50 53
  /**
51
   * Provide the default form form for validating options
54
   * Provide the default form form for validating options.
52 55
   */
53
  function options_validate(&$form, &$form_state) { }
56
  public function options_validate(&$form, &$form_state) {
57
  }
54 58

  
55 59
  /**
56
   * Provide the default form form for submitting options
60
   * Provide the default form form for submitting options.
57 61
   */
58
  function options_submit(&$form, &$form_state) { }
62
  public function options_submit(&$form, &$form_state) {
63
  }
59 64

  
60 65
  /**
61
   * Return a string to display as the clickable title for the
62
   * access control.
66
   * Return a string to display as the clickable title for the access control.
63 67
   */
64
  function summary_title() {
68
  public function summary_title() {
65 69
    return t('Unknown');
66 70
  }
67 71

  
68 72
  /**
69 73
   * Determine if the current user has access or not.
70 74
   */
71
  function access($account) {
72
    // default to no access control.
75
  public function access($account) {
76
    // Default to no access control.
73 77
    return TRUE;
74 78
  }
75 79

  
......
80 84
   * performance hits during menu item access testing, which happens
81 85
   * a lot.
82 86
   *
83
   * @return an array; the first item should be the function to call,
84
   *   and the second item should be an array of arguments. The first
85
   *   item may also be TRUE (bool only) which will indicate no
86
   *   access control.)
87
   * @return array
88
   *   The first item should be the function to call, and the second item should
89
   *   be an array of arguments. The first item may also be TRUE (bool only)
90
   *   which will indicate no access control.
87 91
   */
88
  function get_access_callback() {
89
    // default to no access control.
92
  public function get_access_callback() {
93
    // Default to no access control.
90 94
    return TRUE;
91 95
  }
96

  
92 97
}
93 98

  
94 99
/**

Formats disponibles : Unified diff