admin.module 1.75 KB
Newer Older
Dries's avatar
 
Dries committed
1 2 3 4 5 6 7 8 9 10 11
<?php
// $Id$

include_once "includes/common.inc";

function status($message) {
  if ($message) {
    return "<b>Status:</b> $message<hr />\n";
  }
}

Dries's avatar
 
Dries committed
12 13 14 15
function admin_help($section) {
  $output = "";

  switch ($section) {
Dries's avatar
 
Dries committed
16
    case "admin/system/modules#description":
Dries's avatar
 
Dries committed
17
      $output .= t("Handles the administration pages.");
Dries's avatar
 
Dries committed
18
      break;
Dries's avatar
 
Dries committed
19
    case "admin":
Dries's avatar
 
Dries committed
20
      $output .= t("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.");
Dries's avatar
 
Dries committed
21
      break;
Dries's avatar
 
Dries committed
22 23
    case "admin/overview":
      $output = t("This is a complete overview of the site administration page.");
Dries's avatar
 
Dries committed
24 25
      break;
  }
Dries's avatar
 
Dries committed
26
  return $output;
Dries's avatar
 
Dries committed
27
}
Dries's avatar
 
Dries committed
28

Dries's avatar
 
Dries committed
29
function admin_link($type) {
Dries's avatar
Dries committed
30
  if ($type == "system" && user_access("access administration pages")) {
Dries's avatar
 
Dries committed
31
    menu("admin", t("administer"), NULL, 9);
Dries's avatar
 
Dries committed
32 33 34
  }
}

Dries's avatar
 
Dries committed
35
function admin_page() {
Dries's avatar
 
Dries committed
36
  if (user_access("access administration pages")) {
Dries's avatar
 
Dries committed
37 38
    theme("header");

39
    if ($help = menu_get_active_help()) {
Dries's avatar
 
Dries committed
40 41 42
      $contents = "<small>$help</small><hr />";
    }
    if (arg(1)) {
Dries's avatar
 
Dries committed
43
      $contents .= menu_execute_active_handler();
Dries's avatar
 
Dries committed
44 45 46 47 48 49
    }
    else {
      $contents.= watchdog_overview("actions");
      $title = t("System messages");
    }

Dries's avatar
 
Dries committed
50
    $breadcrumb = menu_get_active_breadcrumb();
Dries's avatar
 
Dries committed
51
    array_pop($breadcrumb);
52
    $title = menu_get_active_title();
Dries's avatar
 
Dries committed
53 54 55 56

    theme("breadcrumb", $breadcrumb);
    theme("box", $title, $contents);
    theme("footer");
Dries's avatar
 
Dries committed
57 58
  }
  else {
Dries's avatar
 
Dries committed
59 60 61
    theme("header");
    theme("box", t("Access denied"), message_access());
    theme("footer");
Dries's avatar
 
Dries committed
62 63 64 65
  }
}

?>