front.inc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * Plugin to provide access control based on drupal_is_front_page.
  5. */
  6. /**
  7. * Plugins are described by creating a $plugin array which will be used
  8. * by the system that includes this file.
  9. */
  10. $plugin = array(
  11. 'title' => t('Front page'),
  12. 'description' => t('Is this the front page.'),
  13. 'callback' => 'ctools_front_ctools_access_check',
  14. 'default' => array('negate' => 0),
  15. 'settings form' => 'ctools_front_ctools_access_settings',
  16. 'summary' => 'ctools_front_ctools_access_summary',
  17. );
  18. /**
  19. * Settings form for the 'by parent term' access plugin.
  20. */
  21. function ctools_front_ctools_access_settings($form, &$form_state, $conf) {
  22. // No additional configuration necessary.
  23. return $form;
  24. }
  25. /**
  26. * Check for access.
  27. */
  28. function ctools_front_ctools_access_check($conf, $context) {
  29. if (drupal_is_front_page()) {
  30. return TRUE;
  31. }
  32. else {
  33. return FALSE;
  34. }
  35. }
  36. /**
  37. * Provide a summary description based upon the checked terms.
  38. */
  39. function ctools_front_ctools_access_summary($conf, $context) {
  40. return t('The front page');
  41. }