You are here

function system_admin_by_module in Drupal 5

Same name and namespace in other branches
  1. 6 modules/system/system.admin.inc \system_admin_by_module()

Menu callback; prints a listing of admin tasks for each installed module.

1 string reference to 'system_admin_by_module'
system_menu in modules/system/system.module
Implementation of hook_menu().

File

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

Code

function system_admin_by_module() {
  $modules = module_rebuild_cache();
  $menu_items = array();
  foreach ($modules as $file) {
    $module = $file->name;
    if ($module == 'help') {
      continue;
    }
    $admin_tasks = system_get_module_admin_tasks($module);

    // Only display a section if there are any available tasks.
    if (count($admin_tasks)) {

      // Check for help links.
      if (module_invoke($module, 'help', "admin/help#{$module}")) {
        $admin_tasks[100] = l(t('Get help'), "admin/help/{$module}");
      }

      // Sort.
      ksort($admin_tasks);
      $menu_items[$file->info['name']] = array(
        $file->info['description'],
        $admin_tasks,
      );
    }
  }
  return theme('system_admin_by_module', $menu_items);
}