[phpwebapp-commits] CVS: web_app/parser class.WebPage.php,1.13,1.14
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-10-08 10:02:11
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16923/parser Modified Files: class.WebPage.php Log Message: Added function WebApp::popup_window($name, $url, $features ='nil') Index: class.WebPage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebPage.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.WebPage.php 22 Jul 2004 16:25:37 -0000 1.13 --- class.WebPage.php 8 Oct 2004 10:01:55 -0000 1.14 *************** *** 45,54 **** var $rs_collection; ! /** Keeps a list of messages that are displayed with alert() ! * to the user after the page is loaded. */ var $messages; ! /** Keeps a list of debug messages that are displayed ! * after the page is rendered. */ var $dbg_messages; --- 45,67 ---- var $rs_collection; ! /** ! * Keeps a list of messages that are displayed with alert() ! * to the user after the page is loaded. ! * @see WebApp::message($msg) ! */ var $messages; ! /** ! * 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' and 'features'. ! * @see WebApp::window($name, $url, $features) ! */ ! var $popup_windows; ! ! /** ! * Keeps a list of debug messages that are displayed ! * after the page is rendered. ! */ var $dbg_messages; *************** *** 64,67 **** --- 77,81 ---- $this->messages = array(); + $this->popup_windows = array(); $this->dbg_messages = array(); *************** *** 207,210 **** --- 221,242 ---- } + /** + * Returns JS code that will open a popup window + * for each window in the list popup_windows + */ + function popup_windows_to_js() + { + if (sizeof($this->popup_windows)==0) return ''; + + $js = "<script language='javascript'>\n"; + while ( list($name,$data) = each ($this->popup_windows) ) + { + $url = $data['url']; + $features = $data['features']; + $js .= " $name = window.open('$url', '$name', '$features');\n"; + } + $js .= "</script>\n"; + return $js; + } function print_dbg_messages() |