admin.php 1.52 KB
Newer Older
Dries's avatar
   
Dries committed
1
<?php
2
// $Id$
Dries's avatar
Dries committed
3

4
include_once "includes/common.inc";
Dries's avatar
   
Dries committed
5

Dries's avatar
   
Dries committed
6
function status($message) {
Dries's avatar
   
Dries committed
7
8
9
  if ($message) {
    return "<B>Status:</B> $message<HR>\n";
  }
Dries's avatar
   
Dries committed
10
11
}

Dries's avatar
   
Dries committed
12
function admin_page($mod) {
Dries's avatar
   
Dries committed
13
  global $user;
Dries's avatar
   
Dries committed
14
15

 ?>
Dries's avatar
   
Dries committed
16
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
Dries's avatar
   
Dries committed
17
18
19
20
21
  <html>
   <head>
    <title><?php echo variable_get(site_name, "drupal"); ?> administration pages</title>
   </head>
   <style>
Dries's avatar
   
Dries committed
22
    body { font-family: helvetica, arial; font-size: 12pt; }
Dries's avatar
CHANGES    
Dries committed
23
24
25
    h1   { font-famile: helvetica, arial; font-size: 18pt; font-weight: bold; color: #660000; }
    h2   { font-family: helvetica, arial; font-size: 18pt; font-weight: bold; color: #000066; }
    h3   { font-family: helvetica, arial; font-size: 14pt; font-weight: bold; color: #006600; }
Dries's avatar
   
Dries committed
26
27
    th   { font-family: helvetica, arial; font-size: 12pt; text-align: center; vertical-align: top; background-color: #CCCCCC; color: #995555; }
    td   { font-family: helvetica, arial; font-size: 12pt; }
Dries's avatar
   
Dries committed
28
29
30
31
   </style>
   <body bgcolor="#FFFFFF" link="#005599" vlink="#004499" alink="#FF0000">
    <h1>Administration</h1>
    <?php
Dries's avatar
   
Dries committed
32

Dries's avatar
   
Dries committed
33
      $links[] = "<a href=\"index.php\">home</a>";
Dries's avatar
   
Dries committed
34
      foreach (module_list() as $name) {
Dries's avatar
   
Dries committed
35
36
37
        if (module_hook($name, "link")) {
          $links = array_merge($links, module_invoke($name, "link", "admin"));
        }
Dries's avatar
   
Dries committed
38
39
40
41
      }

      print implode(" | ", $links) ."<hr />";

Dries's avatar
   
Dries committed
42
43
44
      if ($mod) {
        module_invoke($mod, "admin");
      }
Dries's avatar
   
Dries committed
45
46
47
    ?>
  </body>
 </html>
Dries's avatar
   
Dries committed
48
 <?php
Dries's avatar
Dries committed
49
}
Dries's avatar
   
Dries committed
50

Dries's avatar
   
Dries committed
51
if (user_access("access administration pages")) {
Dries's avatar
   
Dries committed
52
53
  admin_page($mod);
}
Dries's avatar
   
Dries committed
54

Dries's avatar
   
Dries committed
55
?>