context_condition_language.inc 378 B

12345678910111213141516
  1. <?php
  2. /**
  3. * Expose current language as a context condition.
  4. */
  5. class context_condition_language extends context_condition {
  6. function condition_values() {
  7. return module_exists('locale') ? locale_language_list() : array();
  8. }
  9. function execute($value) {
  10. foreach ($this->get_contexts($value) as $context) {
  11. $this->condition_met($context, $value);
  12. }
  13. }
  14. }