system_get_module_admin_tasks
modules/system/system.module, строка 2320
- Версии
- 5 – 6
system_get_module_admin_tasks($module)
Код
<?php
function system_get_module_admin_tasks($module) {
$admin_access = user_access('administer access control');
$menu = menu_get_menu();
$admin_tasks = array();
// Check for permissions.
if (module_hook($module, 'perm') && $admin_access) {
$admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/access', NULL, NULL, 'module-'. $module);
}
// Check for menu items that are admin links.
if ($items = module_invoke($module, 'menu', TRUE)) {
foreach ($items as $item) {
$parts = explode('/', $item['path']);
$n = count($parts);
if ((!isset($item['type']) || ($item['type'] & MENU_VISIBLE_IN_TREE)) && ($parts[0] == 'admin') && ($n >= 3) && _menu_item_is_accessible($menu['path index'][$item['path']])) {
$admin_tasks[$item['title']] = l($item['title'], $item['path']);
}
}
}
return $admin_tasks;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии