system_admin_by_module

Versions
5 – 7
system_admin_by_module()

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

Code

modules/system/system.admin.inc, line 146

<?php
function system_admin_by_module() {

  $module_info = system_get_info('module');
  $menu_items = array();
  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;

  foreach ($module_info as $module => $info) {
    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[$info['name']] = array($info['description'], $admin_tasks);
    }
  }
  return theme('system_admin_by_module', array('menu_items' => $menu_items));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.