summaryrefslogtreecommitdiff
path: root/admin.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-05-05 13:57:29 +0000
committerDries Buytaert <dries@buytaert.net>2001-05-05 13:57:29 +0000
commitbe8e898d23a3f9ca515f59fbcc8d82e112ed7ee8 (patch)
treecf0d05f6b767f36e7feb09a3bc59cbc9a01e459b /admin.php
parent16818777616eadeb8a4670324e099b95c8d53e3b (diff)
downloadbrdo-be8e898d23a3f9ca515f59fbcc8d82e112ed7ee8.tar.gz
brdo-be8e898d23a3f9ca515f59fbcc8d82e112ed7ee8.tar.bz2
- Uhm. Rewrote the module system: less code clutter, less run-time
overhead, and a lot better (simpler) module API. I had to edit a LOT of files to get this refactored but I'm sure it was worth the effort. For module writers / maintainers: None of the hooks changed, so 95% of the old modules should still work. You can remove some code instead as "$module = array(...)" just became obsolete. Also - and let's thank God for this - the global variable "$repository" has been eliminated to avoid modules relying on, and poking in drupal's internal data structures. Take a look at include/module.inc to investigate the details/changes. - Improved design of the content modules "story", "book" and "node" (to aid smooth integration of permisions + moderate.module). I'm still working on the permissions but I got side tracked for which I "Oops!".
Diffstat (limited to 'admin.php')
-rw-r--r--admin.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/admin.php b/admin.php
index c9085ea11..33f89dd76 100644
--- a/admin.php
+++ b/admin.php
@@ -10,11 +10,11 @@ function status($message) {
}
function admin_page($mod) {
- global $repository, $menu, $modules, $user;
+ global $menu, $user;
- function module($name, $module) {
- global $menu, $modules, $user;
- if ($module["admin"] && user_access($user, $name)) $output .= "<A HREF=\"admin.php?mod=$name\">$name</A> | ";
+ function module($name) {
+ global $menu, $user;
+ if (function_exists($name. "_admin") && user_access($user, $name)) $output .= "<A HREF=\"admin.php?mod=$name\">$name</A> | ";
$menu .= $output;
}
@@ -32,18 +32,9 @@ function admin_page($mod) {
</STYLE>
<BODY BGCOLOR="#FFFFFF" LINK="#005599" VLINK="#004499" ALINK="#FF0000">
<H1>Administration</H1>
- <?php
-
- ksort($repository);
- module_iterate("module");
-
- ?>
+ <?php module_iterate("module"); ?>
<HR><?php echo $menu; ?><A HREF="index.php">home</A><HR>
- <?php
-
- if (user_access($user, $mod)) module_execute($mod, "admin");
-
- ?>
+ <?php if (user_access($user, $mod)) module_invoke($mod, "admin"); ?>
</BODY>
</HTML>
<?php