function site_banner_get_text_colors in Site Banner 7
Function defining the color code and readable name for the text color.
Including a code example for ease of configuration, not commented code
@code @ignore production_code $text_colors = array( '#000000' => t('Black'), '#ffffff' => t('White'), @ignore production_code ); @code
Always needs to map a 6 digit hexadecimal (hex) color code to a name displayed on the module's admin page.
Return value
array array mapping hex colors to readable names
5 calls to site_banner_get_text_colors()
- SiteBannerColorUnitTestCase::testTextColorsAreValid in ./
site_banner.test - Tests whether all preset text colors pass validation.
- SiteBannerColorUnitTestCase::testTextColorsExist in ./
site_banner.test - Tests whether there is at least one preset text color.
- site_banner_generate_text_color_form_elements in ./
site_banner.admin.inc - Generates the form elements for defining text colors.
- site_banner_get_existing_text_color in ./
site_banner_context_reaction_functions.inc - Returns the existing text color if defined.
- site_banner_get_text_color_code in ./
site_banner.module - Searches the form response to determine the text color to be saved.
File
- ./
site_banner_options.inc, line 58 - A set of configuration and customisable functions for the site banner module.
Code
function site_banner_get_text_colors() {
$text_colors = array(
'#000000' => t('Black'),
'#ffffff' => t('White'),
);
return $text_colors;
}