58 lines
1.8 KiB
Plaintext
58 lines
1.8 KiB
Plaintext
<?php
|
|
|
|
function module_help() {
|
|
?>
|
|
The module administration page provide you a list of all available modules. Moreover, it allows you to "rehash" modules. Whenever you install a new module or when an existing module has been changed or updated, it requires "rehashing": when you rehash a module, the module is registered to the engine and properly initialized.
|
|
<?php
|
|
}
|
|
|
|
function module_admin_rehash() {
|
|
$result = db_query("SELECT * FROM modules");
|
|
while ($module = db_fetch_object($result)) {
|
|
module_rehash($module->name);
|
|
}
|
|
|
|
foreach (module_list() as $name) {
|
|
module_rehash($name);
|
|
}
|
|
}
|
|
|
|
function module_admin_overview() {
|
|
$output .= "<FORM ACTION=\"admin.php?mod=module\" METHOD=\"post\">\n";
|
|
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
|
$output .= " <TR><TH>module</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
|
|
|
|
foreach (module_list() as $name) {
|
|
$output .= " <TR><TD>$name</TD><TD>". (module_hook($name, "page") ? "<A HREF=\"module.php?mod=$name\">view</A>" : " ") ."</TD><TD>". (module_hook($name, "admin") ? "<A HREF=\"admin.php?mod=$name\">admin</A>" : " ") ."</TD><TD><A HREF=\"admin.php?mod=module&op=rehash&name=$name\">rehash</A></TD></TR>\n";
|
|
}
|
|
|
|
$output .= "</TABLE>\n";
|
|
$output .= "<INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Rehash modules\">\n";
|
|
$output .= "</FORM>\n";
|
|
print $output;
|
|
}
|
|
|
|
function module_admin() {
|
|
global $op, $name;
|
|
|
|
print "<SMALL><A HREF=\"admin.php?mod=module\">overview</A> | <A HREF=\"admin.php?mod=module&op=help\">help</A></SMALL><HR>\n";
|
|
|
|
switch ($op) {
|
|
case "help":
|
|
module_help();
|
|
break;
|
|
case "rehash":
|
|
module_rehash($name);
|
|
module_admin_overview();
|
|
break;
|
|
case "Rehash modules":
|
|
module_admin_rehash();
|
|
module_admin_overview();
|
|
break;
|
|
default:
|
|
module_admin_overview();
|
|
}
|
|
}
|
|
|
|
?>
|