pastebin

Paste Search Dynamic
Recent pastes
front
  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. }
Parsed in 0.017 seconds