context_condition_theme.module

  1. cis7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  2. cle7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  3. ecd7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  4. elmsmedia7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  5. harmony7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  6. icor7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  7. meedjum_blog7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
  8. mooc7 sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module

Functions

File

sites/all/modules/ulmus/context_condition_theme/context_condition_theme.module
View source
  1. <?php
  2. // $Id:
  3. /**
  4. * Implements hook_ctools_plugin_api().
  5. */
  6. function context_condition_theme_ctools_plugin_api($module, $api) {
  7. if ($module == 'context' && $api == 'plugins') {
  8. return array('version' => 3);
  9. }
  10. }
  11. /**
  12. * Implements hook_context_plugins().
  13. */
  14. function context_condition_theme_context_plugins() {
  15. $plugins = array();
  16. /**
  17. * Conditions
  18. */
  19. $plugins['context_condition_theme'] = array(
  20. 'handler' => array(
  21. 'path' => drupal_get_path('module', 'context_condition_theme') . '/plugins',
  22. 'file' => 'context_condition_theme.inc',
  23. 'class' => 'context_condition_theme',
  24. 'parent' => 'context_condition',
  25. ),
  26. );
  27. return $plugins;
  28. }
  29. /**
  30. * Implements hook_context_registry().
  31. */
  32. function context_condition_theme_context_registry() {
  33. $registry = array();
  34. $registry['conditions'] = array(
  35. 'theme' => array(
  36. 'title' => t('Theme'),
  37. 'description' => 'Set this context on the basis of the theme being rendered',
  38. 'plugin' => 'context_condition_theme',
  39. ),
  40. );
  41. return $registry;
  42. }
  43. /**
  44. * Implementation of hook_context_page_reaction()
  45. * adds context based on the browser keywords string.
  46. */
  47. function context_condition_theme_context_page_condition() {
  48. if ($plugin = context_get_plugin('condition', 'theme')) {
  49. $plugin->execute();
  50. }
  51. }