Projet

Général

Profil

Paste
Télécharger (698 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / tests / test_plugins / views_test_plugin_access_test_static.inc @ 5d12d676

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_test_plugin_access_test_static.
6
 */
7

    
8
/**
9
 * Tests a static access plugin.
10
 */
11
class views_test_plugin_access_test_static extends views_plugin_access {
12

    
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public function option_definition() {
17
    $options = parent::option_definition();
18
    $options['access'] = array('default' => FALSE, 'bool' => TRUE);
19

    
20
    return $options;
21
  }
22

    
23
  /**
24
   * {@inheritdoc}
25
   */
26
  public function access($account) {
27
    return !empty($this->options['access']);
28
  }
29

    
30
  /**
31
   * {@inheritdoc}
32
   */
33
  public function get_access_callback() {
34
    return array('views_test_test_static_access_callback', array(!empty($options['access'])));
35
  }
36

    
37
}