]> andersk Git - sql-web.git/blobdiff - lib/joe/site.lib.php
git-svn-id: svn://presbrey.mit.edu/php/lib@122 a142d4bd-2cfb-0310-9673-cb33a7e74f58
[sql-web.git] / lib / joe / site.lib.php
index 1321a8b08a471be088f270d1240076e6cdfe2b21..c2a2e3a62b030b19413e8b07cf60e1eb526e7645 100755 (executable)
@@ -5,12 +5,12 @@
 
 class Site {
        function Start() {}
-       function Call($MODULE, $METHOD) {
+       function Call($MODULE, $METHOD, $ARGP=array()) {
                $nCalls = 0;
                if (file_exists(strtolower('site/'.$MODULE.'.php'))) {
                        require_once strtolower('site/'.$MODULE.'.php');
                        if (class_exists($MODULE)) {
-                               $page = new $MODULE($this, $METHOD);
+                               $page = new $MODULE($this, $METHOD, $ARGP);
                                $page->Start();
                                $handlers = $page->get_handlers($METHOD);
                                switch ($METHOD) {
@@ -28,9 +28,7 @@ class Site {
                                                $nCalls++;
                                        }
                                }
-                               echo $nCalls;
-                               print_r($page);
-                               if ($nCalls == 0 && is_callable($page, '_default')) {
+                               if ($nCalls == 0 && is_callable(array($page, '_default'))) {
                                        $page->Call('_default', $argv);
                                        $nCalls++;
                                }
@@ -43,10 +41,11 @@ class Site {
 }
 
 class Page {
-       var $site, $method;
-       function __construct($site, $method) {
+       var $site, $method, $argp;
+       function __construct($site, $method, $argp) {
                $this->site = $site;
                $this->method = $method;
+               $this->argp = $argp;
        }
        function get_handlers() {
                $handlers = isset($this->handlers[$this->method]) ?
@@ -59,9 +58,11 @@ class Page {
 
        function Start() {}
        function Call($handler, $argv) {
-               if (is_callable(array($this, $handler)))
-                       return array(0, call_user_func_array(array($this, $handler), $argv));
-               else return false;
+               if (is_callable(array($this, $handler))) {
+                       return array(0, call_user_func(array($this, $handler), $argv));
+               } else {
+                       return false;
+               }
        }
        function Finish() {}
 }
This page took 0.026997 seconds and 4 git commands to generate.