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

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

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


Revision 1.1 - (show annotations) (download) (as text)
Mon Aug 31 15:53:44 2009 UTC (2 months, 4 weeks ago) by hoainam12k
Branch: MAIN
CVS Tags: DRUPAL-6--1-4, HEAD
File MIME type: text/x-php
no message
1 <?php
2 // $Id: theme-settings.php,v 1.1.2.9 2009/05/13 12:15:32 jwolf Exp $
3
4 /**
5 * Implementation of THEMEHOOK_settings() function.
6 *
7 * @param $saved_settings
8 * array An array of saved settings for this theme.
9 * @return
10 * array A form array.
11 */
12 function phptemplate_settings($saved_settings) {
13
14 // Only open one of the general or node setting fieldsets at a time
15 $js = <<<SCRIPT
16 $(document).ready(function(){
17 $("fieldset.general_settings > legend > a").click(function(){
18 if(!$("fieldset.node_settings").hasClass("collapsed")) {
19 Drupal.toggleFieldset($("fieldset.node_settings"));
20 }
21 });
22 $("fieldset.node_settings > legend > a").click(function(){
23 if (!$("fieldset.general_settings").hasClass("collapsed")) {
24 Drupal.toggleFieldset($("fieldset.general_settings"));
25 }
26 });
27 });
28 SCRIPT;
29 drupal_add_js($js, 'inline');
30
31 // Get the node types
32 $node_types = node_get_types('names');
33
34 /**
35 * The default values for the theme variables. Make sure $defaults exactly
36 * matches the $defaults in the template.php file.
37 */
38 $defaults = array(
39 'user_notverified_display' => 1,
40 'breadcrumb_display' => 0,
41 'search_snippet' => 1,
42 'search_info_type' => 1,
43 'search_info_user' => 1,
44 'search_info_date' => 1,
45 'search_info_comment' => 1,
46 'search_info_upload' => 1,
47 'mission_statement_pages' => 'home',
48 'front_page_title_display' => 'title_slogan',
49 'page_title_display_custom' => '',
50 'other_page_title_display' => 'ptitle_slogan',
51 'other_page_title_display_custom' => '',
52 'configurable_separator' => ' | ',
53 'meta_keywords' => '',
54 'meta_description' => '',
55 'taxonomy_display_default' => 'only',
56 'taxonomy_format_default' => 'vocab',
57 'taxonomy_enable_content_type' => 0,
58 'submitted_by_author_default' => 1,
59 'submitted_by_date_default' => 1,
60 'submitted_by_enable_content_type' => 0,
61 'readmore_default' => t('Read more'),
62 'readmore_title_default' => t('Read the rest of this posting.'),
63 'readmore_prefix_default' => '',
64 'readmore_suffix_default' => '',
65 'readmore_enable_content_type' => 0,
66 'comment_singular_default' => t('1 comment'),
67 'comment_plural_default' => t('@count comments'),
68 'comment_title_default' => t('Jump to the first comment of this posting.'),
69 'comment_prefix_default' => '',
70 'comment_suffix_default' => '',
71 'comment_new_singular_default' => t('1 new comment'),
72 'comment_new_plural_default' => t('@count new comments'),
73 'comment_new_title_default' => t('Jump to the first new comment of this posting.'),
74 'comment_new_prefix_default' => '',
75 'comment_new_suffix_default' => '',
76 'comment_add_default' => t('Add new comment'),
77 'comment_add_title_default' => t('Add a new comment to this page.'),
78 'comment_add_prefix_default' => '',
79 'comment_add_suffix_default' => '',
80 'comment_node_default' => t('Add new comment'),
81 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'),
82 'comment_node_prefix_default' => '',
83 'comment_node_suffix_default' => '',
84 'comment_enable_content_type' => 0,
85 'rebuild_registry' => 0,
86 );
87
88 // Make the default content-type settings the same as the default theme settings,
89 // so we can tell if content-type-specific settings have been altered.
90 $defaults = array_merge($defaults, theme_get_settings());
91
92 // Set the default values for content-type-specific settings
93 foreach ($node_types as $type => $name) {
94 $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
95 $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
96 $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
97 $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
98 $defaults["readmore_{$type}"] = $defaults['readmore_default'];
99 $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
100 $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
101 $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
102 $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
103 $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
104 $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
105 $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
106 $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
107 $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
108 $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
109 $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
110 $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
111 $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
112 $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
113 $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
114 $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
115 $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
116 $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
117 $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
118 $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
119 $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
120 }
121
122 // Merge the saved variables and their default values
123 $settings = array_merge($defaults, $saved_settings);
124
125 // If content type-specifc settings are not enabled, reset the values
126 if ($settings['readmore_enable_content_type'] == 0) {
127 foreach ($node_types as $type => $name) {
128 $settings["readmore_{$type}"] = $settings['readmore_default'];
129 $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
130 $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
131 $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
132 }
133 }
134 if ($settings['comment_enable_content_type'] == 0) {
135 foreach ($node_types as $type => $name) {
136 $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
137 $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
138 $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
139 $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
140 $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
141 $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
142 $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
143 $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
144 $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
145 $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
146 $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
147 $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
148 $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
149 $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
150 $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
151 $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
152 $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
153 $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
154 }
155 }
156
157 // Create theme settings form widgets using Forms API
158
159 // TNT Fieldset
160 $form['ab_container'] = array(
161 '#type' => 'fieldset',
162 '#title' => t('Absynthe settings'),
163 '#description' => t('Use these settings to change what and how information is displayed in your theme.'),
164 '#collapsible' => TRUE,
165 '#collapsed' => false,
166 );
167
168 // Search Settings
169 if (module_exists('search')) {
170 $form['ab_container']['general_settings']['search_container'] = array(
171 '#type' => 'fieldset',
172 '#title' => t('Search results'),
173 '#description' => t('What additional information should be displayed on your search results page?'),
174 '#collapsible' => TRUE,
175 '#collapsed' => TRUE,
176 );
177 $form['ab_container']['general_settings']['search_container']['search_results']['search_snippet'] = array(
178 '#type' => 'checkbox',
179 '#title' => t('Display text snippet'),
180 '#default_value' => $settings['search_snippet'],
181 );
182 $form['ab_container']['general_settings']['search_container']['search_results']['search_info_type'] = array(
183 '#type' => 'checkbox',
184 '#title' => t('Display content type'),
185 '#default_value' => $settings['search_info_type'],
186 );
187 $form['ab_container']['general_settings']['search_container']['search_results']['search_info_user'] = array(
188 '#type' => 'checkbox',
189 '#title' => t('Display author name'),
190 '#default_value' => $settings['search_info_user'],
191 );
192 $form['ab_container']['general_settings']['search_container']['search_results']['search_info_date'] = array(
193 '#type' => 'checkbox',
194 '#title' => t('Display posted date'),
195 '#default_value' => $settings['search_info_date'],
196 );
197 $form['ab_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array(
198 '#type' => 'checkbox',
199 '#title' => t('Display comment count'),
200 '#default_value' => $settings['search_info_comment'],
201 );
202 $form['ab_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array(
203 '#type' => 'checkbox',
204 '#title' => t('Display attachment count'),
205 '#default_value' => $settings['search_info_upload'],
206 );
207 }
208
209 // Node Settings
210 $form['ab_container']['node_type_specific'] = array(
211 '#type' => 'fieldset',
212 '#title' => t('Node settings'),
213 '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed. You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type. For example, you may want to show the date on stories, but not pages.'),
214 '#collapsible' => TRUE,
215 '#collapsed' => TRUE,
216 '#attributes' => array('class' => 'node_settings'),
217 );
218
219 // Read More & Comment Link Settings
220 $form['ab_container']['node_type_specific']['link_settings'] = array(
221 '#type' => 'fieldset',
222 '#title' => t('Links'),
223 '#description' => t('Customize the text of node links'),
224 '#collapsible' => TRUE,
225 '#collapsed' => TRUE,
226 );
227
228 // Read more link settings
229 $form['ab_container']['node_type_specific']['link_settings']['readmore'] = array(
230 '#type' => 'fieldset',
231 '#title' => t('"Read more"'),
232 '#collapsible' => TRUE,
233 '#collapsed' => TRUE,
234 );
235 // Default & content-type specific settings
236 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
237 // Read more
238 $form['ab_container']['node_type_specific']['link_settings']['readmore'][$type] = array(
239 '#type' => 'fieldset',
240 '#title' => t('!name', array('!name' => t($name))),
241 '#collapsible' => TRUE,
242 '#collapsed' => TRUE,
243 );
244 $form['ab_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array(
245 '#type' => 'textfield',
246 '#title' => t('Link text'),
247 '#default_value' => $settings["readmore_{$type}"],
248 '#description' => t('HTML is allowed.'),
249 );
250 $form['ab_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array(
251 '#type' => 'textfield',
252 '#title' => t('Title text (tool tip)'),
253 '#default_value' => $settings["readmore_title_{$type}"],
254 '#description' => t('Displayed when hovering over link. Plain text only.'),
255 );
256 $form['ab_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array(
257 '#type' => 'textfield',
258 '#title' => t('Prefix'),
259 '#default_value' => $settings["readmore_prefix_{$type}"],
260 '#description' => t('Text or HTML placed before the link.'),
261 );
262 $form['ab_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array(
263 '#type' => 'textfield',
264 '#title' => t('Suffix'),
265 '#default_value' => $settings["readmore_suffix_{$type}"],
266 '#description' => t('Text or HTML placed after the link.'),
267 );
268 // Options for default settings
269 if ($type == 'default') {
270 $form['ab_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
271 $form['ab_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
272 $form['ab_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array(
273 '#type' => 'checkbox',
274 '#title' => t('Use custom settings for each content type instead of the default above'),
275 '#default_value' => $settings['readmore_enable_content_type'],
276 );
277 }
278 // Collapse content-type specific settings if default settings are being used
279 else if ($settings['readmore_enable_content_type'] == 0) {
280 $form['readmore'][$type]['#collapsed'] = TRUE;
281 }
282 }
283
284 // Comments link settings
285 $form['ab_container']['node_type_specific']['link_settings']['comment'] = array(
286 '#type' => 'fieldset',
287 '#title' => t('"Comment"'),
288 '#collapsible' => TRUE,
289 '#collapsed' => TRUE,
290 );
291 // Default & content-type specific settings
292 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
293 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type] = array(
294 '#type' => 'fieldset',
295 '#title' => t('!name', array('!name' => t($name))),
296 '#collapsible' => TRUE,
297 '#collapsed' => TRUE,
298 );
299 // Full nodes
300 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array(
301 '#type' => 'fieldset',
302 '#title' => t('For full content'),
303 '#collapsible' => TRUE,
304 '#collapsed' => TRUE,
305 );
306 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array(
307 '#type' => 'fieldset',
308 '#title' => t('"Add new comment" link'),
309 '#description' => t('The link when the full content is being displayed.'),
310 '#collapsible' => TRUE,
311 '#collapsed' => TRUE,
312 );
313 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array(
314 '#type' => 'textfield',
315 '#title' => t('Link text'),
316 '#default_value' => $settings["comment_node_{$type}"],
317 '#description' => t('HTML is allowed.'),
318 );
319 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array(
320 '#type' => 'textfield',
321 '#title' => t('Title text (tool tip)'),
322 '#default_value' => $settings["comment_node_title_{$type}"],
323 '#description' => t('Displayed when hovering over link. Plain text only.'),
324 );
325 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array(
326 '#type' => 'fieldset',
327 '#title' => t('Advanced'),
328 '#collapsible' => TRUE,
329 '#collapsed' => TRUE,
330 );
331 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array(
332 '#type' => 'textfield',
333 '#title' => t('Prefix'),
334 '#default_value' => $settings["comment_node_prefix_{$type}"],
335 '#description' => t('Text or HTML placed before the link.'),
336 );
337 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array(
338 '#type' => 'textfield',
339 '#title' => t('Suffix'),
340 '#default_value' => $settings["comment_node_suffix_{$type}"],
341 '#description' => t('Text or HTML placed after the link.'),
342 );
343 // Teasers
344 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array(
345 '#type' => 'fieldset',
346 '#title' => t('For teasers'),
347 '#collapsible' => TRUE,
348 '#collapsed' => TRUE,
349 );
350 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array(
351 '#type' => 'fieldset',
352 '#title' => t('"Add new comment" link'),
353 '#description' => t('The link when there are no comments.'),
354 '#collapsible' => TRUE,
355 '#collapsed' => TRUE,
356 );
357 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array(
358 '#type' => 'textfield',
359 '#title' => t('Link text'),
360 '#default_value' => $settings["comment_add_{$type}"],
361 '#description' => t('HTML is allowed.'),
362 );
363 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array(
364 '#type' => 'textfield',
365 '#title' => t('Title text (tool tip)'),
366 '#default_value' => $settings["comment_add_title_{$type}"],
367 '#description' => t('Displayed when hovering over link. Plain text only.'),
368 );
369 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array(
370 '#type' => 'fieldset',
371 '#title' => t('Advanced'),
372 '#collapsible' => TRUE,
373 '#collapsed' => TRUE,
374 );
375 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array(
376 '#type' => 'textfield',
377 '#title' => t('Prefix'),
378 '#default_value' => $settings["comment_add_prefix_{$type}"],
379 '#description' => t('Text or HTML placed before the link.'),
380 );
381 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array(
382 '#type' => 'textfield',
383 '#title' => t('Suffix'),
384 '#default_value' => $settings["comment_add_suffix_{$type}"],
385 '#description' => t('Text or HTML placed after the link.'),
386 );
387 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array(
388 '#type' => 'fieldset',
389 '#title' => t('"Comments" link'),
390 '#description' => t('The link when there are one or more comments.'),
391 '#collapsible' => TRUE,
392 '#collapsed' => TRUE,
393 );
394 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array(
395 '#type' => 'textfield',
396 '#title' => t('Link text when there is 1 comment'),
397 '#default_value' => $settings["comment_singular_{$type}"],
398 '#description' => t('HTML is allowed.'),
399 );
400 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array(
401 '#type' => 'textfield',
402 '#title' => t('Link text when there are multiple comments'),
403 '#default_value' => $settings["comment_plural_{$type}"],
404 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
405 );
406 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array(
407 '#type' => 'textfield',
408 '#title' => t('Title text (tool tip)'),
409 '#default_value' => $settings["comment_title_{$type}"],
410 '#description' => t('Displayed when hovering over link. Plain text only.'),
411 );
412 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array(
413 '#type' => 'fieldset',
414 '#title' => t('Advanced'),
415 '#collapsible' => TRUE,
416 '#collapsed' => TRUE,
417 );
418 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array(
419 '#type' => 'textfield',
420 '#title' => t('Prefix'),
421 '#default_value' => $settings["comment_prefix_{$type}"],
422 '#description' => t('Text or HTML placed before the link.'),
423 );
424 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array(
425 '#type' => 'textfield',
426 '#title' => t('Suffix'),
427 '#default_value' => $settings["comment_suffix_{$type}"],
428 '#description' => t('Text or HTML placed after the link.'),
429 );
430 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array(
431 '#type' => 'fieldset',
432 '#title' => t('"New comments" link'),
433 '#description' => t('The link when there are one or more new comments.'),
434 '#collapsible' => TRUE,
435 '#collapsed' => TRUE,
436 );
437 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array(
438 '#type' => 'textfield',
439 '#title' => t('Link text when there is 1 new comment'),
440 '#default_value' => $settings["comment_new_singular_{$type}"],
441 '#description' => t('HTML is allowed.'),
442 );
443 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array(
444 '#type' => 'textfield',
445 '#title' => t('Link text when there are multiple new comments'),
446 '#default_value' => $settings["comment_new_plural_{$type}"],
447 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
448 );
449 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array(
450 '#type' => 'textfield',
451 '#title' => t('Title text (tool tip)'),
452 '#default_value' => $settings["comment_new_title_{$type}"],
453 '#description' => t('Displayed when hovering over link. Plain text only.'),
454 );
455 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array(
456 '#type' => 'fieldset',
457 '#title' => t('Advanced'),
458 '#collapsible' => TRUE,
459 '#collapsed' => TRUE,
460 );
461 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array(
462 '#type' => 'textfield',
463 '#title' => t('Prefix'),
464 '#default_value' => $settings["comment_new_prefix_{$type}"],
465 '#description' => t('Text or HTML placed before the link.'),
466 );
467 $form['ab_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array(
468 '#type' => 'textfield',
469 '#title' => t('Suffix'),
470 '#default_value' => $settings["comment_new_suffix_{$type}"],
471 '#description' => t('Text or HTML placed after the link.'),
472 );
473 // Options for default settings
474 if ($type == 'default') {
475 $form['ab_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
476 $form['ab_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
477 $form['ab_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array(
478 '#type' => 'checkbox',
479 '#title' => t('Use custom settings for each content type instead of the default above'),
480 '#default_value' => $settings['comment_enable_content_type'],
481 );
482 }
483 // Collapse content-type specific settings if default settings are being used
484 else if ($settings['comment_enable_content_type'] == 0) {
485 $form['comment'][$type]['#collapsed'] = TRUE;
486 }
487 }
488
489 // SEO settings
490 $form['ab_container']['seo'] = array(
491 '#type' => 'fieldset',
492 '#title' => t('Search engine optimization (SEO) settings'),
493 '#collapsible' => TRUE,
494 '#collapsed' => FALSE,
495 );
496 // Page titles
497 $form['ab_container']['seo']['page_format_titles'] = array(
498 '#type' => 'fieldset',
499 '#title' => t('Page titles'),
500 '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page. [NOTE: For more advanced page title functionality, consider using the "Page Title" module. However, the Page titles theme settings do not work in combination with the "Page Title" module and will be disabled if you have it enabled.]'),
501 '#collapsible' => TRUE,
502 '#collapsed' => TRUE,
503 );
504 if (module_exists('page_title') == FALSE) {
505 // front page title
506 $form['ab_container']['seo']['page_format_titles']['front_page_format_titles'] = array(
507 '#type' => 'fieldset',
508 '#title' => t('Front page title'),
509 '#description' => t('Your front page in particular should have important keywords for your site in the page title'),
510 '#collapsible' => TRUE,
511 '#collapsed' => TRUE,
512 );
513 $form['ab_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array(
514 '#type' => 'select',
515 '#title' => t('Set text of front page title'),
516 '#collapsible' => TRUE,
517 '#collapsed' => FALSE,
518 '#default_value' => $settings['front_page_title_display'],
519 '#options' => array(
520 'title_slogan' => t('Site title | Site slogan'),
521 'slogan_title' => t('Site slogan | Site title'),
522 'title_mission' => t('Site title | Site mission'),
523 'custom' => t('Custom (below)'),
524 ),
525 );
526 $form['ab_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array(
527 '#type' => 'textfield',
528 '#title' => t('Custom'),
529 '#size' => 60,
530 '#default_value' => $settings['page_title_display_custom'],
531 '#description' => t('Enter a custom page title for your front page'),
532 );
533 // other pages title
534 $form['ab_container']['seo']['page_format_titles']['other_page_format_titles'] = array(
535 '#type' => 'fieldset',
536 '#title' => t('Other page titles'),
537 '#collapsible' => TRUE,
538 '#collapsed' => TRUE,
539 );
540 $form['ab_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array(
541 '#type' => 'select',
542 '#title' => t('Set text of other page titles'),
543 '#collapsible' => TRUE,
544 '#collapsed' => FALSE,
545 '#default_value' => $settings['other_page_title_display'],
546 '#options' => array(
547 'ptitle_slogan' => t('Page title | Site slogan'),
548 'ptitle_stitle' => t('Page title | Site title'),
549 'ptitle_smission' => t('Page title | Site mission'),
550 'ptitle_custom' => t('Page title | Custom (below)'),
551 'custom' => t('Custom (below)'),
552 ),
553 );
554 $form['ab_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array(
555 '#type' => 'textfield',
556 '#title' => t('Custom'),
557 '#size' => 60,
558 '#default_value' => $settings['other_page_title_display_custom'],
559 '#description' => t('Enter a custom page title for all other pages'),
560 );
561 // SEO configurable separator
562 $form['ab_container']['seo']['page_format_titles']['configurable_separator'] = array(
563 '#type' => 'textfield',
564 '#title' => t('Title separator'),
565 '#description' => t('Customize the separator character used in the page title'),
566 '#size' => 60,
567 '#default_value' => $settings['configurable_separator'],
568 );
569 } else {
570 $form['ab_container']['seo']['page_format_titles']['#description'] = 'NOTICE: You currently have the "Page Title" module installed and enabled, so the Page titles theme settings have been disabled to prevent conflicts. If you wish to re-enable the Page titles theme settings, you must first disable the "Page Title" module.';
571 $form['ab_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
572 }
573 // Metadata
574 $form['ab_container']['seo']['meta'] = array(
575 '#type' => 'fieldset',
576 '#title' => t('Meta tags'),
577 '#description' => t('Meta tags are not used as much by search engines anymore, but the meta description is important: it will be shown as the description of your link in search engine results. [NOTE: For more advanced meta tag functionality, consider using the "Meta Tags (or nodewords)" module. However, the Meta tags theme settings do not work in combination with the "Meta Tags" module and will be disabled if you have it enabled.]'),
578 '#collapsible' => TRUE,
579 '#collapsed' => TRUE,
580 );
581 if (module_exists('nodewords') == FALSE) {
582 $form['ab_container']['seo']['meta']['meta_keywords'] = array(
583 '#type' => 'textfield',
584 '#title' => t('Meta keywords'),
585 '#description' => t('Enter a comma-separated list of keywords'),
586 '#size' => 60,
587 '#default_value' => $settings['meta_keywords'],
588 );
589 $form['ab_container']['seo']['meta']['meta_description'] = array(
590 '#type' => 'textarea',
591 '#title' => t('Meta description'),
592 '#cols' => 60,
593 '#rows' => 6,
594 '#default_value' => $settings['meta_description'],
595 );
596 } else {
597 $form['ab_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "Meta Tags (or nodewords)" module installed and enabled, so the Meta tags theme settings have been disabled to prevent conflicts. If you wish to re-enable the Meta tags theme settings, you must first disable the "Meta Tags" module.';
598 $form['ab_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
599 $form['ab_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
600 }
601 // Development settings
602 $form['ab_container']['themedev'] = array(
603 '#type' => 'fieldset',
604 '#title' => t('Theme development settings'),
605 '#collapsible' => TRUE,
606 '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE,
607 );
608 $form['ab_container']['themedev']['rebuild_registry'] = array(
609 '#type' => 'checkbox',
610 '#title' => t('Rebuild theme registry on every page.'),
611 '#default_value' => $settings['rebuild_registry'],
612 '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')),
613 );
614
615 // Return theme settings form
616 return $form;
617 }
618
619 ?>

  ViewVC Help
Powered by ViewVC 1.1.2