Hi all
I made an automatic module importer for the admin. If you want to use add in's (modules) you can put them in a directory Modules. All changes are then made automaticaly to the admin menu. I'm currently working on an annotation module that can be used with this extra function.
How to:
Find next code in the admin/index.php file
if (@is_dir("plugins")) {
show_nav_header("PlugIns");
$handle = @opendir("plugins/");
while ($file = @readdir($handle)) {
if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
continue;
}
$plugin_file = file("./plugins/".$file);
$plugin_file[0] = trim($plugin_file[0]);
if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
show_nav_option(trim($regs[1]), "./plugins/".$file);
}
else {
show_nav_option($file, "./plugins/".$file);
}
}
@closedir($handle);
}
After this code instal next code:
//
// NEW!!! Module Handler v1.0
//
// Author: Ing. Dipl.Ing. (FH) L.J.L. Houben
// Http://seilbahn.homaris.nl - Image Gallery
//
//
// Directory Listing
$startdir="../Modules/";
$ignoredDirectory[] = ".";
$ignoredDirectory[] = "..";
if (is_dir($startdir)) {
if ($dh = opendir($startdir)) {
while (($directoy = readdir($dh)) !== false) {
if (!(array_search($directoy,$ignoredDirectory) > -1)) {
if (filetype($startdir . $directoy) == "dir") {
show_nav_header("Mod ".$directoy);
// Internal functions listing
$handle = opendir($startdir.$directoy);
if(!is_file("./".$startdir.$directoy."/install.php"))
{
while ($file = @readdir($handle))
{
if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file))
{
continue;
}
$plugin_file = file("./".$startdir.$directoy."/".$file);
$plugin_file[0] = trim($plugin_file[0]);
if (preg_match("/MODULE_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs))
{
show_nav_option(trim($regs[1]), "./".$startdir.$directoy."/".$file);
}
else
{
show_nav_option($file, "./".$startdir.$directoy."/".$file);
}
}
}
else
{
$plugin_file = file("./".$startdir.$directoy."/install.php");
$plugin_file[0] = trim($plugin_file[0]);
if (preg_match("/MODULE_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs))
{
show_nav_option(trim($regs[1]), "./".$startdir.$directoy."/install.php");
}
else
{
show_nav_option($file, "./".$startdir.$directoy."/install.php");
}
}
@closedir($handle);
// End function listing
}
}
}
}
closedir($dh);
}
//
// END Module handler
//
That's all.
Now you can make you own modules. Here is a example of a map
C:\4 Images 1.7.3\
|- Admin\
|- Cache\
|- Captcha\
|- ........
|- Modules\
| |- Example map\ (This is shown in the admin site as a module name/header)
| | | Annotate.php (This is shown as a clickable link to the *.php file)
| | | Install.php (If this file is present, all others are ignored, so you can make your own installer)
| | |- OwnMap1
| | |- OwnMap2
| |- Example map2\
|- Templates