class SiteBannerContextReactionChangeBannerBackgroundColor in Site Banner 7
Handle changing the site banner background colors reaction.
Hierarchy
Expanded class hierarchy of SiteBannerContextReactionChangeBannerBackgroundColor
1 string reference to 'SiteBannerContextReactionChangeBannerBackgroundColor'
- site_banner_context_plugins in ./
site_banner.module - Implements hook_context_plugins().
File
- ./
site_banner_context_reaction_functions.inc, line 151
View source
class SiteBannerContextReactionChangeBannerBackgroundColor extends context_reaction {
/**
* Admin panel for setting banner background color for selected contexts.
*/
public function options_form($context) {
$existing_color_code = site_banner_get_existing_background_color($context);
return site_banner_generate_bg_color_form_elements($existing_color_code);
}
/**
* 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.
site_banner_validate_background_color_code_form($form_state);
}
/**
* Submit handler for context-specific site banner background color settings.
*/
public function options_form_submit($values) {
$is_custom_selected = array_key_exists('site_banner_background_color_select', $values) ? $values['site_banner_background_color_select'] : 1;
$color_code = site_banner_get_background_color_code($values['site_banner_background_color_form'], $values['site_banner_background_custom_color_form'], $is_custom_selected);
return $color_code;
}
/**
* Output banner background colour for active contexts.
*/
public function execute(&$background_color_as_text) {
$contexts = context_active_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions['change_banner_background_color'])) {
$background_color_as_text = site_banner_get_existing_background_color($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. | ||
SiteBannerContextReactionChangeBannerBackgroundColor:: |
public | function | Output banner background colour for active contexts. | |
SiteBannerContextReactionChangeBannerBackgroundColor:: |
public | function |
Admin panel for setting banner background color for selected contexts. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerBackgroundColor:: |
public | function |
Submit handler for context-specific site banner background color settings. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerBackgroundColor:: |
public | function | Validate hook for context-specific site banner background color settings. |