summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.admin.inc29
-rw-r--r--modules/system/system.install29
-rw-r--r--modules/system/system.module19
3 files changed, 32 insertions, 45 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index d67213e64..dbf0d39d0 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -399,30 +399,7 @@ function system_theme_settings(&$form_state, $key = '') {
}
}
- // System wide only settings.
- if (!$key) {
- // Create neat 2-column layout for the toggles
- $form['theme_settings'] += array(
- '#prefix' => '<div class="theme-settings-left">',
- '#suffix' => '</div>',
- );
-
- // Toggle node display.
- $node_types = node_get_types('names');
- if ($node_types) {
- $form['node_info'] = array(
- '#type' => 'fieldset',
- '#title' => t('Display post information on'),
- '#description' => t('Enable or disable the <em>submitted by Username on date</em> text when displaying posts of the following type.'),
- '#prefix' => '<div class="theme-settings-right">',
- '#suffix' => '</div>',
- );
- foreach ($node_types as $type => $name) {
- $form['node_info']["toggle_node_info_$type"] = array('#type' => 'checkbox', '#title' => check_plain($name), '#default_value' => $settings["toggle_node_info_$type"]);
- }
- }
- }
- elseif (!element_children($form['theme_settings'])) {
+ if (!element_children($form['theme_settings'])) {
// If there is no element in the theme settings fieldset then do not show
// it -- but keep it in the form if another module wants to alter.
$form['theme_settings']['#access'] = FALSE;
@@ -436,7 +413,7 @@ function system_theme_settings(&$form_state, $key = '') {
'#description' => t('If toggled on, the following logo will be displayed.'),
'#attributes' => array('class' => 'theme-settings-bottom'),
);
- $form['logo']["default_logo"] = array(
+ $form['logo']['default_logo'] = array(
'#type' => 'checkbox',
'#title' => t('Use the default logo'),
'#default_value' => $settings['default_logo'],
@@ -461,7 +438,7 @@ function system_theme_settings(&$form_state, $key = '') {
$form['favicon'] = array(
'#type' => 'fieldset',
'#title' => t('Shortcut icon settings'),
- '#description' => t("Your shortcut icon, or 'favicon', is displayed in the address bar and bookmarks of most browsers.")
+ '#description' => t("Your shortcut icon, or 'favicon', is displayed in the address bar and bookmarks of most browsers."),
);
$form['favicon']['default_favicon'] = array(
'#type' => 'checkbox',
diff --git a/modules/system/system.install b/modules/system/system.install
index e75b91658..5b73c4b87 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -3166,6 +3166,35 @@ function system_update_7016() {
}
/**
+ * Change the theme setting 'toggle_node_info' into a per content type variable.
+ */
+function system_update_7017() {
+ $ret = array();
+ $types = node_get_types();
+ if (count($types)) {
+ foreach ($types as $type) {
+ $node_info = theme_get_setting('toggle_node_info_' . $type->type);
+ if ($node_info !== NULL) {
+ variable_set('node_submitted_' . $type->type, $node_info);
+ $ret[] = array('success' => TRUE, 'query' => "variable_set('node_submitted_$type->type')");
+ }
+ }
+ }
+
+ // Unset deprecated 'toggle_node_info' theme settings.
+ $theme_settings = theme_get_settings();
+ foreach ($theme_settings as $setting => $value) {
+ if (substr($setting, 0, 16) == 'toggle_node_info') {
+ unset($theme_settings[$setting]);
+ }
+ }
+ variable_set('theme_settings', $theme_settings);
+ $ret[] = array('success' => TRUE, 'query' => "variable_set('theme_settings')");
+
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/
diff --git a/modules/system/system.module b/modules/system/system.module
index f71ccd75c..49caeea00 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1354,25 +1354,6 @@ function _system_sort_requirements($a, $b) {
}
/**
- * Implementation of hook_node_type().
- *
- * Updates theme settings after a node type change.
- */
-function system_node_type($op, $info) {
- if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
- $old = 'toggle_node_info_' . $info->old_type;
- $new = 'toggle_node_info_' . $info->type;
-
- $theme_settings = variable_get('theme_settings', array());
- if (isset($theme_settings[$old])) {
- $theme_settings[$new] = $theme_settings[$old];
- unset($theme_settings[$old]);
- variable_set('theme_settings', $theme_settings);
- }
- }
-}
-
-/**
* Output a confirmation form
*
* This function returns a complete form for confirming an action. A link is