summaryrefslogtreecommitdiff
path: root/admin.php
blob: ffc4cdfccb14c9da36606cc93ee04c09cc859f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

include_once "includes/common.inc";

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

function admin_page($mod) {
  global $menu, $user;

  function module($name) {
    global $menu, $user;
    if (module_hook($name, "admin")) $output .= "<A HREF=\"admin.php?mod=$name\">$name</A> | ";
    $menu .= $output;
  }

 ?>
  <html>
   <head>
    <title><?php echo variable_get(site_name, "drupal"); ?> administration pages</title>
   </head>
   <style>
    body { font-family: helvetica, arial; }
    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; }
    th   { font-family: helvetica, arial; text-align: center; vertical-align: top; background-color: #CCCCCC; color: #995555; }
    td   { font-family: helvetica, arial; }
   </style>
   <body bgcolor="#FFFFFF" link="#005599" vlink="#004499" alink="#FF0000">
    <h1>Administration</h1>
    <?php
      foreach (module_list() as $name) {
        if (module_hook($name, "admin")) $links[] = "<a href=\"admin.php?mod=$name\">$name</a>";
      }
      $links[] = "<a href=\"index.php\">home</a>";

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

      if ($mod) module_invoke($mod, "admin");
    ?>
  </body>
 </html>
 <?php
}

if (user_access($user, "access administration pages")) {
  user_rehash();
  admin_page($mod);
}

?>