class SiteBannerContextReactionChangeBannerTextColor in Site Banner 7
Handle changing the site banner text color reaction.
Hierarchy
Expanded class hierarchy of SiteBannerContextReactionChangeBannerTextColor
1 string reference to 'SiteBannerContextReactionChangeBannerTextColor'
- site_banner_context_plugins in ./
site_banner.module - Implements hook_context_plugins().
File
- ./
site_banner_context_reaction_functions.inc, line 200
View source
class SiteBannerContextReactionChangeBannerTextColor extends context_reaction {
/**
* Administration panel for setting banner text color for selected contexts.
*/
public function options_form($context) {
$existing_color_code = site_banner_get_existing_text_color($context);
return (array) site_banner_generate_text_color_form_elements($existing_color_code);
}
/**
* Validate hook for context-specific site banner text 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_text_color_code_form($form_state);
}
/**
* Submit handler for context-specific site banner text color settings.
*/
public function options_form_submit($values) {
$is_custom_selected = array_key_exists('site_banner_text_color_select', $values) ? $values['site_banner_text_color_select'] : 1;
$color_code = site_banner_get_text_color_code($values['site_banner_text_color_form'], $values['site_banner_text_custom_color_form'], $is_custom_selected);
return $color_code;
}
/**
* Output banner text colour for active contexts.
*/
public function execute(&$text_color_as_text) {
$contexts = context_active_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions['change_banner_text_color'])) {
$text_color_as_text = site_banner_get_existing_text_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. | ||
SiteBannerContextReactionChangeBannerTextColor:: |
public | function | Output banner text colour for active contexts. | |
SiteBannerContextReactionChangeBannerTextColor:: |
public | function |
Administration panel for setting banner text color for selected contexts. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerTextColor:: |
public | function |
Submit handler for context-specific site banner text color settings. Overrides context_reaction:: |
|
SiteBannerContextReactionChangeBannerTextColor:: |
public | function | Validate hook for context-specific site banner text color settings. |