2つの機能の違いは何ですか?どちらを代わりに使用すればよいですか?
機能は本質的に逆です。
実際の唯一の違いは、user_is_anonymous()関数に$ GLOBALS ['menu_admin']の追加のチェックがあり、メニュー管理者が匿名ユーザーのみに表示されるメニューリンクを管理できるようにすることです。
drupal_valid_path() および menu_overview_form() 関数で使用されます。
function drupal_valid_path($path, $dynamic_allowed = FALSE) {
global $menu_admin;
// We indicate that a menu administrator is running the menu access check.
$menu_admin = TRUE;
if ($path == '<front>' || url_is_external($path)) {
$item = array('access' => TRUE);
}
elseif ($dynamic_allowed && preg_match('/\/\%/', $path)) {
// Path is dynamic (ie 'user/%'), so check directly against menu_router table.
if ($item = db_query("SELECT * FROM {menu_router} where path = :path", array(':path' => $path))->fetchAssoc()) {
$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'];
}