[phpwebapp-commits] CVS: web_app class.WebApp.php,1.12.2.4,1.12.2.5
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-10-12 09:17:14
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11107 Modified Files: Tag: phpwebapp-1_0 class.WebApp.php Log Message: Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.12.2.4 retrieving revision 1.12.2.5 diff -C2 -d -r1.12.2.4 -r1.12.2.5 *** class.WebApp.php 11 Oct 2004 09:53:21 -0000 1.12.2.4 --- class.WebApp.php 12 Oct 2004 09:17:04 -0000 1.12.2.5 *************** *** 115,118 **** --- 115,156 ---- /** + * This function stops constructing the current page + * and starts loading and constructing the given target page. + * Similar to the JS function GoTo(), because it also sends + * an event to the new page that is going to be constructed + * (actually modifies the current event). + */ + function GoTo($target_page, $target_object =UNDEFINED, + $event_name =UNDEFINED, $event_args =UNDEFINED) + { + global $event, $webPage, $tplVars, $parser, $render; + + //modify $event according to the given params + if ($target_page<>'thisPage' and $target_page<>'') + { + $event->sourcePage = $event->targetPage; + $event->targetPage = $target_page; + } + if ($target_object<>UNDEFINED) $event->target = $target_object; + if ($event_name<>UNDEFINED) $event->name = $event_name; + if ($event_args<>UNDEFINED) $event->args = $event_args; + + //create new global vars + $webPage = new WebPage; + $tplVars = new VarStack; + $parser = new Parser; + $render = new Render; + + WebApp::constructHtmlPage(TPL_PATH.$event->targetPage); + + //after the page is constructed, stop php execution immediately + //in order to avoid any side effects of the previous call of + //constructHtmlPage() etc. (because this function is called + //somewhere in the middle of some functions, and we don't want + //the rest of the code of those functions to be executed + exit(0); + } + + /** * Constructs an HTML page and returns it as a string. * Then resumes constructing the previous page. *************** *** 188,216 **** } - /** - * This function stops loading the current page - * and starts loading and constructing the given page. - * If no page is given, reloads the same page again. - * - * @todo It doesn't work yet, see how to fix it. - */ - function reloadPage($tpl_file=UNDEFINED) - { - global $webPage, $tplVars, $parser; - - if ($tpl_file==UNDEFINED) //no parameter given - { - //reload again the same template - $tpl_file = $webPage->tpl_file; - } - //XX - $tplVars = new VarStack; - $parser = new Parser; - print "<xmp>--------------------------------------</xmp>\n"; //XX - $parser->parse_main(TPL_PATH.$tpl_file); - global $webapp_stop_parser; - $webapp_stop_parser = true; - } - /*------ end construct functions ----------------*/ --- 226,229 ---- |