You are here

function context_condition_user_page::options_form in Context 6.3

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

Options form. Provide additional options for your condition.

Overrides context_condition::options_form

File

plugins/context_condition_user_page.inc, line 15

Class

context_condition_user_page
Expose user pages as a context condition.

Code

function options_form($context) {
  $defaults = $this
    ->fetch_from_context($context, 'options');
  return array(
    'mode' => array(
      '#title' => t('Active for'),
      '#type' => 'select',
      '#options' => array(
        'all' => t('Any user'),
        'current' => t('Only the current user'),
        'other' => t('Only other users'),
      ),
      '#default_value' => isset($defaults['mode']) ? $defaults['mode'] : 'all',
    ),
  );
}