summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.admin.inc52
-rw-r--r--modules/system/system.install2
-rw-r--r--modules/system/system.module57
3 files changed, 59 insertions, 52 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
new file mode 100644
index 000000000..41ed65edb
--- /dev/null
+++ b/modules/system/system.admin.inc
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * Provide the administration overview page.
+ */
+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');
+ }
+ $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
+ WHERE ml.href like 'admin/%' AND ml.href != 'admin/help' AND ml.depth = 2 AND ml.menu_name = 'navigation'
+ ORDER BY p1 ASC, p2 ASC, p3 ASC");
+ while ($item = db_fetch_object($result)) {
+ _menu_link_translate($item);
+ if (!$item->access) {
+ continue;
+ }
+ $block = (array)$item;
+ $block['content'] = '';
+ if ($item->block_callback && function_exists($item->block_callback)) {
+ $function = $item->block_callback;
+ $block['content'] .= $function();
+ }
+ $block['content'] .= theme('admin_block_content', system_admin_menu_block($item));
+ $blocks[] = $block;
+ }
+ return theme('admin_page', $blocks);
+}
+
+
+/**
+ * Provide a single block from the administration menu as a page.
+ * This function is often a destination for these blocks.
+ * For example, 'admin/content/types' needs to have a destination to be valid
+ * in the Drupal menu system, but too much information there might be
+ * hidden, so we supply the contents of the block.
+ */
+function system_admin_menu_block_page() {
+ $item = menu_get_item();
+ $content = system_admin_menu_block($item);
+
+ $output = theme('admin_block_content', $content);
+ return $output;
+}
diff --git a/modules/system/system.install b/modules/system/system.install
index 30d4a62d3..366ad44ea 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -371,6 +371,7 @@ function system_install() {
description TEXT,
position varchar(255) NOT NULL default '',
weight int NOT NULL default 0,
+ file mediumtext NOT NULL default '',
PRIMARY KEY (path),
KEY fit (fit),
KEY tab_parent (tab_parent)
@@ -891,6 +892,7 @@ function system_install() {
description TEXT,
position varchar(255) NOT NULL default '',
weight int NOT NULL default 0,
+ file text NOT NULL default '',
PRIMARY KEY (path)
)");
db_query("CREATE INDEX {menu_router}_fit_idx ON {menu_router} (fit)");
diff --git a/modules/system/system.module b/modules/system/system.module
index 430880b33..23d910788 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -134,6 +134,7 @@ function system_menu() {
'access arguments' => array('access administration pages'),
'page callback' => 'system_main_admin_page',
'weight' => 9,
+ 'file' => 'system.admin.inc',
);
$items['admin/compact'] = array(
'title' => 'Compact mode',
@@ -167,6 +168,7 @@ function system_menu() {
'weight' => -10,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer site configuration'),
+ 'file' => 'system.admin.inc',
);
$items['admin/settings/admin'] = array(
'title' => 'Administration theme',
@@ -309,6 +311,7 @@ function system_menu() {
'page callback' => 'system_admin_menu_block_page',
'weight' => 5,
'position' => 'left',
+ 'file' => 'system.admin.inc',
);
$items['admin/logs/status'] = array(
'title' => 'Status report',
@@ -385,41 +388,6 @@ function system_user($type, $edit, &$user, $category = NULL) {
}
/**
- * Provide the administration overview page.
- */
-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');
- }
- $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
- WHERE ml.href like 'admin/%' AND ml.href != 'admin/help' AND ml.depth = 2 AND ml.menu_name = 'navigation'
- ORDER BY p1 ASC, p2 ASC, p3 ASC");
- while ($item = db_fetch_object($result)) {
- _menu_link_translate($item);
- if (!$item->access) {
- continue;
- }
- $block = (array)$item;
- $block['content'] = '';
- if ($item->block_callback && function_exists($item->block_callback)) {
- $function = $item->block_callback;
- $block['content'] .= $function();
- }
- $block['content'] .= theme('admin_block_content', system_admin_menu_block($item));
- $blocks[] = $block;
- }
- return theme('admin_page', $blocks);
-}
-
-/**
* Provide a single block on the administration overview page.
*/
function system_admin_menu_block($item) {
@@ -439,21 +407,6 @@ function system_admin_menu_block($item) {
return $content;
}
-/**
- * Provide a single block from the administration menu as a page.
- * This function is often a destination for these blocks.
- * For example, 'admin/content/types' needs to have a destination to be valid
- * in the Drupal menu system, but too much information there might be
- * hidden, so we supply the contents of the block.
- */
-function system_admin_menu_block_page() {
- $item = menu_get_item();
- $content = system_admin_menu_block($item);
-
- $output = theme('admin_block_content', $content);
- return $output;
-}
-
function system_admin_compact_page($mode = 'off') {
global $user;
user_save($user, array('admin_compact_mode' => ($mode == 'on')));
@@ -1444,12 +1397,12 @@ function system_themes_form_submit($form_values, $form, &$form_state) {
menu_rebuild();
drupal_set_message(t('The configuration options have been saved.'));
$form_state['redirect'] = 'admin/build/themes';
-
+
// Notify locale module about new themes being enabled, so translations can
// be imported. This might start a batch, and only return to the redirect
// path after that.
module_invoke('locale', 'system_update', array_diff($new_theme_list, $old_theme_list));
-
+
return;
}