You are here

class title_override_reaction_override in Title Override 7.2

@file Context reaction for Metatag.

Hierarchy

Expanded class hierarchy of title_override_reaction_override

2 string references to 'title_override_reaction_override'
title_override_context_plugins in ./title_override.module
Implements hook_context_plugins()
title_override_context_registry in ./title_override.module
Implements hook_context_registry()

File

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

View source
class title_override_reaction_override extends context_reaction {
  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;
  }

  /**
   * Output a list of active contexts.
   */
  function execute() {
    $contexts = context_active_contexts();
    foreach ($contexts as $context) {
      if (!empty($context->reactions['title_override'])) {
        $title_override =& drupal_static('title_override');
        $title_override = $context->reactions['title_override']['title'];
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
context_reaction::$description property
context_reaction::$plugin property
context_reaction::$title property
context_reaction::fetch_from_context function Retrieve options from the context provided. 1
context_reaction::get_contexts function Retrieve active contexts that have values for this reaction.
context_reaction::options_form_submit function Options form submit handler. 3
context_reaction::settings_form function Settings form. Provide variable settings for your reaction. 2
context_reaction::__clone function Clone our references when we're being cloned.
context_reaction::__construct function Constructor. Do not override.
title_override_reaction_override::execute function Output a list of active contexts.
title_override_reaction_override::options_form function Overrides context_reaction::options_form