menu_edit_item_validate

Versions
4.6
menu_edit_item_validate($edit)
6 – 7
menu_edit_item_validate($form, &$form_state)

Confirm that an edited menu item has fields properly filled in.

▾ 2 functions call menu_edit_item_validate()

menu_add_menu in modules/menu.module
Menu callback; handle the adding of a new menu.
menu_edit_item in modules/menu.module
Menu callback; dispatch to the appropriate menu item edit function.

Code

modules/menu.module, line 335

<?php
function menu_edit_item_validate($edit) {
  if (empty($edit['title'])) {
    form_set_error('title', t('You must specify a title.'));
  }

  if ($edit['pid'] != 0) {
    if (empty($edit['path'])) {
      form_set_error('path', t('You must specify a path.'));
    }
  }
}
?>
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.