? .DS_Store ? make_node_optional_14.patch ? node_decouple_locale_00.patch ? node_decouple_locale_01.patch ? node_decouple_locale_02.patch ? modules/.DS_Store Index: modules/locale/locale.install =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v retrieving revision 1.46 diff -u -p -r1.46 locale.install --- modules/locale/locale.install 14 Jul 2009 10:22:17 -0000 1.46 +++ modules/locale/locale.install 5 Aug 2009 09:58:13 -0000 @@ -74,10 +74,6 @@ function locale_uninstall() { variable_del('locale_cache_strings'); variable_del('locale_js_directory'); - foreach (node_type_get_types() as $type => $content_type) { - $setting = variable_del('language_content_type_' . $type); - } - // Switch back to English: with a $language->language value different from 'en' // successive calls of t() might result in calling locale(), which in turn might // try to query the unexisting {locales_source} and {locales_target} tables. Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.246 diff -u -p -r1.246 locale.module --- modules/locale/locale.module 2 Aug 2009 15:44:08 -0000 1.246 +++ modules/locale/locale.module 5 Aug 2009 09:58:14 -0000 @@ -277,45 +277,6 @@ function locale_form_path_admin_form_alt } /** - * Implement hook_form_FORM_ID_alter(). - */ -function locale_form_node_type_form_alter(&$form, &$form_state) { - if (isset($form['identity']['type'])) { - $form['workflow']['language_content_type'] = array( - '#type' => 'radios', - '#title' => t('Multilingual support'), - '#default_value' => variable_get('language_content_type_' . $form['#node_type']->type, 0), - '#options' => array(t('Disabled'), t('Enabled')), - '#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/international/language'))), - ); - } -} - -/** - * Implement hook_form_alter(). Adds language fields to forms. - */ -function locale_form_alter(&$form, &$form_state, $form_id) { - if (isset($form['#id']) && $form['#id'] == 'node-form') { - if (isset($form['#node']->type) && variable_get('language_content_type_' . $form['#node']->type, 0)) { - $form['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#default_value' => (isset($form['#node']->language) ? $form['#node']->language : ''), - '#options' => array('' => t('Language neutral')) + locale_language_list('name'), - ); - } - // Node type without language selector: assign the default for new nodes - elseif (!isset($form['#node']->nid)) { - $default = language_default(); - $form['language'] = array( - '#type' => 'value', - '#value' => $default->language - ); - } - } -} - -/** * Implement hook_theme(). */ function locale_theme() { Index: modules/locale/locale.test =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v retrieving revision 1.33 diff -u -p -r1.33 locale.test --- modules/locale/locale.test 3 Aug 2009 03:04:33 -0000 1.33 +++ modules/locale/locale.test 5 Aug 2009 09:58:15 -0000 @@ -1216,7 +1216,7 @@ class LocalePathFunctionalTest extends D } function setUp() { - parent::setUp('locale', 'path'); + parent::setUp('node', 'locale', 'path'); } /** @@ -1299,7 +1299,7 @@ class LocaleContentFunctionalTest extend } function setUp() { - parent::setUp('locale'); + parent::setUp('node', 'locale'); } /** Index: modules/node/content_types.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v retrieving revision 1.84 diff -u -p -r1.84 content_types.inc --- modules/node/content_types.inc 29 Jul 2009 06:39:34 -0000 1.84 +++ modules/node/content_types.inc 5 Aug 2009 09:58:15 -0000 @@ -169,6 +169,14 @@ function node_type_form(&$form_state, $t ), '#description' => t('Users with the administer nodes permission will be able to override these options.'), ); + if (module_exists('locale')) { + $form['workflow']['node_type_language'] = array( + '#type' => 'checkbox', + '#title' => t('Multilingual support'), + '#default_value' => variable_get('node_type_language_' . $form['#node_type']->type, 0), + '#description' => t('Add a language selection field to the editing form, allowing you to select from one of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/international/language'))), + ); + } $form['display'] = array( '#type' => 'fieldset', '#title' => t('Display settings'), Index: modules/node/node.install =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.install,v retrieving revision 1.25 diff -u -p -r1.25 node.install --- modules/node/node.install 27 Jul 2009 19:26:31 -0000 1.25 +++ modules/node/node.install 5 Aug 2009 09:58:16 -0000 @@ -335,6 +335,20 @@ function node_schema() { } /** + * Implementation of hook_uninstall(). + */ +function node_uninstall() { + global $conf; + + $variables = db_query("SELECT name FROM {variable} WHERE name LIKE 'node_%'")->fetchCol(); + foreach ($variables as $variable) { + unset($conf[$variable]); + } + db_query("DELETE FROM {variable} WHERE name LIKE 'node_%'"); + cache_clear_all('variables', 'cache'); +} + +/** * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x * @{ */ Index: modules/node/node.js =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.js,v retrieving revision 1.4 diff -u -p -r1.4 node.js --- modules/node/node.js 27 Apr 2009 20:19:37 -0000 1.4 +++ modules/node/node.js 5 Aug 2009 09:58:16 -0000 @@ -29,6 +29,11 @@ Drupal.behaviors.nodeFieldsetSummaries = } return vals.join(', '); }); + + $('fieldset#edit-language-information', context).setSummary(function (context) { + var element = $('#edit-language-1'); + return element.find('option[value=' + element.val() + ']').text(); + }); } }; Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.73 diff -u -p -r1.73 node.pages.inc --- modules/node/node.pages.inc 4 Aug 2009 06:44:48 -0000 1.73 +++ modules/node/node.pages.inc 5 Aug 2009 09:58:16 -0000 @@ -161,6 +161,30 @@ function node_form(&$form_state, $node) '#type' => 'vertical_tabs', ); + if (TRUE || variable_get('node_type_language_' . $node->type, 0)) { + $form['language_information'] = array( + '#type' => 'fieldset', + '#title' => t('Language'), + '#collapsible' => TRUE, + '#collapsed' => isset($node->language), + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'), + ); + $form['language_information']['language'] = array( + '#type' => 'select', + '#title' => t('Language'), + '#default_value' => (isset($node->language) ? $node->language : ''), + '#options' => array('' => t('Language neutral')) + locale_language_list('name'), + ); + } + // Node type without language selector: assign the default for new nodes + elseif (!isset($form['#node']->nid)) { + $form['language'] = array( + '#type' => 'value', + '#value' => language_default()->language, + ); + } + // Add a log field if the "Create new revision" option is checked, or if the // current user has the ability to check that option. if (!empty($node->revision) || user_access('administer nodes')) {