Add interface PlIteraface and the corresponding abstract class
[platal.git] / classes / plmodule.php
index 1dbdaff..55de69f 100644 (file)
@@ -50,10 +50,15 @@ abstract class PLModule
      */
     public function make_hook($fun, $auth, $perms = 'user', $type = DO_AUTH)
     {
-        return array('hook'  => 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.