You are here

class context_no_title_reaction in Context No Title 7

@file Define class and override.

Hierarchy

Expanded class hierarchy of context_no_title_reaction

2 string references to 'context_no_title_reaction'
context_no_title_context_plugins in ./context_no_title.module
Implements hook_context_plugins().
context_no_title_context_registry in ./context_no_title.module
Implements hook_context_registry().

File

plugins/context_no_title_reaction.inc, line 7
Define class and override.

View source
class context_no_title_reaction extends context_reaction {

  /**
   * Prevent editor form..
   */
  function editor_form($context) {
  }

  /**
   * Add option to not show title.
   */
  function options_form($context) {
    $values = $this
      ->fetch_from_context($context);
    $form = array(
      'no_title' => array(
        '#title' => t('No Title on Page'),
        '#description' => t('Remove the title from the page template (often need if the node template wants to render the title)'),
        '#type' => 'checkbox',
        '#default_value' => isset($values['no_title']) ? $values['no_title'] : '',
      ),
    );
    return $form;
  }

  /**
   * Hide node title if option is set.
   */
  function execute(&$vars) {
    foreach ($this
      ->get_contexts() as $k => $v) {
      if (isset($v->reactions[$this->plugin]) && $v->reactions[$this->plugin]['no_title']) {
        $vars['title'] = '';
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
context_no_title_reaction::editor_form function Prevent editor form..
context_no_title_reaction::execute function Hide node title if option is set.
context_no_title_reaction::options_form function Add option to not show title. Overrides context_reaction::options_form
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.