path_form

Versions
4.6 – 5
path_form($edit = '')

Return a form for editing or creating an individual URL alias.

▾ 2 functions call path_form()

path_admin_edit in modules/path.module
Menu callback; handles pages for creating and editing URL aliases.
path_save in modules/path.module
Verify that a new URL alias is valid, and save it to the database.

Code

modules/path.module, line 174

<?php
function path_form($edit = '') {

  $form .= form_textfield(t('Existing system path'), 'src', $edit['src'], 50, 64, t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'));
  $form .= form_textfield(t('New path alias'), 'dst', $edit['dst'], 50, 64, 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 .= form_hidden('pid', $edit['pid']);
    $form .= form_submit(t('Update alias'));
  }
  else {
    $form .= form_submit(t('Create new alias'));
  }

  return form($form);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.