Here's a patch that adds to the admin secttings page (admin/settings/localizer) a checkbox to contol whether or not a node's language can be set to 'any'. If the checkbox is not checked, the meta-language 'any' will not be shown in the language drop-down menu in the create/edit form of nodes and blocks.
I attached the patch as a txt-file and print it here for convenience.
Index: modules/localizerblock.module
===================================================================
--- modules/localizerblock.module (revision 217)
+++ modules/localizerblock.module (working copy)
@@ -6,6 +6,8 @@
$form['#submit']['localizerblock_form_submission'] = array(); // register callback
$options = localizer_available_contentlocales();
+ if (variable_get('localizer_any_support', TRUE))
+ $options = array_merge(array('-' => 'Any') , $options);
$options = array_merge(array('-' => 'Any') , $options);
global $theme;
$blid = $form['module']['#value'] . '-' . $form['delta']['#value'] . '-' . $theme;
Index: modules/localizernode.module
===================================================================
--- modules/localizernode.module (revision 217)
+++ modules/localizernode.module (working copy)
@@ -85,7 +85,8 @@
$contents_types_enabled = variable_get('localizer_contents_types', array('page'=>'page', 'story'=>'story'));
if($contents_types_enabled[$form['type']['#value']]) {
$options = localizer_available_contentlocales();
- $options = array_merge(array('-' => 'Any') , $options);
+ if (variable_get('localizer_any_support', TRUE))
+ $options = array_merge(array('-' => 'Any') , $options);
$form['localizernode_locale'] = array(
'#type' => 'select',
'#title' => t('Language'),
@@ -412,4 +413,4 @@
}
}
-?>
\ No newline at end of file
+?>
Index: localizer.module
===================================================================
--- localizer.module (revision 217)
+++ localizer.module (working copy)
@@ -334,6 +334,14 @@
'#description' => 'Enable global support for views module'
);
+ $form['anysupport']['localizer_any_support'] = array (
+ '#type' => 'checkbox',
+ '#title' => t('Support for meta-language \'any\''),
+ '#default_value' => variable_get('localizer_any_support', TRUE),
+ '#weight' => -19,
+ '#description' => 'If enabled, the language of a node can, in addition to the installed languages, also be set to \'any\'.'
+ );
+
return system_settings_form($form);
}
The patch is against modules/localizerblock.module 1.1.4.9 (DRUPAL-5--1-9), modules/localizernode.module 1.2.2.24 (DRUPAL-5--1-9), and localizer.module 1.2.2.51 (DRUPAL-5--1-9).
| Comment | File | Size | Author |
|---|---|---|---|
| patch_130.txt | 2.11 KB | hbfkf |