You are here

function path_get_admin_paths in Redis 7.2

Same name and namespace in other branches
  1. 7.3 redis.path.inc \path_get_admin_paths()

Gets a list of administrative and non-administrative paths.

Return value

array An associative array containing the following keys: 'admin': An array of administrative paths and regular expressions in a format suitable for drupal_match_path(). 'non_admin': An array of non-administrative paths and regular expressions.

See also

hook_admin_paths()

hook_admin_paths_alter()

1 call to path_get_admin_paths()
path_is_admin in ./redis.path.inc
Determines whether a path is in the administrative section of the site.

File

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

Code

function path_get_admin_paths() {
  $patterns =& drupal_static(__FUNCTION__);
  if (!isset($patterns)) {
    $paths = module_invoke_all('admin_paths');
    drupal_alter('admin_paths', $paths);

    // Combine all admin paths into one array, and likewise for non-admin paths,
    // for easier handling.
    $patterns = array();
    $patterns['admin'] = array();
    $patterns['non_admin'] = array();
    foreach ($paths as $path => $enabled) {
      if ($enabled) {
        $patterns['admin'][] = $path;
      }
      else {
        $patterns['non_admin'][] = $path;
      }
    }
    $patterns['admin'] = implode("\n", $patterns['admin']);
    $patterns['non_admin'] = implode("\n", $patterns['non_admin']);
  }
  return $patterns;
}