drupal/modules/admin.module

126 lines
3.4 KiB
Plaintext
Raw Normal View History

2003-01-06 19:51:01 +00:00
<?php
// $Id$
include_once "includes/common.inc";
function status($message) {
if ($message) {
return "<b>Status:</b> $message<hr />\n";
}
}
function admin_help($section) {
$output = "";
switch ($section) {
case 'admin/system/modules':
$output .= "Handles the administration pages.";
break;
case 'admin':
$output .= "Welcome to the administration section. Below are the most recent system events. To get started please choose an item in the left column. If there is an arrow it will expand into a submenu. To jump up a level use the link,bread crumbs, above this block of text. To return to the home page click on the site name, and to go to Drupal's home page click on Druplicon, the drop on to the right.";
break;
case 'admin':
$output = "This is a complete overview of the site administration page.";
break;
}
return t($output);
}
function admin_system($field){
$output = "";
if ($field == "description") { $output = admin_help("admin/system/modules"); }
return $output;
}
function admin_link($type) {
if ($type == "admin") {
menu("admin", "Administration", NULL, admin_help("admin"));
menu("admin/overview", "sitemap", "overview_callback", admin_help("admin/overview"), 8);
}
}
function overview_callback() {
return menu_map("admin");
}
function admin_admin() {
print menu_map();
}
function admin_page() {
global $base_url;
2003-01-06 19:51:01 +00:00
if (user_access("access administration pages")) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo t("%sitename administration pages", array("%sitename" => variable_get("site_name", "drupal"))); ?></title>
- Bugfix: made request_uri() rewrite ( and ) with their entity equivalents to avoid XSS attacks! Patch by Al, Moshe, Marco, Kjartan and me. - Bugfix: the admin module does now import drupal.css prior to admin.css. Patch by me. - Bugfix: the admin module was still emitting a <base href=""> tag. I removed this as it is been taken care of by theme_head(); Patch by me. - Bugfix: made the tracker module's pager only consider published pages. Patch by Moshe. - Bugfix: cured some typos in the comment module's help function. Patch by Marco. - Bugfix: fixed a typo in the pager_display() that caused optional attributes to be discarded. - Bugfix: made the Xtemplate emit empty boxes like any other theme does. Patch by Al. - Bugfix: fixed broken link on the statistics module's log page. Reported by Kjartan. - CSS improvements: made the HTML output emitted by the tracker module look nicer. Patch by Moshe and Al. - CSS improvements: added CSS classes for form elements. Patch by Al. - CSS improvements: added a vertical gap between the last form item and the submit button. Patch by Al. Note that Opera 6 is not picking up this CSS but apparently others browsers such as Konqueror do. - Xtemplate improvements: changed the color of the selected day in the archive module's calendar. Patch by Al. - Usability improvements: made the "birthday" field of the profile module look nicer. Patch by Al. ------ - TODO: it might be a good idea to emit the following meta tag in the theme_head() function: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Currently, some themes (and modules!) emit this while others don't. This would also make it possible to change the charset site-wide. - TODO: now we added support for td.dark and td.light to drupal.css, maybe it can be removed from admin.css as well as xtemplate.css?
2003-06-03 18:04:47 +00:00
<?php print theme_head(); ?>
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
2003-01-06 19:51:01 +00:00
<link rel="stylesheet" type="text/css" media="print" href="misc/print.css" />
<style type="text/css" title="layout" media="Screen">
@import url("misc/admin.css");
</style>
</head>
2003-04-21 13:56:09 +00:00
<body<?php print theme_onload_attribute(); ?>>
2003-01-06 19:51:01 +00:00
<?php
// NOTE: we include a dummy "print.css" to remove the "flash of unstyled content" (FUOC) problems in IE.
menu_build("admin");
2003-01-06 19:51:01 +00:00
/*
** Body:
*/
print "<div id=\"logo\"><a href=\"http://drupal.org/\"><img src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" title=\"Druplicon - Drupal logo\" /></a></div>";
2003-01-06 19:51:01 +00:00
print "<div id=\"main\">";
if ($path = menu_path()) {
print "<h2>$path</h2>";
2003-01-06 19:51:01 +00:00
}
if ($help = menu_help()) {
print "<small>$help</small>";
2003-01-06 19:51:01 +00:00
}
print "<hr />";
2003-01-06 19:51:01 +00:00
if (arg(1)) {
//print module_invoke(arg(1), "admin");
print menu_execute_action();
2003-01-06 19:51:01 +00:00
}
else {
print "<h2>". t("System messages") ."</h2>";
2003-01-06 19:51:01 +00:00
print watchdog_overview("actions");
}
print "</div>";
/*
** Menu:
** We rebuild the admin menu once more because one might have
** enabled/disabled themes or modules, changed permissions, etc.
*/
menu_build("admin");
print "<div id=\"menu\">";
echo "<h1><a href=\"$base_url/\">". variable_get("site_name", "drupal") ."</a></h1>";
print menu_tree("admin") ;
print "</div>";
print theme_footer();
2003-01-06 19:51:01 +00:00
?>
</body>
</html>
<?php
}
else {
print message_access();
}
}
?>