context_condition_theme.inc

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

Classes

Namesort descending Description
context_condition_theme Expose themes as a context condition.

File

sites/all/modules/ulmus/context_condition_theme/plugins/context_condition_theme.inc
View source
  1. <?php
  2. // $Id:
  3. /**
  4. * Expose themes as a context condition.
  5. */
  6. class context_condition_theme extends context_condition {
  7. /**
  8. * Override of condition_values().
  9. */
  10. function condition_values() {
  11. $values = array();
  12. foreach (list_themes() as $theme) {
  13. if ($theme->status) {
  14. $values[$theme->name] = $theme->info['name'];
  15. }
  16. }
  17. return $values;
  18. }
  19. /**
  20. * Override of execute().
  21. */
  22. function execute() {
  23. global $theme_info;
  24. if ($this->condition_used()) {
  25. foreach ($this->get_contexts($theme_info->name) as $context) {
  26. $themes = $this->fetch_from_context($context, 'values');
  27. foreach($themes as $theme) {
  28. if ($theme_info->name == $theme) {
  29. $this->condition_met($context);
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.