Mercurial > hg > rr-repo
comparison sites/all/modules/ctools/plugins/access/node_status.inc @ 0:ff03f76ab3fe
initial version
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Wed, 21 Aug 2013 18:51:11 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:ff03f76ab3fe |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Plugin to provide access control based upon node (un)published status. | |
6 */ | |
7 | |
8 /** | |
9 * Plugins are described by creating a $plugin array which will be used | |
10 * by the system that includes this file. | |
11 */ | |
12 $plugin = array( | |
13 'title' => t("Node: (un)published"), | |
14 'description' => t('Control access by the nodes published status.'), | |
15 'callback' => 'ctools_node_status_ctools_access_check', | |
16 'summary' => 'ctools_node_status_ctools_access_summary', | |
17 'required context' => new ctools_context_required(t('Node'), 'node'), | |
18 ); | |
19 | |
20 /** | |
21 * Check for access. | |
22 */ | |
23 function ctools_node_status_ctools_access_check($conf, $context) { | |
24 return (!empty($context->data) && $context->data->status); | |
25 } | |
26 | |
27 /** | |
28 * Provide a summary description based upon the checked node_statuss. | |
29 */ | |
30 function ctools_node_status_ctools_access_summary($conf, $context) { | |
31 return t('Returns true if the nodes status is "published".'); | |
32 } | |
33 |