Same name and namespace in other branches
  1. 6.x modules/system/system.module \system_get_module_admin_tasks()
  2. 7.x modules/system/system.module \system_get_module_admin_tasks()
  3. 8.9.x core/modules/system/system.module \system_get_module_admin_tasks()
  4. 9 core/modules/system/system.module \system_get_module_admin_tasks()
2 calls to system_get_module_admin_tasks()
help_page in modules/help/help.module
Menu callback; prints a page listing general help for all modules.
system_admin_by_module in modules/system/system.module
Menu callback; prints a listing of admin tasks for each installed module.

File

modules/system/system.module, line 2320
Configuration system that lets administrators modify the workings of the site.

Code

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;
}