shortcut_valid_link

function shortcut_valid_link

shortcut_valid_link($path)

Determines if a path corresponds to a valid shortcut link.

Parameters

$path: The path to the link.

Return value

TRUE if the shortcut link is valid, FALSE otherwise. Valid links are ones that correspond to actual paths on the site.

See also

menu_edit_item_validate()

File

modules/shortcut/shortcut.module, line 614
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_valid_link($path) {
  // Do not use URL aliases.
  $normal_path = drupal_get_normal_path($path);
  if ($path != $normal_path) {
    $path = $normal_path;
  }
  // An empty path is valid too and will be converted to <front>.
  return (!url_is_external($path) && menu_get_item($path)) || empty($path) || $path == '<front>';
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.module/function/shortcut_valid_link/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部