You are here

function path_is_admin in Redis 7.3

Same name and namespace in other branches
  1. 7.2 redis.path.inc \path_is_admin()

Determines whether a path is in the administrative section of the site.

By default, paths are considered to be non-administrative. If a path does not match any of the patterns in path_get_admin_paths(), or if it matches both administrative and non-administrative patterns, it is considered non-administrative.

Parameters

$path: A Drupal path.

Return value

TRUE if the path is administrative, FALSE otherwise.

See also

path_get_admin_paths()

hook_admin_paths()

hook_admin_paths_alter()

1 call to path_is_admin()
drupal_lookup_path in ./redis.path.inc
Given an alias, return its Drupal system URL if one exists. Given a Drupal system URL return one of its aliases if such a one exists. Otherwise, return FALSE.

File

./redis.path.inc, line 502
Drupal default includes/path.inc file copy which only differs in:

Code

function path_is_admin($path) {
  $path_map =& drupal_static(__FUNCTION__);
  if (!isset($path_map['admin'][$path])) {
    $patterns = path_get_admin_paths();
    $path_map['admin'][$path] = drupal_match_path($path, $patterns['admin']);
    $path_map['non_admin'][$path] = drupal_match_path($path, $patterns['non_admin']);
  }
  return $path_map['admin'][$path] && !$path_map['non_admin'][$path];
}