You are here

function _pathauto_path_is_callback in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto.inc \_pathauto_path_is_callback()
  2. 5 pathauto.module \_pathauto_path_is_callback()
  3. 6.2 pathauto.inc \_pathauto_path_is_callback()
  4. 7 pathauto.inc \_pathauto_path_is_callback()

Verify if the given path is a valid menu callback.

Taken from menu_execute_active_handler().

Parameters

$path: A string containing a relative path.

Return value

TRUE if the path already exists.

1 call to _pathauto_path_is_callback()
_pathauto_set_alias in ./pathauto.inc
Private function for Pathauto to create an alias.

File

./pathauto.inc, line 415
Miscellaneous functions for Pathauto.

Code

function _pathauto_path_is_callback($path) {
  $menu = menu_get_item($path);
  if (isset($menu['path']) && $menu['path'] == $path) {
    return TRUE;
  }
  elseif (is_file('./' . $path) || is_dir('./' . $path)) {

    // Do not allow existing files or directories to get assigned an automatic
    // alias. Note that we do not need to use is_link() to check for symbolic
    // links since this returns TRUE for either is_file() or is_dir() already.
    return TRUE;
  }
  return FALSE;
}