function site_banner_get_background_color_code in Site Banner 7
Searches the form response to determine the background color to be saved.
Parameters
int $position_in_color_array: the form_sate object containing user settings.
string $custom_color_code: a HTML hex color code denoting selected custom color.
bool $is_custom_color: whether a custom color is being used or not.
Return value
string the background color as HTML hex color code.
2 calls to site_banner_get_background_color_code()
- SiteBannerContextReactionChangeBannerBackgroundColor::options_form_submit in ./
site_banner_context_reaction_functions.inc - Submit handler for context-specific site banner background color settings.
- site_banner_get_background_color_from_form in ./
site_banner.admin.inc - Searches the form response to determine the background color to be saved.
File
- ./
site_banner.module, line 260 - Main module file implementing callbacks for the site banner module.
Code
function site_banner_get_background_color_code($position_in_color_array, $custom_color_code, $is_custom_color = TRUE) {
$background_color_code = '#ffffff';
if ($is_custom_color) {
$background_color_code = $custom_color_code;
}
else {
$background_colors = array_keys(site_banner_get_background_colors());
$background_color_code = $background_colors[$position_in_color_array];
}
return $background_color_code;
}