]> andersk Git - sql-web.git/commitdiff
git-svn-id: svn://presbrey.mit.edu/php/lib@122 a142d4bd-2cfb-0310-9673-cb33a7e74f58
authorJoe Presbrey <presbrey@mit.edu>
Tue, 10 Apr 2007 02:25:03 +0000 (02:25 +0000)
committerJoe Presbrey <presbrey@mit.edu>
Tue, 10 Apr 2007 02:25:03 +0000 (02:25 +0000)
lib/joe/site.lib.php

index c28c231a4f6a9973a7b346919e37c8c297268fd1..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) {
@@ -41,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]) ?
@@ -57,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.032884 seconds and 5 git commands to generate.