class SiteBannerContextReactionChangeBannerStatus in Site Banner 7
Handle enabling/disabling the site banner and debug mode.
Hierarchy
Expanded class hierarchy of SiteBannerContextReactionChangeBannerStatus
1 string reference to 'SiteBannerContextReactionChangeBannerStatus'
- site_banner_context_plugins in ./
site_banner.module - Implements hook_context_plugins().
File
- ./
site_banner_context_reaction_functions.inc, line 13
View source
class SiteBannerContextReactionChangeBannerStatus extends context_reaction {
/**
* Admin panel for setting banner background color for selected contexts.
*/
public function options_form($context) {
$existing_status = site_banner_get_site_banner_status($context);
$existing_debug_status = site_banner_get_site_banner_debug_status($context);
return site_banner_generate_banner_status_form_elements($existing_status, $existing_debug_status);
}
/**
* Validate hook for context-specific site banner background color settings.
*/
public function options_form_validate($form_state) {
// Not linked into context module.
// TODO: raise bug to allow validation of reaction fields.
}
/**
* Submit handler for context-specific site banner background color settings.
*/
public function options_form_submit($values) {
return $values;
}
/**
* Output banner background colour for active contexts.
*/
public function execute(&$site_banner_status, &$site_banner_debug_status) {
$contexts = context_active_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions['change_banner_status'])) {
$site_banner_status |= site_banner_get_site_banner_status($context);
$site_banner_debug_status |= site_banner_get_site_banner_debug_status($context);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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 | 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. | ||
SiteBannerContextReactionChangeBannerStatus:: |
public | function | Output banner background colour for active contexts. | |
SiteBannerContextReactionChangeBannerStatus:: |
public | function |
Admin panel for setting banner background color for selected contexts. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerStatus:: |
public | function |
Submit handler for context-specific site banner background color settings. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerStatus:: |
public | function | Validate hook for context-specific site banner background color settings. |