Projet

Général

Profil

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

root / drupal7 / sites / all / modules / acl / acl.api.php @ cfceb792

1
<?php
2

    
3
/**
4
 * @file
5
 * API documentation for ACL.
6
 */
7

    
8
/**
9
 * Explain what your ACL grant records mean.
10
 */
11
function hook_acl_explain($acl_id, $name, $number, $users = NULL) {
12
  if (empty($users)) {
13
    return "ACL (id=$acl_id) would grant access to $name/$number.";
14
  }
15
  return "ACL (id=$acl_id) grants access to $name/$number to the listed user(s).";
16
}
17

    
18
/**
19
 * Inform ACL module that the client module is enabled.
20
 *
21
 * ACL will not return its NA records for your module if your module does not
22
 * confirm that it's active.
23
 *
24
 * If you use the example below, you can disable ACL on hook_disable using:
25
 * @code
26
 * function MYMODULE_disable() {
27
 *   MYMODULE_enabled(FALSE);
28
 * }
29
 * @endcode
30
 */
31
function hook_enabled($set = NULL) {
32
  static $enabled = TRUE; // not drupal_static!
33

    
34
  if ($set !== NULL) {
35
    $enabled = $set;
36
  }
37
  return $enabled;
38
}