function path_form in Drupal 4
Same name and namespace in other branches
- 5 modules/path/path.module \path_form()
Return a form for editing or creating an individual URL alias.
1 call to path_form()
- path_admin_edit in modules/
path.module - Menu callback; handles pages for creating and editing URL aliases.
File
- modules/
path.module, line 181 - Enables users to rename URLs.
Code
function path_form($edit = '') {
$form['src'] = array(
'#type' => 'textfield',
'#title' => t('Existing system path'),
'#default_value' => $edit['src'],
'#maxlength' => 64,
'#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'),
);
$form['dst'] = array(
'#type' => 'textfield',
'#default_value' => $edit['dst'],
'#maxlength' => 64,
'#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
);
if ($edit['pid']) {
$form['pid'] = array(
'#type' => 'hidden',
'#value' => $edit['pid'],
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Update alias'),
);
}
else {
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Create new alias'),
);
}
return drupal_get_form('path_form', $form);
}