4 * Contains some miscellaneous functions.
8 * Get all defined colours as array.
11 * All defined colours for this theme.
13 function _rijkshuisstijl_defined_colours() {
36 * Get all defined logos as array.
39 * An associative array with all defined logos in the starterskit.
41 function _rijkshuisstijl_defined_logos() {
42 $starterskit = _rijkshuisstijl_init_starterskit();
43 $path = $starterskit['library path'] .
'/logos';
45 $filesdir = file_scan_directory($path, '/\.png$/', array('nomask' => '/RO_Footer_Homepage/', 'key' => 'name'));
47 $search_replacements = array(
48 'AZ_' => 'Algemene Zaken - ',
49 'BZK_' => 'Binnenlandse Zaken en Koninkrijksrelaties - ',
50 'BuZa_' => 'Buitenlandse Zaken - ',
51 'ELI_' => 'Economische Zaken, Landbouw en Innovatie - ',
52 'D_' => 'Defensie - ',
53 'F_' => 'Financiƫn - ',
54 'IM_' => 'Infrastructuur en Milieu - ',
55 'OCW_' => 'Onderwijs, Cultuur en Wetenschap - ',
56 'SZW_' => 'Sociale Zaken en Werkgelegenheid - ',
57 'VJ_' => 'Veiligheid en Justitie - ',
58 'VWS_' => 'Volksgezondheid, Welzijn en Sport - ',
59 'J_' => 'Justitie - ',
60 'WWI_' => 'Wonen, Wijken en Integratie - ',
61 'JG_' => 'Jeugd en Gezin - ',
64 $search = array("RO_", "_Logo_Homepage");
65 $replacements = array("", "");
68 foreach ($filesdir as
$key => $value) {
69 $newindex = str_replace($search, $replacements, $key);
70 $logofiles[$path .
'/' .
$value->filename
] = str_replace(array_keys($search_replacements), array_values($search_replacements), $newindex);
77 * Format a color checkbox label on the admin screen.
79 * @param string $colour
80 * The name of the colour
83 * A string containing the rendered label.
85 function _rijkshuisstijl_format_color_swatch($colour) {
86 return "<span class=\"" .
$colour .
"\">" .
$colour .
"</span>";
90 * Initialized the Starterskit library, otherwise display an error.
93 * The starterskit library as associative array.
95 function _rijkshuisstijl_init_starterskit() {
96 if (!module_exists('libraries') || !($library = libraries_load('starterskit')) || empty($library['loaded'])) {
97 drupal_set_message(t('The Starterskit library cannot be loaded. Please make sure that it exists before using the Rijkshuisstijl theme.'), 'error', FALSE
);