date_context.module

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

Functions

File

sites/all/modules/ulmus/date/date_context/date_context.module
View source
  1. <?php
  2. /**
  3. * @TODO
  4. *
  5. * Currently only implemented for nodes. Need to add $plugin->execute()
  6. * for any other entities that might be supported.
  7. *
  8. * Cache the date processing, perhaps cache the formatted, timezone-adjusted
  9. * date strings for each entity (would have to be cached differently for each
  10. * timezone, based on the tz_handling method for the date).
  11. *
  12. * Add an option to set/not set the context on forms vs views.
  13. */
  14. /**
  15. * Implements hook_context_node_condition_alter().
  16. */
  17. function date_context_context_node_condition_alter($node, $op) {
  18. if ($plugin = context_get_plugin('condition', 'date_context_date_condition')) {
  19. $plugin->execute($node, $op);
  20. }
  21. }
  22. /**
  23. * Implements hook_context_plugins()
  24. */
  25. function date_context_context_plugins() {
  26. $plugins = array();
  27. $plugins['date_context_date_condition'] = array(
  28. 'handler' => array(
  29. 'class' => 'date_context_date_condition',
  30. 'parent' => 'context_condition_node',
  31. 'path' => drupal_get_path('module', 'date_context') . '/plugins',
  32. 'file' => 'date_context_date_condition.inc',
  33. ),
  34. );
  35. return $plugins;
  36. }
  37. /**
  38. * Implements hook_context_registry()
  39. */
  40. function date_context_context_registry() {
  41. return array(
  42. 'conditions' => array(
  43. 'date_context_date_condition' => array(
  44. 'title' => t('Date'),
  45. 'description' => t('Set a condition based on the value of a date field'),
  46. 'plugin' => 'date_context_date_condition',
  47. ),
  48. ),
  49. );
  50. }
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.