You are here

function system_admin_by_module in Drupal 6

Same name and namespace in other branches
  1. 5 modules/system/system.module \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.admin.inc, line 99
Admin page callbacks for the system module.

Code

function system_admin_by_module() {
  $modules = module_rebuild_cache();
  $menu_items = array();
  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
  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 ($help_arg && module_invoke($module, 'help', "admin/help#{$module}", $help_arg)) {
        $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);
}