function site_banner_get_existing_background_color in Site Banner 7
Returns the existing background color.
Parameters
array $context: context array with the predefined background color.
Return value
string the HTML hexadecimal color code
2 calls to site_banner_get_existing_background_color()
- SiteBannerContextReactionChangeBannerBackgroundColor::execute in ./
site_banner_context_reaction_functions.inc - Output banner background colour for active contexts.
- SiteBannerContextReactionChangeBannerBackgroundColor::options_form in ./
site_banner_context_reaction_functions.inc - Admin panel for setting banner background color for selected contexts.
File
- ./
site_banner_context_reaction_functions.inc, line 274
Code
function site_banner_get_existing_background_color($context) {
if (!empty($context->reactions['change_banner_background_color'])) {
return $context->reactions['change_banner_background_color'];
}
else {
// Get first element in background color array.
$colors = array_keys(site_banner_get_background_colors());
return $colors[0];
}
}