Commit 2032c280 authored by Dries's avatar Dries

- Patch #1236680 by franz, Gábor Hojtsy: move path language settings from Locale to Path module.

parent bb01b39a
......@@ -293,20 +293,6 @@ function locale_language_selector_form(&$form, &$form_state, $user) {
);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function locale_form_path_admin_form_alter(&$form, &$form_state) {
$form['language'] = array(
'#type' => 'select',
'#title' => t('Language'),
'#options' => array(LANGUAGE_NONE => t('All languages')) + locale_language_list('name'),
'#default_value' => $form['language']['#value'],
'#weight' => -10,
'#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for <em>All languages</em>.'),
);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
......
......@@ -130,11 +130,23 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
'#required' => TRUE,
);
// This will be a hidden value unless locale module is enabled.
$form['language'] = array(
'#type' => 'value',
'#value' => $path['language']
);
// A hidden value unless locale module is enabled.
if (module_exists('locale')) {
$form['language'] = array(
'#type' => 'select',
'#title' => t('Language'),
'#options' => array(LANGUAGE_NONE => t('All languages')) + locale_language_list('name'),
'#default_value' => $path['language'],
'#weight' => -10,
'#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for <em>All languages</em>.'),
);
}
else {
$form['language'] = array(
'#type' => 'value',
'#value' => $path['language']
);
}
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment