4 * Functionality for the admin form of the theme.
7 $path_rijkshuisstijl = drupal_get_path('theme', 'rijkshuisstijl');
8 include_once
'./' .
$path_rijkshuisstijl .
'/functions/misc.php';
11 * Implements hook_form_system_theme_settings_alter().
13 function rijkshuisstijl_form_system_theme_settings_alter(&$form, $form_state) {
14 // Add some stylesheets for the theme settings.
15 drupal_add_css(drupal_get_path('theme', 'rijkshuisstijl') .
'/styles/theme-settings.css', array(
18 'preprocess' => FALSE
,
21 // Disable some required display toggles.
22 $form['theme_settings']['toggle_logo']['#disabled'] = TRUE
;
24 // Override the logo path form element with our own logo form element.
25 $form['logo']['settings']['logo_path'] = array(
27 '#title' => t('Custom logo'),
28 '#options' => _rijkshuisstijl_defined_logos(),
29 '#default_value' => theme_get_setting('logo_path'),
30 '#description' => t('Select a custom logo for a specific government agency.'),
32 // Remove the logo upload form from the display.
33 $form['logo']['settings']['logo_upload']['#access'] = FALSE
;
35 $form['titlebar'] = array(
36 '#type' => 'fieldset',
37 '#title' => t('Titlebar settings'),
41 $form['titlebar']['default_titlebar'] = array(
42 '#type' => 'checkbox',
43 '#title' => t('Use the default site title and slogan in the titlebar.'),
44 '#default_value' => theme_get_setting('default_titlebar', 'rijkshuisstijl'),
45 '#collapsible' => TRUE
,
46 '#collapsed' => FALSE
,
49 $form['titlebar']['settings'] = array(
50 '#type' => 'container',
52 // Hide the titlebar settings when using the default logo.
54 'input[name="default_titlebar"]' => array('checked' => TRUE
),
59 $form['titlebar']['settings']['titlebar_title'] = array(
60 '#type' => 'textfield',
61 '#title' => t('Custom titlebar title'),
62 '#default_value' => theme_get_setting('titlebar_title', 'rijkshuisstijl'),
65 '#description' => t("Override the titlebar's title with a custom title."),
68 $form['titlebar']['settings']['titlebar_slogan'] = array(
69 '#type' => 'textfield',
70 '#title' => t('Custom titlebar slogan'),
71 '#default_value' => theme_get_setting('titlebar_slogan', 'rijkshuisstijl'),
74 '#description' => t("Override the titlebar's slogan with a custom slogan."),
77 $form['color'] = array(
78 '#type' => 'fieldset',
79 '#title' => t('Color settings'),
80 '#collapsible' => TRUE
,
81 '#collapsed' => FALSE
,
85 $colours = _rijkshuisstijl_defined_colours();
86 $colours_assoc = array();
87 foreach (_rijkshuisstijl_defined_colours() as
$index => $colour) {
88 $colours_assoc[$colour] = _rijkshuisstijl_format_color_swatch($colour);
91 $form['color']['color_swatch'] = array(
93 '#title' => t('Color swatches'),
94 '#options' => $colours_assoc,
95 '#default_value' => theme_get_setting('color_swatch', 'rijkshuisstijl'),
98 $form['system'] = array(
99 '#type' => 'fieldset',
100 '#title' => t('System settings'),
101 '#collapsible' => TRUE
,
102 '#collapsed' => FALSE
,
106 $form['system']['system_type'] = array(
108 '#title' => t('Type'),
109 '#default_value' => theme_get_setting('system_type', 'rijkshuisstijl'),
111 // @todo This should be defined somewhere else.
112 'internet' => 'Internet',
113 'intranet' => 'Intranet / External Application',
114 'application' => 'Internal Application',
116 // @todo Should the colors be influenced?
117 '#description' => t('The choice of %system influenced the layout, the available colors and other theme settings.', array(
118 '%system' => 'system',
122 $form['internet_settings'] = array(
123 '#type' => 'fieldset',
124 '#title' => t('Internet Settings'),
125 '#collapsible' => TRUE
,
126 '#collapsed' => FALSE
,
129 ':input[name="system_type"]' => array('value' => 'internet'),
135 $form['internet_settings']['system_width'] = array(
137 '#title' => t('Width And Column Behaviour'),
138 '#default_value' => theme_get_setting('system_width'),
139 '#options' => drupal_map_assoc(array('default', 'wide', 'wider', 'liquid')),
140 '#description' => t('Select the behaviour for the sizing of columns.'),