diff options
author | deva <deva> | 2010-02-28 10:55:20 +0000 |
---|---|---|
committer | deva <deva> | 2010-02-28 10:55:20 +0000 |
commit | 5594d11c6f16cb5e2e8c88568137b35e4338a418 (patch) | |
tree | 0d1532e42cc5435cb05c43b874e2a1729076048d /utils | |
parent | 90ed713a8c23e77028a413e9c3a7e88b51575b7c (diff) |
Load all modules by looking in the filesystem
Diffstat (limited to 'utils')
-rw-r--r-- | utils/modules.php | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/utils/modules.php b/utils/modules.php index 0b72f08..a2051b3 100644 --- a/utils/modules.php +++ b/utils/modules.php @@ -4,23 +4,18 @@ $modules = array(); function getModuleList() { + global $MODULES_DIR; + $mlist = array(); - array_push($mlist, "config"); - array_push($mlist, "discography"); - array_push($mlist, "events"); - array_push($mlist, "gallery"); - array_push($mlist, "guestbook"); - array_push($mlist, "icons"); - array_push($mlist, "links"); - array_push($mlist, "members"); - array_push($mlist, "news"); - array_push($mlist, "pages"); - array_push($mlist, "downloads"); - array_push($mlist, "newsletter"); - array_push($mlist, "pressrelease"); - array_push($mlist, "user"); - array_push($mlist, "users"); + $d = opendir($MODULES_DIR); + while(false !== ($f = readdir($d))) { + if($f == '.' || $f == '..') continue; + array_push($mlist, basename($f, ".php")); + } + closedir($d); + + sort($mlist); return $mlist; } |