You are here

function system_main_admin_page in Drupal 5

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

Provide the administration overview page.

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

File

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

Code

function system_main_admin_page($arg = NULL) {

  // If we received an argument, they probably meant some other page.
  // Let's 404 them since the menu system cannot be told we do not
  // accept arguments.
  if (isset($arg) && substr($arg, 0, 3) != 'by-') {
    return drupal_not_found();
  }

  // Check for status report errors.
  if (system_status(TRUE)) {
    drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the <a href="@status">status report</a> for more information.', array(
      '@status' => url('admin/logs/status'),
    )), 'error');
  }
  $menu = menu_get_item(NULL, 'admin');
  usort($menu['children'], '_menu_sort');
  foreach ($menu['children'] as $mid) {
    $block = menu_get_item($mid);
    if ($block['block callback'] && function_exists($block['block callback'])) {
      $arguments = isset($block['block arguments']) ? $block['block arguments'] : array();
      $block['content'] .= call_user_func_array($block['block callback'], $arguments);
    }
    $block['content'] .= theme('admin_block_content', system_admin_menu_block($block));
    $blocks[] = $block;
  }
  return theme('admin_page', $blocks);
}