Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.460
diff -u -p -r1.460 theme.inc
--- includes/theme.inc 4 Jan 2009 16:19:39 -0000 1.460
+++ includes/theme.inc 6 Jan 2009 21:57:07 -0000
@@ -918,11 +918,6 @@ function theme_get_settings($key = NULL)
'toggle_secondary_menu' => 1,
);
- if (module_exists('node')) {
- foreach (node_get_types() as $type => $name) {
- $defaults['toggle_node_info_' . $type] = 1;
- }
- }
$settings = array_merge($defaults, variable_get('theme_settings', array()));
if ($key) {
@@ -2010,7 +2005,7 @@ function template_preprocess_node(&$vari
$variables = array_merge((array)$node, $variables);
// Display info only on certain node types.
- if (theme_get_setting('toggle_node_info_' . $node->type)) {
+ if (variable_get('node_submitted_' . $node->type, TRUE)) {
$variables['submitted'] = theme('node_submitted', $node);
$variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '';
}
Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.61
diff -u -p -r1.61 content_types.inc
--- modules/node/content_types.inc 20 Dec 2008 18:24:38 -0000 1.61
+++ modules/node/content_types.inc 6 Jan 2009 21:57:07 -0000
@@ -159,7 +159,18 @@ function node_type_form(&$form_state, $t
),
'#description' => t('Users with the administer nodes permission will be able to override these options.'),
);
-
+ $form['display'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Display settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['display']['node_submitted'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display post information'),
+ '#default_value' => variable_get('node_submitted_'. $type->type, TRUE),
+ '#description' => t('Enable or disable the submitted by Username on date text.'),
+ );
$form['old_type'] = array(
'#type' => 'value',
'#value' => $type->type,
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.112
diff -u -p -r1.112 system.admin.inc
--- modules/system/system.admin.inc 6 Jan 2009 13:33:06 -0000 1.112
+++ modules/system/system.admin.inc 6 Jan 2009 21:57:08 -0000
@@ -399,30 +399,7 @@ function system_theme_settings(&$form_st
}
}
- // System wide only settings.
- if (!$key) {
- // Create neat 2-column layout for the toggles
- $form['theme_settings'] += array(
- '#prefix' => '
',
- '#suffix' => '
',
- );
-
- // 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 submitted by Username on date text when displaying posts of the following type.'),
- '#prefix' => '',
- '#suffix' => '
',
- );
- 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_st
'#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_st
$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',
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.295
diff -u -p -r1.295 system.install
--- modules/system/system.install 30 Dec 2008 16:43:19 -0000 1.295
+++ modules/system/system.install 6 Jan 2009 21:57:09 -0000
@@ -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.
*/
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.656
diff -u -p -r1.656 system.module
--- modules/system/system.module 5 Jan 2009 02:52:43 -0000 1.656
+++ modules/system/system.module 6 Jan 2009 21:57:10 -0000
@@ -1354,25 +1354,6 @@ function _system_sort_requirements($a, $
}
/**
- * 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
Index: profiles/default/default.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v
retrieving revision 1.32
diff -u -p -r1.32 default.profile
--- profiles/default/default.profile 5 Dec 2008 12:50:28 -0000 1.32
+++ profiles/default/default.profile 6 Jan 2009 21:57:10 -0000
@@ -125,9 +125,7 @@ function default_profile_tasks(&$task, $
variable_set('comment_page', COMMENT_NODE_DISABLED);
// Don't display date and author information for page nodes by default.
- $theme_settings = variable_get('theme_settings', array());
- $theme_settings['toggle_node_info_page'] = FALSE;
- variable_set('theme_settings', $theme_settings);
+ variable_set('node_submitted_page', FALSE);
// Create a default vocabulary named "Tags", enabled for the 'article' content type.
$description = st('Use tags to group articles on similar topics into categories.');
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.86
diff -u -p -r1.86 chameleon.theme
--- themes/chameleon/chameleon.theme 31 Dec 2008 12:02:23 -0000 1.86
+++ themes/chameleon/chameleon.theme 6 Jan 2009 21:57:11 -0000
@@ -134,7 +134,7 @@ function chameleon_node($node, $teaser =
$output .= " \n";
$submitted = '';
- if (theme_get_setting("toggle_node_info_$node->type")) {
+ if (variable_get('node_submitted_' . $node->type, TRUE)) {
$submitted = t("By !author at @date", array('!author' => theme('username', $node), '@date' => format_date($node->created, 'small')));
}