You are here

function title_override_reaction_override::options_form in Title Override 7.2

Overrides context_reaction::options_form

File

./title_override.context.inc, line 8
Context reaction for Metatag.

Class

title_override_reaction_override
@file Context reaction for Metatag.

Code

function options_form($context) {
  $values = $this
    ->fetch_from_context($context);
  $form = array();
  $form['title'] = array(
    '#title' => t('Title tag'),
    '#description' => t('Overrides the page title'),
    '#type' => 'textfield',
    '#maxlength' => 400,
    '#default_value' => isset($values['title']) ? $values['title'] : '',
  );
  $form['admin'] = array(
    '#type' => 'hidden',
    '#value' => TRUE,
  );
  $form['tokens'] = array(
    '#theme' => 'token_tree',
    '#token_types' => 'all',
    // The token types that have specific context. Can be multiple token types like 'term' and/or 'user'
    '#global_types' => TRUE,
    // A boolean TRUE or FALSE whether to include 'global' context tokens like [current-user:*] or [site:*]. Defaults to TRUE.
    '#click_insert' => TRUE,
  );
  return $form;
}