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

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

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


Revision 1.3 - (show annotations) (download) (as text)
Fri Feb 13 08:56:04 2009 UTC (9 months, 1 week ago) by jwolf
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.2: +38 -5 lines
File MIME type: text/x-php
Updating HEAD
#369552 - clean implementation of rebuild_registry - by wmostrey
#369692 - collapse fieldsets - by wmostrey
1 <?php
2 // $Id: theme-settings.php,v 1.1.2.3 2009/02/13 08:04:16 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['tnt_container'] = array(
161 '#type' => 'fieldset',
162 '#title' => t('Acquia Marina 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 // General Settings
169 $form['tnt_container']['general_settings'] = array(
170 '#type' => 'fieldset',
171 '#title' => t('General settings'),
172 '#collapsible' => TRUE,
173 '#collapsed' => FALSE,
174 '#attributes' => array('class' => 'general_settings'),
175 );
176
177 // Mission Statement
178 $form['tnt_container']['general_settings']['mission_statement'] = array(
179 '#type' => 'fieldset',
180 '#title' => t('Mission statement'),
181 '#collapsible' => TRUE,
182 '#collapsed' => TRUE,
183 );
184 $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array(
185 '#type' => 'radios',
186 '#title' => t('Where should your mission statement be displayed?'),
187 '#default_value' => $settings['mission_statement_pages'],
188 '#options' => array(
189 'home' => t('Display mission statement only on front page'),
190 'all' => t('Display mission statement on all pages'),
191 ),
192 );
193
194 // Breadcrumb
195 $form['tnt_container']['general_settings']['breadcrumb'] = array(
196 '#type' => 'fieldset',
197 '#title' => t('Breadcrumb'),
198 '#collapsible' => TRUE,
199 '#collapsed' => TRUE,
200 );
201 $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array(
202 '#type' => 'checkbox',
203 '#title' => t('Display breadcrumb'),
204 '#default_value' => $settings['breadcrumb_display'],
205 );
206
207 // Username
208 $form['tnt_container']['general_settings']['username'] = array(
209 '#type' => 'fieldset',
210 '#title' => t('Username'),
211 '#collapsible' => TRUE,
212 '#collapsed' => TRUE,
213 );
214 $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array(
215 '#type' => 'checkbox',
216 '#title' => t('Display "not verified" for unregistered usernames'),
217 '#default_value' => $settings['user_notverified_display'],
218 );
219
220 // Search Settings
221 $form['tnt_container']['general_settings']['search_container'] = array(
222 '#type' => 'fieldset',
223 '#title' => t('Search results'),
224 '#description' => t('What additional information should be displayed on your search results page?'),
225 '#collapsible' => TRUE,
226 '#collapsed' => TRUE,
227 );
228 $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array(
229 '#type' => 'checkbox',
230 '#title' => t('Display text snippet'),
231 '#default_value' => $settings['search_snippet'],
232 );
233 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array(
234 '#type' => 'checkbox',
235 '#title' => t('Display content type'),
236 '#default_value' => $settings['search_info_type'],
237 );
238 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array(
239 '#type' => 'checkbox',
240 '#title' => t('Display author name'),
241 '#default_value' => $settings['search_info_user'],
242 );
243 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array(
244 '#type' => 'checkbox',
245 '#title' => t('Display posted date'),
246 '#default_value' => $settings['search_info_date'],
247 );
248 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array(
249 '#type' => 'checkbox',
250 '#title' => t('Display comment count'),
251 '#default_value' => $settings['search_info_comment'],
252 );
253 $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array(
254 '#type' => 'checkbox',
255 '#title' => t('Display attachment count'),
256 '#default_value' => $settings['search_info_upload'],
257 );
258
259 // Node Settings
260 $form['tnt_container']['node_type_specific'] = array(
261 '#type' => 'fieldset',
262 '#title' => t('Node settings'),
263 '#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.'),
264 '#collapsible' => TRUE,
265 '#collapsed' => TRUE,
266 '#attributes' => array('class' => 'node_settings'),
267 );
268
269 // Author & Date Settings
270 $form['tnt_container']['node_type_specific']['submitted_by_container'] = array(
271 '#type' => 'fieldset',
272 '#title' => t('Author & date'),
273 '#collapsible' => TRUE,
274 '#collapsed' => TRUE,
275 );
276 // Default & content-type specific settings
277 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
278 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array(
279 '#type' => 'fieldset',
280 '#title' => t('!name', array('!name' => t($name))),
281 '#collapsible' => TRUE,
282 '#collapsed' => TRUE,
283 );
284 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array(
285 '#type' => 'checkbox',
286 '#title' => t('Display author\'s username'),
287 '#default_value' => $settings["submitted_by_author_{$type}"],
288 );
289 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array(
290 '#type' => 'checkbox',
291 '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'),
292 '#default_value' => $settings["submitted_by_date_{$type}"],
293 );
294 // Options for default settings
295 if ($type == 'default') {
296 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
297 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
298 $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array(
299 '#type' => 'checkbox',
300 '#title' => t('Use custom settings for each content type instead of the default above'),
301 '#default_value' => $settings['submitted_by_enable_content_type'],
302 );
303 }
304 // Collapse content-type specific settings if default settings are being used
305 else if ($settings['submitted_by_enable_content_type'] == 0) {
306 $form['submitted_by'][$type]['#collapsed'] = TRUE;
307 }
308 }
309
310 // Taxonomy Settings
311 if (module_exists('taxonomy')) {
312 $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array(
313 '#type' => 'fieldset',
314 '#title' => t('Taxonomy terms'),
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 // taxonomy display per node
321 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array(
322 '#type' => 'fieldset',
323 '#title' => t('!name', array('!name' => t($name))),
324 '#collapsible' => TRUE,
325 '#collapsed' => TRUE,
326 );
327 // display
328 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array(
329 '#type' => 'select',
330 '#title' => t('When should taxonomy terms be displayed?'),
331 '#default_value' => $settings["taxonomy_display_{$type}"],
332 '#options' => array(
333 '' => '',
334 'never' => t('Never display taxonomy terms'),
335 'all' => t('Always display taxonomy terms'),
336 'only' => t('Only display taxonomy terms on full node pages'),
337 ),
338 );
339 // format
340 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array(
341 '#type' => 'radios',
342 '#title' => t('Taxonomy display format'),
343 '#default_value' => $settings["taxonomy_format_{$type}"],
344 '#options' => array(
345 'vocab' => t('Display each vocabulary on a new line'),
346 'list' => t('Display all taxonomy terms together in single list'),
347 ),
348 );
349 // Get taxonomy vocabularies by node type
350 $vocabs = array();
351 $vocabs_by_type = ($type == 'default') ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
352 foreach ($vocabs_by_type as $key => $value) {
353 $vocabs[$value->vid] = $value->name;
354 }
355 // Display taxonomy checkboxes
356 foreach ($vocabs as $key => $vocab_name) {
357 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array(
358 '#type' => 'checkbox',
359 '#title' => t('Display vocabulary: '. $vocab_name),
360 '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"],
361 );
362 }
363 // Options for default settings
364 if ($type == 'default') {
365 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
366 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
367 $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array(
368 '#type' => 'checkbox',
369 '#title' => t('Use custom settings for each content type instead of the default above'),
370 '#default_value' => $settings['taxonomy_enable_content_type'],
371 );
372 }
373 // Collapse content-type specific settings if default settings are being used
374 else if ($settings['taxonomy_enable_content_type'] == 0) {
375 $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
376 }
377 }
378 }
379
380 // Read More & Comment Link Settings
381 $form['tnt_container']['node_type_specific']['link_settings'] = array(
382 '#type' => 'fieldset',
383 '#title' => t('Links'),
384 '#description' => t('Customize the text of node links'),
385 '#collapsible' => TRUE,
386 '#collapsed' => TRUE,
387 );
388
389 // Read more link settings
390 $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array(
391 '#type' => 'fieldset',
392 '#title' => t('“Read more”'),
393 '#collapsible' => TRUE,
394 '#collapsed' => TRUE,
395 );
396 // Default & content-type specific settings
397 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
398 // Read more
399 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array(
400 '#type' => 'fieldset',
401 '#title' => t('!name', array('!name' => t($name))),
402 '#collapsible' => TRUE,
403 '#collapsed' => TRUE,
404 );
405 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array(
406 '#type' => 'textfield',
407 '#title' => t('Link text'),
408 '#default_value' => $settings["readmore_{$type}"],
409 '#description' => t('HTML is allowed.'),
410 );
411 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array(
412 '#type' => 'textfield',
413 '#title' => t('Title text (tool tip)'),
414 '#default_value' => $settings["readmore_title_{$type}"],
415 '#description' => t('Displayed when hovering over link. Plain text only.'),
416 );
417 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array(
418 '#type' => 'textfield',
419 '#title' => t('Prefix'),
420 '#default_value' => $settings["readmore_prefix_{$type}"],
421 '#description' => t('Text or HTML placed before the link.'),
422 );
423 $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array(
424 '#type' => 'textfield',
425 '#title' => t('Suffix'),
426 '#default_value' => $settings["readmore_suffix_{$type}"],
427 '#description' => t('Text or HTML placed after the link.'),
428 );
429 // Options for default settings
430 if ($type == 'default') {
431 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
432 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
433 $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array(
434 '#type' => 'checkbox',
435 '#title' => t('Use custom settings for each content type instead of the default above'),
436 '#default_value' => $settings['readmore_enable_content_type'],
437 );
438 }
439 // Collapse content-type specific settings if default settings are being used
440 else if ($settings['readmore_enable_content_type'] == 0) {
441 $form['readmore'][$type]['#collapsed'] = TRUE;
442 }
443 }
444
445 // Comments link settings
446 $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array(
447 '#type' => 'fieldset',
448 '#title' => t('“Comment”'),
449 '#collapsible' => TRUE,
450 '#collapsed' => TRUE,
451 );
452 // Default & content-type specific settings
453 foreach ((array('default' => 'Default') + node_get_types('names')) as $type => $name) {
454 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array(
455 '#type' => 'fieldset',
456 '#title' => t('!name', array('!name' => t($name))),
457 '#collapsible' => TRUE,
458 '#collapsed' => TRUE,
459 );
460 // Full nodes
461 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array(
462 '#type' => 'fieldset',
463 '#title' => t('For full content'),
464 '#collapsible' => TRUE,
465 '#collapsed' => TRUE,
466 );
467 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array(
468 '#type' => 'fieldset',
469 '#title' => t('“Add new comment” link'),
470 '#description' => t('The link when the full content is being displayed.'),
471 '#collapsible' => TRUE,
472 '#collapsed' => TRUE,
473 );
474 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array(
475 '#type' => 'textfield',
476 '#title' => t('Link text'),
477 '#default_value' => $settings["comment_node_{$type}"],
478 '#description' => t('HTML is allowed.'),
479 );
480 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array(
481 '#type' => 'textfield',
482 '#title' => t('Title text (tool tip)'),
483 '#default_value' => $settings["comment_node_title_{$type}"],
484 '#description' => t('Displayed when hovering over link. Plain text only.'),
485 );
486 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array(
487 '#type' => 'fieldset',
488 '#title' => t('Advanced'),
489 '#collapsible' => TRUE,
490 '#collapsed' => TRUE,
491 );
492 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array(
493 '#type' => 'textfield',
494 '#title' => t('Prefix'),
495 '#default_value' => $settings["comment_node_prefix_{$type}"],
496 '#description' => t('Text or HTML placed before the link.'),
497 );
498 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array(
499 '#type' => 'textfield',
500 '#title' => t('Suffix'),
501 '#default_value' => $settings["comment_node_suffix_{$type}"],
502 '#description' => t('Text or HTML placed after the link.'),
503 );
504 // Teasers
505 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array(
506 '#type' => 'fieldset',
507 '#title' => t('For teasers'),
508 '#collapsible' => TRUE,
509 '#collapsed' => TRUE,
510 );
511 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array(
512 '#type' => 'fieldset',
513 '#title' => t('“Add new comment” link'),
514 '#description' => t('The link when there are no comments.'),
515 '#collapsible' => TRUE,
516 '#collapsed' => TRUE,
517 );
518 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array(
519 '#type' => 'textfield',
520 '#title' => t('Link text'),
521 '#default_value' => $settings["comment_add_{$type}"],
522 '#description' => t('HTML is allowed.'),
523 );
524 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array(
525 '#type' => 'textfield',
526 '#title' => t('Title text (tool tip)'),
527 '#default_value' => $settings["comment_add_title_{$type}"],
528 '#description' => t('Displayed when hovering over link. Plain text only.'),
529 );
530 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array(
531 '#type' => 'fieldset',
532 '#title' => t('Advanced'),
533 '#collapsible' => TRUE,
534 '#collapsed' => TRUE,
535 );
536 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array(
537 '#type' => 'textfield',
538 '#title' => t('Prefix'),
539 '#default_value' => $settings["comment_add_prefix_{$type}"],
540 '#description' => t('Text or HTML placed before the link.'),
541 );
542 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array(
543 '#type' => 'textfield',
544 '#title' => t('Suffix'),
545 '#default_value' => $settings["comment_add_suffix_{$type}"],
546 '#description' => t('Text or HTML placed after the link.'),
547 );
548 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array(
549 '#type' => 'fieldset',
550 '#title' => t('“Comments” link'),
551 '#description' => t('The link when there are one or more comments.'),
552 '#collapsible' => TRUE,
553 '#collapsed' => TRUE,
554 );
555 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array(
556 '#type' => 'textfield',
557 '#title' => t('Link text when there is 1 comment'),
558 '#default_value' => $settings["comment_singular_{$type}"],
559 '#description' => t('HTML is allowed.'),
560 );
561 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array(
562 '#type' => 'textfield',
563 '#title' => t('Link text when there are multiple comments'),
564 '#default_value' => $settings["comment_plural_{$type}"],
565 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
566 );
567 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array(
568 '#type' => 'textfield',
569 '#title' => t('Title text (tool tip)'),
570 '#default_value' => $settings["comment_title_{$type}"],
571 '#description' => t('Displayed when hovering over link. Plain text only.'),
572 );
573 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array(
574 '#type' => 'fieldset',
575 '#title' => t('Advanced'),
576 '#collapsible' => TRUE,
577 '#collapsed' => TRUE,
578 );
579 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array(
580 '#type' => 'textfield',
581 '#title' => t('Prefix'),
582 '#default_value' => $settings["comment_prefix_{$type}"],
583 '#description' => t('Text or HTML placed before the link.'),
584 );
585 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array(
586 '#type' => 'textfield',
587 '#title' => t('Suffix'),
588 '#default_value' => $settings["comment_suffix_{$type}"],
589 '#description' => t('Text or HTML placed after the link.'),
590 );
591 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array(
592 '#type' => 'fieldset',
593 '#title' => t('“New comments” link'),
594 '#description' => t('The link when there are one or more new comments.'),
595 '#collapsible' => TRUE,
596 '#collapsed' => TRUE,
597 );
598 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array(
599 '#type' => 'textfield',
600 '#title' => t('Link text when there is 1 new comment'),
601 '#default_value' => $settings["comment_new_singular_{$type}"],
602 '#description' => t('HTML is allowed.'),
603 );
604 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array(
605 '#type' => 'textfield',
606 '#title' => t('Link text when there are multiple new comments'),
607 '#default_value' => $settings["comment_new_plural_{$type}"],
608 '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'),
609 );
610 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array(
611 '#type' => 'textfield',
612 '#title' => t('Title text (tool tip)'),
613 '#default_value' => $settings["comment_new_title_{$type}"],
614 '#description' => t('Displayed when hovering over link. Plain text only.'),
615 );
616 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array(
617 '#type' => 'fieldset',
618 '#title' => t('Advanced'),
619 '#collapsible' => TRUE,
620 '#collapsed' => TRUE,
621 );
622 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array(
623 '#type' => 'textfield',
624 '#title' => t('Prefix'),
625 '#default_value' => $settings["comment_new_prefix_{$type}"],
626 '#description' => t('Text or HTML placed before the link.'),
627 );
628 $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array(
629 '#type' => 'textfield',
630 '#title' => t('Suffix'),
631 '#default_value' => $settings["comment_new_suffix_{$type}"],
632 '#description' => t('Text or HTML placed after the link.'),
633 );
634 // Options for default settings
635 if ($type == 'default') {
636 $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
637 $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
638 $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array(
639 '#type' => 'checkbox',
640 '#title' => t('Use custom settings for each content type instead of the default above'),
641 '#default_value' => $settings['comment_enable_content_type'],
642 );
643 }
644 // Collapse content-type specific settings if default settings are being used
645 else if ($settings['comment_enable_content_type'] == 0) {
646 $form['comment'][$type]['#collapsed'] = TRUE;
647 }
648 }
649
650 // SEO settings
651 $form['tnt_container']['seo'] = array(
652 '#type' => 'fieldset',
653 '#title' => t('Search engine optimization (SEO) settings'),
654 '#collapsible' => TRUE,
655 '#collapsed' => FALSE,
656 );
657 // Page titles
658 $form['tnt_container']['seo']['page_format_titles'] = array(
659 '#type' => 'fieldset',
660 '#title' => t('Page titles'),
661 '#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'),
662 '#collapsible' => TRUE,
663 '#collapsed' => TRUE,
664 );
665 // front page title
666 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array(
667 '#type' => 'fieldset',
668 '#title' => t('Front page title'),
669 '#description' => t('Your front page in particular should have important keywords for your site in the page title'),
670 '#collapsible' => TRUE,
671 '#collapsed' => TRUE,
672 );
673 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array(
674 '#type' => 'select',
675 '#title' => t('Set text of front page title'),
676 '#collapsible' => TRUE,
677 '#collapsed' => FALSE,
678 '#default_value' => $settings['front_page_title_display'],
679 '#options' => array(
680 'title_slogan' => t('Site title | Site slogan'),
681 'slogan_title' => t('Site slogan | Site title'),
682 'title_mission' => t('Site title | Site mission'),
683 'custom' => t('Custom (below)'),
684 ),
685 );
686 $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array(
687 '#type' => 'textfield',
688 '#title' => t('Custom'),
689 '#size' => 60,
690 '#default_value' => $settings['page_title_display_custom'],
691 '#description' => t('Enter a custom page title for your front page'),
692 );
693 // other pages title
694 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array(
695 '#type' => 'fieldset',
696 '#title' => t('Other page titles'),
697 '#collapsible' => TRUE,
698 '#collapsed' => TRUE,
699 );
700 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array(
701 '#type' => 'select',
702 '#title' => t('Set text of other page titles'),
703 '#collapsible' => TRUE,
704 '#collapsed' => FALSE,
705 '#default_value' => $settings['other_page_title_display'],
706 '#options' => array(
707 'ptitle_slogan' => t('Page title | Site slogan'),
708 'ptitle_stitle' => t('Page title | Site title'),
709 'ptitle_smission' => t('Page title | Site mission'),
710 'ptitle_custom' => t('Page title | Custom (below)'),
711 'custom' => t('Custom (below)'),
712 ),
713 );
714 $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array(
715 '#type' => 'textfield',
716 '#title' => t('Custom'),
717 '#size' => 60,
718 '#default_value' => $settings['other_page_title_display_custom'],
719 '#description' => t('Enter a custom page title for all other pages'),
720 );
721 // SEO configurable separator
722 $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array(
723 '#type' => 'textfield',
724 '#title' => t('Title separator'),
725 '#description' => t('Customize the separator character used in the page title'),
726 '#size' => 60,
727 '#default_value' => $settings['configurable_separator'],
728 );
729 // Metadata
730 $form['tnt_container']['seo']['meta'] = array(
731 '#type' => 'fieldset',
732 '#title' => t('Meta tags'),
733 '#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.'),
734 '#collapsible' => TRUE,
735 '#collapsed' => TRUE,
736 );
737 if (module_exists('nodewords') == FALSE) {
738 $form['tnt_container']['seo']['meta']['meta_keywords'] = array(
739 '#type' => 'textfield',
740 '#title' => t('Meta keywords'),
741 '#description' => t('Enter a comma-separated list of keywords'),
742 '#size' => 60,
743 '#default_value' => $settings['meta_keywords'],
744 );
745 $form['tnt_container']['seo']['meta']['meta_description'] = array(
746 '#type' => 'textarea',
747 '#title' => t('Meta description'),
748 '#cols' => 60,
749 '#rows' => 6,
750 '#default_value' => $settings['meta_description'],
751 );
752 } else {
753 $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.';
754 $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
755 $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
756 }
757 // Development settings
758 $form['tnt_container']['themedev'] = array(
759 '#type' => 'fieldset',
760 '#title' => t('Theme development settings'),
761 '#collapsible' => TRUE,
762 '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE,
763 );
764 $form['tnt_container']['themedev']['rebuild_registry'] = array(
765 '#type' => 'checkbox',
766 '#title' => t('Rebuild theme registry on every page.'),
767 '#default_value' => $settings['rebuild_registry'],
768 '#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')),
769 );
770
771 // Return theme settings form
772 return $form;
773 }
774
775 ?>

  ViewVC Help
Powered by ViewVC 1.1.2