You are here

function masquerade_context_condition::options_form in Masquerade Extras 7.2

Same name and namespace in other branches
  1. 6.2 masquerade_context/plugins/condition/masquerade_context.inc \masquerade_context_condition::options_form()
  2. 7 masquerade_context/plugins/condition/masquerade_context.inc \masquerade_context_condition::options_form()

Exposes additonal configuration options for this plugin. @returns A form. @retval array

Overrides context_condition::options_form

File

masquerade_context/plugins/condition/masquerade_context.inc, line 27
Expose masquerade as a customizable context condition.

Class

masquerade_context_condition
@file Expose masquerade as a customizable context condition.

Code

function options_form($context) {

  // Get the current settings from the context provided.
  $defaults = $this
    ->fetch_from_context($context, 'options');
  $form = array();
  $form['mode'] = array(
    '#title' => t('How should this condition be evaluated?'),
    '#type' => 'checkboxes',
    '#default_value' => !empty($defaults['mode']) ? $defaults['mode'] : array(
      'is_masquerading' => 'is_masquerading',
    ),
    '#options' => array(
      'is_masquerading' => t('This user is posing as someone else.'),
      'is_being_masqueraded' => t('Someone is posing as this user.'),
    ),
  );
  return $form;
}