Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
}
}
+ public static function load($modname, $include = null)
+ {
+ global $platal;
+ $modname = strtolower($modname);
+ if (isset($platal->__mods[$modname])) {
+ if (is_null($include)) {
+ return;
+ }
+ $platal->__mods[$modname]->load($include);
+ } else {
+ if (is_null($include)) {
+ require_once PLModule::path($modname) . '.php';
+ } else {
+ require_once PLModule::path($modname) . '/' . $include;
+ }
+ }
+ }
+
static public function &page()
{
global $platal;
/* static functions */
- public static function factory($modname)
+ public static function path($modname)
{
global $globals;
if ($modname == 'core') {
} else {
$mod_path = $globals->spoolroot . '/modules/' . $modname;
}
+ return $mod_path;
+ }
+
+ public static function factory($modname)
+ {
+ $mod_path = self::path($modname);
$class = ucfirst($modname) . 'Module';
require_once $mod_path . '.php';