On this page
function path_get_admin_paths
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
File
- includes/path.inc, line 518
- Functions to handle paths in Drupal, including path aliasing.
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;
}
© 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/includes!path.inc/function/path_get_admin_paths/7.x