context_condition_user.inc

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

Classes

Namesort descending Description
context_condition_user Expose current user role as a context condition.

File

sites/all/modules/ulmus/context/plugins/context_condition_user.inc
View source
  1. <?php
  2. /**
  3. * Expose current user role as a context condition.
  4. */
  5. class context_condition_user extends context_condition {
  6. function condition_values() {
  7. $values = array();
  8. foreach (user_roles() as $rid => $role_name) {
  9. if ($rid == DRUPAL_ANONYMOUS_RID) {
  10. $values['anonymous user'] = check_plain($role_name);
  11. }
  12. elseif ($rid == DRUPAL_AUTHENTICATED_RID) {
  13. $values['authenticated user'] = check_plain($role_name);
  14. }
  15. else {
  16. $values[$role_name] = check_plain($role_name);
  17. }
  18. }
  19. return $values;
  20. }
  21. function execute($account) {
  22. $roles = $account->roles;
  23. foreach ($roles as $rid => $role) {
  24. foreach ($this->get_contexts($role) as $context) {
  25. $this->condition_met($context, $role);
  26. }
  27. }
  28. }
  29. }
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.