You are here

class supersized_context_reaction in Supersized 7

Same name and namespace in other branches
  1. 8 supersized_context/supersized_context_reaction.inc \supersized_context_reaction

@file Reaction class of supersized.

To apply Supersized.

Hierarchy

Expanded class hierarchy of supersized_context_reaction

2 string references to 'supersized_context_reaction'
supersized_context_context_plugins in supersized_context/supersized_context.module
Implements hook_context_plugins().
supersized_context_context_registry in supersized_context/supersized_context.module
Implements hook_context_registry().

File

supersized_context/supersized_context_reaction.inc, line 9
Reaction class of supersized.

View source
class supersized_context_reaction extends context_reaction {

  /**
   * Construct option form.
   */
  function options_form($context) {
    $values = $this
      ->fetch_from_context($context);
    $form['#tree'] = TRUE;
    $form['nid'] = array(
      '#type' => 'textfield',
      '#title' => t('Content'),
      '#autocomplete_path' => 'supersized/autocomplete',
      '#maxlength' => 1024,
      '#default_value' => $values ? $values['nid'] : NULL,
      '#description' => t('Slides of the content will be used as the supersized.'),
    );
    return $form;
  }

  /**
   * See if context contains redirect reaction.
   */
  function execute() {
    $contexts = context_active_contexts();
    foreach ($contexts as $context) {
      if (!empty($context->reactions[$this->plugin])) {
        preg_match('/\\[nid: (\\d+)\\]$/', $context->reactions[$this->plugin]['nid'], $matches);
        $nid = $matches[1];
        return $nid;
      }
    }
  }

}

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.
supersized_context_reaction::execute function See if context contains redirect reaction.
supersized_context_reaction::options_form function Construct option form. Overrides context_reaction::options_form