diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2008-01-03 09:59:00 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2008-01-03 09:59:00 +0000 |
commit | 18cabdb8d35215f296295d42e383a24977d2f435 (patch) | |
tree | 490cd093786a439004191591073c3e1bb7aa1edf /modules/menu/menu.module | |
parent | 03c18bb2042114d3a9a8b5396d77696cdff2a188 (diff) | |
download | brdo-18cabdb8d35215f296295d42e383a24977d2f435.tar.gz brdo-18cabdb8d35215f296295d42e383a24977d2f435.tar.bz2 |
#205843 report by asimmonds, patch by chx: menu_valid_path() was used as an API function, but was located in menu.module, move to menu.inc
Diffstat (limited to 'modules/menu/menu.module')
-rw-r--r-- | modules/menu/menu.module | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/menu/menu.module b/modules/menu/menu.module index acc30f385..c6ba63394 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -444,36 +444,3 @@ function menu_get_menus($all = TRUE) { } return $rows; } - -/** - * Validates the path of a menu link being created or edited. - * - * @return - * TRUE if it is a valid path AND the current user has access permission, - * FALSE otherwise. - */ -function menu_valid_path($form_item) { - global $menu_admin; - $item = array(); - $path = $form_item['link_path']; - // We indicate that a menu administrator is running the menu access check. - $menu_admin = TRUE; - if ($path == '<front>' || menu_path_is_external($path)) { - $item = array('access' => TRUE); - } - elseif (preg_match('/\/\%/', $path)) { - // Path is dynamic (ie 'user/%'), so check directly against menu_router table. - if ($item = db_fetch_array(db_query("SELECT * FROM {menu_router} where path = '%s' ", $path))) { - $item['link_path'] = $form_item['link_path']; - $item['link_title'] = $form_item['link_title']; - $item['external'] = FALSE; - $item['options'] = ''; - _menu_link_translate($item); - } - } - else { - $item = menu_get_item($path); - } - $menu_admin = FALSE; - return $item && $item['access']; -} |