You are here

function context_condition::editor_form in Context 6.3

Same name and namespace in other branches
  1. 6 plugins/context_condition.inc \context_condition::editor_form()
  2. 7.3 plugins/context_condition.inc \context_condition::editor_form()

Context editor form for conditions.

1 call to context_condition::editor_form()
context_condition_sitewide::editor_form in plugins/context_condition_sitewide.inc
Context editor form for conditions.
1 method overrides context_condition::editor_form()
context_condition_sitewide::editor_form in plugins/context_condition_sitewide.inc
Context editor form for conditions.

File

plugins/context_condition.inc, line 92

Class

context_condition
Base class for a context condition.

Code

function editor_form($context = NULL) {
  $form = array();
  if (!empty($this->values)) {
    $options = $this
      ->condition_values();
    foreach ($this->values as $value => $contexts) {
      $label = "{$this->title}: ";
      $label .= isset($options[$value]) ? trim($options[$value], ' -') : $value;
      $form[$value] = array(
        '#type' => 'checkbox',
        '#title' => check_plain($label),
        '#default_value' => empty($context->name) ? TRUE : in_array($context->name, $contexts, TRUE),
      );
    }
  }
  return $form;
}