X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplmodule.php;h=55de69f15af7c817105a20594d4bd208608ebcda;hb=a797e4f7daf5fbcc9b12f64c298e9aa4df0f0acc;hp=ec1e5f0271417f829cdcac57aee911c91c8dac33;hpb=24173926fa9e13ef5c3509645fca69e5304b0068;p=platal.git diff --git a/classes/plmodule.php b/classes/plmodule.php index ec1e5f0..55de69f 100644 --- a/classes/plmodule.php +++ b/classes/plmodule.php @@ -1,6 +1,6 @@ array($this, 'handler_'.$fun), - 'auth' => $auth, - 'perms' => $perms, - 'type' => $type); + return new PlStdHook(array($this, 'handler_' . $fun), + $auth, $perms, $type); + } + + /** Register a hook that points to a wiki page. + */ + public function make_wiki_hook($auth = AUTH_PUBLIC, $perms = 'user', $type = DO_AUTH) + { + return new PlWikiHook($auth, $perms, $type); } /** Include a 'module-specific' file. @@ -66,7 +71,7 @@ abstract class PLModule /* static functions */ - public static function factory($modname) + public static function path($modname) { global $globals; if ($modname == 'core') { @@ -74,6 +79,12 @@ abstract class PLModule } 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';