| 1 |
<?php
|
| 2 |
|
| 3 |
$defaults = array(
|
| 4 |
'fixedfluid' => 'px',
|
| 5 |
'layout_width_fluid' => 80,
|
| 6 |
'layout_width_fixed' => 820,
|
| 7 |
'sidebar_width' => '20',
|
| 8 |
'expand_admin' => 0,
|
| 9 |
'layout_min_width' => 680,
|
| 10 |
'layout_max_width' => 1300,
|
| 11 |
'headings_font_face' => 'arial',
|
| 12 |
'body_font_face' => 'arial',
|
| 13 |
'cufon_enable' => 1,
|
| 14 |
'cufon_font_face' => 'Gentium_Basic_Bold.js',
|
| 15 |
'taxonomy_display_default' => 'only',
|
| 16 |
'taxonomy_format_default' => 'vocab',
|
| 17 |
'taxonomy_enable_content_type' => 0,
|
| 18 |
'readmore_default' => t('Read more'),
|
| 19 |
'readmore_title_default' => t('Read the rest of this article.'),
|
| 20 |
'readmore_prefix_default' => '',
|
| 21 |
'readmore_suffix_default' => '',
|
| 22 |
'readmore_enable_content_type' => 0,
|
| 23 |
'comment_singular_default' => t('1 comment'),
|
| 24 |
'comment_plural_default' => t('@count comments'),
|
| 25 |
'comment_title_default' => t('Go to the first comment.'),
|
| 26 |
'comment_prefix_default' => '',
|
| 27 |
'comment_suffix_default' => '',
|
| 28 |
'comment_new_singular_default' => t('1 new comment'),
|
| 29 |
'comment_new_plural_default' => t('@count new comments'),
|
| 30 |
'comment_new_title_default' => t('Go to the first new comment.'),
|
| 31 |
'comment_new_prefix_default' => '',
|
| 32 |
'comment_new_suffix_default' => '',
|
| 33 |
'comment_add_default' => t('Add new comment'),
|
| 34 |
'comment_add_title_default' => t('Add a new comment to this page.'),
|
| 35 |
'comment_add_prefix_default' => '',
|
| 36 |
'comment_add_suffix_default' => '',
|
| 37 |
'comment_enable_content_type' => 0,
|
| 38 |
'commentheader' => 'Comments:',
|
| 39 |
'superfish_enable' => 1,
|
| 40 |
'superfish_speed' => 500,
|
| 41 |
'superfish_delay' => 500,
|
| 42 |
'superfish_easing' => 'swing',
|
| 43 |
'superfish_properties' => array('opacity' => TRUE, 'height' => TRUE),
|
| 44 |
'iepngfix' => 1,
|
| 45 |
'link_icons' => 0,
|
| 46 |
'superfish' => 1,
|
| 47 |
'block_edit' => 1,
|
| 48 |
'force_eq_heights' => 1,
|
| 49 |
'input_example' => 1,
|
| 50 |
'timestamp' => 0,
|
| 51 |
);
|
| 52 |
|
| 53 |
// Make the default content-type settings the same as the default theme settings,
|
| 54 |
// so we can tell if content-type-specific settings have been altered.
|
| 55 |
$defaults = array_merge($defaults, theme_get_settings());
|
| 56 |
|
| 57 |
// Get the node types
|
| 58 |
$node_types = node_get_types('names');
|
| 59 |
|
| 60 |
// Set the default values for content-type-specific settings
|
| 61 |
foreach ($node_types as $type => $name) {
|
| 62 |
$defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
|
| 63 |
$defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
|
| 64 |
$defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
|
| 65 |
$defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
|
| 66 |
$defaults["readmore_{$type}"] = $defaults['readmore_default'];
|
| 67 |
$defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
|
| 68 |
$defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
|
| 69 |
$defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
|
| 70 |
$defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
|
| 71 |
$defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
|
| 72 |
$defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
|
| 73 |
$defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
|
| 74 |
$defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
|
| 75 |
$defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
|
| 76 |
$defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
|
| 77 |
$defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
|
| 78 |
$defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
|
| 79 |
$defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
|
| 80 |
$defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
|
| 81 |
$defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
|
| 82 |
$defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
|
| 83 |
$defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
|
| 84 |
}
|
| 85 |
|
| 86 |
// Merge the saved variables and their default values
|
| 87 |
$settings = array_merge($defaults, $saved_settings);
|
| 88 |
|
| 89 |
// If content type-specifc settings are not enabled, reset the values
|
| 90 |
if (!$settings['readmore_enable_content_type']) {
|
| 91 |
foreach ($node_types as $type => $name) {
|
| 92 |
$settings["readmore_{$type}"] = $settings['readmore_default'];
|
| 93 |
$settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
|
| 94 |
$settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
|
| 95 |
$settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
|
| 96 |
}
|
| 97 |
}
|
| 98 |
if (!$settings['comment_enable_content_type']) {
|
| 99 |
foreach ($node_types as $type => $name) {
|
| 100 |
$defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
|
| 101 |
$defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
|
| 102 |
$defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
|
| 103 |
$defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
|
| 104 |
$defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
|
| 105 |
$defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
|
| 106 |
$defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
|
| 107 |
$defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
|
| 108 |
$defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
|
| 109 |
$defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
|
| 110 |
$defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
|
| 111 |
$defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
|
| 112 |
$defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
|
| 113 |
$defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
|
| 114 |
}
|
| 115 |
}
|