context_var.module

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

Functions

File

sites/all/modules/elmsln_contrib/context_var/context_var.module
View source
  1. <?php
  2. // ELMS: Context Variable
  3. // Development Sponsored by The Pennsylvania State University
  4. // The ELMS project name is Copyright (C) 2008-2014 The Pennsylvania State University
  5. // Bryan Ollendyke
  6. // bto108@psu.edu
  7. // 12 Borland
  8. // University Park, PA 16802
  9. /**
  10. * Implements hook_context_registry().
  11. */
  12. function context_var_context_registry() {
  13. return array(
  14. 'conditions' => array(
  15. 'context_var' => array(
  16. 'title' => t('Variable match'),
  17. 'plugin' => 'context_var_context_condition',
  18. ),
  19. ),
  20. );
  21. }
  22. /**
  23. * Implements hook_ctools_plugin_api().
  24. */
  25. function context_var_ctools_plugin_api($module, $api) {
  26. if ($module == 'context' && $api == 'plugins') {
  27. return array('version' => 3);
  28. }
  29. }
  30. /**
  31. * Implements hook_context_plugins().
  32. */
  33. function context_var_context_plugins() {
  34. $plugins = array();
  35. $plugins['context_var_context_condition'] = array(
  36. 'handler' => array(
  37. 'path' => drupal_get_path('module', 'context_var') . '/plugins',
  38. 'file' => 'context_var_context_condition.inc',
  39. 'class' => 'context_var_context_condition',
  40. 'parent' => 'context_condition',
  41. ),
  42. );
  43. return $plugins;
  44. }
  45. /**
  46. * Implements hook_init().
  47. */
  48. function context_var_init() {
  49. // get the mapping of conditions and if they should execute
  50. $map = context_condition_map();
  51. if (!empty($map['context_var']) && $plugin = context_get_plugin('condition', 'context_var')) {
  52. $plugin->execute();
  53. }
  54. }