Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/access/context_exists.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Plugin to provide access control/visibility based on existence of a specified context |
|
5 |
* Plugin to provide access control/visibility based on existence of a specified context.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
$plugin = array( |
... | ... | |
16 | 16 |
); |
17 | 17 |
|
18 | 18 |
/** |
19 |
* Settings form |
|
19 |
* Settings form.
|
|
20 | 20 |
*/ |
21 | 21 |
function ctools_context_exists_ctools_access_settings($form, &$form_state, $conf) { |
22 | 22 |
$form['settings']['exists'] = array( |
... | ... | |
29 | 29 |
} |
30 | 30 |
|
31 | 31 |
/** |
32 |
* Check for access |
|
32 |
* Check for access.
|
|
33 | 33 |
*/ |
34 | 34 |
function ctools_context_exists_ctools_access_check($conf, $context) { |
35 |
// xor returns false if the two bools are the same, and true if they are not.
|
|
35 |
// Xor returns false if the two bools are the same, and true if they are not.
|
|
36 | 36 |
// i.e, if we asked for context_exists and it does, return true. |
37 | 37 |
// If we asked for context does not exist and it does, return false. |
38 | 38 |
return (empty($context->data) xor !empty($conf['exists'])); |
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
/** |
42 |
* Provide a summary description based upon the specified context |
|
42 |
* Provide a summary description based upon the specified context.
|
|
43 | 43 |
*/ |
44 | 44 |
function ctools_context_exists_ctools_access_summary($conf, $context) { |
45 | 45 |
if (!empty($conf['exists'])) { |
Formats disponibles : Unified diff
Weekly update of contrib modules