function context_condition::editor_form

cis7 context_condition.inc context_condition::editor_form($context = NULL)
cle7 context_condition.inc context_condition::editor_form($context = NULL)
elmsmedia7 context_condition.inc context_condition::editor_form($context = NULL)
icor7 context_condition.inc context_condition::editor_form($context = NULL)
meedjum_blog7 context_condition.inc context_condition::editor_form($context = NULL)
mooc7 context_condition.inc context_condition::editor_form($context = NULL)

Context editor form for conditions.

File

sites/all/modules/ulmus/context/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;
}