[phpwebapp-commits] CVS: web_app/parser class.WebObject.php,1.13,1.14 class.WebPage.php,1.22,1.23
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:49
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/parser Modified Files: class.WebObject.php class.WebPage.php Log Message: Index: class.WebObject.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebObject.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.WebObject.php 4 Nov 2005 06:54:14 -0000 1.13 --- class.WebObject.php 4 Jan 2006 08:32:38 -0000 1.14 *************** *** 157,189 **** { global $session; ! ! switch ($type) ! { ! case "DB": ! $arr_vars = $session->dbVars; ! break; ! case "JS": ! $arr_vars = $session->Vars; ! break; ! default: ! $msg = TF_("unreckognized \$type 'v_type'"); ! $msg = str_replace('v_type', $type, $msg); ! print WebApp::warning_msg("WebObject::getSVars(): $msg."); ! case UNDEFINED: ! $arr_vars = array_merge($session->Vars, $session->dbVars); ! break; ! } ! ! $stateVars = array(); ! $pattern = "^".$this->id."->(.*)"; ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! if (ereg($pattern, $var_name, $regs)) ! { ! $v_name = $regs[1]; ! $stateVars[$v_name] = $var_value; ! } ! } ! return $stateVars; } --- 157,161 ---- { global $session; ! $stateVars = $session->getObjVars($this->id, $type); return $stateVars; } Index: class.WebPage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebPage.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** class.WebPage.php 4 Nov 2005 06:54:14 -0000 1.22 --- class.WebPage.php 4 Jan 2006 08:32:38 -0000 1.23 *************** *** 63,68 **** * Keeps a list of windows that are poped up after the page is loaded. * It is a two dimensional array, indexed by name and with columns for ! * 'url', 'features' and 'html_content'. ! * @see WebApp::popup_window($name, $url, $features, $html_content) */ var $popup_windows; --- 63,68 ---- * Keeps a list of windows that are poped up after the page is loaded. * It is a two dimensional array, indexed by name and with columns for ! * 'url', 'html_content', 'features' and 'timeout'. ! * @see WebApp::popup_window($name, $url, $html_content, $features, $timeout) */ var $popup_windows; *************** *** 298,302 **** { //open the window - $url = $data['url']; $features = $data['features']; if ($features==UNDEFINED) --- 298,301 ---- *************** *** 310,319 **** { $html_content = WebApp::js_encode($html_content); ! $js .= " $name.document.write('$html_content');"; ! $js .= " $name.document.close();"; } if ($url!='') { ! $js .= " $name.location.href=\"$url\";"; } } --- 309,328 ---- { $html_content = WebApp::js_encode($html_content); ! $js .= " $name.document.write('$html_content');\n"; ! $js .= " $name.document.close();\n"; } + + //set the timeout of the window + $timeout = $data['timeout']; + if ($timeout!=UNDEFINED) + { + $js .= " $name.setTimeout('window.close()', $timeout);\n"; + } + + //load the url in the window, if it is not empty + $url = $data['url']; if ($url!='') { ! $js .= " $name.location.href=\"$url\";\n"; } } |