context_condition_sitewide.inc 524 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Simple sitewide context, always present.
  4. */
  5. class context_condition_sitewide extends context_condition {
  6. function condition_values() {
  7. return array(1 => t('Always active'));
  8. }
  9. function editor_form($context = NULL) {
  10. $form = parent::editor_form($context);
  11. $form[1]['#title'] = t('Always active');
  12. $form['#weight'] = -10;
  13. return $form;
  14. }
  15. function execute($value) {
  16. foreach ($this->get_contexts($value) as $context) {
  17. $this->condition_met($context, $value);
  18. }
  19. }
  20. }