Commit d7a7ec64 authored by Dries's avatar Dries
Browse files

- Patch #678590 by asimmonds, Dave Reid, Damien Tournoud: fixed path alias...

- Patch #678590 by asimmonds, Dave Reid, Damien Tournoud: fixed path alias link being below submit button on taxonomy term add.
parent f0006574
......@@ -241,12 +241,12 @@ function path_form_taxonomy_form_term_alter(&$form, $form_state) {
'alias' => '',
'language' => LANGUAGE_NONE,
);
$form['identification']['path'] = array(
$form['path'] = array(
'#access' => user_access('create url aliases') || user_access('administer url aliases'),
'#tree' => TRUE,
'#element_validate' => array('path_form_element_validate'),
);
$form['identification']['path']['alias'] = array(
$form['path']['alias'] = array(
'#type' => 'textfield',
'#title' => t('URL alias'),
'#default_value' => $path['alias'],
......@@ -254,9 +254,9 @@ function path_form_taxonomy_form_term_alter(&$form, $form_state) {
'#weight' => 0,
'#description' => t("Optionally specify an alternative URL by which this term can be accessed. Use a relative path and don't add a trailing slash or the URL alias won't work."),
);
$form['identification']['path']['pid'] = array('#type' => 'value', '#value' => $path['pid']);
$form['identification']['path']['source'] = array('#type' => 'value', '#value' => $path['source']);
$form['identification']['path']['language'] = array('#type' => 'value', '#value' => $path['language']);
$form['path']['pid'] = array('#type' => 'value', '#value' => $path['pid']);
$form['path']['source'] = array('#type' => 'value', '#value' => $path['source']);
$form['path']['language'] = array('#type' => 'value', '#value' => $path['language']);
}
}
......@@ -305,4 +305,3 @@ function path_taxonomy_term_delete($term) {
// Delete all aliases associated with this term.
path_delete(array('source' => 'taxonomy/term/' . $term->tid));
}
......@@ -664,6 +664,7 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
'#title' => t('Relations'),
'#collapsible' => TRUE,
'#collapsed' => $vocabulary->hierarchy < 2,
'#weight' => 10,
);
// taxonomy_get_tree and taxonomy_get_parents may contain large numbers of
......@@ -702,23 +703,35 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
'#size' => 6,
'#default_value' => $edit['weight'],
'#description' => t('Terms are displayed in ascending order by weight.'),
'#required' => TRUE);
'#required' => TRUE,
);
$form['vid'] = array(
'#type' => 'value',
'#value' => $vocabulary->vid);
$form['submit'] = array(
'#value' => $vocabulary->vid,
);
$form['tid'] = array(
'#type' => 'value',
'#value' => $edit['tid'],
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
'#weight' => 100,
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'));
'#value' => t('Save'),
'#weight' => 5,
);
if ($edit['tid']) {
$form['delete'] = array(
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
'#access' => user_access("delete terms in $vocabulary->vid") || user_access('administer taxonomy'),
'#weight' => 10,
);
$form['tid'] = array(
'#type' => 'value',
'#value' => $edit['tid']);
}
else {
$form_state['redirect'] = $_GET['q'];
......
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