[phpwebapp-commits] CVS: web_app class.WebApp.php,1.13,1.14
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2003-09-30 07:11:26
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv20128 Modified Files: class.WebApp.php Log Message: 'free events' modified Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.WebApp.php 8 Sep 2003 13:18:24 -0000 1.13 --- class.WebApp.php 30 Sep 2003 07:11:20 -0000 1.14 *************** *** 41,48 **** /** * A free event has target 'none', doesn't have a target webobject, ! * so no webobject can handle it. Instead, it is handled by the ! * function on_eventName($event), that is in the file 'on.eventName.php', ! * which is placed in the same folder as the target page or the source ! * page of the event. */ function callFreeEvent() --- 41,47 ---- /** * A free event has target 'none', doesn't have a target webobject, ! * so no webobject can handle it. Instead, it is handled by the ! * file 'on.eventName.php', which is placed in the same folder as the ! * source page of the event. */ function callFreeEvent() *************** *** 50,78 **** global $event; $file_name = "on.".$event->name.".php"; - $fun_name = "on_".$event->name; - - //look for the event handler in the path of targetPage - $path = TPL_PATH.dirname($event->targetPage); $fname = $path."/".$file_name; if (file_exists($fname)) { include_once $fname; - $fun_name($event); - return; } ! ! //look for the event handler in the path of sourcePage ! $path = TPL_PATH.dirname($event->sourcePage); ! $fname = $path."/".$file_name; ! if (file_exists($fname)) { ! include_once $fname; ! $fun_name($event); ! return; } - - //no event handler found - print WebApp::error_msg("event handler '$file_name' not found."); } --- 49,65 ---- global $event; + //look for the event handler in the path of sourcePage + $path = TPL_PATH.dirname($event->sourcePage); $file_name = "on.".$event->name.".php"; $fname = $path."/".$file_name; if (file_exists($fname)) { include_once $fname; } ! else { ! $err_msg = "WebApp::callFreeEvent(): File '$file_name' not found."; ! print WebApp::error_msg($err_msg); } } |