class context_breadcrumb_current_page_reaction in Context Breadcrumb Current Page 7
@file Define class and override.
Hierarchy
- class \context_reaction
Expanded class hierarchy of context_breadcrumb_current_page_reaction
2 string references to 'context_breadcrumb_current_page_reaction'
File
- plugins/
context_breadcrumb_current_page_reaction.inc, line 7 - Define class and override.
View source
class context_breadcrumb_current_page_reaction extends context_reaction {
/**
* Prevent editor form.
*/
function editor_form($context) {
}
/**
* Add options.
*/
function options_form($context) {
$values = $this
->fetch_from_context($context);
$form = array(
'breadcrumb_show_current_page' => array(
'#title' => t('Show the Current Page in the Breadrumbs'),
'#description' => t('Have the last element in the breadcrumbs be the current page title.'),
'#type' => 'checkbox',
'#default_value' => isset($values['breadcrumb_show_current_page']) ? $values['breadcrumb_show_current_page'] : '',
),
'breadcrumb_show_current_page_title' => array(
'#title' => t('Title Override'),
'#description' => t('Show this as the breadcrumb title'),
'#type' => 'textfield',
'#default_value' => isset($values['breadcrumb_show_current_page_title']) ? $values['breadcrumb_show_current_page_title'] : '',
),
'breadcrumb_show_current_page_only' => array(
'#title' => t('Remove parent Breadcurmbs'),
'#description' => t('Have the only item in the breadcrumbs be the title.'),
'#type' => 'checkbox',
'#default_value' => isset($values['breadcrumb_show_current_page_only']) ? $values['breadcrumb_show_current_page_only'] : '',
),
);
return $form;
}
/**
* Set the breadcrumb.
*/
function execute(&$vars) {
foreach ($this
->get_contexts() as $k => $v) {
if (isset($v->reactions[$this->plugin]) && $v->reactions[$this->plugin]['breadcrumb_show_current_page']) {
$breadcrumb = drupal_get_breadcrumb();
if ($v->reactions[$this->plugin]['breadcrumb_show_current_page_only']) {
$breadcrumb = array(
$breadcrumb[0],
);
}
$title = $v->reactions[$this->plugin]['breadcrumb_show_current_page_title'] ? $v->reactions[$this->plugin]['breadcrumb_show_current_page_title'] : drupal_get_title();
$breadcrumb[] = $title;
drupal_set_breadcrumb($breadcrumb);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_breadcrumb_current_page_reaction:: |
function | Prevent editor form. | ||
context_breadcrumb_current_page_reaction:: |
function | Set the breadcrumb. | ||
context_breadcrumb_current_page_reaction:: |
function |
Add options. 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. |