/[drupal]/contributions/themes/adt_basetheme/theme-settings.php
ViewVC logotype

Contents of /contributions/themes/adt_basetheme/theme-settings.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Jun 30 12:56:23 2009 UTC (4 months, 3 weeks ago) by peach
Branch: MAIN
CVS Tags: DRUPAL-6--2-1, HEAD
Changes since 1.1: +12 -8 lines
File MIME type: text/x-php
*** empty log message ***
1 <?php
2
3 /**
4 * Implementation of THEMEHOOK_settings() function.
5 *
6 * @param $saved_settings
7 * array An array of saved settings for this theme.
8 * @return
9 * array A form array.
10 */
11
12 function phptemplate_settings($saved_settings) {
13
14 /* Store theme paths in variables - if you rename the theme you have to change the second parameter of the drupal_get_path function on the next line */
15 $theme_path = drupal_get_path('theme', 'adt_basetheme') .'/';
16
17 //Load Defaults
18 if(is_file(drupal_get_path('theme', 'adt_basetheme') . '/theme-settings-defaults.php')) {
19 include('theme-settings-defaults.php');
20 }
21
22 // Create the form widgets using Forms API
23 $form['layout'] = array(
24 '#title' => t('Layout Options'),
25 '#type' => 'fieldset',
26 '#collapsible' => TRUE,
27 '#collapsed' => TRUE,
28 );
29
30 $form['layout']['fixedfluid'] = array(
31 '#type' => 'radios',
32 '#title' => t('Fixed or Fluid width'),
33 '#default_value' => $settings['fixedfluid'],
34 '#options' => array(
35 'px' => t('Fixed width (in pixels)'),
36 '%' => t('Fluid width (as percentage of browser width)')
37 ),
38 );
39
40 $form['layout']['layout_width_fixed'] = array(
41 '#type' => 'textfield',
42 '#title' => t('FIXED Layout Width'),
43 '#default_value' => $settings['layout_width_fixed'],
44 '#size' => 4,
45 '#maxlength' => 4,
46 '#description' => t('Width in pixels, do not add trailing \'px\'. This field is only used when "Fixed" is selected above.'),
47 '#element_validate' => array('is_number'),
48 );
49
50 $form['layout']['layout_width_fluid'] = array(
51 '#type' => 'textfield',
52 '#title' => t('FLUID Layout Width'),
53 '#default_value' => $settings['layout_width_fluid'],
54 '#size' => 3,
55 '#maxlength' => 3,
56 '#description' => t('Width in percentage of browser, do not add trailing \'%\'. This field is only used when "Fluid" is selected above.'),
57 '#element_validate' => array('is_number'),
58 );
59
60 $form['layout']['sidebar_width'] = array(
61 '#type' => 'textfield',
62 '#title' => t('Sidebar Width'),
63 '#default_value' => $settings['sidebar_width'],
64 '#size' => 6,
65 '#maxlength' => 6,
66 '#description' => t('Sidebar width as percentage of layout width. The main content area (center) automatically assumes the leftover width. If you want 3 equal width columns it\'s best to fill in 33.333.'),
67 '#element_validate' => array('is_number'),
68 );
69
70 $form['layout']['adv_layout'] = array(
71 '#title' => t('Advanced Layout Options'),
72 '#type' => 'fieldset',
73 '#collapsible' => TRUE,
74 '#collapsed' => TRUE,
75 );
76
77 $form['layout']['adv_layout']['layout_min_width'] = array(
78 '#type' => 'textfield',
79 '#title' => t('Min-width'),
80 '#default_value' => $settings['layout_min_width'],
81 '#size' => 4,
82 '#maxlength' => 4,
83 '#description' => t('CSS min-width setting in pixels. Set 0 to disable.'),
84 '#element_validate' => array('is_number'),
85 );
86
87 $form['layout']['adv_layout']['layout_max_width'] = array(
88 '#type' => 'textfield',
89 '#title' => t('Max-width'),
90 '#default_value' => $settings['layout_max_width'],
91 '#size' => 4,
92 '#maxlength' => 4,
93 '#description' => t('CSS max-width setting in pixels. Set 0 to disable.'),
94 '#element_validate' => array('is_number'),
95 );
96
97 $form['layout']['adv_layout']['expand_admin'] = array(
98 '#type' => 'radios',
99 '#title' => t('Expand admin pages'),
100 '#default_value' => $settings['expand_admin'],
101 '#options' => array(
102 '0' => t('No'),
103 '1' => t('Yes'),
104 ),
105 '#description' => t('Expand admin pages to 90% of browser width, to make your site more manageable if regular pages are narrow. Admin pages are all pages in the /admin path.')
106 );
107
108 // Typography Options
109 $form['typography_options'] = array(
110 '#title' => t('Typography options'),
111 '#type' => 'fieldset',
112 '#collapsible' => TRUE,
113 '#collapsed' => TRUE,
114 );
115
116 // Regular Fonts Settings
117 $form['typography_options']['body_font_face'] = array(
118 '#type' => 'select',
119 '#title' => t('Base Font'),
120 '#default_value' => $settings['body_font_face'],
121 '#options' => font_list(),
122 '#description' => t('Select the font set for the body text.'),
123 );
124
125 $form['typography_options']['headings_font_face'] = array(
126 '#type' => 'select',
127 '#title' => t('Headings Font'),
128 '#default_value' => $settings['headings_font_face'],
129 '#options' => font_list(),
130 '#description' => t('Select the font set for the headings.'),
131 );
132
133 // Cufon Font Replacement
134
135 $form['typography_options']['cufon_font_replacement'] = array(
136 '#title' => t('Cufon Font Replacement'),
137 '#type' => 'fieldset',
138 '#collapsible' => TRUE,
139 '#collapsed' => FALSE,
140 );
141
142 $form['typography_options']['cufon_font_replacement']['cufon_enable'] = array(
143 '#type' => 'checkbox',
144 '#title' => t('Enable Cufon font replacement'),
145 '#default_value' => $settings['cufon_enable'],
146 '#prefix' => '<p>Cufon is a script that replaces web fonts with an embedded font. This method does not have any effect on Search Engines or accessibility for screen-readers. You can generate you own Cufon fonts with the <a target=_blank" href="http://cufon.shoqolate.com/generate/">Cufon Generator</a>. For further instructions see (todo: write some documentation on this).</p>',
147 );
148 if(is_file($theme_path .'scripts/typography/cufon-yui.js')) {
149 foreach (file_scan_directory($theme_path .'scripts/typography/fonts', '.js', array('.', '..', 'CVS')) as $file) {
150 $cufon_files[$file->basename] = $file->name;
151 }
152 $cufon_font_face_suffix = '<p><strong>'. t('Available font example images:') .'</strong></p>';
153 foreach (file_scan_directory($theme_path .'scripts/typography/fonts', '.png', array('.', '..', 'CVS')) as $file) {
154 $cufon_font_face_suffix .= theme_image($theme_path .'scripts/typography/fonts/' .$file->basename);
155 }
156 } else {
157 $cufon_font_face_suffix = '<p class="error">'. t('Cufon script not found, did you download the typography package as instructed on http://drupal.org/project/adt_basetheme?') .'</p>';
158 }
159 $form['typography_options']['cufon_font_replacement']['cufon_font_face'] = array(
160 '#type' => 'select',
161 '#title' => t('Cufon Font Face'),
162 '#default_value' => $settings['cufon_font_face'],
163 '#options' => $cufon_files,
164 '#suffix' => $cufon_font_face_suffix,
165 );
166
167
168 // Node links and Taxonomy Links
169 $form['node_options'] = array(
170 '#title' => t('Node options'),
171 '#type' => 'fieldset',
172 '#collapsible' => TRUE,
173 '#collapsed' => TRUE,
174 );
175
176 // Taxonomy Settings
177 if (module_exists('taxonomy')) {
178 $form['node_options']['display_taxonomy_container'] = array(
179 '#type' => 'fieldset',
180 '#title' => t('Taxonomy terms'),
181 '#collapsible' => TRUE,
182 '#collapsed' => TRUE,
183 );
184 // Default & content-type specific settings
185 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
186 // taxonomy display per node
187 $form['node_options']['display_taxonomy_container']['display_taxonomy'][$type] = array(
188 '#type' => 'fieldset',
189 '#title' => t('!name', array('!name' => t($name))),
190 '#collapsible' => TRUE,
191 '#collapsed' => TRUE,
192 );
193 // display
194 $form['node_options']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array(
195 '#type' => 'select',
196 '#title' => t('When should taxonomy terms be displayed?'),
197 '#default_value' => $settings["taxonomy_display_{$type}"],
198 '#options' => array(
199 '' => '',
200 'never' => t('Never display taxonomy terms'),
201 'all' => t('Always display taxonomy terms'),
202 'only' => t('Only display taxonomy terms on full node pages'),
203 ),
204 );
205 // format
206 $form['node_options']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array(
207 '#type' => 'radios',
208 '#title' => t('Taxonomy display format'),
209 '#default_value' => $settings["taxonomy_format_{$type}"],
210 '#options' => array(
211 'vocab' => t('Display each vocabulary on a new line'),
212 'list' => t('Display all taxonomy terms together in single list'),
213 ),
214 );
215 // Get taxonomy vocabularies by node type
216 $vocabs = array();
217 $vocabs_by_type = ($type == 'default') ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
218 foreach ($vocabs_by_type as $key => $value) {
219 $vocabs[$value->vid] = $value->name;
220 }
221 // Display taxonomy checkboxes
222 foreach ($vocabs as $key => $vocab_name) {
223 $form['node_options']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array(
224 '#type' => 'checkbox',
225 '#title' => t('Hide vocabulary: '. $vocab_name),
226 '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"],
227 );
228 }
229 // Options for default settings
230 if ($type == 'default') {
231 $form['node_options']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
232 $form['node_options']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
233 $form['node_options']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array(
234 '#type' => 'checkbox',
235 '#title' => t('Use custom settings for each content type instead of the default above'),
236 '#default_value' => $settings['taxonomy_enable_content_type'],
237 );
238 }
239 // Collapse content-type specific settings if default settings are being used
240 else if ($settings['taxonomy_enable_content_type'] == 0) {
241 $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
242 }
243 }
244 }
245
246 // Read More & Comment Link Settings
247 $form['node_options']['link_settings'] = array(
248 '#type' => 'fieldset',
249 '#title' => t('Links'),
250 '#description' => t('Customize the text of node links'),
251 '#collapsible' => TRUE,
252 '#collapsed' => TRUE,
253 );
254
255 // Read more link settings
256 $form['node_options']['link_settings']['readmore'] = array(
257 '#type' => 'fieldset',
258 '#title' => t('Read more'),
259 '#collapsible' => TRUE,
260 '#collapsed' => TRUE,
261 );
262 // Default & content-type specific settings
263 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
264 // Read more
265 $form['node_options']['link_settings']['readmore'][$type] = array(
266 '#type' => 'fieldset',
267 '#title' => t('!name', array('!name' => t($name))),
268 '#collapsible' => TRUE,
269 '#collapsed' => TRUE,
270 );
271 $form['node_options']['link_settings']['readmore'][$type]["readmore_{$type}"] = array(
272 '#type' => 'textfield',
273 '#title' => t('Link text'),
274 '#default_value' => $settings["readmore_{$type}"],
275 '#description' => t('HTML is allowed.'),
276 );
277 $form['node_options']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array(
278 '#type' => 'textfield',
279 '#title' => t('Title text (tool tip)'),
280 '#default_value' => $settings["readmore_title_{$type}"],
281 '#description' => t('Displayed when hovering over link. Plain text only.'),
282 );
283 $form['node_options']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array(
284 '#type' => 'textfield',
285 '#title' => t('Prefix'),
286 '#default_value' => $settings["readmore_prefix_{$type}"],
287 '#description' => t('Text or HTML placed before the link.'),
288 );
289 $form['node_options']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array(
290 '#type' => 'textfield',
291 '#title' => t('Suffix'),
292 '#default_value' => $settings["readmore_suffix_{$type}"],
293 '#description' => t('Text or HTML placed after the link.'),
294 );
295 // Options for default settings
296 if ($type == 'default') {
297 $form['node_options']['link_settings']['readmore']['default']['#title'] = t('Default');
298 $form['node_options']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
299 $form['node_options']['link_settings']['readmore']['readmore_enable_content_type'] = array(
300 '#type' => 'checkbox',
301 '#title' => t('Use custom settings for each content type instead of the default above'),
302 '#default_value' => $settings['readmore_enable_content_type'],
303 );
304 }
305 // Collapse content-type specific settings if default settings are being used
306 else if ($settings['readmore_enable_content_type'] == 0) {
307 $form['readmore'][$type]['#collapsed'] = TRUE;
308 }
309 }
310
311 // Comments link settings
312 $form['node_options']['link_settings']['comment'] = array(
313 '#type' => 'fieldset',
314 '#title' => t('Comment'),
315 '#collapsible' => TRUE,
316 '#collapsed' => TRUE,
317 );
318 // Default & content-type specific settings
319 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
320 $form['node_options']['link_settings']['comment'][$type] = array(
321 '#type' => 'fieldset',
322 '#title' => t('!name', array('!name' => t($name))),
323 '#collapsible' => TRUE,
324 '#collapsed' => TRUE,
325 );
326 $form['node_options']['link_settings']['comment'][$type]['add'] = array(
327 '#type' => 'fieldset',
328 '#title' => t('Add new comment link'),
329 '#description' => t('The link when there are no comments.'),
330 '#collapsible' => TRUE,
331 '#collapsed' => TRUE,
332 );
333 $form['node_options']['link_settings']['comment'][$type]['add']["comment_add_{$type}"] = array(
334 '#type' => 'textfield',
335 '#title' => t('Link text'),
336 '#default_value' => $settings["comment_add_{$type}"],
337 '#description' => t('HTML is allowed.'),
338 );
339 $form['node_options']['link_settings']['comment'][$type]['add']["comment_add_title_{$type}"] = array(
340 '#type' => 'textfield',
341 '#title' => t('Title text (tool tip)'),
342 '#default_value' => $settings["comment_add_title_{$type}"],
343 '#description' => t('Displayed when hovering over link. Plain text only.'),
344 );
345 $form['node_options']['link_settings']['comment'][$type]['add']['extra'] = array(
346 '#type' => 'fieldset',
347 '#title' => t('Advanced'),
348 '#collapsible' => TRUE,
349 '#collapsed' => TRUE,
350 );
351 $form['node_options']['link_settings']['comment'][$type]['add']['extra']["comment_add_prefix_{$type}"] = array(
352 '#type' => 'textfield',
353 '#title' => t('Prefix'),
354 '#default_value' => $settings["comment_add_prefix_{$type}"],
355 '#description' => t('Text or HTML placed before the link.'),
356 );
357 $form['node_options']['link_settings']['comment'][$type]['add']['extra']["comment_add_suffix_{$type}"] = array(
358 '#type' => 'textfield',
359 '#title' => t('Suffix'),
360 '#default_value' => $settings["comment_add_suffix_{$type}"],
361 '#description' => t('Text or HTML placed after the link.'),
362 );
363 $form['node_options']['link_settings']['comment'][$type]['standard'] = array(
364 '#type' => 'fieldset',
365 '#title' => t('Comments link'),
366 '#description' => t('The link when there are one or more comments.'),
367 '#collapsible' => TRUE,
368 '#collapsed' => TRUE,
369 );
370 $form['node_options']['link_settings']['comment'][$type]['standard']["comment_singular_{$type}"] = array(
371 '#type' => 'textfield',
372 '#title' => t('Link text when there is 1 comment'),
373 '#default_value' => $settings["comment_singular_{$type}"],
374 '#description' => t('HTML is allowed.'),
375 );
376 $form['node_options']['link_settings']['comment'][$type]['standard']["comment_plural_{$type}"] = array(
377 '#type' => 'textfield',
378 '#title' => t('Link text when there are multiple comments'),
379 '#default_value' => $settings["comment_plural_{$type}"],
380 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
381 );
382 $form['node_options']['link_settings']['comment'][$type]['standard']["comment_title_{$type}"] = array(
383 '#type' => 'textfield',
384 '#title' => t('Title text (tool tip)'),
385 '#default_value' => $settings["comment_title_{$type}"],
386 '#description' => t('Displayed when hovering over link. Plain text only.'),
387 );
388 $form['node_options']['link_settings']['comment'][$type]['standard']['extra'] = array(
389 '#type' => 'fieldset',
390 '#title' => t('Advanced'),
391 '#collapsible' => TRUE,
392 '#collapsed' => TRUE,
393 );
394 $form['node_options']['link_settings']['comment'][$type]['standard']['extra']["comment_prefix_{$type}"] = array(
395 '#type' => 'textfield',
396 '#title' => t('Prefix'),
397 '#default_value' => $settings["comment_prefix_{$type}"],
398 '#description' => t('Text or HTML placed before the link.'),
399 );
400 $form['node_options']['link_settings']['comment'][$type]['standard']['extra']["comment_suffix_{$type}"] = array(
401 '#type' => 'textfield',
402 '#title' => t('Suffix'),
403 '#default_value' => $settings["comment_suffix_{$type}"],
404 '#description' => t('Text or HTML placed after the link.'),
405 );
406 $form['node_options']['link_settings']['comment'][$type]['new'] = array(
407 '#type' => 'fieldset',
408 '#title' => t('New comments link'),
409 '#description' => t('The link when there are one or more new comments.'),
410 '#collapsible' => TRUE,
411 '#collapsed' => TRUE,
412 );
413 $form['node_options']['link_settings']['comment'][$type]['new']["comment_new_singular_{$type}"] = array(
414 '#type' => 'textfield',
415 '#title' => t('Link text when there is 1 new comment'),
416 '#default_value' => $settings["comment_new_singular_{$type}"],
417 '#description' => t('HTML is allowed.'),
418 );
419 $form['node_options']['link_settings']['comment'][$type]['new']["comment_new_plural_{$type}"] = array(
420 '#type' => 'textfield',
421 '#title' => t('Link text when there are multiple new comments'),
422 '#default_value' => $settings["comment_new_plural_{$type}"],
423 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
424 );
425 $form['node_options']['link_settings']['comment'][$type]['new']["comment_new_title_{$type}"] = array(
426 '#type' => 'textfield',
427 '#title' => t('Title text (tool tip)'),
428 '#default_value' => $settings["comment_new_title_{$type}"],
429 '#description' => t('Displayed when hovering over link. Plain text only.'),
430 );
431 $form['node_options']['link_settings']['comment'][$type]['new']['extra'] = array(
432 '#type' => 'fieldset',
433 '#title' => t('Advanced'),
434 '#collapsible' => TRUE,
435 '#collapsed' => TRUE,
436 );
437 $form['node_options']['link_settings']['comment'][$type]['new']['extra']["comment_new_prefix_{$type}"] = array(
438 '#type' => 'textfield',
439 '#title' => t('Prefix'),
440 '#default_value' => $settings["comment_new_prefix_{$type}"],
441 '#description' => t('Text or HTML placed before the link.'),
442 );
443 $form['node_options']['link_settings']['comment'][$type]['new']['extra']["comment_new_suffix_{$type}"] = array(
444 '#type' => 'textfield',
445 '#title' => t('Suffix'),
446 '#default_value' => $settings["comment_new_suffix_{$type}"],
447 '#description' => t('Text or HTML placed after the link.'),
448 );
449 // Options for default settings
450 if ($type == 'default') {
451 $form['node_options']['link_settings']['comment']['default']['#title'] = t('Default');
452 $form['node_options']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
453 $form['node_options']['link_settings']['comment']['comment_enable_content_type'] = array(
454 '#type' => 'checkbox',
455 '#title' => t('Use custom settings for each content type instead of the default above'),
456 '#default_value' => $settings['comment_enable_content_type'],
457 );
458 }
459 // Collapse content-type specific settings if default settings are being used
460 else if ($settings['comment_enable_content_type'] == 0) {
461 $form['comment'][$type]['#collapsed'] = TRUE;
462 }
463 }
464
465 $form['node_options']['commentheader'] = array(
466 '#type' => 'textfield',
467 '#title' => t('Comments Header'),
468 '#default_value' => $settings['commentheader'],
469 '#description' => t('Displays a header above your comments, leave blank to disable.'),
470 );
471
472 $form['dropdown'] = array(
473 '#title' => t('Dropdown Menu Options'),
474 '#type' => 'fieldset',
475 '#collapsible' => TRUE,
476 '#collapsed' => TRUE,
477 );
478
479 // Width of Drop-down menus
480 $form['dropdown']['sublevel_width'] = array(
481 '#type' => 'select',
482 '#title' => t('Drop-down Menus Sub-Level Menu Width'),
483 '#default_value' => $settings['sky_sub_navigation_size'],
484 '#options' => adt_size_range(7, 30, 'em', 10),
485 '#prefix' => '<p>'. t('Note: Drop-down menus go up to 4 levels deep.') .'</p>',
486 '#description' => t('Sets the width of all the Sublevels of the dropdown menu.'),
487 );
488
489 $form['dropdown']['superfish'] = array(
490 '#title' => t('Drop-down Animation (Superfish)'),
491 '#type' => 'fieldset',
492 '#collapsible' => TRUE,
493 '#collapsed' => FALSE,
494 );
495
496 $form['dropdown']['superfish']['superfish_enable'] = array(
497 '#type' => 'checkbox',
498 '#title' => t('Enable Superfish drop-down animation'),
499 '#default_value' => $settings['superfish_enable'],
500 );
501
502 $form['dropdown']['superfish']['superfish_speed'] = array(
503 '#type' => 'textfield',
504 '#title' => t('Animation Speed'),
505 '#default_value' => $settings['superfish_speed'],
506 '#size' => 6,
507 '#maxlength' => 6,
508 '#description' => t('Animation speed in milliseconds. Do not add "ms" to the number.'),
509 '#element_validate' => array('is_number'),
510 );
511
512 $form['dropdown']['superfish']['superfish_delay'] = array(
513 '#type' => 'textfield',
514 '#title' => t('Mouse-Out Delay'),
515 '#default_value' => $settings['superfish_delay'],
516 '#size' => 6,
517 '#maxlength' => 6,
518 '#description' => t('Time in milliseconds the sublevel menus remain visible when you mouse out of the menu. A study by usability expert Jacob Nielsen recommends 500 milliseconds. Do not add "ms" to the number. Set 0 to disable.'),
519 '#element_validate' => array('is_number'),
520 );
521
522 $form['dropdown']['superfish']['superfish_easing'] = array(
523 '#type' => 'radios',
524 '#title' => t('Animation Easing'),
525 '#default_value' => $settings['superfish_easing'],
526 '#options' => array(
527 'linear' => t('Linear'),
528 'swing' => t('Swing (Default)'),
529 ),
530 '#description' => t('This determines how the animation gains speed. Swing looks especially nice on larger sub-menes'),
531 );
532
533 $form['dropdown']['superfish']['superfish_properties'] = array(
534 '#type' => 'checkboxes',
535 '#title' => t('Animation set-up'),
536 '#default_value' => $settings['superfish_properties'],
537 '#options' => array(
538 'opacity' => t('Fade in'),
539 'width' => t('Fold out sideways'),
540 'height' => t('Fold out downwards'),
541 ),
542 '#description' => t('Select the properties you would like to animate. You can select as many properties as you like.'),
543 );
544
545 $form['misc'] = array(
546 '#title' => t('Misc Options'),
547 '#type' => 'fieldset',
548 '#collapsible' => TRUE,
549 '#collapsed' => TRUE,
550 );
551
552 $form['misc']['link_icons'] = array(
553 '#type' => 'radios',
554 '#title' => t('Link Icons'),
555 '#default_value' => $settings['link_icons'],
556 '#prefix' => '<p>Icons can be <a href="http://www.alldrupalthemes.com/sites/www.alldrupalthemes.com/files/basetheme/icons.zip">downloaded here</a> and extracted to images/icons in the theme folder.</p>',
557 '#options' => array(
558 '0' => t('No'),
559 '1' => t('Yes'),
560 ),
561 '#description' => t('Standards compliant browsers with load icons through CSS3 selectors (no javascript!). Older browsers (internet explorer 6 and below) will load the icons through a tiny jquery javascript.'),
562 );
563
564 $form['misc']['block_edit'] = array(
565 '#type' => 'radios',
566 '#title' => t('Edit-Block links'),
567 '#default_value' => $settings['block_edit'],
568 '#options' => array(
569 '0' => t('No'),
570 '1' => t('Yes'),
571 ),
572 '#description' => t('Add edit links on all blocks to allow easy access to blocks management.'),
573 );
574
575 $form['misc']['force_eq_heights'] = array(
576 '#type' => 'radios',
577 '#title' => t('Enforce Equal heights'),
578 '#default_value' => $settings['force_eq_heights'],
579 '#options' => array(
580 '0' => t('No'),
581 '1' => t('Yes'),
582 ),
583 '#description' => t('Enforce equal heights on horizontally aligned blocks (it looks better).'),
584 );
585
586 $form['misc']['input_example'] = array(
587 '#type' => 'radios',
588 '#title' => t('Preload Example Text'),
589 '#default_value' => $settings['input_example'],
590 '#options' => array(
591 '0' => t('No'),
592 '1' => t('Yes'),
593 ),
594 '#description' => t('Loads example text in compact forms (with no labels).'),
595 );
596
597 $form['misc']['iepngfix'] = array(
598 '#type' => 'radios',
599 '#title' => t('Use IE PNG Fix'),
600 '#default_value' => $settings['iepngfix'],
601 '#options' => array(
602 '0' => t('No'),
603 '1' => t('Yes'),
604 ),
605 '#description' => t('Fix Alpha-transparency in PNG support for internet explorer 6.'),
606 );
607
608 $form['timestamp'] = array(
609 '#type' => 'value',
610 '#value' => time(),
611 );
612
613 /**
614 * Validation Function to enforce numeric values
615 */
616 function is_number($formelement, &$form_state) {
617 $thevalue = $formelement['#value'];
618 $title = $formelement['#title'];
619 if (!is_numeric($thevalue)) {
620 form_error($formelement, t("<em>$title</em> must be a number."));
621 }
622 }
623 // Return the additional form widgets
624 return $form;
625 }
626
627 /**
628 * Helper function to provide a list of fonts for select list in theme settings.
629 * Originally by Jacine @ Sky theme - thx ;)
630 */
631 function font_list() {
632 $fonts = array(
633 'Sans-serif' => array(
634 'arial' => t('Arial, Helvetica'),
635 'verdana' => t('Verdana'),
636 'lucida' => t('Lucida Grande, Lucida Sans Unicode'),
637 'geneva' => t('Geneva'),
638 'tahoma' => t('Tahoma'),
639 'century' => t('Century Gothic'),
640 ),
641 'Serif' => array(
642 'georgia' => t('Georgia'),
643 'palatino' => t('Palatino Linotype, Book Antiqua'),
644 'times' => t('Times New Roman'),
645 ),
646 );
647 return $fonts;
648 }
649
650 /**
651 * Helper function to provide a list of sizes for use in theme settings.
652 * Originally by Jacine @ Sky theme - thx ;)
653 */
654 function adt_size_range($start = 11, $end = 16, $unit = 'px', $default = NULL) {
655 $range = '';
656 if (is_numeric($start) && is_numeric($end)) {
657 $range = array();
658 $size = $start;
659 while ($size >= $start && $size <= $end) {
660 if ($size == $default) {
661 $range[$size . $unit] = $size . $unit .' (default)';
662 }
663 else {
664 $range[$size . $unit] = $size . $unit;
665 }
666 $size++;
667 }
668 }
669 return $range;
670 }

  ViewVC Help
Powered by ViewVC 1.1.2