Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.431
diff -u -p -r1.431 theme.inc
--- includes/theme.inc 2 Aug 2008 19:01:02 -0000 1.431
+++ includes/theme.inc 8 Aug 2008 12:27:19 -0000
@@ -876,11 +876,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) {
@@ -1954,7 +1949,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.57
diff -u -p -r1.57 content_types.inc
--- modules/node/content_types.inc 16 Jul 2008 21:59:27 -0000 1.57
+++ modules/node/content_types.inc 8 Aug 2008 12:27:19 -0000
@@ -161,7 +161,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.83
diff -u -p -r1.83 system.admin.inc
--- modules/system/system.admin.inc 2 Aug 2008 19:01:02 -0000 1.83
+++ modules/system/system.admin.inc 8 Aug 2008 12:27:20 -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.258
diff -u -p -r1.258 system.install
--- modules/system/system.install 2 Aug 2008 19:01:02 -0000 1.258
+++ modules/system/system.install 8 Aug 2008 12:27:21 -0000
@@ -3042,6 +3042,35 @@ function system_update_7009() {
}
/**
+ * Change the theme setting 'toggle_node_info' into a per node variable
+ */
+function system_update_7010() {
+ $ret = array();
+ $types = node_get_types();
+ if (count($types)) {
+ foreach ($types as $type) {
+ $node_info = theme_get_setting('toggle_node_info_' . $type);
+ if ($node_info !== NULL) {
+ variable_set('node_submitted_' . $type, $node_info);
+ $ret[] = array('success' => TRUE, 'query' => "variable_set('node_submitted_' . $type)");
+ }
+ }
+ }
+
+ // Unset deprecated 'toggle_node_info' theme settings.
+ $theme_setings = 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.612
diff -u -p -r1.612 system.module
--- modules/system/system.module 2 Aug 2008 19:01:02 -0000 1.612
+++ modules/system/system.module 8 Aug 2008 12:27:23 -0000
@@ -1241,25 +1241,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.26
diff -u -p -r1.26 default.profile
--- profiles/default/default.profile 24 Jun 2008 21:26:48 -0000 1.26
+++ profiles/default/default.profile 8 Aug 2008 12:27:23 -0000
@@ -129,9 +129,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.78
diff -u -p -r1.78 chameleon.theme
--- themes/chameleon/chameleon.theme 25 Jun 2008 09:12:25 -0000 1.78
+++ themes/chameleon/chameleon.theme 8 Aug 2008 12:27:23 -0000
@@ -131,7 +131,7 @@ function chameleon_node($node, $teaser =
$output .= " \n";
- $submitted['node_submitted'] = theme_get_setting("toggle_node_info_$node->type") ? array(
+ $submitted['node_submitted'] = variable_get('node_submitted_' . $node->type, TRUE) ? array(
'title' => t("By !author at @date", array('!author' => theme('username', $node), '@date' => format_date($node->created, 'small'))),
'html' => TRUE) : array();