From: Joe Presbrey Date: Tue, 10 Apr 2007 02:25:03 +0000 (+0000) Subject: git-svn-id: svn://presbrey.mit.edu/php/lib@122 a142d4bd-2cfb-0310-9673-cb33a7e74f58 X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/commitdiff_plain/46d82986e84aadf111798281490aad4fdb542553 git-svn-id: svn://presbrey.mit.edu/php/lib@122 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- diff --git a/lib/joe/site.lib.php b/lib/joe/site.lib.php index c28c231..c2a2e3a 100755 --- a/lib/joe/site.lib.php +++ b/lib/joe/site.lib.php @@ -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() {} }