You are here

function pathauto_menu_get_mid in Pathauto 5

Check if mid/path is present in the menu.

Parameters

$in: Numeric input is treated a menu-id, strings as src-paths.

Return value

An existing mid, or 0 if none found.

1 call to pathauto_menu_get_mid()
pathauto_menu_get_placeholders in ./pathauto_menu.inc
Generate the menu placeholders.

File

./pathauto_menu.inc, line 76
This is pathauto_menu.inc, an submodule for pathauto.module

Code

function pathauto_menu_get_mid($in) {
  global $_menu;
  if (!is_numeric($in)) {
    if (isset($_menu['path index'][$in])) {
      $mid = $_menu['path index'][$in];
    }
    else {
      $mid = 0;
    }
  }
  else {
    if (!isset($_menu['visible'][$in])) {
      $mid = 0;
    }
  }

  // temporary paths would break much of this module
  if ($mid < 0) {
    $mid = 0;
  }
  return $mid;
}