comparison sites/all/modules/ctools/plugins/access/front.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 on drupal_is_front_page.
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('Front page'),
14 'description' => t('Is this the front page.'),
15 'callback' => 'ctools_front_ctools_access_check',
16 'default' => array('negate' => 0),
17 'settings form' => 'ctools_front_ctools_access_settings',
18 'summary' => 'ctools_front_ctools_access_summary',
19 );
20
21 /**
22 * Settings form for the 'by parent term' access plugin
23 */
24 function ctools_front_ctools_access_settings($form, &$form_state, $conf) {
25 // No additional configuration necessary.
26 return $form;
27 }
28
29 /**
30 * Check for access.
31 */
32 function ctools_front_ctools_access_check($conf, $context) {
33 if (drupal_is_front_page()) {
34 return TRUE;
35 }
36 else {
37 return FALSE;
38 }
39 }
40
41 /**
42 * Provide a summary description based upon the checked terms.
43 */
44 function ctools_front_ctools_access_summary($conf, $context) {
45 return t('The front page');
46 }