class context_no_title_reaction in Context No Title 7
@file Define class and override.
Hierarchy
- class \context_reaction
- class \context_no_title_reaction
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_no_title_reaction:: |
function | Prevent editor form.. | ||
context_no_title_reaction:: |
function | Hide node title if option is set. | ||
context_no_title_reaction:: |
function |
Add option to not show title. Overrides context_reaction:: |
||
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
function | Retrieve options from the context provided. | 1 | |
context_reaction:: |
function | Retrieve active contexts that have values for this reaction. | ||
context_reaction:: |
function | Options form submit handler. | 3 | |
context_reaction:: |
function | Settings form. Provide variable settings for your reaction. | 2 | |
context_reaction:: |
function | Clone our references when we're being cloned. | ||
context_reaction:: |
function | Constructor. Do not override. |