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

Contents of /contributions/themes/acquia_slate/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 May 26 06:29:01 2009 UTC (6 months ago) by jwolf
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +171 -267 lines
File MIME type: text/x-php
updating MAIN
1 <?php
2 // $Id$
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 // Allow only one general or node setting fieldset open 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 global $base_url;
32
33 // Retrieve & combine default and saved theme settings
34 include_once(path_to_theme() . '/template.php');
35 $defaults = phptemplate_default_theme_settings();
36 $settings = array_merge($defaults, $saved_settings);
37
38 // Create theme settings form widgets using Forms API
39
40 // TNT Fieldset
41 $form['tnt_container'] = array(
42 '#type' => 'fieldset',
43 '#title' => t('Acquia Slate settings'),
44 '#description' => t('Use these settings to change what and how information is displayed in your theme.'),
45 '#collapsible' => TRUE,
46 '#collapsed' => FALSE,
47 );
48
49 // General Settings
50 $form['tnt_container']['general_settings'] = array(
51 '#type' => 'fieldset',
52 '#title' => t('General settings'),
53 '#collapsible' => TRUE,
54 '#collapsed' => FALSE,
55 );
56
57
58 // Mission Statement
59 $form['tnt_container']['general_settings']['mission_statement'] = array(
60 '#type' => 'fieldset',
61 '#title' => t('Mission statement'),
62 '#collapsible' => TRUE,
63 '#collapsed' => TRUE,
64 );
65 $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array(
66 '#type' => 'radios',
67 '#title' => t('Where should your mission statement be displayed?'),
68 '#default_value' => $settings['mission_statement_pages'],
69 '#options' => array(
70 'home' => t('Display mission statement only on front page'),
71 'all' => t('Display mission statement on all pages'),
72 ),
73 );
74
75 // Breadcrumb
76 $form['tnt_container']['general_settings']['breadcrumb'] = array(
77 '#type' => 'fieldset',
78 '#title' => t('Breadcrumb'),
79 '#collapsible' => TRUE,
80 '#collapsed' => TRUE,
81 );
82 $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array(
83 '#type' => 'checkbox',
84 '#title' => t('Display breadcrumb'),
85 '#default_value' => $settings['breadcrumb_display'],
86 );
87
88 // Username
89 $form['tnt_container']['general_settings']['username'] = array(
90 '#type' => 'fieldset',
91 '#title' => t('Username'),
92 '#collapsible' => TRUE,
93 '#collapsed' => TRUE,
94 );
95 $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array(
96 '#type' => 'checkbox',
97 '#title' => t('Display "not verified" for unregistered usernames'),
98 '#default_value' => $settings['user_notverified_display'],
99 );
100
101 // Search Settings
102 if (module_exists('search')) {
103 $form['tnt_container']['general_settings']['search_container'] = array(
104 '#type' => 'fieldset',
105 '#title' => t('Search results'),
106 '#description' => t('What additional information should be displayed on your search results page?'),
107 '#collapsible' => TRUE,
108 '#collapsed' => TRUE,
109 );
110 $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array(
111 '#type' => 'checkbox',
112 '#title' => t('Display text snippet'),
113 '#default_value' => $settings['search_snippet'],
114 );
115 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array(
116 '#type' => 'checkbox',
117 '#title' => t('Display content type'),
118 '#default_value' => $settings['search_info_type'],
119 );
120 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array(
121 '#type' => 'checkbox',
122 '#title' => t('Display author name'),
123 '#default_value' => $settings['search_info_user'],
124 );
125 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array(
126 '#type' => 'checkbox',
127 '#title' => t('Display posted date'),
128 '#default_value' => $settings['search_info_date'],
129 );
130 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array(
131 '#type' => 'checkbox',
132 '#title' => t('Display comment count'),
133 '#default_value' => $settings['search_info_comment'],
134 );
135 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array(
136 '#type' => 'checkbox',
137 '#title' => t('Display attachment count'),
138 '#default_value' => $settings['search_info_upload'],
139 );
140 }
141
142 // Node Settings
143 $form['tnt_container']['node_type_specific'] = array(
144 '#type' => 'fieldset',
145 '#title' => t('Node settings'),
146 '#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.'),
147 '#collapsible' => TRUE,
148 '#collapsed' => FALSE,
149 );
150
151 // Author & Date Settings
152 $form['tnt_container']['node_type_specific']['submitted_by_container'] = array(
153 '#type' => 'fieldset',
154 '#title' => t('Author and date'),
155 '#collapsible' => TRUE,
156 '#collapsed' => TRUE,
157 );
158 // Default & content-type specific settings
159 if (module_exists('submitted_by') == FALSE) {
160 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
161 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array(
162 '#type' => 'fieldset',
163 '#title' => t('!name', array('!name' => t($name))),
164 '#collapsible' => TRUE,
165 '#collapsed' => TRUE,
166 );
167 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array(
168 '#type' => 'checkbox',
169 '#title' => t('Display author\'s username'),
170 '#default_value' => $settings["submitted_by_author_{$type}"],
171 );
172 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array(
173 '#type' => 'checkbox',
174 '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'),
175 '#default_value' => $settings["submitted_by_date_{$type}"],
176 );
177 // Options for default settings
178 if ($type == 'default') {
179 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
180 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
181 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array(
182 '#type' => 'checkbox',
183 '#title' => t('Use custom settings for each content type instead of the default above'),
184 '#default_value' => $settings['submitted_by_enable_content_type'],
185 );
186 }
187 // Collapse content-type specific settings if default settings are being used
188 else if ($settings['submitted_by_enable_content_type'] == 0) {
189 $form['submitted_by'][$type]['#collapsed'] = TRUE;
190 }
191 }
192 } else {
193 $form['tnt_container']['node_type_specific']['submitted_by_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts. If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
194 }
195
196 // Taxonomy Settings
197 if (module_exists('taxonomy')) {
198 $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array(
199 '#type' => 'fieldset',
200 '#title' => t('Taxonomy terms'),
201 '#collapsible' => TRUE,
202 '#collapsed' => TRUE,
203 );
204 // Default & content-type specific settings
205 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
206 // taxonomy display per node
207 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array(
208 '#type' => 'fieldset',
209 '#title' => t('!name', array('!name' => t($name))),
210 '#collapsible' => TRUE,
211 '#collapsed' => TRUE,
212 );
213 // display
214 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array(
215 '#type' => 'select',
216 '#title' => t('When should taxonomy terms be displayed?'),
217 '#default_value' => $settings["taxonomy_display_{$type}"],
218 '#options' => array(
219 '' => '',
220 'never' => t('Never display taxonomy terms'),
221 'all' => t('Always display taxonomy terms'),
222 'only' => t('Only display taxonomy terms on full node pages'),
223 ),
224 );
225 // format
226 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array(
227 '#type' => 'radios',
228 '#title' => t('Taxonomy display format'),
229 '#default_value' => $settings["taxonomy_format_{$type}"],
230 '#options' => array(
231 'vocab' => t('Display each vocabulary on a new line'),
232 'list' => t('Display all taxonomy terms together in single list'),
233 ),
234 );
235 // Get taxonomy vocabularies by node type
236 $vocabs = array();
237 $vocabs_by_type = ($type == 'default') ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
238 foreach ($vocabs_by_type as $key => $value) {
239 $vocabs[$value->vid] = $value->name;
240 }
241 // Display taxonomy checkboxes
242 foreach ($vocabs as $key => $vocab_name) {
243 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array(
244 '#type' => 'checkbox',
245 '#title' => t('Hide vocabulary: '. $vocab_name),
246 '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"],
247 );
248 }
249 // Options for default settings
250 if ($type == 'default') {
251 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
252 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
253 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array(
254 '#type' => 'checkbox',
255 '#title' => t('Use custom settings for each content type instead of the default above'),
256 '#default_value' => $settings['taxonomy_enable_content_type'],
257 );
258 }
259 // Collapse content-type specific settings if default settings are being used
260 else if ($settings['taxonomy_enable_content_type'] == 0) {
261 $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
262 }
263 }
264 }
265
266 // Read More & Comment Link Settings
267 $form['tnt_container']['node_type_specific']['link_settings'] = array(
268 '#type' => 'fieldset',
269 '#title' => t('Links'),
270 '#description' => t('Customize the text of node links'),
271 '#collapsible' => TRUE,
272 '#collapsed' => TRUE,
273 );
274
275 // Read more link settings
276 $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array(
277 '#type' => 'fieldset',
278 '#title' => t('"Read more"'),
279 '#collapsible' => TRUE,
280 '#collapsed' => TRUE,
281 );
282 // Default & content-type specific settings
283 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
284 // Read more
285 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array(
286 '#type' => 'fieldset',
287 '#title' => t('!name', array('!name' => t($name))),
288 '#collapsible' => TRUE,
289 '#collapsed' => TRUE,
290 );
291 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array(
292 '#type' => 'textfield',
293 '#title' => t('Link text'),
294 '#default_value' => $settings["readmore_{$type}"],
295 '#description' => t('HTML is allowed.'),
296 );
297 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array(
298 '#type' => 'textfield',
299 '#title' => t('Title text (tool tip)'),
300 '#default_value' => $settings["readmore_title_{$type}"],
301 '#description' => t('Displayed when hovering over link. Plain text only.'),
302 );
303 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array(
304 '#type' => 'textfield',
305 '#title' => t('Prefix'),
306 '#default_value' => $settings["readmore_prefix_{$type}"],
307 '#description' => t('Text or HTML placed before the link.'),
308 );
309 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array(
310 '#type' => 'textfield',
311 '#title' => t('Suffix'),
312 '#default_value' => $settings["readmore_suffix_{$type}"],
313 '#description' => t('Text or HTML placed after the link.'),
314 );
315 // Options for default settings
316 if ($type == 'default') {
317 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
318 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
319 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array(
320 '#type' => 'checkbox',
321 '#title' => t('Use custom settings for each content type instead of the default above'),
322 '#default_value' => $settings['readmore_enable_content_type'],
323 );
324 }
325 // Collapse content-type specific settings if default settings are being used
326 else if ($settings['readmore_enable_content_type'] == 0) {
327 $form['readmore'][$type]['#collapsed'] = TRUE;
328 }
329 }
330
331 // Comments link settings
332 $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array(
333 '#type' => 'fieldset',
334 '#title' => t('"Comment"'),
335 '#collapsible' => TRUE,
336 '#collapsed' => TRUE,
337 );
338 // Default & content-type specific settings
339 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
340 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array(
341 '#type' => 'fieldset',
342 '#title' => t('!name', array('!name' => t($name))),
343 '#collapsible' => TRUE,
344 '#collapsed' => TRUE,
345 );
346 // Full nodes
347 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array(
348 '#type' => 'fieldset',
349 '#title' => t('For full content'),
350 '#collapsible' => TRUE,
351 '#collapsed' => TRUE,
352 );
353 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array(
354 '#type' => 'fieldset',
355 '#title' => t('"Add new comment" link'),
356 '#description' => t('The link when the full content is being displayed.'),
357 '#collapsible' => TRUE,
358 '#collapsed' => TRUE,
359 );
360 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array(
361 '#type' => 'textfield',
362 '#title' => t('Link text'),
363 '#default_value' => $settings["comment_node_{$type}"],
364 '#description' => t('HTML is allowed.'),
365 );
366 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array(
367 '#type' => 'textfield',
368 '#title' => t('Title text (tool tip)'),
369 '#default_value' => $settings["comment_node_title_{$type}"],
370 '#description' => t('Displayed when hovering over link. Plain text only.'),
371 );
372 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array(
373 '#type' => 'fieldset',
374 '#title' => t('Advanced'),
375 '#collapsible' => TRUE,
376 '#collapsed' => TRUE,
377 );
378 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array(
379 '#type' => 'textfield',
380 '#title' => t('Prefix'),
381 '#default_value' => $settings["comment_node_prefix_{$type}"],
382 '#description' => t('Text or HTML placed before the link.'),
383 );
384 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array(
385 '#type' => 'textfield',
386 '#title' => t('Suffix'),
387 '#default_value' => $settings["comment_node_suffix_{$type}"],
388 '#description' => t('Text or HTML placed after the link.'),
389 );
390 // Teasers
391 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array(
392 '#type' => 'fieldset',
393 '#title' => t('For teasers'),
394 '#collapsible' => TRUE,
395 '#collapsed' => TRUE,
396 );
397 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array(
398 '#type' => 'fieldset',
399 '#title' => t('"Add new comment" link'),
400 '#description' => t('The link when there are no comments.'),
401 '#collapsible' => TRUE,
402 '#collapsed' => TRUE,
403 );
404 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array(
405 '#type' => 'textfield',
406 '#title' => t('Link text'),
407 '#default_value' => $settings["comment_add_{$type}"],
408 '#description' => t('HTML is allowed.'),
409 );
410 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array(
411 '#type' => 'textfield',
412 '#title' => t('Title text (tool tip)'),
413 '#default_value' => $settings["comment_add_title_{$type}"],
414 '#description' => t('Displayed when hovering over link. Plain text only.'),
415 );
416 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array(
417 '#type' => 'fieldset',
418 '#title' => t('Advanced'),
419 '#collapsible' => TRUE,
420 '#collapsed' => TRUE,
421 );
422 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array(
423 '#type' => 'textfield',
424 '#title' => t('Prefix'),
425 '#default_value' => $settings["comment_add_prefix_{$type}"],
426 '#description' => t('Text or HTML placed before the link.'),
427 );
428 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array(
429 '#type' => 'textfield',
430 '#title' => t('Suffix'),
431 '#default_value' => $settings["comment_add_suffix_{$type}"],
432 '#description' => t('Text or HTML placed after the link.'),
433 );
434 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array(
435 '#type' => 'fieldset',
436 '#title' => t('"Comments" link'),
437 '#description' => t('The link when there are one or more comments.'),
438 '#collapsible' => TRUE,
439 '#collapsed' => TRUE,
440 );
441 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array(
442 '#type' => 'textfield',
443 '#title' => t('Link text when there is 1 comment'),
444 '#default_value' => $settings["comment_singular_{$type}"],
445 '#description' => t('HTML is allowed.'),
446 );
447 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array(
448 '#type' => 'textfield',
449 '#title' => t('Link text when there are multiple comments'),
450 '#default_value' => $settings["comment_plural_{$type}"],
451 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
452 );
453 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array(
454 '#type' => 'textfield',
455 '#title' => t('Title text (tool tip)'),
456 '#default_value' => $settings["comment_title_{$type}"],
457 '#description' => t('Displayed when hovering over link. Plain text only.'),
458 );
459 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array(
460 '#type' => 'fieldset',
461 '#title' => t('Advanced'),
462 '#collapsible' => TRUE,
463 '#collapsed' => TRUE,
464 );
465 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array(
466 '#type' => 'textfield',
467 '#title' => t('Prefix'),
468 '#default_value' => $settings["comment_prefix_{$type}"],
469 '#description' => t('Text or HTML placed before the link.'),
470 );
471 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array(
472 '#type' => 'textfield',
473 '#title' => t('Suffix'),
474 '#default_value' => $settings["comment_suffix_{$type}"],
475 '#description' => t('Text or HTML placed after the link.'),
476 );
477 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array(
478 '#type' => 'fieldset',
479 '#title' => t('"New comments" link'),
480 '#description' => t('The link when there are one or more new comments.'),
481 '#collapsible' => TRUE,
482 '#collapsed' => TRUE,
483 );
484 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array(
485 '#type' => 'textfield',
486 '#title' => t('Link text when there is 1 new comment'),
487 '#default_value' => $settings["comment_new_singular_{$type}"],
488 '#description' => t('HTML is allowed.'),
489 );
490 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array(
491 '#type' => 'textfield',
492 '#title' => t('Link text when there are multiple new comments'),
493 '#default_value' => $settings["comment_new_plural_{$type}"],
494 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
495 );
496 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array(
497 '#type' => 'textfield',
498 '#title' => t('Title text (tool tip)'),
499 '#default_value' => $settings["comment_new_title_{$type}"],
500 '#description' => t('Displayed when hovering over link. Plain text only.'),
501 );
502 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array(
503 '#type' => 'fieldset',
504 '#title' => t('Advanced'),
505 '#collapsible' => TRUE,
506 '#collapsed' => TRUE,
507 );
508 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array(
509 '#type' => 'textfield',
510 '#title' => t('Prefix'),
511 '#default_value' => $settings["comment_new_prefix_{$type}"],
512 '#description' => t('Text or HTML placed before the link.'),
513 );
514 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array(
515 '#type' => 'textfield',
516 '#title' => t('Suffix'),
517 '#default_value' => $settings["comment_new_suffix_{$type}"],
518 '#description' => t('Text or HTML placed after the link.'),
519 );
520 // Options for default settings
521 if ($type == 'default') {
522 $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
523 $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
524 $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array(
525 '#type' => 'checkbox',
526 '#title' => t('Use custom settings for each content type instead of the default above'),
527 '#default_value' => $settings['comment_enable_content_type'],
528 );
529 }
530 // Collapse content-type specific settings if default settings are being used
531 else if ($settings['comment_enable_content_type'] == 0) {
532 $form['comment'][$type]['#collapsed'] = TRUE;
533 }
534 }
535
536 // SEO settings
537 $form['tnt_container']['seo'] = array(
538 '#type' => 'fieldset',
539 '#title' => t('Search engine optimization (SEO) settings'),
540 '#collapsible' => TRUE,
541 '#collapsed' => FALSE,
542 );
543 // Page titles
544 $form['tnt_container']['seo']['page_format_titles'] = array(
545 '#type' => 'fieldset',
546 '#title' => t('Page titles'),
547 '#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'),
548 '#collapsible' => TRUE,
549 '#collapsed' => TRUE,
550 );
551 // front page title
552 if (module_exists('page_title') == FALSE) {
553 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array(
554 '#type' => 'fieldset',
555 '#title' => t('Front page title'),
556 '#description' => t('Your front page in particular should have important keywords for your site in the page title'),
557 '#collapsible' => TRUE,
558 '#collapsed' => TRUE,
559 );
560 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array(
561 '#type' => 'select',
562 '#title' => t('Set text of front page title'),
563 '#collapsible' => TRUE,
564 '#collapsed' => FALSE,
565 '#default_value' => $settings['front_page_title_display'],
566 '#options' => array(
567 'title_slogan' => t('Site title | Site slogan'),
568 'slogan_title' => t('Site slogan | Site title'),
569 'title_mission' => t('Site title | Site mission'),
570 'custom' => t('Custom (below)'),
571 ),
572 );
573 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array(
574 '#type' => 'textfield',
575 '#title' => t('Custom'),
576 '#size' => 60,
577 '#default_value' => $settings['page_title_display_custom'],
578 '#description' => t('Enter a custom page title for your front page'),
579 );
580 // other pages title
581 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array(
582 '#type' => 'fieldset',
583 '#title' => t('Other page titles'),
584 '#collapsible' => TRUE,
585 '#collapsed' => TRUE,
586 );
587 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array(
588 '#type' => 'select',
589 '#title' => t('Set text of other page titles'),
590 '#collapsible' => TRUE,
591 '#collapsed' => FALSE,
592 '#default_value' => $settings['other_page_title_display'],
593 '#options' => array(
594 'ptitle_slogan' => t('Page title | Site slogan'),
595 'ptitle_stitle' => t('Page title | Site title'),
596 'ptitle_smission' => t('Page title | Site mission'),
597 'ptitle_custom' => t('Page title | Custom (below)'),
598 'custom' => t('Custom (below)'),
599 ),
600 );
601 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array(
602 '#type' => 'textfield',
603 '#title' => t('Custom'),
604 '#size' => 60,
605 '#default_value' => $settings['other_page_title_display_custom'],
606 '#description' => t('Enter a custom page title for all other pages'),
607 );
608 // SEO configurable separator
609 $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array(
610 '#type' => 'textfield',
611 '#title' => t('Title separator'),
612 '#description' => t('Customize the separator character used in the page title'),
613 '#size' => 60,
614 '#default_value' => $settings['configurable_separator'],
615 );
616 } else {
617 $form['tnt_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.';
618 $form['tnt_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
619 }
620 // Metadata
621 $form['tnt_container']['seo']['meta'] = array(
622 '#type' => 'fieldset',
623 '#title' => t('Meta tags'),
624 '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results. NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module. These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'),
625 '#collapsible' => TRUE,
626 '#collapsed' => TRUE,
627 );
628 if (module_exists('nodewords') == FALSE) {
629 $form['tnt_container']['seo']['meta']['meta_keywords'] = array(
630 '#type' => 'textfield',
631 '#title' => t('Meta keywords'),
632 '#description' => t('Enter a comma-separated list of keywords'),
633 '#size' => 60,
634 '#default_value' => $settings['meta_keywords'],
635 );
636 $form['tnt_container']['seo']['meta']['meta_description'] = array(
637 '#type' => 'textarea',
638 '#title' => t('Meta description'),
639 '#cols' => 60,
640 '#rows' => 6,
641 '#default_value' => $settings['meta_description'],
642 );
643 }
644 else {
645 $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts. If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
646 $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
647 $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
648 }
649
650 // Add custom settings, if present
651 if (function_exists('phptemplate_settings_custom_settings')) {
652 $form = phptemplate_settings_custom_settings($form, $settings);
653 }
654
655 // Development settings
656 $form['tnt_container']['themedev'] = array(
657 '#type' => 'fieldset',
658 '#title' => t('Theme development settings'),
659 '#collapsible' => TRUE,
660 '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE,
661 );
662 $form['tnt_container']['themedev']['rebuild_registry'] = array(
663 '#type' => 'checkbox',
664 '#title' => t('Rebuild theme registry for every page.'),
665 '#default_value' => $settings['rebuild_registry'],
666 '#description' => t('This setting is useful while developing themes (see <a href="!link">rebuilding the theme registry</a>). However, it <strong>significantly degrades performance</strong> and should be turned off for any production website.', array('!link' => 'http://drupal.org/node/173880#theme-registry')),
667 );
668 $form['tnt_container']['themedev']['fix_css_limit'] = array(
669 '#type' => 'checkbox',
670 '#title' => t('Fix IE stylesheet limit.'),
671 '#default_value' => $settings['fix_css_limit'],
672 '#description' => t('This setting groups css files so Internet Explorer can see more than 30 of them. This is useful when you cannot use aggregation (e.g., when developing or using private file downloads). But because it degrades performance and can load files out of order, CSS aggregation (<a href="!link">Optimize CSS files</a>) is <strong>strongly</strong> recommended instead for any production website.', array('!link' => $base_url .'/admin/settings/performance')),
673 );
674
675 // Return theme settings form
676 return $form;
677 }
678
679 ?>

  ViewVC Help
Powered by ViewVC 1.1.2