You are here

function context_error_context_condition_error::condition_form in Context error 7

Condition form.

Overrides context_condition::condition_form

File

plugins/context_error_context_conditions.inc, line 48
Context condition plugin to provide a trigger for 404 and 403 error pages.

Class

context_error_context_condition_error
Expose the 404 error page as the context condition.

Code

function condition_form($context) {
  return array(
    '#title' => $this->title,
    '#description' => t('Select which error case should this condition activate.'),
    '#options' => $this
      ->condition_values(),
    '#type' => 'radios',
    '#default_value' => count($this
      ->fetch_from_context($context, 'values')) > 1 ? CONTEXT_ERROR_403_404 : key($this
      ->fetch_from_context($context, 'values')),
  );
}