Expose a way to enable aliases for _All_ languages.

You can read the details of the issue here:
  http://drupal.org/node/321848

This version of the patch allows the user to select from three different
options:

 - Default language handling (each alias will be enabled for the language of
   its node),

 - aliases for nodes without language-specific patterns will be enabled for
   all languages,

 - or aliases for all nodes (including those with language-specific patterns)
   will be enabled for all languages. 

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jack Aponte (jackaponte) <jack@palantetech.com>

---
 pathauto.admin.inc |   15 +++++++++++++++
 pathauto.inc       |   10 ++++++++++
 2 files changed, 25 insertions(+)

Index: pathauto/pathauto.admin.inc
===================================================================
--- pathauto.orig/pathauto.admin.inc
+++ pathauto/pathauto.admin.inc
@@ -146,6 +146,21 @@
     '#wysiwyg' => FALSE,
   );
 
+  if (module_exists('locale')) {
+    $lang_alias_options = array(
+      'default_handling' => t('Default language handling. Each alias will be enabled for the language of its node.'),
+      'no_lang_pattern_all_langs' => t('Aliases for nodes <em>without language-specific patterns</em> will be enabled for <strong>all languages</strong>.'),
+      'all_aliases_all_langs' => t('Aliases for <em>all nodes</em>, including those with language-specific patterns, will be enabled for <strong>all languages</strong>.'));
+
+    $form['general']['pathauto_node_enable_alias_for_all_languages'] = array(
+      '#type' => 'radios',
+      '#title' => t('Language handling for aliases of localized nodes'),
+      '#default_value' => variable_get('pathauto_node_enable_alias_for_all_languages', 'default_handling'),
+      '#options' => $lang_alias_options,
+      '#description' => t('Configure how to handle aliases language.'),
+    );
+  }
+
   $form['punctuation'] = array(
     '#type' => 'fieldset',
     '#weight' => $group_weight,
Index: pathauto/pathauto.inc
===================================================================
--- pathauto.orig/pathauto.inc
+++ pathauto/pathauto.inc
@@ -283,6 +283,16 @@
     }
   }
 
+  if ($module == 'node') {
+    $alias_for_all_languages = variable_get('pathauto_node_enable_alias_for_all_languages', 'default_handling');
+    $lang_pattern = trim(variable_get('pathauto_'. $module .'_'. $type .'_'. $language .'_pattern', ''));
+
+    if ((empty($lang_pattern) && $alias_for_all_languages == 'no_lang_pattern_all_langs') ||
+        $alias_for_all_languages == 'all_aliases_all_langs') {
+      $language = '';
+    }
+  }
+
   // Special handling when updating an item which is already aliased.
   $pid = NULL;
   $old_alias = NULL;
