From d14bc428c695e9d8e6a17c9e7cb7f985b733992e Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Fri, 14 Jan 2005 15:21:39 +0000
Subject: [PATCH] - Patch #15570 by Drumm: integrated the admin and system
 module.  Renamed the callback as per Goba's suggestion.

---
 modules/admin.module         | 42 ------------------------------------
 modules/system.module        | 16 +++++++++++++-
 modules/system/system.module | 16 +++++++++++++-
 3 files changed, 30 insertions(+), 44 deletions(-)
 delete mode 100644 modules/admin.module

diff --git a/modules/admin.module b/modules/admin.module
deleted file mode 100644
index 53804388df5f..000000000000
--- a/modules/admin.module
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Handles the administration pages.
- */
-
-/**
- * Implementation of hook_help().
- */
-function admin_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Handles the administration pages.');
-    case 'admin':
-      return t('<p>Welcome to the administration section. Below are the most recent system events.</p>');
-  }
-}
-
-/**
- * Implementation of hook_menu().
- */
-function admin_menu($may_cache) {
-  $items = array();
-  if ($may_cache) {
-    $items[] = array('path' => 'admin', 'title' => t('administer'),
-      'access' => user_access('access administration pages'),
-      'callback' => 'admin_main_page',
-      'weight' => 9);
-  }
-  return $items;
-}
-
-/**
- * Menu callback; provides the main page of the administration section.
- */
-function admin_main_page() {
-  watchdog_overview('actions');
-}
-
-?>
diff --git a/modules/system.module b/modules/system.module
index c2a7ac769062..d622ccc3f27e 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -13,6 +13,8 @@ function system_help($section) {
   global $base_url;
 
   switch ($section) {
+    case 'admin':
+      return t('<p>Welcome to the administration section. Below are the most recent system events.</p>');
     case 'admin/settings':
       return t('General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.');
     case 'admin/themes':
@@ -69,6 +71,11 @@ function system_menu($may_cache) {
 
     $access = user_access('administer site configuration');
 
+    $items[] = array('path' => 'admin', 'title' => t('administer'),
+      'access' => user_access('access administration pages'),
+      'callback' => 'system_admin_page',
+      'weight' => 9);
+
     // Themes:
     $items[] = array('path' => 'admin/themes', 'title' => t('themes'),
       'callback' => 'system_themes', 'access' => $access);
@@ -114,6 +121,13 @@ function system_menu($may_cache) {
 function system_test() {
 }
 
+/**
+ * Menu callback; provides the main page of the administration section.
+ */
+function system_admin_page() {
+  watchdog_overview('actions');
+}
+
 /**
  * Implementation of hook_user().
  *
@@ -439,7 +453,7 @@ function system_module_listing() {
 
   ksort($files);
 
-  $required = array('admin', 'block', 'filter', 'system', 'user', 'watchdog');
+  $required = array('block', 'filter', 'system', 'user', 'watchdog');
   $throttle_required = array_merge($required, array('throttle'));
 
   $header = array(t('Name'), t('Description'), t('Enabled'));
diff --git a/modules/system/system.module b/modules/system/system.module
index c2a7ac769062..d622ccc3f27e 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -13,6 +13,8 @@ function system_help($section) {
   global $base_url;
 
   switch ($section) {
+    case 'admin':
+      return t('<p>Welcome to the administration section. Below are the most recent system events.</p>');
     case 'admin/settings':
       return t('General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.');
     case 'admin/themes':
@@ -69,6 +71,11 @@ function system_menu($may_cache) {
 
     $access = user_access('administer site configuration');
 
+    $items[] = array('path' => 'admin', 'title' => t('administer'),
+      'access' => user_access('access administration pages'),
+      'callback' => 'system_admin_page',
+      'weight' => 9);
+
     // Themes:
     $items[] = array('path' => 'admin/themes', 'title' => t('themes'),
       'callback' => 'system_themes', 'access' => $access);
@@ -114,6 +121,13 @@ function system_menu($may_cache) {
 function system_test() {
 }
 
+/**
+ * Menu callback; provides the main page of the administration section.
+ */
+function system_admin_page() {
+  watchdog_overview('actions');
+}
+
 /**
  * Implementation of hook_user().
  *
@@ -439,7 +453,7 @@ function system_module_listing() {
 
   ksort($files);
 
-  $required = array('admin', 'block', 'filter', 'system', 'user', 'watchdog');
+  $required = array('block', 'filter', 'system', 'user', 'watchdog');
   $throttle_required = array_merge($required, array('throttle'));
 
   $header = array(t('Name'), t('Description'), t('Enabled'));
-- 
GitLab