phpwebapp-commits Mailing List for phpWebApp (Page 29)
Brought to you by:
dashohoxha
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
(43) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(194) |
Sep
(60) |
Oct
(6) |
Nov
|
Dec
(16) |
2004 |
Jan
(73) |
Feb
(13) |
Mar
(5) |
Apr
|
May
(5) |
Jun
|
Jul
(183) |
Aug
|
Sep
(5) |
Oct
(30) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(1) |
Jun
(35) |
Jul
(17) |
Aug
(2) |
Sep
(6) |
Oct
(19) |
Nov
(108) |
Dec
|
2006 |
Jan
(10) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dashamir H. <das...@us...> - 2003-08-20 10:10:32
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv7039 Modified Files: class.WebApp.php Log Message: Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** class.WebApp.php 15 Aug 2003 09:00:15 -0000 1.9 --- class.WebApp.php 20 Aug 2003 07:07:56 -0000 1.10 *************** *** 482,487 **** if (!SHOW_ERROR_MESSAGES) return ""; $err_msg = htmlentities($err_msg); ! return "\n<div class='error_msg'>WebApp Error: ".$err_msg."</div>\n"; } --- 482,489 ---- if (!SHOW_ERROR_MESSAGES) return ""; + $err_msg = str_replace(UP_PATH, '', $err_msg); $err_msg = htmlentities($err_msg); ! return "\n<span class='webapp_error'><b>WebApp Error:</b> " ! . $err_msg . "</span>\n"; } *************** *** 491,496 **** if (!SHOW_ERROR_MESSAGES) return ""; $warn_msg = htmlentities($warn_msg); ! return "\n<div class='warning_msg'>WebApp Warning: ".$warn_msg."</div>\n"; } --- 493,500 ---- if (!SHOW_ERROR_MESSAGES) return ""; + $err_msg = str_replace(UP_PATH, '', $err_msg); $warn_msg = htmlentities($warn_msg); ! return "\n<span class='webapp_warning'><b>WebApp Warning:</b> " ! . $warn_msg . "</span>\n"; } |
From: Dashamir H. <das...@us...> - 2003-08-20 09:40:18
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1:/tmp/cvs-serv5996/parser Modified Files: class.WebPage.php class.Template.php Log Message: changed some styles Index: class.WebPage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebPage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** class.WebPage.php 15 Aug 2003 07:03:42 -0000 1.5 --- class.WebPage.php 20 Aug 2003 07:00:49 -0000 1.6 *************** *** 185,189 **** } - /****************** debug functions ***********************/ function print_dbg_messages() --- 185,188 ---- *************** *** 204,220 **** } /** outputs the data of each template in $this->tpl_collection */ function template_list() { ! $html = "<hr>\n"; ! $html .= "<a name='top'> </a>\n"; $html .= "<strong>List of Templates of the Page:</strong>\n"; $html .= "<ul>\n"; reset($this->tpl_collection); ! while ( list($tplID, $tpl) = each($this->tpl_collection) ) { ! $html .= "\t<li> <a href='#$tpl->id'> $tpl->id </a>\n"; } $html .= "</ul>\n"; //print each template --- 203,225 ---- } + /*------------------ debug functions --------------------------*/ + /** outputs the data of each template in $this->tpl_collection */ function template_list() { ! $html = "<a name='top'> </a>\n"; ! $html .= "<div class='webapp'>\n"; $html .= "<strong>List of Templates of the Page:</strong>\n"; $html .= "<ul>\n"; reset($this->tpl_collection); ! while ( list($tpl_id, $tpl) = each($this->tpl_collection) ) { ! //don't output the appended templates ! if (ereg("web_app/append/append.html\$", $tpl->id)) break; ! ! $html .= "\t<li><a href='#$tpl->id'>$tpl->id</a></li>\n"; } $html .= "</ul>\n"; + $html .= "</div>\n"; //print each template *************** *** 222,225 **** --- 227,233 ---- while ( list($tplID, $tpl) = each($this->tpl_collection) ) { + //don't output the appended templates + if (ereg("web_app/append/append.html\$", $tpl->id)) break; + $html .= $tpl->toHtmlTable(); } *************** *** 234,242 **** $tree = "<hr>\n"; $tree .= "<a name='top'> </a>\n"; ! $tree .= "<strong>The tree structure of the templates: </strong>\n"; ! $tree .= "<pre>\n"; $tree .= $this->rootTpl->to_tree(""); $tree .= "</pre>\n"; - $tree .= "<hr>\n"; return $tree; } --- 242,249 ---- $tree = "<hr>\n"; $tree .= "<a name='top'> </a>\n"; ! $tree .= "<pre class='webapp'>\n"; ! $tree .= "<strong>The tree structure of the templates:</strong>\n\n"; $tree .= $this->rootTpl->to_tree(""); $tree .= "</pre>\n"; return $tree; } Index: class.Template.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Template.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** class.Template.php 11 Aug 2003 16:17:51 -0000 1.4 --- class.Template.php 20 Aug 2003 07:00:49 -0000 1.5 *************** *** 47,51 **** $htmlTable = " <br> ! <a name='$this->id'> </a>[<a href='javascript: back()'>Top</a>] <table width='90%' bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> --- 47,51 ---- $htmlTable = " <br> ! <a name='$this->id'> </a>[<a href='javascript: back()'>Back</a>] <table width='90%' bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> *************** *** 85,89 **** function content2html() { ! $html = "\n<pre>"; $i = 0; while ($i < sizeof($this->content)) --- 85,89 ---- function content2html() { ! $html = "\n<pre class='webapp'>"; $i = 0; while ($i < sizeof($this->content)) *************** *** 109,112 **** --- 109,115 ---- function to_tree($indent) { + //don't output the appended boxes + if (ereg("web_app/append/append.html\$", $this->id)) return; + global $webPage; |
From: Dashamir H. <das...@us...> - 2003-08-20 09:09:32
|
Update of /cvsroot/phpwebapp/documentation/templates/tutorial In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates/tutorial Modified Files: tutorial_items.php tutorial.css intro.html Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: tutorial_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/tutorial_items.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tutorial_items.php 23 Feb 2003 14:29:07 -0000 1.2 --- tutorial_items.php 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 5,17 **** */ $menu_items = array( ! "intro" => "0 - Introduction", ! "transitions" => "1 - Transitions", ! "templates" => "2 - Templates", ! "weboxes" => "3 - WebBox-es", ! "events" => "4 - Events", ! "sess_var" => "5 - Session and Variables", ! "database" => "6 - Database", ! "advanced" => "7 - Advanced", ! "documentation" => "8 - Documentation" ! ); ?> --- 5,17 ---- */ $menu_items = array( ! "intro" => "0 - Introduction", ! "transitions" => "1 - Transitions", ! "templates" => "2 - Templates", ! "weboxes" => "3 - WebBox-es", ! "events" => "4 - Events", ! "sess_var" => "5 - Session and Variables", ! "database" => "6 - Database", ! "advanced" => "7 - Advanced", ! "documentation" => "8 - Documentation" ! ); ?> Index: tutorial.css =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/tutorial.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tutorial.css 15 Aug 2003 07:32:12 -0000 1.1 --- tutorial.css 20 Aug 2003 07:31:55 -0000 1.2 *************** *** 1,13 **** - h1, h2 - { - text-align: center; - } - - h1, h2, h3, h4, h5 - { - color: #660000; - } - pre { --- 1,3 ---- *************** *** 15,18 **** --- 5,14 ---- border: 1px solid #0000aa; color: #00aa00; + } + + kbd + { + font-family: courier; + color: #008888; } Index: intro.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/intro.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** intro.html 15 Aug 2003 07:37:30 -0000 1.3 --- intro.html 20 Aug 2003 07:31:55 -0000 1.4 *************** *** 1,120 **** ! The tutorial consists of a list of sample applications ! which are built using phpWebApp. Each application uses some ! features of phpWebApp and has explanations about the features ! used. It also has code reviews which show how these features ! are used in the application, and exercises which require the ! reader to try himself some simple modifications to the application. ! <p> ! Each application builds on the things explained on the previous ! applications and explains only the new features that are introduced ! in it, so it is recomended to study them in the given order. ! <p> ! These sample applications may also serve as templates for your applications. ! Instead of building a new application from scratch, you can just copy one ! of the samples and modify it according to your needs. ! <br> <br> <table width="100%" align="center" cellspacing="0" cellpadding="20" border="0"> ! <tr> ! <td width="50%" valign="top" bgcolor="#eeeeee"> ! <a href="javascript: tabs3_select('tabs3::tutorial', 'transitions')"> ! <b>1 - Transitions</b> ! </a> ! <br> ! A very simple application that has 2 or 3 HTML files ! which have transitions to each-other and have some ! links to external pages. ! Explains the folder structure of a simple application, ! explains what are the transitions and the difference ! between the transitions and the links. Explains how to ! debug transitions. ! </td> ! <td width="50%" valign="top" bgcolor="#f8f8f8"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'templates')">2 - Templates</a></b> ! <br> ! The HTML files now become templates. This application ! uses the <Include> tag to insert the same header file ! at the beginning of each template and to break the ! templates into sub templates. It shows how to include ! the javascript code and the stylesheet of each template. ! It also explains the use of the framework comments and ! the difference between them and the HTML comments. ! Explains how to debug the template structure. ! </td> </tr> - <tr> - <td width="50%" valign="top" bgcolor="#f8f8f8"> - <b><a href="javascript: tabs3_select('tabs3::tutorial', 'weboxes')">3 - Introducing WebBox-es</a></b> - <br> - Some of the templates are turned into weboxes. - Explains the fundamental difference between a template - and a webox. The PHP code of the weboxes - declares the function onRender(), where some variables - are added using WebApp::addVar(), and these {{variables}} - are used in the corresponding template. ! </td> ! <td width="50%" valign="top" bgcolor="#eeeeee"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'events')">4 - Sending and Handelling Events</a></b> ! <br> ! Some of the transitions send ! events to some of the weboxes. The target weboxes handle ! these events in their eventHandler() functions. Explains also ! the transitions to 'thisPage', sending an event to 'any' webox, ! and sending events to 'none' of the weboxes (independent events). ! </td> </tr> ! <tr> ! <td width="50%" valign="top" bgcolor="#eeeeee"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'sess_var')">5 - Session and Variables</a></b> ! <br> ! Explains what are the session variables and how to use them. ! Explains further how the {{template variables}} are evaluated. ! Explains how the session variables are used to keep the state ! of the weboxes and the states of the application (introduces ! the function onLoad() of the weboxes). Explains how the <If> ! elements are used to display templates conditionally. ! Explains how to debug the session variables. ! </td> ! <td width="50%" valign="top" bgcolor="#f8f8f8"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'database')">6 - Interacting with a Database</a></b> ! <br> ! Explains how to set a default connection with a database. ! Explains the configuration file of a template (*.tpc) and ! the <Recordset> element. Explains the <Repeat> elements and ! how to use them inside a template. Explains the '.db' file ! of a webox, the <Recordset> and <dbCommand> elements inside it, ! and how to use the functions WebApp::execDBCmd(), WebApp::openRS() ! and WebApp::execQuery() inside the PHP code of the webox. ! Explains how to debug the recordsets of the page and the execution ! times of the queries (and other processes). ! </td> </tr> ! <tr> ! <td width="50%" valign="top" bgcolor="#f8f8f8"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'advanced')">7 - All the rest of the advanced features</a></b> ! <br> ! A complicated, real and almost finished web application (which ! may evolve from the previous samples or may be independent of ! them), which makes use and explains almost all of the advanced ! features of framework which have not been explained in the ! previous samples. Such features may be: ! <ul> ! <li> Detailed explanation of the <Repeat> element and the page ! recordsets. ! <li> <Var> elements ! <li> An <Include> element that uses a variable. ! <li> Usage of an external webox. ! <li> Etc. ! </ul> ! </td> ! <td width="50%" valign="top" bgcolor="#eeeeee"> ! <b><a href="javascript: tabs3_select('tabs3::tutorial', 'documentation')">8 - The documentation application</a></b> ! <br> ! This web application (the 'phpWebApp documentation') is built ! using phpWebApp itself. This tutorial explains how this ! web application is constructed. ! </td> </tr> </table> --- 1,144 ---- + <p>The tutorial consists of a list of sample applications which are + built using phpWebApp. Each application uses some features of + phpWebApp and has explanations about the features used. It also has + code reviews which show how these features are used in the + application, and exercises which require the reader to try himself + some simple modifications to the application.</p> ! <p>Each application builds on the things explained on the previous ! applications and explains only the new features that are introduced ! in it, so it is recomended to study them in the given order.</p> ! ! <p>These sample applications may also serve as templates for your ! applications. Instead of building a new application from scratch, ! you can just copy one of the samples and modify it according to ! your needs.</p> <br> + <table width="100%" align="center" cellspacing="0" cellpadding="20" border="0"> ! <tr> ! <td width="50%" valign="top" bgcolor="#EEEEEE"> ! <a href="javascript:tabs3_select('tabs3::tutorial','transitions')"> ! <strong>1 - Transitions</strong> ! </a> ! <br> ! A very simple application that has 2 or 3 HTML files which have ! transitions to each-other and have some links to external ! pages. Explains the folder structure of a simple application, ! explains what are the transitions and the difference between ! the transitions and the links. Explains how to debug ! transitions. ! </td> ! ! <td width="50%" valign="top" bgcolor="#F8F8F8"> ! <a href="javascript:tabs3_select('tabs3::tutorial','templates')"> ! <strong>2 - Templates</strong> ! </a> ! <br> ! The HTML files now become templates. This application uses the ! <Include> tag to insert the same header file at the ! beginning of each template and to break the templates into sub ! templates. It shows how to include the javascript code and the ! stylesheet of each template. It also explains the use of the ! framework comments and the difference between them and the HTML ! comments. Explains how to debug the template structure. ! </td> </tr> ! <tr> ! <td width="50%" valign="top" bgcolor="#F8F8F8"> ! <a href="javascript:tabs3_select('tabs3::tutorial','weboxes')"> ! <strong>3 - Introducing WebBox-es</strong> ! </a> ! <br> ! Some of the templates are turned into weboxes. Explains the ! fundamental difference between a template and a webox. The PHP ! code of the weboxes declares the function onRender(), where ! some variables are added using WebApp::addVar(), and these ! {{variables}} are used in the corresponding template. ! </td> ! ! <td width="50%" valign="top" bgcolor="#EEEEEE"> ! <a href="javascript:tabs3_select('tabs3::tutorial','events')"> ! <strong>4 - Sending and Handelling Events</strong> ! </a> ! <br> ! Some of the transitions send events to some of the weboxes. The ! target weboxes handle these events in their eventHandler() ! functions. Explains also the transitions to 'thisPage', sending ! an event to 'any' webox, and sending events to 'none' of the ! weboxes (independent events). ! </td> </tr> ! ! <tr> ! <td width="50%" valign="top" bgcolor="#EEEEEE"> ! <a href="javascript:tabs3_select('tabs3::tutorial','sess_var')"> ! <strong>5 - Session and Variables</strong> ! </a> ! <br> ! Explains what are the session variables and how to use them. ! Explains further how the {{template variables}} are evaluated. ! Explains how the session variables are used to keep the state ! of the weboxes and the states of the application (introduces ! the function onLoad() of the weboxes). Explains how the ! <If> elements are used to display templates ! conditionally. Explains how to debug the session ! variables. ! </td> ! ! <td width="50%" valign="top" bgcolor="#F8F8F8"> ! <a href="javascript:tabs3_select('tabs3::tutorial','database')"> ! <strong>6 - Interacting with a Database</strong> ! </a> ! <br> ! Explains how to set a default connection with a database. ! Explains the configuration file of a template (*.tpc) and the ! <Recordset> element. Explains the <Repeat> elements ! and how to use them inside a template. Explains the '.db' file ! of a webox, the <Recordset> and <dbCommand> ! elements inside it, and how to use the functions ! WebApp::execDBCmd(), WebApp::openRS() and WebApp::execQuery() ! inside the PHP code of the webox. Explains how to debug the ! recordsets of the page and the execution times of the queries ! (and other processes). ! </td> </tr> ! ! <tr> ! <td width="50%" valign="top" bgcolor="#F8F8F8"> ! <a href="javascript:tabs3_select('tabs3::tutorial','advanced')"> ! <strong>7 - All the rest of the advanced features</strong> ! </a> ! <br> ! A complicated, real and almost finished web application ! (which may evolve from the previous samples or may be ! independent of them), which makes use and explains almost all ! of the advanced features of framework which have not been ! explained in the previous samples. Such features may be: ! ! <ul> ! <li>Detailed explanation of the <Repeat> element and ! the page recordsets.</li> ! ! <li><Var> elements</li> ! ! <li>An <Include> element that uses a variable.</li> ! ! <li>Usage of an external webox.</li> ! ! <li>Etc.</li> ! </ul> ! </td> ! ! <td width="50%" valign="top" bgcolor="#EEEEEE"> ! <a href="javascript:tabs3_select('tabs3::tutorial','documentation')"> ! <strong>8 - The documentation application</strong> ! </a> ! <br> ! This web application (the 'phpWebApp documentation') is built ! using phpWebApp itself. This tutorial explains how this web ! application is constructed. ! </td> </tr> </table> |
From: Dashamir H. <das...@us...> - 2003-08-20 09:09:31
|
Update of /cvsroot/phpwebapp/documentation/templates In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates Modified Files: styles.css mainMenu_items.php main.html content.php about.html Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/styles.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** styles.css 15 Aug 2003 07:37:30 -0000 1.3 --- styles.css 20 Aug 2003 07:31:55 -0000 1.4 *************** *** 3,7 **** margin: 5px; background-color: #ffffff; ! font-family: arial, helvetica, sans-se; font-size: 12pt; color: #000044; --- 3,7 ---- margin: 5px; background-color: #ffffff; ! font-family: arial, helvetica, sans-se; font-size: 12pt; color: #000044; *************** *** 13,16 **** --- 13,26 ---- } + h1 + { + text-align: center; + } + + h1, h2, h3, h4, h5 + { + color: #660000; + } + .small_font { *************** *** 25,29 **** { padding: 10px; ! background-color: #ffaaaa; } --- 35,39 ---- { padding: 10px; ! background-color: #ffddaa; } Index: mainMenu_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/mainMenu_items.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mainMenu_items.php 23 Feb 2003 14:29:07 -0000 1.2 --- mainMenu_items.php 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 4,12 **** */ $menu_items = array( ! "about" => "About", ! "tutorial" => "Tutorial", ! "user_manual" => "User Manual", ! "webobjects" => "Web Objects", ! "developer_docs"=> "Developer Docs" ! ); ?> --- 4,12 ---- */ $menu_items = array( ! "about" => "About", ! "tutorial" => "Tutorial", ! "user_manual" => "User Manual", ! "webobjects" => "Web Objects", ! "developer_docs"=> "Developer Docs" ! ); ?> Index: main.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/main.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.html 15 Aug 2003 07:37:30 -0000 1.3 --- main.html 20 Aug 2003 07:31:55 -0000 1.4 *************** *** 18,22 **** <td width="1%" align="left" valign="top" nowrap> <Include SRC="{{./}}bismilah.html" /> ! </td> </tr> </table> --- 18,22 ---- <td width="1%" align="left" valign="top" nowrap> <Include SRC="{{./}}bismilah.html" /> ! </td> </tr> </table> Index: content.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/content.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** content.php 21 Feb 2003 08:18:24 -0000 1.1.1.1 --- content.php 20 Aug 2003 07:31:55 -0000 1.2 *************** *** 7,28 **** $tab = WebApp::getSVar("tabs1::mainMenu->selected_item"); switch ($tab) ! { ! default: ! case "about": ! $content_file = "about.html"; ! break; ! case "tutorial": ! $content_file = "tutorial/tutorial.html"; ! break; ! case "user_manual": ! $content_file = "user_manual/user_manual.html"; ! break; ! case "developer_docs": ! $content_file = "developer_docs.html"; ! break; ! case "webobjects": ! $content_file = "webobjects/webobjects.html"; ! break; ! } WebApp::addVar("content_file", $content_file); } --- 7,28 ---- $tab = WebApp::getSVar("tabs1::mainMenu->selected_item"); switch ($tab) ! { ! default: ! case "about": ! $content_file = "about.html"; ! break; ! case "tutorial": ! $content_file = "tutorial/tutorial.html"; ! break; ! case "user_manual": ! $content_file = "user_manual/user_manual.html"; ! break; ! case "developer_docs": ! $content_file = "developer_docs.html"; ! break; ! case "webobjects": ! $content_file = "webobjects/webobjects.html"; ! break; ! } WebApp::addVar("content_file", $content_file); } Index: about.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/about.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** about.html 7 Aug 2003 15:54:14 -0000 1.5 --- about.html 20 Aug 2003 07:31:55 -0000 1.6 *************** *** 1,3 **** - <br> <h3>What is phpWebApp</h3> <p> --- 1,2 ---- |
From: Dashamir H. <das...@us...> - 2003-08-20 08:28:39
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv5996 Modified Files: styles.css Log Message: changed some styles Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/styles.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** styles.css 15 Aug 2003 07:05:08 -0000 1.3 --- styles.css 20 Aug 2003 07:00:52 -0000 1.4 *************** *** 1,4 **** ! /* styles of [Powered by phpWebApp] logo */ .webapp_logo { --- 1,4 ---- ! /*--- styles of [Powered by phpWebApp] logo ---*/ .webapp_logo { *************** *** 24,43 **** background-color: #eeeeee; } ! .error_msg { ! color: red; font-family: arial, helvetica, sans-se; font-size: 10px; ! font-weight: bold; } ! ! .warning_msg { ! color: brawn; font-family: arial, helvetica, sans-se; font-size: 10px; font-weight: bold; } .whiteRow --- 24,70 ---- background-color: #eeeeee; } + /*--- end styles of [Powered by phpWebApp] logo ---*/ ! ! .webapp_error { ! color: #ff0000; font-family: arial, helvetica, sans-se; font-size: 10px; ! background-color: #ffffff; } ! .webapp_warning { ! color: #bb0000; font-family: arial, helvetica, sans-se; font-size: 10px; + background-color: #ffffff; + } + + /*---------------------------------------*/ + pre.webapp, div.webapp + { + background-color: #ffffff; + border: 1px solid #660000; + color: #006699; + font-style: courier; + font-size: 12pt; + font-weight: normal; + } + pre.webapp a, div.webapp a + { + color: #0000ee; + text-decoration: none; + } + pre.webapp strong, div.webapp strong + { + color: #660000; + font-style: arial, helvetica, sans-se; + font-size: 14pt; font-weight: bold; + text-decoration: underline; } + /*---------------------------------------*/ + .whiteRow |
From: Dashamir H. <das...@us...> - 2003-08-20 08:17:36
|
Update of /cvsroot/phpwebapp/web_app/boxes/codeViewer In directory sc8-pr-cvs1:/tmp/cvs-serv5996/boxes/codeViewer Modified Files: codeViewer.html codeViewer.css Log Message: changed some styles Index: codeViewer.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/codeViewer/codeViewer.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** codeViewer.html 16 Jul 2003 09:28:00 -0000 1.2 --- codeViewer.html 20 Aug 2003 07:00:50 -0000 1.3 *************** *** 6,10 **** <td class="{{class-nr}}">{{nr}} </td> </If> ! <td class="{{class-line}}"><pre>{{line}}</pre></td> </tr> </Repeat> --- 6,10 ---- <td class="{{class-nr}}">{{nr}} </td> </If> ! <td class="{{class-line}}"><pre class="{{class-line}}">{{line}}</pre></td> </tr> </Repeat> Index: codeViewer.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/codeViewer/codeViewer.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** codeViewer.css 21 Feb 2003 08:15:05 -0000 1.1.1.1 --- codeViewer.css 20 Aug 2003 07:00:51 -0000 1.2 *************** *** 1,10 **** - body - { - background-color: white; - margin-top: 0px; - margin-left: 0px; - margin-right: 0px; - margin-bottom: 0px; - } table.codeViewer-table --- 1,2 ---- *************** *** 20,24 **** width: 1; font-size: small; ! color: black white-space: nowrap; } --- 12,16 ---- width: 1; font-size: small; ! color: black; white-space: nowrap; } *************** *** 30,34 **** width: 1; font-size: small; ! color: black white-space: nowrap; } --- 22,26 ---- width: 1; font-size: small; ! color: black; white-space: nowrap; } *************** *** 38,43 **** padding: 0 5; white-space: nowrap; ! background-color: white; ! color: #000099 } --- 30,35 ---- padding: 0 5; white-space: nowrap; ! background-color: #ffffff; ! color: #000099; } *************** *** 46,51 **** padding: 0 5; white-space: nowrap; ! background-color: #0000ff; ! color: white } --- 38,56 ---- padding: 0 5; white-space: nowrap; ! background-color: #5555ff; ! color: #ffff00; ! } ! ! pre.codeViewer-line ! { ! background-color: #ffffff; ! color: #000099; ! border: none; } + pre.codeViewer-line-highlighted + { + background-color: #5555ff; + color: #ffff00; + border: none; + } |
From: Dashamir H. <das...@us...> - 2003-08-20 08:16:29
|
Update of /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates/user_manual/manual_pages Modified Files: webox.txt variables.txt transitions.txt templates.txt session.txt new_app.txt misc.txt events.txt database.txt Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: webox.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/webox.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webox.txt 23 Feb 2003 14:29:07 -0000 1.2 --- webox.txt 20 Aug 2003 07:31:54 -0000 1.3 *************** *** 16,22 **** ----------------- It is denoted by the tag <WebBox> and it has an ID attribute: ! <WebBox ID="boxID"> ! <!-- content of WebBox --> ! </WebBox> The identifier of the box is very important and must be different for each box used in the application. --- 16,22 ---- ----------------- It is denoted by the tag <WebBox> and it has an ID attribute: ! <WebBox ID="boxID"> ! <!-- content of WebBox --> ! </WebBox> The identifier of the box is very important and must be different for each box used in the application. *************** *** 37,41 **** So, at the time that the framework is about to load (parse) the ! WebBox, it includes the "boxID.php" file, and then calls the functions "boxID_eventHandler($event)" and "boxID_onParse()". Later, when it is about to render (generate the HTML code of) the WebBox, --- 37,41 ---- So, at the time that the framework is about to load (parse) the ! WebBox, it includes the "boxID.php" file, and then calls the functions "boxID_eventHandler($event)" and "boxID_onParse()". Later, when it is about to render (generate the HTML code of) the WebBox, *************** *** 67,71 **** some template variables that affect the parsing. E.g. if we have this line in a template: ! <Include SRC="{{#content_file}}" /> then the variable {{#content_file}} must have a value before this line is parsed, and usually this value is given in the onParse() --- 67,71 ---- some template variables that affect the parsing. E.g. if we have this line in a template: ! <Include SRC="{{#content_file}}" /> then the variable {{#content_file}} must have a value before this line is parsed, and usually this value is given in the onParse() *************** *** 105,119 **** The 'boxID.js' file contains the javascript functions related to the webox (same as for the templates). It is included like this: ! <script language="javascript" src="{{#./}}boxID.js"></script> ! The 'boxID.css' file contains the stylesheet of the webox. It is included like this: ! <link rel="stylesheet" type="text/css" href="{{#./}}boxID.css"> The 'boxID.rs' file contains the recordsets of the webox that are used in the layout (for the <Repeat> tags). It is included like this: ! <Include SRC="{{#./}}boxID.rs"/> ! The 'boxID.php' file contains the PHP code of the webox. It is included automatically by the framework, if it exists. --- 105,119 ---- The 'boxID.js' file contains the javascript functions related to the webox (same as for the templates). It is included like this: ! <script language="javascript" src="{{#./}}boxID.js"></script> ! The 'boxID.css' file contains the stylesheet of the webox. It is included like this: ! <link rel="stylesheet" type="text/css" href="{{#./}}boxID.css"> The 'boxID.rs' file contains the recordsets of the webox that are used in the layout (for the <Repeat> tags). It is included like this: ! <Include SRC="{{#./}}boxID.rs"/> ! The 'boxID.php' file contains the PHP code of the webox. It is included automatically by the framework, if it exists. *************** *** 152,156 **** The class "boxID" can override the functions: ! eventHandler($event), onParse() and onRender() of IWebBox, or can define other functions that can be used inside these functions. These functions replace --- 152,156 ---- The class "boxID" can override the functions: ! eventHandler($event), onParse() and onRender() of IWebBox, or can define other functions that can be used inside these functions. These functions replace *************** *** 170,179 **** vars of the webox with default values. Previously, this was done in the onParse() with a statement like this: ! if (!isset($session->Vars["state_var"])) ! { ! $session->Vars["state_var"] = "initial_value"; ! } Now it should be done in the init() function, like this: ! $this->addSVar("state_var", "initial_value"); --- 170,179 ---- vars of the webox with default values. Previously, this was done in the onParse() with a statement like this: ! if (!isset($session->Vars["state_var"])) ! { ! $session->Vars["state_var"] = "initial_value"; ! } Now it should be done in the init() function, like this: ! $this->addSVar("state_var", "initial_value"); *************** *** 182,193 **** persistent vars). Inside the class of the webox, its state vars can be accessed like this: ! $this->addSVar ($var_name, $var_value); ! $this->addSVars($associated_array); ! $this->setSVar ($var_name, $var_value); ! $this->setSVars($associated_array); ! $var_value = $this->getSVar($var_name); ! $assoc_arr = $this->getSVars(); These variables can be accessed inside the webox in the usual way: ! {{var_name}} and they are valid only in the scope of this webox (and shadow any other {{variables}} with the same name that are defined in the --- 182,193 ---- persistent vars). Inside the class of the webox, its state vars can be accessed like this: ! $this->addSVar ($var_name, $var_value); ! $this->addSVars($associated_array); ! $this->setSVar ($var_name, $var_value); ! $this->setSVars($associated_array); ! $var_value = $this->getSVar($var_name); ! $assoc_arr = $this->getSVars(); These variables can be accessed inside the webox in the usual way: ! {{var_name}} and they are valid only in the scope of this webox (and shadow any other {{variables}} with the same name that are defined in the *************** *** 196,207 **** In case that some state variable of a webox needs to be used from the template of another webox, they can be accessed like this: ! {{boxID->var_name}} From the JS code as well, they can be accessed like this: ! session.setVar("boxID->var_name", var_value); etc. Also, when you need to access the state var of another box from the PHP code of this webox, you can use this function: ! $var_value = WebApp::getSVar("otherBoxID->var_name"); The function $var_value=WebApp::getSVar($var_name) can also be used to get the session variables (instead of --- 196,207 ---- In case that some state variable of a webox needs to be used from the template of another webox, they can be accessed like this: ! {{boxID->var_name}} From the JS code as well, they can be accessed like this: ! session.setVar("boxID->var_name", var_value); etc. Also, when you need to access the state var of another box from the PHP code of this webox, you can use this function: ! $var_value = WebApp::getSVar("otherBoxID->var_name"); The function $var_value=WebApp::getSVar($var_name) can also be used to get the session variables (instead of *************** *** 224,238 **** * - The framework supports WebClasses and WebObjects. ! <WebClass ID="className" Path="path/to/className.php"> ! <Parameter name="param1" default="default value" /> ! <Parameter name="param2" /> ! <!--# . . . . . . . . . . . . . . . . #--> ! <!--# the template of the web class #--> ! <!--# . . . . . . . . . . . . . . . . #--> ! </WebClass> ! <WebObject Class="className" name="wObj1" param1="value1" param2="value2" /> ! <WebObject Class="className" name="wObj2" param2="value2" /> ! <WebObject Class="className" name="wObj3" param1="{{nr}}+1" param2="red" /> The element <WebClass> defines a web class, but it by itself --- 224,238 ---- * - The framework supports WebClasses and WebObjects. ! <WebClass ID="className" Path="path/to/className.php"> ! <Parameter name="param1" default="default value" /> ! <Parameter name="param2" /> ! <!--# . . . . . . . . . . . . . . . . #--> ! <!--# the template of the web class #--> ! <!--# . . . . . . . . . . . . . . . . #--> ! </WebClass> ! <WebObject Class="className" name="wObj1" param1="value1" param2="value2" /> ! <WebObject Class="className" name="wObj2" param2="value2" /> ! <WebObject Class="className" name="wObj3" param1="{{nr}}+1" param2="red" /> The element <WebClass> defines a web class, but it by itself *************** *** 277,315 **** ------------- The file "className.php", if it egzists, contains this class definition: ! <? ! class className extends WebObject ! { ! . . . . . ! } ! ?> Where 'WebObject' is a class defined by the framework that supplies some useful functionality for all webclasses. This functionality is: 1 - The callback functions that are called by the framework at ! certain moments during the time that the webobject is processesed. ! These callback functions are: ! + init() ! + on_eventName($event_args) ! + eventHandler($event) ! + onParse() ! + onRender() ! 2 - The ability to keep persistent variables that define the ! state of the object. These state variables can be used ! inside the "className" like this: ! + $this->addSVar($var_name, $var_value); ! + $this->addSVar($var_name, $var_value, "DB"); ! + $this->setSVar($var_name, $var_value); ! + $this->setSVars($var_name, $var_value); ! + $var_value = $this->getSVar($var_name); ! + $arr_values = $this->getSVars($var_name); ! + etc. ! Outside the scope of the WebClass, these state variables can ! be accessed like this: ! + WebApp::setSVar("className::objName->var_name", "var_value") ! + $var_value = WebApp::getSVar("className::objName->var_name"); ! + {{className::objName->var_name}} (in templates) ! + session.setVar("className::objName->var_name", "var_value") ! + etc. --- 277,315 ---- ------------- The file "className.php", if it egzists, contains this class definition: ! <? ! class className extends WebObject ! { ! . . . . . ! } ! ?> Where 'WebObject' is a class defined by the framework that supplies some useful functionality for all webclasses. This functionality is: 1 - The callback functions that are called by the framework at ! certain moments during the time that the webobject is processesed. ! These callback functions are: ! + init() ! + on_eventName($event_args) ! + eventHandler($event) ! + onParse() ! + onRender() ! 2 - The ability to keep persistent variables that define the ! state of the object. These state variables can be used ! inside the "className" like this: ! + $this->addSVar($var_name, $var_value); ! + $this->addSVar($var_name, $var_value, "DB"); ! + $this->setSVar($var_name, $var_value); ! + $this->setSVars($var_name, $var_value); ! + $var_value = $this->getSVar($var_name); ! + $arr_values = $this->getSVars($var_name); ! + etc. ! Outside the scope of the WebClass, these state variables can ! be accessed like this: ! + WebApp::setSVar("className::objName->var_name", "var_value") ! + $var_value = WebApp::getSVar("className::objName->var_name"); ! + {{className::objName->var_name}} (in templates) ! + session.setVar("className::objName->var_name", "var_value") ! + etc. *************** *** 319,329 **** <WebClass>-es and <WebObject>-s. When the framework parses: <WebBox ID="boxID"> ! . . . . . ! </WebBox> it interprets it as: <WebClass ID="boxID"> ! . . . . . ! </WebClass> ! <WebObject Class="boxID" /> and the ID of the created object, instead of being "className::objName" is just "boxID", so it is handled the same as before --- 319,329 ---- <WebClass>-es and <WebObject>-s. When the framework parses: <WebBox ID="boxID"> ! . . . . . ! </WebBox> it interprets it as: <WebClass ID="boxID"> ! . . . . . ! </WebClass> ! <WebObject Class="boxID" /> and the ID of the created object, instead of being "className::objName" is just "boxID", so it is handled the same as before *************** *** 342,350 **** -------- webobject vars -------------------------- * - The framework declares for each webobject these variables: ! {{obj_id}} -- the object id ({{class_name}}::{{obj_name}}) ! {{class_name}} -- the name of the class ! {{obj_name}} -- the name of the object ! {{obj_count}} -- counts the objects of the same class, ! starting from 1 These vars can be used inside the template of the webclass, if the webclass designer needs them, e.g.: --- 342,350 ---- -------- webobject vars -------------------------- * - The framework declares for each webobject these variables: ! {{obj_id}} -- the object id ({{class_name}}::{{obj_name}}) ! {{class_name}} -- the name of the class ! {{obj_name}} -- the name of the object ! {{obj_count}} -- counts the objects of the same class, ! starting from 1 These vars can be used inside the template of the webclass, if the webclass designer needs them, e.g.: *************** *** 365,369 **** in the same folder with the <WebBox>. If it exists there, then the framework includes a line like this in the <head> of the page: ! <script language='javascript' src='path/to/box_id.js'></script> Similarly, for the CSS code, the framework includes a line like --- 365,369 ---- in the same folder with the <WebBox>. If it exists there, then the framework includes a line like this in the <head> of the page: ! <script language='javascript' src='path/to/box_id.js'></script> Similarly, for the CSS code, the framework includes a line like Index: variables.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/variables.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** variables.txt 23 Feb 2003 14:29:07 -0000 1.2 --- variables.txt 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 58,62 **** A variable is declared by the <Var> element like this: ! <Var name="var_name">expression</Var> and it adds a new variable in the current scope. 'expression' is a php expression that may contain other {{#variables}}. --- 58,62 ---- A variable is declared by the <Var> element like this: ! <Var name="var_name">expression</Var> and it adds a new variable in the current scope. 'expression' is a php expression that may contain other {{#variables}}. *************** *** 126,137 **** 1 - First the current scope is searched for it. 2 - If it is not found, then the scope above it is searched, ! and so on until it is found. 3 - If it is not found in any scope, then session variables ! are searched for it. 4 - If it not found among session variables, then global ! variables of PHP are searched for it. 5 - If it is not found there, then constants of PHP are searched. 6 - If it still is not found then its name is taken as its value ! (e.g. {{#var1}} is replaced by "var1"). --- 126,137 ---- 1 - First the current scope is searched for it. 2 - If it is not found, then the scope above it is searched, ! and so on until it is found. 3 - If it is not found in any scope, then session variables ! are searched for it. 4 - If it not found among session variables, then global ! variables of PHP are searched for it. 5 - If it is not found there, then constants of PHP are searched. 6 - If it still is not found then its name is taken as its value ! (e.g. {{#var1}} is replaced by "var1"). Index: transitions.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/transitions.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** transitions.txt 21 Feb 2003 08:18:32 -0000 1.1.1.1 --- transitions.txt 20 Aug 2003 07:31:55 -0000 1.2 *************** *** 3,7 **** =========== ! What is a Transition --------------------- --- 3,7 ---- =========== ! What is a Transition --------------------- *************** *** 40,46 **** application). These data validations can be done in the client-side by using a javascript function. For example: ! <a href="javascript: on_link()"> Link </a> ! <input type="button" value="Button" onClick="on_button()"> ! <form onSubmit="on_submit(); return false;"> The functions on_link(), on_button() and on_submit() usually do some client-side validations and error checkings and then, if everything --- 40,46 ---- application). These data validations can be done in the client-side by using a javascript function. For example: ! <a href="javascript: on_link()"> Link </a> ! <input type="button" value="Button" onClick="on_button()"> ! <form onSubmit="on_submit(); return false;"> The functions on_link(), on_button() and on_submit() usually do some client-side validations and error checkings and then, if everything *************** *** 51,57 **** ----------------------------------------- Like usual links which can send variables to the server, like this: ! <a href="page1.php?var1=val1&var2=val2"> Link </a> a transition can send variables as well: ! <a href="javascript: GoTo('page1.html?var1=val1&var2=val2')"> Link </a> These variables will be declared as PHP global variables by the framework and may be used in the PHP code of the application. However --- 51,57 ---- ----------------------------------------- Like usual links which can send variables to the server, like this: ! <a href="page1.php?var1=val1&var2=val2"> Link </a> a transition can send variables as well: ! <a href="javascript: GoTo('page1.html?var1=val1&var2=val2')"> Link </a> These variables will be declared as PHP global variables by the framework and may be used in the PHP code of the application. However *************** *** 66,70 **** application a server-side event that should be handled by the application. The format of an event variable is like this: ! event=targetBox.eventName(arg1=val1;arg2=val2;arg3=val3) When the framework gets the variable 'event', it builds an object of class Event and forwards it to the appropriate WebBox for handling. --- 66,70 ---- application a server-side event that should be handled by the application. The format of an event variable is like this: ! event=targetBox.eventName(arg1=val1;arg2=val2;arg3=val3) When the framework gets the variable 'event', it builds an object of class Event and forwards it to the appropriate WebBox for handling. *************** *** 86,89 **** usually submits to its action, by not using a transition. To overcome this, we should declare the form like this: ! <form name="form1" onSubmit="return false;"> or ! <form name="form1" onSubmit="on_submit(); return false;"> --- 86,89 ---- usually submits to its action, by not using a transition. To overcome this, we should declare the form like this: ! <form name="form1" onSubmit="return false;"> or ! <form name="form1" onSubmit="on_submit(); return false;"> Index: templates.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/templates.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** templates.txt 23 Feb 2003 14:29:07 -0000 1.2 --- templates.txt 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 4,63 **** NOTE: For almost every element, the opening and closing tags ! are required to be in a single line and alone, in order to ! be processed correctly, like this: ! <Element> ! Element content here. ! </Element> ! This restriction is imposed by the current implementation ! and will be removed later when the templates will be ! processed using an XML parser. ! ! Also, the names of the elements and the attributes are ! case sensitive and they must be used the same as they are ! in the documentation. E.g. if you use <recordset> instead ! if <Recordset> it will not work. ! * Comments ========== ! <!--# Comments are denoted like this #--> ! <!--# diesis at the beginning, diesis at the end #--> ! <!--# ! Such comments are not included ! in the XHTML file that is generated ! and sent to the browser. ! #--> ! <!-- ! Usual XHTML comments (like this one) are passed to ! the XHTML file that is generated from the template. ! --> ! ! Note: For the time being, the beginning of the comment ! requires an empty space after it "<!--# " in order to be ! recognized as a comment, and everything in the line ! of the closing comment "#-->", even after it, is treated ! as a comment and is discarded. This restrictions come from ! the current implementation and later they will be removed. * Include elements ================== ! <Include SRC="templates/header.html"/> ! <Include SRC="{{#content_file}}"/> ! <!--# ! The <Include> element is used to include a template ! inside another template. This provides to the application ! modularity and more flexibility. ! ! The modularity consists in breaking a large page into ! smaller templates, and in using the same template in ! several pages. ! ! The flexibility consists in this: the file that will be ! included may be a variable (or may contain variables), so ! different files may be included in the same place of the page, ! according to the logic of the application. ! #--> --- 4,63 ---- NOTE: For almost every element, the opening and closing tags ! are required to be in a single line and alone, in order to ! be processed correctly, like this: ! <Element> ! Element content here. ! </Element> ! This restriction is imposed by the current implementation ! and will be removed later when the templates will be ! processed using an XML parser. ! ! Also, the names of the elements and the attributes are ! case sensitive and they must be used the same as they are ! in the documentation. E.g. if you use <recordset> instead ! if <Recordset> it will not work. ! * Comments ========== ! <!--# Comments are denoted like this #--> ! <!--# diesis at the beginning, diesis at the end #--> ! <!--# ! Such comments are not included ! in the XHTML file that is generated ! and sent to the browser. ! #--> ! <!-- ! Usual XHTML comments (like this one) are passed to ! the XHTML file that is generated from the template. ! --> ! ! Note: For the time being, the beginning of the comment ! requires an empty space after it "<!--# " in order to be ! recognized as a comment, and everything in the line ! of the closing comment "#-->", even after it, is treated ! as a comment and is discarded. This restrictions come from ! the current implementation and later they will be removed. * Include elements ================== ! <Include SRC="templates/header.html"/> ! <Include SRC="{{#content_file}}"/> ! <!--# ! The <Include> element is used to include a template ! inside another template. This provides to the application ! modularity and more flexibility. ! ! The modularity consists in breaking a large page into ! smaller templates, and in using the same template in ! several pages. ! ! The flexibility consists in this: the file that will be ! included may be a variable (or may contain variables), so ! different files may be included in the same place of the page, ! according to the logic of the application. ! #--> *************** *** 65,276 **** ================= ! <Repeat rs="rsID"> ! <IfEmpty> ! <!--# <IfEmpty> is included in the page in case ! that recordset specified has no records #--> ! <tr> ! <td>No articles found!</td> ! </tr> ! </IfEmpty> ! <Header> ! <!--# <Header> is processed before ! the repeated part (only once) #--> ! </Header> ! <RepeatBody> ! <!--# ! Here comes the part that is repeated ! for each record in the recordset. The tag ! <RepeatBody> is optional and may be omitted ! #--> ! <tr> ! <td> {{#TI}} </td> ! <td> {{#AU}} </td> ! . . . ! </tr> ! </RepeatBody> ! <Separator> ! <!--# <Separator> is processed between ! two repetitions of the <RepeatBody> #--> ! <tr><td colspan="3"> <hr width="90%"> </td></tr> ! </Separator> ! <Footer> ! <!--# <Footer> is processed after ! the repeated part (only once) #--> ! </Footer> ! </Repeat> ! ! <!--# ! The <Repeat> element is connected with a recordset by the attribute ! "rs". Its body is processed for each row of the recordset. Before ! processing the content for a certain row, all the fields of the recordset ! are declared as variables with values taken from the current record. ! In case that the recordset is empty, then the element <IfEmpty> is ! processed instead. It is optional. ! ! The elements <Header> and <Footer> are processed before the ! repetition starts and after the repetition is done. They are ! optional. ! ! The <Separator> element is processed between two repetitions ! of the body of the <Repeat>. It is optional. ! ! Everything inside the <Repeat> element and outside the ! elements <IfEmpty>, <Header>, <Footer> and <Separator> is ! considered as body of the <Repeat> and is processed for ! each record of the recordset. To make it more readable, the ! tags <RepeatBody> and </RepeatBody> may be used, but they ! are just "syntactic sugar" and don't influence anything; ! they are optional and may be omitted. ! #--> * <If> element =============== ! <If condition="!{{#logged}}"> ! <!--# login template comes here #--> ! <!--# . . . . . . . . . . . . . #--> ! </If> ! <!--# ! The content of the <If> element is processed conditionally: ! if the value of the attribute "condition" is true, then it ! is processed, otherwise it is not processed. ! The value of the condition is calculated as a PHP expression ! (after the template variables have been replaced). ! #--> * <Recordset> elements ======================= ! <Recordset ID="rsID"> ! <Query> select {{#R_NAME}} from table </Query> ! </Recordset> ! <!--# ! Each recordset has a unique ID. Later, when we use ! this recordset (e.g. in a <Repeat> element) we refer ! to it by this ID. It also has a <Query> element, which ! is executed using the default database connection. ! ! The query may contain variables, which are replaced at ! the time that the query is executed. ! #--> ! ! <Recordset ID="doc"> ! <Query> ! Select NAME_D, ! SURNAME_D ! From DOCTOR ! Where condition ! Group By field ! </Query> ! </Recordset> ! <--# ! If the query is a big one, then it can be declared in several ! lines (in order to be more readable and editable). ! #--> * Recordsets that are displayed over several pages =================================================== ! <Recordset ID="art" recs_per_page="10"> ! <Query>{{#ART_QUERY}}</Query> ! </Recordset> ! ! <!--# ! Recordsets that have a "recs_per_page" attribute are ! recordsets that are displayed over several pages. ! It retrievs from the database only one page at a time, ! out of all the results that the query may return. ! A page is a group of consecutive records, all the pages ! have the same number of records and they form a partition ! of all the records of the query. ! ! In this case some additional variables are declared ! which show which records are being displayed, how many ! pages are there, and at which page we are currently. ! These variables are declared during the processing of the ! <Repeat> elements, and are usually used in <Header> and <Footer>. ! These variables are: ! {{#FirstRec}} -- the number of the first record of the page ! {{#LastRec}} -- the number of the last record of the page ! {{#AllRecs}} -- the number of all records that can be retrieved by the query ! {{#CurrPage}} -- current page of records that is retrieved ! {{#NextPage}} -- the number of the next page ! {{#PrevPage}} -- the number of the previous page ! {{#LastPage}} -- the number of the last page ! ! Also, the following variables are declared each time ! that the body of the <Repeat> element is processed: ! {{#CurrentRecNr}} -- the number of the current record ! {{#CurrentRowNr}} -- the number of the current row ! (These can be used to define other variables, like this: ! <Var name="bgColor">({{#CurrentRowNr}}==5 ? "red" : "grey")</Var> ! and then use {{#bgColor}} ) ! #--> * <Var> elements ================= ! <Var name="SUM">{{#field1}} + {{#field2}} + {{#field3}}</Var> ! <Var name="ROW_COLOR">({{#CurrentRowNr}}%2 ? "tabgrey" : "tabwhite")</Var> ! <tr class="{{#ROW_COLOR}}"> . . . </tr> ! ! <!--# ! <Var> elements declare variables that can be used anywhere in the ! template in the current scope and in the scopes inside it. They ! are identified by their name, and their value is calculated using ! their content. The value of a variable is calculated in this way: ! first, any template variable inside them is found and replaced, ! then the resulting string is evaluated as a PHP expression. ! A variable defined by <Var> is evaluated at the time that ! it is processed, so that if a variable is inside a <Repeat> ! element, then it may have different values for different ! iterations. ! ! Note: All the <Var> element must be declared in a single line, ! in order to be processed correctly. This restriction is ! imposed by the current implementation and it will be ! removed later. ! #--> * Template {{#variables}} ========================= ! <!--# ! Anywhere in XML where we can put character data, ! we can also put {{#variables}}, which are replaced ! by their string values at the time of template ! processing and conversion to XHTML. ! ! For more details see the file: 'variables.txt' . ! ! Note: The current implementation actually is not based on ! XML parsing, and the variables are recognized and ! replaced only in certain attributes (which are indicated ! in the documentation) and in every line that is not ! part of a framework tag (is not inside the <tag denoters>). ! #--> ! ! * WebBox-es ============ ! <WebBox ID="boxID"> ! <!-- content of WebBox --> ! </WebBox> ! <!--# ! A WebBox is a template which has also its own PHP code, which ! handles its server-side logic. It is an almost self-contained ! and independent template which can be easily included in other ! pages or in other projects. ! ! For more details see the file: 'webox.txt' . #--> --- 65,276 ---- ================= ! <Repeat rs="rsID"> ! <IfEmpty> ! <!--# <IfEmpty> is included in the page in case ! that recordset specified has no records #--> ! <tr> ! <td>No articles found!</td> ! </tr> ! </IfEmpty> ! <Header> ! <!--# <Header> is processed before ! the repeated part (only once) #--> ! </Header> ! <RepeatBody> ! <!--# ! Here comes the part that is repeated ! for each record in the recordset. The tag ! <RepeatBody> is optional and may be omitted ! #--> ! <tr> ! <td> {{#TI}} </td> ! <td> {{#AU}} </td> ! . . . ! </tr> ! </RepeatBody> ! <Separator> ! <!--# <Separator> is processed between ! two repetitions of the <RepeatBody> #--> ! <tr><td colspan="3"> <hr width="90%"> </td></tr> ! </Separator> ! <Footer> ! <!--# <Footer> is processed after ! the repeated part (only once) #--> ! </Footer> ! </Repeat> ! ! <!--# ! The <Repeat> element is connected with a recordset by the attribute ! "rs". Its body is processed for each row of the recordset. Before ! processing the content for a certain row, all the fields of the recordset ! are declared as variables with values taken from the current record. ! In case that the recordset is empty, then the element <IfEmpty> is ! processed instead. It is optional. ! ! The elements <Header> and <Footer> are processed before the ! repetition starts and after the repetition is done. They are ! optional. ! ! The <Separator> element is processed between two repetitions ! of the body of the <Repeat>. It is optional. ! ! Everything inside the <Repeat> element and outside the ! elements <IfEmpty>, <Header>, <Footer> and <Separator> is ! considered as body of the <Repeat> and is processed for ! each record of the recordset. To make it more readable, the ! tags <RepeatBody> and </RepeatBody> may be used, but they ! are just "syntactic sugar" and don't influence anything; ! they are optional and may be omitted. ! #--> * <If> element =============== ! <If condition="!{{#logged}}"> ! <!--# login template comes here #--> ! <!--# . . . . . . . . . . . . . #--> ! </If> ! <!--# ! The content of the <If> element is processed conditionally: ! if the value of the attribute "condition" is true, then it ! is processed, otherwise it is not processed. ! The value of the condition is calculated as a PHP expression ! (after the template variables have been replaced). ! #--> * <Recordset> elements ======================= ! <Recordset ID="rsID"> ! <Query> select {{#R_NAME}} from table </Query> ! </Recordset> ! <!--# ! Each recordset has a unique ID. Later, when we use ! this recordset (e.g. in a <Repeat> element) we refer ! to it by this ID. It also has a <Query> element, which ! is executed using the default database connection. ! ! The query may contain variables, which are replaced at ! the time that the query is executed. ! #--> ! ! <Recordset ID="doc"> ! <Query> ! Select NAME_D, ! SURNAME_D ! From DOCTOR ! Where condition ! Group By field ! </Query> ! </Recordset> ! <--# ! If the query is a big one, then it can be declared in several ! lines (in order to be more readable and editable). ! #--> * Recordsets that are displayed over several pages =================================================== ! <Recordset ID="art" recs_per_page="10"> ! <Query>{{#ART_QUERY}}</Query> ! </Recordset> ! ! <!--# ! Recordsets that have a "recs_per_page" attribute are ! recordsets that are displayed over several pages. ! It retrievs from the database only one page at a time, ! out of all the results that the query may return. ! A page is a group of consecutive records, all the pages ! have the same number of records and they form a partition ! of all the records of the query. ! ! In this case some additional variables are declared ! which show which records are being displayed, how many ! pages are there, and at which page we are currently. ! These variables are declared during the processing of the ! <Repeat> elements, and are usually used in <Header> and <Footer>. ! These variables are: ! {{#FirstRec}} -- the number of the first record of the page ! {{#LastRec}} -- the number of the last record of the page ! {{#AllRecs}} -- the number of all records that can be retrieved by the query ! {{#CurrPage}} -- current page of records that is retrieved ! {{#NextPage}} -- the number of the next page ! {{#PrevPage}} -- the number of the previous page ! {{#LastPage}} -- the number of the last page ! ! Also, the following variables are declared each time ! that the body of the <Repeat> element is processed: ! {{#CurrentRecNr}} -- the number of the current record ! {{#CurrentRowNr}} -- the number of the current row ! (These can be used to define other variables, like this: ! <Var name="bgColor">({{#CurrentRowNr}}==5 ? "red" : "grey")</Var> ! and then use {{#bgColor}} ) ! #--> * <Var> elements ================= ! <Var name="SUM">{{#field1}} + {{#field2}} + {{#field3}}</Var> ! <Var name="ROW_COLOR">({{#CurrentRowNr}}%2 ? "tabgrey" : "tabwhite")</Var> ! <tr class="{{#ROW_COLOR}}"> . . . </tr> ! ! <!--# ! <Var> elements declare variables that can be used anywhere in the ! template in the current scope and in the scopes inside it. They ! are identified by their name, and their value is calculated using ! their content. The value of a variable is calculated in this way: ! first, any template variable inside them is found and replaced, ! then the resulting string is evaluated as a PHP expression. ! A variable defined by <Var> is evaluated at the time that ! it is processed, so that if a variable is inside a <Repeat> ! element, then it may have different values for different ! iterations. ! ! Note: All the <Var> element must be declared in a single line, ! in order to be processed correctly. This restriction is ! imposed by the current implementation and it will be ! removed later. ! #--> * Template {{#variables}} ========================= ! <!--# ! Anywhere in XML where we can put character data, ! we can also put {{#variables}}, which are replaced ! by their string values at the time of template ! processing and conversion to XHTML. ! ! For more details see the file: 'variables.txt' . ! ! Note: The current implementation actually is not based on ! XML parsing, and the variables are recognized and ! replaced only in certain attributes (which are indicated ! in the documentation) and in every line that is not ! part of a framework tag (is not inside the <tag denoters>). ! #--> ! ! * WebBox-es ============ ! <WebBox ID="boxID"> ! <!-- content of WebBox --> ! </WebBox> ! <!--# ! A WebBox is a template which has also its own PHP code, which ! handles its server-side logic. It is an almost self-contained ! and independent template which can be easily included in other ! pages or in other projects. ! ! For more details see the file: 'webox.txt' . #--> *************** *** 287,291 **** * - The syntax of tag Recordset now is: ! <Recordset ID="rsID" type="rsType"> where 'rsType' can be one of the values: "StaticRS", "DynamicRS", "EditableRS", "PagedRS", "TableRS". The attibute type can be --- 287,291 ---- * - The syntax of tag Recordset now is: ! <Recordset ID="rsID" type="rsType"> where 'rsType' can be one of the values: "StaticRS", "DynamicRS", "EditableRS", "PagedRS", "TableRS". The attibute type can be *************** *** 318,331 **** listing and you get the files and folders using some PHP functions). ! This feature can be used in the "folderListing" webbox, for ! example. Instead of generating all the html code of the ! folder listing programatically, a <Repeat> template, associated ! with a <Recordset> could be used, and this recordset could be ! filled from an array or from php code (instead of being filled ! from database). ! The benefit of this aproach (vs. generatin all the html code ! in php) would be that we are able to change the layout of the ! 'folderListing' webbox more easily, because instead of changing ! the php code, we change only a template. -------------------------------------------------------------- --- 318,331 ---- listing and you get the files and folders using some PHP functions). ! This feature can be used in the "folderListing" webbox, for ! example. Instead of generating all the html code of the ! folder listing programatically, a <Repeat> template, associated ! with a <Recordset> could be used, and this recordset could be ! filled from an array or from php code (instead of being filled ! from database). ! The benefit of this aproach (vs. generatin all the html code ! in php) would be that we are able to change the layout of the ! 'folderListing' webbox more easily, because instead of changing ! the php code, we change only a template. -------------------------------------------------------------- *************** *** 357,365 **** * - The expression of the <Var> tag can now be declared in several lines, like this: ! <Var name="class"> ! ( ! "{{item}}"=="{{{{obj_id}}->selected_item}}" ? ! "leftMenu-item-selected" ! :"leftMenu-item" ! ) ! </Var> --- 357,365 ---- * - The expression of the <Var> tag can now be declared in several lines, like this: ! <Var name="class"> ! ( ! "{{item}}"=="{{{{obj_id}}->selected_item}}" ? ! "leftMenu-item-selected" ! :"leftMenu-item" ! ) ! </Var> Index: session.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/session.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** session.txt 23 Feb 2003 14:29:07 -0000 1.2 --- session.txt 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 65,72 **** <script language="JavaScript" src="class.Session.js"></script> <script language='JavaScript'> ! session = new Session(); ! session.addVar('ID_S','IP: 192.168.1.2; DATE: 2001/11/01/ 00:24:33'); ! session.addVar('var1','val1'); ! session.addVar('var2','val2'); </script> --- 65,72 ---- <script language="JavaScript" src="class.Session.js"></script> <script language='JavaScript'> ! session = new Session(); ! session.addVar('ID_S','IP: 192.168.1.2; DATE: 2001/11/01/ 00:24:33'); ! session.addVar('var1','val1'); ! session.addVar('var2','val2'); </script> *************** *** 83,89 **** and its functions: ! session.addVar(var_name, var_value) //ads a new variable ! session.getVar(var_name) //get the value of a variable ! session.setVar(var_name, var_value) //set the value of a variable --- 83,89 ---- and its functions: ! session.addVar(var_name, var_value) //ads a new variable ! session.getVar(var_name) //get the value of a variable ! session.setVar(var_name, var_value) //set the value of a variable *************** *** 114,125 **** persistent vars). Inside the class of the webox, its state vars can be accessed like this: ! $this->addSVar ($var_name, $var_value); ! $this->addSVars($associated_array); ! $this->setSVar ($var_name, $var_value); ! $this->setSVars($associated_array); ! $var_value = $this->getSVar($var_name); ! $assoc_arr = $this->getSVars(); These variables can be accessed inside the webox in the usual way: ! {{var_name}} and they are valid only in the scope of this webox (and shadow any other {{variables}} with the same name that are defined in the --- 114,125 ---- persistent vars). Inside the class of the webox, its state vars can be accessed like this: ! $this->addSVar ($var_name, $var_value); ! $this->addSVars($associated_array); ! $this->setSVar ($var_name, $var_value); ! $this->setSVars($associated_array); ! $var_value = $this->getSVar($var_name); ! $assoc_arr = $this->getSVars(); These variables can be accessed inside the webox in the usual way: ! {{var_name}} and they are valid only in the scope of this webox (and shadow any other {{variables}} with the same name that are defined in the *************** *** 128,139 **** In case that some state variable of a webox needs to be used from the template of another webox, they can be accessed like this: ! {{boxID->var_name}} From the JS code as well, they can be accessed like this: ! session.setVar("boxID->var_name", var_value); etc. Also, when you need to access the state var of another box from the PHP code of this webox, you can use this function: ! $var_value = WebApp::getSVar("otherBoxID->var_name"); The function $var_value=WebApp::getSVar($var_name) can also be used to get the session variables (instead of --- 128,139 ---- In case that some state variable of a webox needs to be used from the template of another webox, they can be accessed like this: ! {{boxID->var_name}} From the JS code as well, they can be accessed like this: ! session.setVar("boxID->var_name", var_value); etc. Also, when you need to access the state var of another box from the PHP code of this webox, you can use this function: ! $var_value = WebApp::getSVar("otherBoxID->var_name"); The function $var_value=WebApp::getSVar($var_name) can also be used to get the session variables (instead of *************** *** 163,190 **** in JS have been changed so that they are more consistent with the other function names in framework. Now they are: ! session.addVar("var_name", "var_value"); ! session.rmVar("var_name"); ! session.setVar("var_name", "var_value"); ! session.getVar("var_name"); * - The names of the functions of the session object are: ! $session->addVar($var_name, $var_value); ! $session->rmVar($var_name); //removes a variable from session ! $session->setVar($var_name, $var_value); //sets a new value ! $session->getVar($var_name); //get the value of the var The names of the functions for the state vars of a webox are: ! $this->addSVar($var_name, $var_value); ! $this->addSVars($arr_vars); ! $this->setSVar($var_name, $var_value); ! $this->setSVars($arr_vars); ! $this->getSVar($var_value); ! $this->getSVars(); The session and state vars can also be accessed using this functions: ! WebApp::addSVar($var_name, $var_value); ! WebApp::setSVar($var_name, $var_value); ! WebApp::getSVar($var_name); ! * - DB Session Vars (or DB State Vars) --- 163,190 ---- in JS have been changed so that they are more consistent with the other function names in framework. Now they are: ! session.addVar("var_name", "var_value"); ! session.rmVar("var_name"); ! session.setVar("var_name", "var_value"); ! session.getVar("var_name"); * - The names of the functions of the session object are: ! $session->addVar($var_name, $var_value); ! $session->rmVar($var_name); //removes a variable from session ! $session->setVar($var_name, $var_value); //sets a new value ! $session->getVar($var_name); //get the value of the var The names of the functions for the state vars of a webox are: ! $this->addSVar($var_name, $var_value); ! $this->addSVars($arr_vars); ! $this->setSVar($var_name, $var_value); ! $this->setSVars($arr_vars); ! $this->getSVar($var_value); ! $this->getSVars(); The session and state vars can also be accessed using this functions: ! WebApp::addSVar($var_name, $var_value); ! WebApp::setSVar($var_name, $var_value); ! WebApp::getSVar($var_name); ! * - DB Session Vars (or DB State Vars) *************** *** 201,210 **** var, but add a third parameter that is not false, like this: ! $session->addVar($var_name, $var_value, true); ! $session->addVar($var_name, $var_value, "DB"); ! $session->addVar($var_name, $var_value, "secure"); etc. ! $this->addSVar($var_name, $var_value,"DB"); ! WebApp::addSVar($var_name, $var_value, "DB"); To change or get the value of a DB variable we use the same "set" --- 201,210 ---- var, but add a third parameter that is not false, like this: ! $session->addVar($var_name, $var_value, true); ! $session->addVar($var_name, $var_value, "DB"); ! $session->addVar($var_name, $var_value, "secure"); etc. ! $this->addSVar($var_name, $var_value,"DB"); ! WebApp::addSVar($var_name, $var_value, "DB"); To change or get the value of a DB variable we use the same "set" *************** *** 219,224 **** The array: '$session->dbVars' can be used to access the DB vars as well, like this: ! $session->dbVars[$var_name] = $var_value; ! $var_value = $session->dbVars[$var_name]; but it is not neccessary and it is not recomended to use it (in fact, it is discouraged to use it). --- 219,224 ---- The array: '$session->dbVars' can be used to access the DB vars as well, like this: ! $session->dbVars[$var_name] = $var_value; ! $var_value = $session->dbVars[$var_name]; but it is not neccessary and it is not recomended to use it (in fact, it is discouraged to use it). Index: new_app.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/new_app.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** new_app.txt 23 Feb 2003 14:29:07 -0000 1.2 --- new_app.txt 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 27,39 **** <? $app_path = dirname(__FILE__); ! $app_path = str_replace("\\", "/", $app_path); //could be a Windows path ! define("APP_PATH", $app_path."/"); ! define("CONFIG_PATH", APP_PATH."config/"); include CONFIG_PATH."const.Paths.php"; //include configuration constants include CONFIG_PATH."const.Settings.php"; ! if (USES_DB) include CONFIG_PATH."const.DB.php"; //include the WebApp framework --- 27,39 ---- <? $app_path = dirname(__FILE__); ! $app_path = str_replace("\\", "/", $app_path); //could be a Windows path ! define("APP_PATH", $app_path."/"); ! define("CONFIG_PATH", APP_PATH."config/"); include CONFIG_PATH."const.Paths.php"; //include configuration constants include CONFIG_PATH."const.Settings.php"; ! if (USES_DB) include CONFIG_PATH."const.DB.php"; //include the WebApp framework *************** *** 61,77 **** if ($event->targetPage==UNDEFINED) { ! //first time that the user enters in the application ! $fname = EVENTHANDLER_PATH."on.firstTime.php"; ! if (file_exists($fname)) ! { ! include $fname; ! on_firstTime(); ! } } if ($event->target=="none") { ! //call the free event ! WebApp::callFreeEvent($event); } --- 61,77 ---- if ($event->targetPage==UNDEFINED) { ! //first time that the user enters in the application ! $fname = EVENTHANDLER_PATH."on.firstTime.php"; ! if (file_exists($fname)) ! { ! include $fname; ! on_firstTime(); ! } } if ($event->target=="none") { ! //call the free event ! WebApp::callFreeEvent($event); } *************** *** 97,104 **** <? //constants of the paths in the application ! define("APP_URL", "/phpWebApp/app1/"); ! define("WEBAPP_PATH", APP_PATH."../web_app/"); ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("TPL_PATH", APP_PATH."templates/"); ?> --- 97,104 ---- <? //constants of the paths in the application ! define("APP_URL", "/phpWebApp/app1/"); ! define("WEBAPP_PATH", APP_PATH."../web_app/"); ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("TPL_PATH", APP_PATH."templates/"); ?> *************** *** 130,158 **** <? //constants of the paths in the application ! define("APP_URL", "/vodafone/"); ! define("WEBAPP_PATH", "/var/www/html/web_app/"); //mix paths ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("GRAPHICS_URL", APP_URL."graphics/"); ! define("INCLUDE_PATH", APP_PATH."include_php/"); //template paths ! define("TPL_PATH", APP_PATH."templates/"); ! define("TOPMENU_PATH", TPL_PATH."topMenu/"); ! define("LEFTSIDE_PATH", TPL_PATH."leftSide/"); ! define("CONTENTMENU_PATH", TPL_PATH."contentMenu_old/"); ! define("CONTENT_PATH", TPL_PATH."content/"); ! define("DBCONTENT_PATH", TPL_PATH."dbContent/"); ! define("EDIT_PATH", TPL_PATH."edit/"); ! define("EDITMENUS_PATH", EDIT_PATH."editMenus/"); ! define("EDITDOCS_PATH", EDIT_PATH."editDocs/"); //module paths ! define("MENU_PATH", CONTENTMENU_PATH."buildMenus/"); ! define("SPONSOR_PATH", APP_PATH."modules/sponsorat/"); ! define("SNIFFER_PATH", APP_PATH."modules/clientsniffer/"); ?> --- 130,158 ---- <? //constants of the paths in the application ! define("APP_URL", "/vodafone/"); ! define("WEBAPP_PATH", "/var/www/html/web_app/"); //mix paths ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("GRAPHICS_URL", APP_URL."graphics/"); ! define("INCLUDE_PATH", APP_PATH."include_php/"); //template paths ! define("TPL_PATH", APP_PATH."templates/"); ! define("TOPMENU_PATH", TPL_PATH."topMenu/"); ! define("LEFTSIDE_PATH", TPL_PATH."leftSide/"); ! define("CONTENTMENU_PATH", TPL_PATH."contentMenu_old/"); ! define("CONTENT_PATH", TPL_PATH."content/"); ! define("DBCONTENT_PATH", TPL_PATH."dbContent/"); ! define("EDIT_PATH", TPL_PATH."edit/"); ! define("EDITMENUS_PATH", EDIT_PATH."editMenus/"); ! define("EDITDOCS_PATH", EDIT_PATH."editDocs/"); //module paths ! define("MENU_PATH", CONTENTMENU_PATH."buildMenus/"); ! define("SPONSOR_PATH", APP_PATH."modules/sponsorat/"); ! define("SNIFFER_PATH", APP_PATH."modules/clientsniffer/"); ?> *************** *** 166,192 **** define("USES_DB", false); ! //if this constant is true, the framework will load the DB component ! //and will open a default connection with the db specified in the ! //file 'config/const.DB.php' define("DEBUG_GOTO", false); ! //if this constant is true, the framework displays an alert ! //each time that the function GoTo() is called (for debug) define("DEBUG_SESSION", false); ! //if this constant is true, the framework outputs the session ! //variables as an HTML table (for debug) define("DEBUG_RECORDSETS", false); ! //if this constant is true, the framework outputs all the ! //recordsets of the page and their contents (for debug) define("DEBUG_TEMPLATES", false); ! //if this constant is true, the framework outputs the tree ! //structure of the templates of the page (for debug) define("EXECUTION_TIME_INFO", false); ! //if this constant is true, the framework outputs information ! //about the execution time of several processes (for debug) //etc. --- 166,192 ---- define("USES_DB", false); ! //if this constant is true, the framework will load the DB component ! //and will open a default connection with the db specified in the ! //file 'config/const.DB.php' define("DEBUG_GOTO", false); ! //if this constant is true, the framework displays an alert ! //each time that the function GoTo() is called (for debug) define("DEBUG_SESSION", false); ! //if this constant is true, the framework outputs the session ! //variables as an HTML table (for debug) define("DEBUG_RECORDSETS", false); ! //if this constant is true, the framework outputs all the ! //recordsets of the page and their contents (for debug) define("DEBUG_TEMPLATES", false); ! //if this constant is true, the framework outputs the tree ! //structure of the templates of the page (for debug) define("EXECUTION_TIME_INFO", false); ! //if this constant is true, the framework outputs information ! //about the execution time of several processes (for debug) //etc. *************** *** 206,213 **** function on_firstTime() { ! //initialize the event ! global $targetPage, $event; ! $targetPage = "page1.html"; ! $event->targetPage = $targetPage; } ?> --- 206,213 ---- function on_firstTime() { ! //initialize the event ! global $targetPage, $event; ! $targetPage = "page1.html"; ! $event->targetPage = $targetPage; } ?> Index: misc.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/misc.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** misc.txt 23 Feb 2003 14:33:06 -0000 1.1 --- misc.txt 20 Aug 2003 07:31:55 -0000 1.2 *************** *** 9,13 **** This function is usefull when you want to construct a page for sending it by e-mail. ! -------- external link to an application page ----------- * - The function WebApp::external_page() returns a link that can --- 9,13 ---- This function is usefull when you want to construct a page for sending it by e-mail. ! -------- external link to an application page ----------- * - The function WebApp::external_page() returns a link that can *************** *** 35,39 **** or password", or an information message, e.g. "Project Data Saved". * - The function: ! WebApp::debug_msg($msg, $comment); is added to the framework. It makes the framework to display the given message after the page is rendered. The comment is --- 35,39 ---- or password", or an information message, e.g. "Project Data Saved". * - The function: ! WebApp::debug_msg($msg, $comment); is added to the framework. It makes the framework to display the given message after the page is rendered. The comment is *************** *** 44,53 **** method is safer and cleaner. The message $msg can be a large message that contains tags, e.g. ! WebApp::debug_msg($tpl->toHtmlTable()); ! WebApp::debug_msg($rs->toHtmlTable(), "The content of recordset"); ! WebApp::debug_msg($tplVars->toHtmlTable(), ! "The content of varstack at this point"); ! WebApp::debug_msg($webPage->template_list(), ! "All the templates parsed up to this point"); etc. ----------------------------------------------------------------- --- 44,53 ---- method is safer and cleaner. The message $msg can be a large message that contains tags, e.g. ! WebApp::debug_msg($tpl->toHtmlTable()); ! WebApp::debug_msg($rs->toHtmlTable(), "The content of recordset"); ! WebApp::debug_msg($tplVars->toHtmlTable(), ! "The content of varstack at this point"); ! WebApp::debug_msg($webPage->template_list(), ! "All the templates parsed up to this point"); etc. ----------------------------------------------------------------- Index: events.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages/events.txt,v... [truncated message content] |
From: Dashamir H. <das...@us...> - 2003-08-20 08:13:24
|
Update of /cvsroot/phpwebapp/documentation/templates/user_manual In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates/user_manual Modified Files: manual_items.php Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: manual_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/user_manual/manual_items.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** manual_items.php 23 Feb 2003 14:29:07 -0000 1.2 --- manual_items.php 20 Aug 2003 07:31:55 -0000 1.3 *************** *** 5,20 **** */ $menu_items = array( ! "intro" => "Introduction", ! "templates" => "Templates", ! "transitions" => "Transitions", ! "webclass" => "WebClass-es", ! "webox" => "WebBox-es", ! "events" => "Events", ! "variables" => "Variables", ! "session" => "Session", ! "database" => "Database", ! "recordset" => "Recordsets", ! "new_app" => "Application Structure", ! "misc" => "Misc" ! ); ?> --- 5,20 ---- */ $menu_items = array( ! "intro" => "Introduction", ! "templates" => "Templates", ! "transitions" => "Transitions", ! "webclass" => "WebClass-es", ! "webox" => "WebBox-es", ! "events" => "Events", ! "variables" => "Variables", ! "session" => "Session", ! "database" => "Database", ! "recordset" => "Recordsets", ! "new_app" => "Application Structure", ! "misc" => "Misc" ! ); ?> |
From: Dashamir H. <das...@us...> - 2003-08-20 08:13:24
|
Update of /cvsroot/phpwebapp/documentation/templates/webobjects/pages In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates/webobjects/pages Modified Files: xlistbox.txt tabs.txt table.txt listbox.txt leftMenu.txt form.txt folderListing.txt dbTable.txt datebox.txt Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: xlistbox.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/xlistbox.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xlistbox.txt 23 Feb 2003 14:42:40 -0000 1.1 --- xlistbox.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 7,20 **** <WebObject Class="xlistbox" Name="office" ! mainlist="true" ! sublist="department" ! onchange="alert(this.options[this.slectedIndex].text)" /> <WebObject Class="xlistbox" Name="department" ! sublist="users" ! onchange="alert(this.options[this.slectedIndex].text)" /> <WebObject Class="xlistbox" Name="user" ! onchange="alert(this.options[this.slectedIndex].text)" /> The 'mainlist' attribute, when it is true, tells that this is the first --- 7,20 ---- <WebObject Class="xlistbox" Name="office" ! mainlist="true" ! sublist="department" ! onchange="alert(this.options[this.slectedIndex].text)" /> <WebObject Class="xlistbox" Name="department" ! sublist="users" ! onchange="alert(this.options[this.slectedIndex].text)" /> <WebObject Class="xlistbox" Name="user" ! onchange="alert(this.options[this.slectedIndex].text)" /> The 'mainlist' attribute, when it is true, tells that this is the first *************** *** 35,40 **** <Recordset ID="xlistbox::office"> <Query> ! SELECT off_id AS id, name AS label ! FROM offices </Query> </Recordset> --- 35,40 ---- <Recordset ID="xlistbox::office"> <Query> ! SELECT off_id AS id, name AS label ! FROM offices </Query> </Recordset> *************** *** 42,47 **** <Recordset ID="xlistbox::department"> <Query> ! SELECT off_id AS master_id, dept_id AS id, name AS label ! FROM departments </Query> </Recordset> --- 42,47 ---- <Recordset ID="xlistbox::department"> <Query> ! SELECT off_id AS master_id, dept_id AS id, name AS label ! FROM departments </Query> </Recordset> *************** *** 49,54 **** <Recordset ID="xlistbox::user"> <Query> ! SELECT department AS master_id, user_id AS id, username AS label ! FROM users </Query> </Recordset> --- 49,54 ---- <Recordset ID="xlistbox::user"> <Query> ! SELECT department AS master_id, user_id AS id, username AS label ! FROM users </Query> </Recordset> Index: tabs.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/tabs.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tabs.txt 23 Feb 2003 14:42:40 -0000 1.1 --- tabs.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 5,9 **** <WebObject Class="tabs1" Name="su" ! items="{{#./}}su_menu_items.php" /> The attribute 'items' is a PHP file that contains the items of the menu, --- 5,9 ---- <WebObject Class="tabs1" Name="su" ! items="{{#./}}su_menu_items.php" /> The attribute 'items' is a PHP file that contains the items of the menu, *************** *** 14,22 **** */ $menu_items = array( ! "item1" => " Menu Item 1 ", ! "item2" => " Menu Item 2 ", ! "item3" => " Menu Item 3 ", ! "etc1" => " . . . ", ! "etc2" => " . . . " ); ?> --- 14,22 ---- */ $menu_items = array( ! "item1" => " Menu Item 1 ", ! "item2" => " Menu Item 2 ", ! "item3" => " Menu Item 3 ", ! "etc1" => " . . . ", ! "etc2" => " . . . " ); ?> Index: table.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/table.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** table.txt 23 Feb 2003 14:42:40 -0000 1.1 --- table.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 6,12 **** <WebObject Class="table" Name="offices" ! table="offices" ! fields="off_id,name" ! where="off_id < 10" /> If attribute 'table' is the name of the table that will be displayed. --- 6,12 ---- <WebObject Class="table" Name="offices" ! table="offices" ! fields="off_id,name" ! where="off_id < 10" /> If attribute 'table' is the name of the table that will be displayed. Index: listbox.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/listbox.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** listbox.txt 23 Feb 2003 14:42:40 -0000 1.1 --- listbox.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 19,24 **** <WebObject Class="listbox" Name="country" rs = "rs_id" ! onchange = "alert(this.options[this.selectedIndex].text)" ! width = "---------------" /> The attribute "rs" is optional. Its default value (if not specified) is --- 19,24 ---- <WebObject Class="listbox" Name="country" rs = "rs_id" ! onchange = "alert(this.options[this.selectedIndex].text)" ! width = "---------------" /> The attribute "rs" is optional. Its default value (if not specified) is *************** *** 33,39 **** This WebClass uses a <select> tag like this: ! <select name="{{#obj_name}}" onchange="{{#onchange}}"> ! . . . . . ! </select> So, this should be kept in mind when accessing the selected value and when giving an initial value. --- 33,39 ---- This WebClass uses a <select> tag like this: ! <select name="{{#obj_name}}" onchange="{{#onchange}}"> ! . . . . . ! </select> So, this should be kept in mind when accessing the selected value and when giving an initial value. Index: leftMenu.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/leftMenu.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** leftMenu.txt 23 Feb 2003 14:42:40 -0000 1.1 --- leftMenu.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 6,10 **** <WebObject Class="leftMenu" Name="su" ! items="{{#./}}su_menu_items.php" /> The attribute 'items' is a PHP file that contains the items of the menu, --- 6,10 ---- <WebObject Class="leftMenu" Name="su" ! items="{{#./}}su_menu_items.php" /> The attribute 'items' is a PHP file that contains the items of the menu, *************** *** 15,23 **** */ $menu_items = array( ! "item1" => " Menu Item 1 ", ! "item2" => " Menu Item 2 ", ! "item3" => " Menu Item 3 ", ! "etc1" => " . . . ", ! "etc2" => " . . . " ); ?> --- 15,23 ---- */ $menu_items = array( ! "item1" => " Menu Item 1 ", ! "item2" => " Menu Item 2 ", ! "item3" => " Menu Item 3 ", ! "etc1" => " . . . ", ! "etc2" => " . . . " ); ?> Index: form.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/form.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** form.txt 23 Feb 2003 14:42:40 -0000 1.1 --- form.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 9,17 **** <WebBox ID="editProject"> ! <form name="bigForm"> ! . . . . . . . . ! <!--# many <input>s, <select>s, etc. here #--> ! . . . . . . . . ! </form> </WebBox> ---------------------------------------------- --- 9,17 ---- <WebBox ID="editProject"> ! <form name="bigForm"> ! . . . . . . . . ! <!--# many <input>s, <select>s, etc. here #--> ! . . . . . . . . ! </form> </WebBox> ---------------------------------------------- *************** *** 21,25 **** class editProject extends formWebObj { ! . . . . . . . . . . } ?> --- 21,25 ---- class editProject extends formWebObj { ! . . . . . . . . . . } ?> *************** *** 28,32 **** class formWebObj extends WebObject { ! . . . . . . . . . . . } ?> --- 28,32 ---- class formWebObj extends WebObject { ! . . . . . . . . . . . } ?> Index: folderListing.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/folderListing.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** folderListing.txt 23 Feb 2003 14:42:40 -0000 1.1 --- folderListing.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 67,71 **** contains it: ! <Include SRC="{{#FOLDERLISTING_PATH}}folderListing.html" /> ({{#FOLDERLISTING_PATH}} is declared by the framework itself) --- 67,71 ---- contains it: ! <Include SRC="{{#FOLDERLISTING_PATH}}folderListing.html" /> ({{#FOLDERLISTING_PATH}} is declared by the framework itself) Index: dbTable.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/dbTable.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbTable.txt 23 Feb 2003 14:42:40 -0000 1.1 --- dbTable.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 6,14 **** <WebObject Class="dbTable" Name="offices" ! table = "offices" ! fields = "off_id,name" ! where = "off_id < 10" ! editable = "true" ! selectable="true" /> The attribute 'table' is the name of the table that will be displayed. --- 6,14 ---- <WebObject Class="dbTable" Name="offices" ! table = "offices" ! fields = "off_id,name" ! where = "off_id < 10" ! editable = "true" ! selectable="true" /> The attribute 'table' is the name of the table that will be displayed. Index: datebox.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/pages/datebox.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** datebox.txt 23 Feb 2003 14:42:40 -0000 1.1 --- datebox.txt 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 10,16 **** <WebObject Class="datebox" Name="information_date" ! value="{{#info_date}}" ! format="YYYY-MM-DD" ! onchange="check_selected_date(this)" /> <WebObject Class="datebox" Name="proposal_date" /> --- 10,16 ---- <WebObject Class="datebox" Name="information_date" ! value="{{#info_date}}" ! format="YYYY-MM-DD" ! onchange="check_selected_date(this)" /> <WebObject Class="datebox" Name="proposal_date" /> |
From: Dashamir H. <das...@us...> - 2003-08-20 07:55:49
|
Update of /cvsroot/phpwebapp/documentation/templates/webobjects In directory sc8-pr-cvs1:/tmp/cvs-serv10107/templates/webobjects Modified Files: webobj_items.php Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: webobj_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/webobjects/webobj_items.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webobj_items.php 23 Feb 2003 14:29:07 -0000 1.2 --- webobj_items.php 20 Aug 2003 07:31:54 -0000 1.3 *************** *** 5,17 **** */ $menu_items = array( ! "tabs" => "tabs", ! "browse" => "fileBrowser", ! "folderListing" => "folderListing", ! "form" => "form", ! "datebox" => "datebox", ! "table" => "table", ! "dbTable" => "dbTable", ! "listbox" => "listbox", ! "xlistbox" => "xlistbox" ! ); ?> --- 5,17 ---- */ $menu_items = array( ! "tabs" => "tabs", ! "browse" => "fileBrowser", ! "folderListing" => "folderListing", ! "form" => "form", ! "datebox" => "datebox", ! "table" => "table", ! "dbTable" => "dbTable", ! "listbox" => "listbox", ! "xlistbox" => "xlistbox" ! ); ?> |
From: Dashamir H. <das...@us...> - 2003-08-20 07:55:49
|
Update of /cvsroot/phpwebapp/documentation/webobjects/displaytxt In directory sc8-pr-cvs1:/tmp/cvs-serv10107/webobjects/displaytxt Modified Files: displaytxt.php displaytxt.html displaytxt.css Log Message: tabs converted to spaces, improvments in templates and stylesheets Index: displaytxt.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/webobjects/displaytxt/displaytxt.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** displaytxt.php 23 Feb 2003 14:42:40 -0000 1.1 --- displaytxt.php 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 11,29 **** $file = $this->getSVar("file"); if (!file_exists($file)) ! { ! $msg = "displaytxt: file '$file' does not exist."; ! print WebApp::error_msg($msg); ! return; ! } $lines = file($file); $rs = new EditableRS("lines"); for ($i=0; $i < sizeof($lines); $i++) ! { ! $line = chop($lines[$i]); ! $line = htmlentities($line); ! $rec = array("line" => $line); ! $rs->addRec($rec); ! } global $webPage; $webPage->addRecordset($rs); --- 11,31 ---- $file = $this->getSVar("file"); if (!file_exists($file)) ! { ! $msg = "displaytxt: file '$file' does not exist."; ! print WebApp::error_msg($msg); ! return; ! } $lines = file($file); $rs = new EditableRS("lines"); for ($i=0; $i < sizeof($lines); $i++) ! { ! $line = chop($lines[$i]); ! $line = htmlentities($line); ! $line = str_replace("\t", " ", $line); ! $line = str_replace(" ", " ", $line); ! $rec = array("line" => $line); ! $rs->addRec($rec); ! } global $webPage; $webPage->addRecordset($rs); Index: displaytxt.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/webobjects/displaytxt/displaytxt.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** displaytxt.html 23 Feb 2003 14:42:40 -0000 1.1 --- displaytxt.html 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 1,9 **** <WebBox ID="displaytxt"> <div class="txtlines"> - <pre> <Repeat rs="lines"> ! {{line}} </Repeat> - </pre> </div> </WebBox> --- 1,7 ---- <WebBox ID="displaytxt"> <div class="txtlines"> <Repeat rs="lines"> ! <span class="txtline"> {{line}}</span><br> </Repeat> </div> </WebBox> Index: displaytxt.css =================================================================== RCS file: /cvsroot/phpwebapp/documentation/webobjects/displaytxt/displaytxt.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** displaytxt.css 23 Feb 2003 14:42:40 -0000 1.1 --- displaytxt.css 20 Aug 2003 07:31:54 -0000 1.2 *************** *** 4,5 **** --- 4,11 ---- color: #000099 } + + .txtline + { + font-family: monospace, sans-se, courier; + white-space: pre; + } |
From: Dashamir H. <das...@us...> - 2003-08-20 07:50:02
|
Update of /cvsroot/phpwebapp/documentation In directory sc8-pr-cvs1:/tmp/cvs-serv10531 Modified Files: ToDo.txt Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/documentation/ToDo.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ToDo.txt 23 Feb 2003 14:29:07 -0000 1.2 --- ToDo.txt 20 Aug 2003 07:33:55 -0000 1.3 *************** *** 1,25 **** ! * Shto nje tab per WebObjects (ose Web Components) ne documentation, ! ku WebObjects te jene te kategorizuara ne kategori dhe nenkategori. ! Ketu mund te perdoren hierMenues per kategorite. Per cdo WebObject duhet te jete dokumentacioni (pershkrimi, si perdoret, si eshte i ndertuar, etj), nje shembull perdorimi, downlodimi, dhe mundesisht edhe nje tools per ta castomizuar. - * Rregullo formatin e komenteve gjenero dokumentacionin me phpDocumentor. - ======================================================================== - * Hiqe on.firstTime.php. Per te gjetur faqen e pare te aplikacionit - perdor contanten FIRSTPAGE te const.Options.php. Nqs nuk eshte - percaktuar, atere merret si faqe e pare 'main.html' ne TPL_PATH. - * Kur nje state var i nje weboxi inicializohet para se te thirret init() atere init() nuk thirret. Kjo nuk eshte ne rregull. (phpWebApp) - - * Kur inkludohet nje template kryesore (qe ka <head> dhe <body>) ne - browser.php, nxjerr disa gabime. (phpWebApp) - - * Pse logini (te DT) nuk punon ne Konqueror? (phpWebApp) * Bug: Tek documentation/webobjects/tabs3, kur nuk i eshte dhene --- 1,30 ---- ! * Make sample apps 3, 4, 5 etc. ! * Update tutorial 2, add tutorials 3, 4, 5 etc. ! * Add a "Would you like to help improve this page." notice at the ! end of some pages. ! * Put summaries of the tutorials in separate files. ! * Review the code of web_app and improve the comments. ! * Generate the code documentation with doxygen and phpDocumentor ! and add links to it from Documentation/Developer Docs. ! * Update app1.tar.gz, etc. ! * Prepare release-1.0 ! ! ! * Rewrite and improve the UML model. ! * Study the texinfo format. ! * Convert user manuals either in texinfo format or in DocBook format ! and construct a webbox that can display such formats in a web application. ! ! * Build a code library for webobjects. It should be hierarchical, so that ! webobjects can be categoriezed. Per cdo WebObject duhet te jete dokumentacioni (pershkrimi, si perdoret, si eshte i ndertuar, etj), nje shembull perdorimi, downlodimi, dhe mundesisht edhe nje tools per ta castomizuar. ======================================================================== * Kur nje state var i nje weboxi inicializohet para se te thirret init() atere init() nuk thirret. Kjo nuk eshte ne rregull. (phpWebApp) * Bug: Tek documentation/webobjects/tabs3, kur nuk i eshte dhene |
From: Dashamir H. <das...@us...> - 2003-08-20 07:50:02
|
Update of /cvsroot/phpwebapp/documentation/templates/tutorial In directory sc8-pr-cvs1:/tmp/cvs-serv10531/templates/tutorial Modified Files: weboxes.html transitions.html templates.html Log Message: Index: weboxes.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/weboxes.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** weboxes.html 15 Aug 2003 07:37:30 -0000 1.2 --- weboxes.html 20 Aug 2003 07:33:55 -0000 1.3 *************** *** 1,23 **** ! <h3>3 - Introducing WebBox-es</h3> ! Some of the templates are turned into weboxes. ! Explains the fundamental difference between a template ! and a webox. The PHP code of the weboxes ! declares the function onRender(), where some variables ! are added using WebApp::addVar(), and these {{variables}} ! are used in the corresponding template. ! <br><br> <span class="button"> ! <a href="javascript: alert('Sorry! Not implemented yet.')">Test</a> </span> <span class="button"> ! <a href="javascript: alert('Sorry! Not implemented yet.')">Browse</a> </span> - <br><br> - <hr> <br> <ul> ! <li> ! <li> ! <li> </ul> --- 1,447 ---- + <h2>3 - Introducing WebBox-es</h2> ! <p>Explains what are WebBox-es and their differences with templates. ! The PHP code of the WebBox-es declares template {{#variables}} ! in the onRender() function, by using WebApp::addVar(). Gives some ! tips about good programming practices with WebBox-es. Shows how to ! debug them. Explains as well the files 'init.php', 'global.php', ! 'before_page.php', 'after_page.php' and the structure of the ! application.</p> <span class="button"> ! <a href="{{UP_URL}}app3/" target= "_blank">Test</a> </span> <span class="button"> ! <a href="{{UP_URL}}app3/browse.php" target="_blank">Browse</a> ! </span> ! <span class="button"> ! <a href="http://phpwebapp.sourceforge.net/download/app3.tar.gz">Download</a> </span> <br> + + <hr> + + <h3><a name="toc">Table of Contents</a></h3> + <ul> ! <li> ! <a href="#webboxes">WebBox-es</a> ! ! <ol> ! <li><a href="#phpcode">The PHP code of a WebBox</a></li> ! ! <li><a href="#onrender">The function <em>onRender()</em></a></li> ! ! <li><a href="#files">Files related to a WebBox</a></li> ! </ol> ! </li> ! ! <li><a href="#tips">Tips about using WebBox-es</a></li> ! ! <li><a href="#optional">Optional framework files</a></li> ! ! <li><a href="#study">Study the sample application</a></li> ! ! <li> ! <a href="#exercises">Exercises</a> ! ! <ol> ! <li><a href="#exercise_1">Modify page2.html and ! page3.html</a></li> ! ! <li><a href="#exercise_2">Rename folder <em>img</em> to ! <em>images</em></a></li> ! ! <li><a href="#exercise_3">Divide Page1 further into ! subtemplates</a></li> ! ! <li><a href="#exercise_4">Move Page1 to a new folder</a></li> ! ! <li><a href="#exercise_5">Change the styles of the ! page1_content</a></li> ! ! <li><a href="#exercise_6">Move template tpl_2.html and its ! related files to folder <em>page3/tpl_2/</em></a></li> ! ! <li><a href="#exercise_7">Think about it</a></li> ! </ol> ! </li> ! </ul> ! <hr> ! ! <a name="webboxes"></a> ! ! <h3>WebBox-es</h3> ! ! <p>A WebBox is a template which has also some <em>PHP</em> code associated ! with it. It is a self-contained and independent template which can be easily ! included in other pages or in other applications. In fact, it may also have ! some <em>JavaScript</em> code, <em>CSS</em> stylesheets, <em>SQL</em> ! queries etc., associated with it.</p> ! ! <p>It is denoted by the tag <strong><WebBox></strong> and it has an ! <strong>ID</strong> attribute:</p> ! <pre> ! <WebBox ID="box_id"> ! <!-- content of WebBox --> ! </WebBox> ! </pre> ! <p>The identifier must be different for each WebBox used in the ! application.</p> ! ! <a name="phpcode"></a> ! ! <h4>1 - The PHP code of the WebBox-es</h4> ! ! <p>The <em>PHP</em> code (as well as <em>JS</em> code, <em>CSS</em> ! styles etc.) are associated to the WebBox by means of ! <strong>box_id</strong>, the identifier of the WebBox. When the ! framework parses a <strong><WebBox></strong> tag, it looks for a ! file named <strong>box_id.php</strong> in the same folder where the ! WebBox template is. If it finds such a file, it includes it.</p> ! ! <p>The <strong>box_id.php</strong> file must contain the definition ! of a <em>PHP</em> class that extends the class <strong>WebObject</strong>, ! like this:</p> ! <pre> ! <?php ! class <strong>box_id</strong> extends <strong>WebObject</strong> ! { ! . ! . ! . ! } ! ?> ! </pre> ! ! <p>See this example: ! <a href="javascript:codeReview('{{APP3_PATH}}templates/menu/menu.html','1')"> ! <em>templates/menu/menu.html</em></a>, ! <a href="javascript:codeReview('{{APP3_PATH}}templates/menu/menu.php','2')"> ! <em>templates/menu/menu.php</em></a>. ! </p> ! ! <p>The class <strong>WebObject</strong> is defined by the framework. ! Among other things, it also contains the member functions ! <strong>WebObject::init()</strong>, ! <strong>WebObject::onParse()</strong> and ! <strong>WebObject::onRender()</strong>. We will discuss in the next ! tutorial the first two functions, and will deal here only with the ! last one.</p> ! ! <a name="onrender"></a> ! ! <h4>2 - The function <em>onRender()</em></h4> ! ! <p>The function <strong>onRender()</strong> of the class ! <em>WebObject</em> is called by the framework at the time of the ! <em>HTML</em> page construction (the page that is sent to the ! browser), just before the template of the WebBox is outputed ! (rendered). Actually <strong>WebObject::onRender()</strong> is an ! abstract (empty) function, and the framework expects the class ! <strong>box_id</strong> to override it, in order to do something ! useful for the WebBox.</p> ! ! <p>What is usually done in <strong>box_id::onRender()</strong> is ! assigning values to the variables used in the template of the WebBox ! <em>box_id</em>, so that the template is rendered properly. ! These values are assigned by the function ! <strong>WebApp::addVar("var_name", "var_value")</strong>. ! E.g. see how it is done in the WebBox <em>tip</em>: ! <a href="javascript:codeReview('{{APP3_PATH}}templates/tip/tip.html','5')"> ! <em>templates/tip/tip.html</em></a>, ! <a href="javascript:codeReview('{{APP3_PATH}}templates/tip/tip.php','10,13')"> ! <em>templates/tip/tip.php</em></a>. ! The framework replaces the variables {{#rand}} and {{#tip_text}} by the ! values assigned in onRender() and generates <em>HTML</em> code. </p> ! ! <a name="files"></a> ! ! <h4>3 - Files related to a WebBox</h4> ! ! <p>The templates may contain some special comments as well:</p> ! <pre> ! <!--# Framework comments #--> ! </pre> ! ! <p>These comments are like HTML comments but they have a diesis ! <strong>#</strong> at the opening and closing marks. These comments ! are not processed (are skiped, ignored) by the framework and are not ! displayed in the HTML page that is generated. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/header.html','1-3')"> ! Example</a>.</p> ! ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> ! ! <h3><a name="study">Study the sample</a></h3> ! ! <p>Here we will highlight and discuss some of the features of the ! sample application, so that we can understand it better.</p> ! ! <ul> ! <li>All the templates of the application are placed in the folder ! <em>/templates/</em>. We tell to the framework where to look for the ! templates by giving an appropriate value to the constant ! <strong>TPL_PATH</strong> ! in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','4')"> ! <em>config/const.Paths.php</em></a>. ! <br> ! <br></li> ! ! <li>All the images of this application are placed in the folder ! <em>/img/</em>. In templates they are linked using the ! <strong>{{#IMG_URL}}</strong> variable. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/footer.html','9,10')"> ! See</a> how it is used. The <strong>{{#IMG_URL}}</strong> template ! variable gets the value from the PHP constant <strong>IMG_URL</strong>, ! which is declared in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','6')"> ! <em>config/const.Paths.php</em></a>. ! <br> ! <br></li> ! ! <li>All the files and templates of the page3 are placed in the ! folder <em>/templates/page3/</em>. Organizing files into folders and ! subfolders reduces the complexity of the application and makes it ! easier to be understood and maintained. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/footer.js','17')"> ! Notice</a> how the transition to page3 is done. ! <br> ! <br></li> ! ! <li>All the pages include the same header and footer template, e.g. see ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1.html','7,9')"> ! page1.html</a>. If you want to change something in the footer of ! the page, then you don't have to change every page, but you make ! the change only once in the footer. ! <br> ! <br></li> ! ! <li><a href="{{APP2_URL}}browse.php" target="_blank">Browse</a> ! the files of the application and see the templates <em>page1.html</em>, ! <em>header.html</em>, <em>footer.html</em>, <em>page1_content.html</em>. ! See them both in preview mode and in code view mode (select the "Code View" ! mode in the panel at the top and then click "Refresh"). ! <br> ! <br></li> ! ! <li>Browse the files and see the template <em>page2.html</em> and all ! the templates in the folder <em>/templates/page3/</em>. See them both in ! preview mode and in code view mode. These two pages are the same ! in terms of what they display, however they are implemented ! differently in the server. <em>page2.html</em> is implemented as a flat ! big HTML file, while <em>page3.html</em> is structured, divided into ! several small subtemplates. Try to make the same modification in ! both of them and see which one is easier to be modified. ! <br> ! <br></li> </ul> + + <span class="button"><a href="#toc">TOC</a></span> + <hr> + + <h3><a name="exercises">Exercises</a></h3> + + <p>Before starting the exercises, make a copy of the application + <em>app2</em> to the folder <em>test/app2</em>. If you have problems + with doing this (e.g. <em>test/app2</em> doesn't work) then see the + <a href="javascript:tabs3_select('tabs3::tutorial','transitions')"> + first tutorial</a>, second exercise.</p> + + <a name="exercise_1"></a> + + <h4>1 - Modify page2.html and page3.html</h4> + + <p>Change to red the color of the tpl_2_1 box, and change the text + inside it to "This box is red!".</p> + + <p>Modify page2.html:</p> + + <ol> + <li>Open the file + <a href="javascript:codeReview('{{APP2_PATH}}templates/page2.css','52,59')"> + page2.css</a> and change the color in the highlighted lines to + <em>red</em>.</li> + + <li>Open the file + <a href="javascript:codeReview('{{APP2_PATH}}templates/page2.html','60')"> + page2.html</a> and change the text in the highlighted lines to + "This box is red!".</li> + </ol> + + <p>Modify page3.html:</p> + + <ol> + <li>Open the file <a href= + "javascript:codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.css','5,12','')"> + tpl_2_1.css</a> and change the color in the highlighted lines to + <em>red</em>.</li> + + <li>Open the file <a href= + "javascript:codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.html','5-6','')"> + tpl_2_1.html</a> and change the text in the highlighted line to + "This box is red!".</li> + </ol> + + <p>Which of the pages do you think is easier to be modified?</p> + + + <a name="exercise_2"></a> + + <h4>2 - Rename folder <em>img</em> to <em>images</em></h4> + + <ol> + <li>Rename folder <em>img</em> to <em>images</em>: + <kbd>$ mv img images</kbd> <br> + Test the application; the images will be broken.</li> + + <li>Change the value of the <strong>IMG_URL</strong> constant in the file + <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','6')"> + const.Paths.php</a>. + Reload the application. The images should be allright.</li> + </ol> + + <p>If all the images in the application are linked like this: + <kbd><img src="{{#IMG_URL}}image_name.png"/></kbd> + there will be no problem. However, if any image is hard linked + like this: <kbd><img src="/img/image_name.png"/></kbd> + it will not be displayed.</p> + + <a name="exercise_3"></a> + <h4>3 - Divide Page1 further into subtemplates</h4> + + <ol> + <li>Open the file + <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','9-14')"> + page1_content.html</a> and copy the selected lines to the file + <em>tpl_vars.html</em>.</li> + + <li>Replace the selected lines with this line: <br> + <kbd><Include SRC="{{#./}}tpl_vars.html"/></kbd></li> + + <li>Copy the + <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','16-30','10-35')"> + selected lines</a> of <em>page1_content.html</em> to file + <em>include_tag.html</em>, and replace them with: <br> + <kbd><Include SRC="{{#./}}include_tag.html"/></kbd></li> + + <li>Copy the + <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','32-42','27-47')"> + selected lines</a> of <em>page1_content.html</em> to file + <em>comments.html</em>, and replace them with: <br> + <kbd><Include SRC="{{#./}}comments.html"/></kbd></li> + + <li>Copy the + <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','44-63','40-70')"> + selected lines</a> of <em>page1_content.html</em> to file + <em>js_code.html</em>, and replace them with: <br> + <kbd><Include SRC="{{#./}}js_code.html"/></kbd></li> + + <li>Test that the application is OK.</li> + </ol> + + <a name="exercise_4"></a> + + <h4>4 - Move Page1 to a new folder</h4> + + <p>If you make a listing of the folder <em>/templates/</em> you will see + that now there are a lot of files in it and it has started to + become messy. It would be better if we moved page1 files to another + folder.</p> + + <ol> + <li>Create new folder <em>page1</em>: <br> + <kbd>$ mkdir page1</kbd></li> + + <li>Move files <em>page1.html</em>, <em>page1_content.html</em>, + <em>tpl_vars.html</em>, <em>include_tags.html</em>, <em>comments.html</em>, + <em>js_code.html</em> to folder <em>page1</em><br> + e.g. <kbd>$ mv page1.html page1/</kbd></li> + + <li>If you test the application now, you will get an error. Open the file + <a href="javascript:codeReview('{{APP2_PATH}}config/const.Options.php','9-13')"> + <em>config/const.Options.php</em></a> and change the value of the constant + <strong>FIRSTPAGE</strong> to "page1/page1.html".</li> + + <li>If you test the application now, it will not be able to find + the stylesheet and the header and footer templates. Open the file + <a href="javascript:codeReview('{{APP2_PATH}}templates/page1.html','4,7,9','')"> + <em>page1/page1.html</em></a> and replace <strong>{{#./}}</strong> + with <strong>{{#TPL_URL}}</strong> for the stylesheet, and with + <strong>{{#TPL_PATH}}</strong> for the templates, in the selected + lines.</li> + </ol> + + + <a name="exercise_5"></a> + + <h4>5 - Change the styles of the page1_content</h4> + + <ol> + <li>In the folder <em>/templates/page1/</em> create the file + <em>page1_content.css</em> which has these lines: + <pre> + h4 { color: red } + p { color: blue } + </pre> + </li> + + <li>At the top of the file <em>page1_content.html</em> add this line: + <pre> + <link rel="stylesheet" type="text/css" href="{{#./}}page1_content.css"> + </pre> + </li> + + <li>Test the application and notice the changes in page1.</li> + </ol> + + + <a name="exercise_6"></a> + + <h4>6 - Move template tpl_2.html to folder <em>page3/tpl_2/</em></h4> + + <ol> + <li>Create new folder <em>tpl_2</em>:<br> + <kbd>$ cd templates/page3/ ; mkdir tpl_2</kbd></li> + + <li>Move the files <em>tpl_2.html</em>, <em>tpl_2.css</em>, + <em>tpl_2_1.html</em>, <em>tpl_2_1.css</em>, <em>tpl_2_2.html</em>, + <em>tpl_2_2.css</em> to the new folder: <br> + <kbd>$ mv tpl_2*.* tpl_2</kbd></li> + + <li>Open the file + <a href="javascript:codeReview('{{APP2_PATH}}templates/page3/tmpl.html','11','')"> + tmpl.html</a> and change the <strong>SRC</strong> attribute of the include + tag to <kbd>{{#./}}tpl_2/tpl_2.html</kbd>.</li> + + <li>Test the application and go to page3. It should be displayed + correctly.</li> + </ol> + + <p>Do yourself these changes as well:</p> + + <ul> + <li>Create a new folder <em>/templates/page2/</em> and move the files + <em>page2.html</em> and <em>page2.css</em> to it.</li> + + <li>Create a new folder <em>/templates/page3/tpl_1</em> and move the + files <em>tpl_1.html</em> and <em>tpl_1.css</em> to it.</li> + + <li>Create a new folder <em>/templates/page3/tpl_2/tpl_2_1</em> and move + the files <em>tpl_2_1.html</em> and <em>tpl_2_1.css</em> to it.</li> + + <li>Create a new folder <em>/templates/page3/tpl_2/tpl_2_2</em> and move + the files <em>tpl_2_2.html</em> and <em>tpl_2_2.css</em> to it.</li> + </ul> + + + <h4><a name="exercise_7">7 - Think about it</a></h4> + + <p>Suppose that you would like to add the current date at the top + of each file (whithout using JavaScript, using PHP). How would you + do it? Or, in general, how could you display something from PHP in + the page?</p> + + <p><span class="button"><a href="#toc">TOC</a></span></p> + <hr> Index: transitions.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/transitions.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** transitions.html 15 Aug 2003 07:40:51 -0000 1.4 --- transitions.html 20 Aug 2003 07:33:55 -0000 1.5 *************** *** 1,4 **** ! ! <h3>1 - Transitions</h3> <p>A very simple application that has 2 or 3 HTML files which have --- 1,3 ---- ! <h2>1 - Transitions</h2> <p>A very simple application that has 2 or 3 HTML files which have *************** *** 19,23 **** <hr> ! <h4><a name="toc">Table of Contents</a></h4> <ul> --- 18,22 ---- <hr> ! <h3><a name="toc">Table of Contents</a></h3> <ul> *************** *** 52,56 **** <p><a name="goto"></a></p> ! <h4>Transitions by Goto</h4> <p>The <strong>phpWebApp</strong> thinks of a web application as --- 51,55 ---- <p><a name="goto"></a></p> ! <h3>Transitions by Goto</h3> <p>The <strong>phpWebApp</strong> thinks of a web application as *************** *** 84,88 **** <a name="external"></a> ! <h4>External Pages</h4> <p>The external pages are HTML pages that are outside the --- 83,87 ---- <a name="external"></a> ! <h3>External Pages</h3> <p>The external pages are HTML pages that are outside the *************** *** 114,118 **** <a name="structure"></a> ! <h4>The Structure of the Application</h4> <p>Each application build with <strong>phpWebApp</strong> framework --- 113,117 ---- <a name="structure"></a> ! <h3>The Structure of the Application</h3> <p>Each application build with <strong>phpWebApp</strong> framework *************** *** 174,178 **** <a name="exercises"></a> ! <h4>Exerxises</h4> <p>To be able to try the exercises you have to instal the --- 173,177 ---- <a name="exercises"></a> ! <h3>Exerxises</h3> <p>To be able to try the exercises you have to instal the *************** *** 182,186 **** <a name="exercise_1"></a> ! <h5>1 - Create a new application</h5> <p>In this exercise you will create another application which is --- 181,185 ---- <a name="exercise_1"></a> ! <h4>1 - Create a new application</h4> <p>In this exercise you will create another application which is *************** *** 196,204 **** </ol> - <span class="button"><a href="#toc">TOC</a></span> - <br> <a name="exercise_2"></a> ! <h5>2 - Move an application to another location</h5> <p>In this exercise you will move the application <em>app1_test</em> to --- 195,201 ---- </ol> <a name="exercise_2"></a> ! <h4>2 - Move an application to another location</h4> <p>In this exercise you will move the application <em>app1_test</em> to *************** *** 222,226 **** framework classes and modules. The constant <strong>UP_PATH</strong> which is defined in <strong>webapp.php</strong>, contains the parent ! folder of the application (app1_test) folder</p>. <p>In this example it is set as a relative path, but it can be set --- 219,223 ---- framework classes and modules. The constant <strong>UP_PATH</strong> which is defined in <strong>webapp.php</strong>, contains the parent ! folder of the application (app1_test) folder.</p> <p>In this example it is set as a relative path, but it can be set *************** *** 230,238 **** location.</p> - <span class="button"><a href="#toc">TOC</a></span> - <br> <a name="exercise_3"></a> ! <h5>3 - Debugging Transitions</h5> <ol> --- 227,233 ---- location.</p> <a name="exercise_3"></a> ! <h4>3 - Debugging Transitions</h4> <ol> *************** *** 246,254 **** </ol> - <span class="button"><a href="#toc">TOC</a></span> - <br> <a name="exercise_4"></a> ! <h5>4 - Add a New Page to the Application</h5> <ol> --- 241,247 ---- </ol> <a name="exercise_4"></a> ! <h4>4 - Add a New Page to the Application</h4> <ol> *************** *** 264,272 **** </ol> - <span class="button"><a href="#toc">TOC</a></span> - <br> <a name="exercise_5"></a> ! <h5>5 - Set the initial page of the application</h5> <ol> --- 257,263 ---- </ol> <a name="exercise_5"></a> ! <h4>5 - Set the initial page of the application</h4> <ol> *************** *** 279,287 **** </ol> - <span class="button"><a href="#toc">TOC</a></span> - <br> <a name="exercise_6"></a> ! <h5>6 - Put the pages in another folder</h5> <p>In this exercise you will put all the pages of the application --- 270,276 ---- </ol> <a name="exercise_6"></a> ! <h4>6 - Put the pages in another folder</h4> <p>In this exercise you will put all the pages of the application *************** *** 329,333 **** <a name="experiments"></a> ! <h4>Experiments and questions</h4> <p>Try to do these experiments and to answer these questions.</p> --- 318,322 ---- <a name="experiments"></a> ! <h3>Experiments and questions</h3> <p>Try to do these experiments and to answer these questions.</p> Index: templates.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/templates.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** templates.html 15 Aug 2003 07:37:30 -0000 1.4 --- templates.html 20 Aug 2003 07:33:55 -0000 1.5 *************** *** 1,15 **** ! <script language="JavaScript" src="{{./}}codeReview.js"></script> ! <h3>2 - Templates</h3> ! Explains templates. This application ! uses the <Include> tag to insert the same header file ! at the beginning of each template and to break the ! templates into sub templates. It shows how to include ! the javascript code and the stylesheet of each template. ! It also explains the use of the framework comments and ! the difference between them and the HTML comments. ! Explains how to debug the template structure. ! <br><br> <span class="button"> ! <a href="{{APP2_URL}}" target="_blank">Test</a> </span> <span class="button"> --- 1,13 ---- ! <h2>2 - Templates</h2> ! ! <p>Explains templates. This application uses the <Include> ! tag to insert the same header file at the beginning of each ! template and to break the templates into sub templates. It shows ! how to include the javascript code and the stylesheet of each ! template. It also explains the use of the framework comments and ! the difference between them and the HTML comments. Explains how to ! debug the template structure.</p> <span class="button"> ! <a href="{{APP2_URL}}" target= "_blank">Test</a> </span> <span class="button"> *************** *** 19,209 **** <a href="http://phpwebapp.sourceforge.net/download/app2.tar.gz">Download</a> </span> ! <br><br> <hr> ! <a name="toc"> ! <h4>Table of Contents</h4> <ul> ! <li><a href="#templates">Templates</a> ! <ol> ! <li><a href="#variables">Template Variables</a> ! <li><a href="#include">The <Include> tag</a> ! <li><a href="#comments">Comments</a> ! <li><a href="#including">JavaScript code and stylesheet of a template</a> ! </ol> ! <li><a href="#study">Study the sample</a> ! <li><a href="#exercises">Exercises</a> ! <ol> ! <li><a href="#exercise1">Modify page2.html and page3.html</a> ! <li><a href="#exercise2">Rename folder 'img' to 'images'</a> ! <li><a href="#exercise3">Divide Page1 further into subtemplates</a> ! <li><a href="#exercise4">Move Page1 to a new folder</a> ! <li><a href="#exercise5">Change the styles of the page1_content</a> ! <li><a href="#exercise6">Move template tpl_2.html and its related files to folder 'page3/tpl_2/</a> ! <li><a href="#exercise7"> Think about it</a> ! </ol> ! </ul> <hr> <a name="templates"></a> - <h4>Templates</h4> - <p> - Templates are pieces of HTML code, that are used or combined - by the framework to generate the HTML pages that are sent to - the browser. - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> <a name="variables"></a> - <h5>1 - Template variables</h5> - <p> - The templates may contain variables inside them (called "template variables"), - which are replaced by the framework with their string values. The variables - inside a template are denoted by double curly braces: <i>{{#tpl_var}}</i>. - </p> - <p> - See this <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/page3.html','4,8,10,12','')">example</a>. - The <i>{{#TPL_URL}}</i> variable in line 4 contains the URL of the folder - 'templates', which in this case is '{{APP2_URL}}templates/'. The <i>{{#TPL_PATH}}</i> - variable in lines 8 and 12 contains the path in the server of the folder - templates, e.g. '/var/www/html{{APP2_URL}}templates/'. Both of them are declared - in the file - <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6,7','')"><i>config/const.Paths.php</i></a>. - The variable <i>{{#./}}</i> in line 10 is a special framework variable - that always contains the path of the current folder, i.e. the folder - of the current file. - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> <a name="include"></a> ! <h5>2 - The <Include> tag</h5> ! <p> ! The templates may also contain some extra tags, which are not HTML tags. ! These tags are reckognised and processed by the framework. One of them is ! the <Include> tag, which is used to include another template inside the ! current template: ! </p> <pre> ! <Include SRC="file_to_be_included" /> </pre> - <p> - It is a very useful tag, because it allows to divide - pages into subtemplates, which results in a better structured application, - provides modularity (the graphical designer can work with smaller pieces of - code), and reusability (templates are easier to be reused in other pages - or other applications). See again the same - <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/page3.html','8,10,12','')">example</a>. - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> <a name="comments"></a> ! <h5>3 - Comments</h5> ! <p> ! The templates may contain some special comments as well: ! </p> <pre> ! <!--# Framework comments #--> </pre> - <p> - These comments are like HTML comments by they have a diesis (#) - at the opening and closing marks. These comments are not processed - by the framework and are not displayed in the HTML page that is generated. - <a href="javascript: codeReview('{{APP2_PATH}}templates/header.html','1-3','')">Example</a>. - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> <a name="including"></a> ! <h5>4 - JavaScript code and stylesheet of a template</h5> ! <p> ! If a certain template has some javascript code or some special styles ! of its own, then it is better to include them at the begining of the ! template (instead of including them globally, at the <Head> of the page). ! This makes the template more independant from the other parts of the page ! and thus easier to use it again into another page. They are included like ! this: ! </p> <pre> ! <script language="javascript" src="file.js"></script> ! <link rel="stylesheet" type="text/css" href="file.css"> </pre> ! <p> ! <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.html','1','')">example1</a>, ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tpl_2.html','1','')">example2</a> ! <br> ! The inclusion is much better than writting the JS and CSS code in the ! template because it separates the HTML code from the JS and CSS codes. ! It also is more efficient (has a better performance) because the next ! time that this template is loaded in browser again, most probably the ! browser will get "file.js" and "file.css" from its cache, instead of ! retrieving them again from the server. ! </p> <span class="button"><a href="#toc">TOC</a></span> <hr> ! <a name="study"> ! <h4>Study the sample</h4> ! <p> ! Here we will highlight and discuss some of the features of the ! sample application, so that we can understand it better. ! </p> ! <p> ! <ul> ! <li> All the templates of the application are placed ! in the folder '/templates/'. We tell to the framework where ! to look for the templates by giving an appropriate value to ! the constant TPL_PATH in the file ! <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','7,8','')"><i>config/const.Paths.php</i></a>. ! <br><br> ! <li> All the images of this application are placed in the folder '/img/'. ! In templates they are linked using the {{#IMG_URL}} variable. ! <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.html','9,10','')">See</a> how it is used. ! The {{#IMG_URL}} template variable gets the value from the ! PHP constant IMG_URL, which is declared in the file ! <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6','')"><i>config/const.Paths.php</i></a>. ! ! <br><br> ! <li> All the files and templates of the page3 are placed in the folder ! '/templates/page3/'. Organizing files into folders and subfolders ! reduces the complexity of the application and makes it easier to be ! understood and maintained. ! <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.js','17','')">Notice</a> ! how the transition to page3 is done. ! <br><br> ! <li> All the pages include the same header and footer template, ! e.g. see ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1.html','8,10','')">page1.html</a>. ! If you want to change something in the footer of the page, then you ! don't have to change every page, but you make the change only once ! in the footer. ! <br><br> ! <li> <a href="{{APP2_URL}}browse.php" target="_blank">Browse</a> ! the files of the application and see the templates ! 'page1.html', 'header.html', 'footer.html', 'page1_content.html'. ! See them both in preview mode and in code view mode (select the ! "Code View" mode in the panel at the top and then click "Refresh"). ! <br><br> ! <li> Browse the files and see the template 'page2.html' and all the templates ! in the folder '/templates/page3/'. See them both in preview mode and ! in code view mode. These two pages are the same in terms of what they ! display, however they are implemented differently in the server. ! 'page2.html' is implemented as a flat big HTML file, while ! 'page3.html' is structured, divided into several small subtemplates. ! Try to make the same modification in both of them and see which one ! is easier to be modified. ! <br><br> </ul> --- 17,233 ---- <a href="http://phpwebapp.sourceforge.net/download/app2.tar.gz">Download</a> </span> ! <br> ! <hr> ! ! <h3><a name="toc">Table of Contents</a></h3> ! <ul> ! <li> ! <a href="#templates">Templates</a> ! ! <ol> ! <li><a href="#variables">Template Variables</a></li> ! ! <li><a href="#include">The <Include> tag</a></li> ! ! <li><a href="#comments">Comments</a></li> ! ! <li><a href="#including">JavaScript code and stylesheet of a ! template</a></li> ! </ol> ! </li> ! ! <li><a href="#study">Study the sample</a></li> ! ! <li> ! <a href="#exercises">Exercises</a> ! ! <ol> ! <li><a href="#exercise_1">Modify page2.html and ! page3.html</a></li> ! ! <li><a href="#exercise_2">Rename folder <em>img</em> to ! <em>images</em></a></li> ! ! <li><a href="#exercise_3">Divide Page1 further into ! subtemplates</a></li> + <li><a href="#exercise_4">Move Page1 to a new folder</a></li> + + <li><a href="#exercise_5">Change the styles of the + page1_content</a></li> + + <li><a href="#exercise_6">Move template tpl_2.html and its + related files to folder <em>page3/tpl_2/</em></a></li> + + <li><a href="#exercise_7">Debug templates</a></li> + + <li><a href="#exercise_8">Think about it</a></li> + </ol> + </li> + </ul> <hr> + <a name="templates"></a> ! <h3>Templates</h3> ! ! <p>Templates are pieces of HTML code, that are used or combined by ! the framework to generate the HTML pages that are sent to the ! browser.</p> <a name="variables"></a> ! <h4>1 - Template variables</h4> ! ! <p>The templates may contain variables inside them (called ! "template variables"), which are replaced by the framework with ! their string values. The variables inside a template are denoted by ! double curly braces: <strong>{{#tpl_var}}</strong>.</p> ! ! <p>See this ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page3/page3.html','4,7,9,11')"> ! example</a>. The <strong>{{#TPL_URL}}</strong> variable in line 4 contains ! the URL of the folder <em>templates</em>, which in this case is ! <em>{{APP2_URL}}templates/</em>. The <strong>{{#TPL_PATH}}</strong> variable in ! lines 7 and 11 contains the path in the server of the folder ! templates, e.g. <em>/var/www/html{{APP2_URL}}templates/</em>. Both of them ! are declared in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','4,5')"> ! <em>config/const.Paths.php</em></a>. The variable <strong>{{#./}}</strong> ! in line 9 is a special framework variable that always contains the ! path of the current folder, i.e. the folder of the current ! file.</p> <a name="include"></a> ! ! <h4>2 - The <Include> tag</h4> ! ! <p>The templates may also contain some extra tags, which are not ! HTML tags. These tags are reckognised and processed by the ! framework. One of them is the <Include> tag, which is used to ! include another template inside the current template:</p> <pre> ! <Include SRC="file_to_be_included" /> </pre> ! <p>It is a very useful tag, because it allows to divide pages into ! subtemplates, which results in a better structured application, ! provides modularity (the graphical designer can work with smaller ! pieces of code), and reusability (templates are easier to be reused ! in other pages or other applications). See how it is used in this ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page3/page3.html','7,9,11')"> ! example</a>.</p> <a name="comments"></a> ! ! <h4>3 - Comments</h4> ! ! <p>The templates may contain some special comments as well:</p> <pre> ! <!--# Framework comments #--> </pre> ! <p>These comments are like HTML comments but they have a diesis ! <strong>#</strong> at the opening and closing marks. These comments ! are not processed (are skiped, ignored) by the framework and are not ! displayed in the HTML page that is generated. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/header.html','1-3')"> ! Example</a>.</p> <a name="including"></a> ! ! <h4>4 - JavaScript code and stylesheet of a template</h4> ! ! <p>If a certain template has some javascript code or some special ! styles of its own, then it is better to include them at the ! begining of the template (instead of including them globally, at ! the <Head> of the page). This makes the template more ! independant from the other parts of the page and thus easier to use ! it again into another page. They are included like this:</p> <pre> ! <script language="javascript" src="file.js"></script> ! <link rel="stylesheet" type="text/css" href="file.css"> </pre> ! ! <a href="javascript:codeReview('{{APP2_PATH}}templates/footer.html','1')"> ! example1</a>, ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page3/tpl_2.html','1')"> ! example2</a>. ! ! <p>The inclusion is much better than writting the JS and CSS code in ! the template because it separates the HTML code from the JS and CSS ! codes. It also is more efficient (has a better performance) because ! the next time that this template is loaded in browser again, most ! probably the browser will get "file.js" and "file.css" from its ! cache, instead of retrieving them again from the server.</p> <span class="button"><a href="#toc">TOC</a></span> <hr> ! <h3><a name="study">Study the sample</a></h3> ! <p>Here we will highlight and discuss some of the features of the ! sample application, so that we can understand it better.</p> ! <ul> ! <li>All the templates of the application are placed in the folder ! <em>/templates/</em>. We tell to the framework where to look for the ! templates by giving an appropriate value to the constant ! <strong>TPL_PATH</strong> ! in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','4')"> ! <em>config/const.Paths.php</em></a>. ! <br> ! <br></li> ! <li>All the images of this application are placed in the folder ! <em>/img/</em>. In templates they are linked using the ! <strong>{{#IMG_URL}}</strong> variable. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/footer.html','9,10')"> ! See</a> how it is used. The <strong>{{#IMG_URL}}</strong> template ! variable gets the value from the PHP constant <strong>IMG_URL</strong>, ! which is declared in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','6')"> ! <em>config/const.Paths.php</em></a>. ! <br> ! <br></li> ! <li>All the files and templates of the page3 are placed in the ! folder <em>/templates/page3/</em>. Organizing files into folders and ! subfolders reduces the complexity of the application and makes it ! easier to be understood and maintained. ! <a href="javascript:codeReview('{{APP2_PATH}}templates/footer.js','17')"> ! Notice</a> how the transition to page3 is done. ! <br> ! <br></li> ! <li>All the pages include the same header and footer template, e.g. see ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1.html','7,9')"> ! page1.html</a>. If you want to change something in the footer of ! the page, then you don't have to change every page, but you make ! the change only once in the footer. ! <br> ! <br></li> ! ! <li><a href="{{APP2_URL}}browse.php" target="_blank">Browse</a> ! the files of the application and see the templates <em>page1.html</em>, ! <em>header.html</em>, <em>footer.html</em>, <em>page1_content.html</em>. ! See them both in preview mode and in code view mode (select the "Code View" ! mode in the panel at the top and then click "Refresh"). ! <br> ! <br></li> + <li>Browse the files and see the template <em>page2.html</em> and all + the templates in the folder <em>/templates/page3/</em>. See them both in + preview mode and in code view mode. These two pages are the same + in terms of what they display, however they are implemented + differently in the server. <em>page2.html</em> is implemented as a flat + big HTML file, while <em>page3.html</em> is structured, divided into + several small subtemplates. Try to make the same modification in + both of them and see which one is easier to be modified. + <br> + <br></li> </ul> *************** *** 211,415 **** <hr> ! <a name="exercises"> ! <h4>Exercises</h4> ! <p> ! Before starting the exercises, make a copy of the application 'app2' ! to the folder 'test/app2'. If you don't know how to do it, go and ! study the first part of the tutorial (Transitions). ! </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> - <a name="exercise1"> - <h5>1 - Modify page2.html and page3.html</h5> - <p> - Change to red the color of the tpl_2_1 box, and change the text - inside it to "This box is red!". - </p> - <p> - Modify page2.html: <ol> ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page2.css','52,59','')">page2.css</a> ! and change the color in the highlighted lines to 'red'. ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page2.html','39-40','')">page2.html</a> ! and change the text in the highlighted lines to "This box is red!". </ol> - Which of the pages do you think is easier to be modified? - </p> ! <p> ! Modify page3.html: <ol> ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.css','5,12','')">tpl_2_1.css</a> ! and change the color in the highlighted lines to 'red'. ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.html','5-6','')">tpl_2_1.html</a> ! and change the text in the highlighted lines to "This box is red!". </ol> - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> - <a name="exercise2"> - <h5>2 - Rename folder 'img' to 'images'</h5> - <p> <ol> ! <li> Rename folder 'img' to 'images' ($ mv img images). Test the application; ! the images will be broken. ! <li> Change the value of the IMG_URL constant in the file ! <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','5-6','')">const.Paths.php</a>. ! Reload the application. The images should be allright. </ol> - If all the images in the application are linked like this: - <pre> - <img src="{{#IMG_URL}}image_name.png"/> - </pre> - there will be no problem. However, if any image is hard linked like this: - <pre> - <img src="/img/image_name.png"/> - </pre> - it will not be displayed. - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> - <a name="exercise3"> - <h5>3 - Divide Page1 further into subtemplates</h5> - <p> <ol> ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1_content.html','11-17','')">page1_content.html</a> ! and copy the selected lines to the file 'tpl_vars.html'. ! <li> Replace the selected lines with this line: ! <pre> ! <Include SRC="{{#./}}tpl_vars.html"/> ! </pre> ! <li> Copy the ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1_content.html','19-36','15-40')">selected lines</a> ! of 'page1_content.html' to file 'include_tag.html', and replace ! them with: ! <pre> ! <Include SRC="{{#./}}include_tag.html"/> ! </pre> ! <li> Copy the ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1_content.html','38-49','33-55')">selected lines</a> ! of 'page1_content.html' to file 'comments.html', and replace ! them with: ! <pre> ! <Include SRC="{{#./}}comments.html"/> ! </pre> ! <li> Copy the ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1_content.html','51-72','45-72')">selected lines</a> ! of 'page1_content.html' to file 'js_code.html', and replace ! them with: ! <pre> ! <Include SRC="{{#./}}js_code.html"/> ! </pre> ! <li> If you test the application now, page1 will be displayed correctly, ! but if you click the link 'page1' at the bottom of the page, an ! error will occour. To fix this, open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.js','7','')">footer.js</a> ! and correct line 7 to go to "page1/page1.html". ! <li> Test that the application now is OK. </ol> - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> - <a name="exercise4"> - <h5>4 - Move Page1 to a new folder</h5> - <p> - If you make a listing of the folder '/templates/' you will see that - now there are a lot of files in it and it has started to become messy. - It would be better if we moved page1 files to another folder. <ol> ! <li> Create new folder 'page1' ($ mkdir page1) ! <li> Move files 'page1.html', 'page1_content.html', ! 'tpl_vars.html', 'include_tags.html', 'comments.html', ! 'js_code.html' to folder 'page1' (e.g. $ mv page1.html page1/) ! <li> If you test the application now, it will give an error. ! Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}event_handlers/on.firstTime.php','8','')">event_handlers/on.firstTime.php</a> ! and change the $targetPage to "page1/page1.html". ! <li> If you test the application now, it will not be able to find the ! stylesheet and the header and footer templates. Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page1.html','4,8,10','')">page1/page1.html</a> ! and replace <i>{{#./}}</i> with <i>{{#TPL_URL}}</i> for the ! stylesheet, and with <i>{{#TPL_PATH}}</i> for the templates, ! in the selected lines. </ol> - </p> - <span class="button"><a href="#toc">TOC</a></span> - <hr> ! <a name="exercise5"> ! <h5>5 - Change the styles of the page1_content</h5> ! <p> <ol> ! <li> In the folder '/templates/page1/' create the file 'page1_content.css' ! which has these lines: ! <pre> ! h4 { color: red } ! p { color: blue } ! </pre> ! <li> At the top of the file 'page1_content.html' add this line: ! <pre> ! <link rel="stylesheet" type="text/css" href="{{#./}}page1_content.css"> ! </pre> ! <li> Test the application and notice the changes in page1. </ol> - </p> - <span class="button"><a href="#toc">TOC</a></span> - <hr> ! <a name="exercise6"> ! <h5>6 - Move template tpl_2.html and its related files to folder 'page3/tpl_2/</h5> ! <p> <ol> ! <li> Create new folder 'tpl_2' ! ($ cd templates/page3/ $ mkdir tpl_2) ! <li> Move the files 'tpl_2.html', 'tpl_2.css', 'tpl_2_1.html', 'tpl_2_1.css', ! 'tpl_2_2.html', 'tpl_2_2.css' to the new folder ! (e.g. $ mv tpl_2*.* tpl_2) ! <li> Open the file ! <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tmpl.html','11','')">tmpl.html</a> ! and change the SRC of the included template to ! "{{#./}}tpl_2/tpl_2.html". ! <li> Test the application and go to page3. It should be displayed correctly. </ol> ! Do yourself these changes as well: <ul> ! <li> Create a new folder '/templates/page2/' and move the files ! 'page2.html' and 'page2.css' to it. ! <li> Create a new folder '/templates/page3/tpl_1' and move the files ! 'tpl_1.html' and 'tpl_1.css' to it. ! <li> Create a new folder '/templates/page3/tpl_2/tpl_2_1' and move the files ! 'tpl_2_1.html' and 'tpl_2_1.css' to it. ! <li> Create a new folder '/templates/page3/tpl_2/tpl_2_2' and move the files ! 'tpl_2_2.html' and 'tpl_2_2.css' to it. </ul> - </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> ! <a name="exercise7"> ! <h5>7 - Think about it</h5> ! <p> ! Suppose that you would like to add the current date at the top of each ! file (whithout using JavaScript, using PHP). How would you do it? ! Or, in general, how could you display something from PHP in the page? ! </p> ! <span class="button"><a href="#toc">TOC</a></span> ! <hr> --- 235,450 ---- <hr> ! <h3><a name="exercises">Exercises</a></h3> ! <p>Before starting the exercises, make a copy of the application ! <em>app2</em> to the folder <em>test/app2</em>. If you have problems ! with doing this (e.g. <em>test/app2</em> doesn't work) then see the ! <a href="javascript:tabs3_select('tabs3::tutorial','transitions')"> ! first tutorial</a>, second exercise.</p> ! ! <a name="exercise_1"></a> ! ! <h4>1 - Modify page2.html and page3.html</h4> ! ! <p>Change to red the color of the tpl_2_1 box, and change the text ! inside it to "This box is red!".</p> ! ! <p>Modify page2.html:</p> <ol> ! <li>Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page2.css','52,59')"> ! page2.css</a> and change the color in the highlighted lines to ! <em>red</em>.</li> ! ! <li>Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page2.html','60')"> ! page2.html</a> and change the text in the highlighted lines to ! "This box is red!".</li> </ol> ! <p>Modify page3.html:</p> ! <ol> ! <li>Open the file <a href= ! "javascript:codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.css','5,12','')"> ! tpl_2_1.css</a> and change the color in the highlighted lines to ! <em>red</em>.</li> ! ! <li>Open the file <a href= ! "javascript:codeReview('{{APP2_PATH}}templates/page3/tpl_2_1.html','5-6','')"> ! tpl_2_1.html</a> and change the text in the highlighted line to ! "This box is red!".</li> </ol> ! <p>Which of the pages do you think is easier to be modified?</p> ! ! ! <a name="exercise_2"></a> ! ! <h4>2 - Rename folder <em>img</em> to <em>images</em></h4> <ol> ! <li>Rename folder <em>img</em> to <em>images</em>: ! <kbd>$ mv img images</kbd> <br> ! Test the application; the images will be broken.</li> ! ! <li>Change the value of the <strong>IMG_URL</strong> constant in the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Paths.php','6')"> ! const.Paths.php</a>. ! Reload the application. The images should be allright.</li> </ol> ! <p>If all the images in the application are linked like this: ! <kbd><img src="{{#IMG_URL}}image_name.png"/></kbd> ! there will be no problem. However, if any image is hard linked ! like this: <kbd><img src="/img/image_name.png"/></kbd> ! it will not be displayed.</p> ! ! <a name="exercise_3"></a> ! <h4>3 - Divide Page1 further into subtemplates</h4> <ol> ! <li>Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','9-14')"> ! page1_content.html</a> and copy the selected lines to the file ! <em>tpl_vars.html</em>.</li> ! ! <li>Replace the selected lines with this line: <br> ! <kbd><Include SRC="{{#./}}tpl_vars.html"/></kbd></li> ! ! <li>Copy the ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','16-30','10-35')"> ! selected lines</a> of <em>page1_content.html</em> to file ! <em>include_tag.html</em>, and replace them with: <br> ! <kbd><Include SRC="{{#./}}include_tag.html"/></kbd></li> ! ! <li>Copy the ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','32-42','27-47')"> ! selected lines</a> of <em>page1_content.html</em> to file ! <em>comments.html</em>, and replace them with: <br> ! <kbd><Include SRC="{{#./}}comments.html"/></kbd></li> ! ! <li>Copy the ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1_content.html','44-63','40-70')"> ! selected lines</a> of <em>page1_content.html</em> to file ! <em>js_code.html</em>, and replace them with: <br> ! <kbd><Include SRC="{{#./}}js_code.html"/></kbd></li> ! ! <li>Test that the application is OK.</li> </ol> ! <a name="exercise_4"></a> ! ! <h4>4 - Move Page1 to a new folder</h4> ! ! <p>If you make a listing of the folder <em>/templates/</em> you will see ! that now there are a lot of files in it and it has started to ! become messy. It would be better if we moved page1 files to another ! folder.</p> <ol> ! <li>Create new folder <em>page1</em>: <br> ! <kbd>$ mkdir page1</kbd></li> ! ! <li>Move files <em>page1.html</em>, <em>page1_content.html</em>, ! <em>tpl_vars.html</em>, <em>include_tags.html</em>, <em>comments.html</em>, ! <em>js_code.html</em> to folder <em>page1</em><br> ! e.g. <kbd>$ mv page1.html page1/</kbd></li> ! ! <li>If you test the application now, you will get an error. Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Options.php','9-13')"> ! <em>config/const.Options.php</em></a> and change the value of the constant ! <strong>FIRSTPAGE</strong> to "page1/page1.html".</li> ! ! <li>If you test the application now, it will not be able to find ! the stylesheet and the header and footer templates. Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page1.html','4,7,9','')"> ! <em>page1/page1.html</em></a> and replace <strong>{{#./}}</strong> ! with <strong>{{#TPL_URL}}</strong> for the stylesheet, and with ! <strong>{{#TPL_PATH}}</strong> for the templates, in the selected ! lines.</li> </ol> ! <a name="exercise_5"></a> ! ! <h4>5 - Change the styles of the page1_content</h4> ! <ol> ! <li>In the folder <em>/templates/page1/</em> create the file ! <em>page1_content.css</em> which has these lines: ! <pre> ! h4 { color: red } ! p { color: blue } ! </pre> ! </li> ! ! <li>At the top of the file <em>page1_content.html</em> add this line: ! <pre> ! <link rel="stylesheet" type="text/css" href="{{#./}}page1_content.css"> ! </pre> ! </li> ! ! <li>Test the application and notice the changes in page1.</li> </ol> ! <a name="exercise_6"></a> ! ! <h4>6 - Move template tpl_2.html to folder <em>page3/tpl_2/</em></h4> ! <ol> ! <li>Create new folder <em>tpl_2</em>:<br> ! <kbd>$ cd templates/page3/ ; mkdir tpl_2</kbd></li> ! ! <li>Move the files <em>tpl_2.html</em>, <em>tpl_2.css</em>, ! <em>tpl_2_1.html</em>, <em>tpl_2_1.css</em>, <em>tpl_2_2.html</em>, ! <em>tpl_2_2.css</em> to the new folder: <br> ! <kbd>$ mv tpl_2*.* tpl_2</kbd></li> ! ! <li>Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}templates/page3/tmpl.html','11','')"> ! tmpl.html</a> and change the <strong>SRC</strong> attribute of the include ! tag to <kbd>{{#./}}tpl_2/tpl_2.html</kbd>.</li> ! ! <li>Test the application and go to page3. It should be displayed ! correctly.</li> </ol> ! ! <p>Do yourself these changes as well:</p> ! <ul> ! <li>Create a new folder <em>/templates/page2/</em> and move the files ! <em>page2.html</em> and <em>page2.css</em> to it.</li> ! ! <li>Create a new folder <em>/templates/page3/tpl_1</em> and move the ! files <em>tpl_1.html</em> and <em>tpl_1.css</em> to it.</li> ! ! <li>Create a new folder <em>/templates/page3/tpl_2/tpl_2_1</em> and move ! the files <em>tpl_2_1.html</em> and <em>tpl_2_1.css</em> to it.</li> ! ! <li>Create a new folder <em>/templates/page3/tpl_2/tpl_2_2</em> and move ! the files <em>tpl_2_2.html</em> and <em>tpl_2_2.css</em> to it.</li> </ul> ! <h4><a name="exercise_7">7 - Debug templates</a></h4> ! <ol> ! <li>Open the file ! <a href="javascript:codeReview('{{APP2_PATH}}config/const.Debug.php','18-22')"> ! <em>config/const.Debug.php</em></a> and set the constant ! <strong>DEBUG_TEMPLATES</strong> to <em>true</em>.</li> ! <li>Refresh the application.</li> ! </ol> ! ! <h4><a name="exercise_8">8 - Think about it</a></h4> + <p>Suppose that you would like to add the current date at the top + of each file (whithout using JavaScript, using PHP). How would you + do it? Or, in general, how could you display something from PHP in + the page?</p> + + <p><span class="button"><a href="#toc">TOC</a></span></p> + <hr> |
From: Dashamir H. <das...@us...> - 2003-08-20 07:32:09
|
Update of /cvsroot/phpwebapp/web_app/boxes/fileView In directory sc8-pr-cvs1:/tmp/cvs-serv7039/boxes/fileView Modified Files: fileView.php fileView.html Log Message: Index: fileView.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/fileView.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fileView.php 11 Aug 2003 16:17:52 -0000 1.3 --- fileView.php 20 Aug 2003 07:07:56 -0000 1.4 *************** *** 8,13 **** function init() { ! $curr_path = WebApp::getVar("./"); ! $this->addSVar("file", $curr_path."sample_file.html"); } --- 8,13 ---- function init() { ! $curr_path = dirname(__FILE__); ! $this->addSVar("file", $curr_path."/sample_file.html"); } Index: fileView.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/fileView.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fileView.html 16 Jul 2003 09:27:59 -0000 1.2 --- fileView.html 20 Aug 2003 07:07:56 -0000 1.3 *************** *** 1,3 **** <WebBox ID="fileView"> ! <Include SRC="{{template}}"> </WebBox> --- 1,3 ---- <WebBox ID="fileView"> ! <Include SRC="{{template}}"> </WebBox> |
From: Dashamir H. <das...@us...> - 2003-08-20 07:01:58
|
Update of /cvsroot/phpwebapp/web_app/database In directory sc8-pr-cvs1:/tmp/cvs-serv5491/database Modified Files: class.MySQLCnn.php class.Connection.php Log Message: fixed a bug introduced by comment conversion Index: class.MySQLCnn.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.MySQLCnn.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** class.MySQLCnn.php 11 Aug 2003 16:17:52 -0000 1.4 --- class.MySQLCnn.php 20 Aug 2003 06:57:45 -0000 1.5 *************** *** 9,13 **** { /** - * passw =DBPASS, $db_name =DBNAME) * Opens a connection using the given parameters. * If no parameters are given, then uses as default values --- 9,12 ---- *************** *** 15,18 **** --- 14,18 ---- */ function MySQLCnn($host =DBHOST, $user =DBUSER, + $passw =DBPASS, $db_name =DBNAME) { $this->cnn = mysql_pconnect($host, $user, $passw); Index: class.Connection.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.Connection.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** class.Connection.php 11 Aug 2003 16:17:52 -0000 1.4 --- class.Connection.php 20 Aug 2003 06:57:45 -0000 1.5 *************** *** 18,23 **** * like this one. */ - /** assw =DBPASS, $db_name =DBNAME) */ function Connection($host =DBHOST, $user =DBUSER, { //empty function --- 18,23 ---- * like this one. */ function Connection($host =DBHOST, $user =DBUSER, + $passw =DBPASS, $db_name =DBNAME) { //empty function |
From: Dashamir H. <das...@us...> - 2003-08-20 07:01:58
|
Update of /cvsroot/phpwebapp/web_app/boxes/fileView In directory sc8-pr-cvs1:/tmp/cvs-serv5385/boxes/fileView Removed Files: viewText.html Log Message: --- viewText.html DELETED --- |
From: Dashamir H. <das...@us...> - 2003-08-16 01:11:10
|
Update of /cvsroot/phpwebapp/app1/img In directory sc8-pr-cvs1:/tmp/cvs-serv31719/img Added Files: state_diagram.png Log Message: improvments of app1 --- NEW FILE: state_diagram.png --- PNG Sjñ:üø41Æhíó9"JÑüo&èÉçsD_§hügߣ Ä(E_ýmÁ Mübx³ÆÍ'Æimm$I¢ë7G(E÷ÓÓÄü Ëñmç>óVuµ "ûåóýsɵ1ÌV Cà°òÔ ÜJÕCÎNÄá¥Äa_¯_éXù ;QÚHt3LO3y-سPTþ<MÜc-v{¢S3g£Õ ñ¸ÄjnèO¸ÁÆFáôÜ3ái*P<Ý¥QËð<î(~:ñþdçݾzpÚÓj ÜÒkoïöUýìas½e Z@¹ ç½qònßNÑxÞññlÛNEÆðÜ@y¶Í£gÃó϶ñ¨¨Âóµ[ÄÓ:Óh\ýFñÖH ç©!àµòj@° ^;æ¼ÙÕ{xºAàZðdÓ¢®Sx e/,EñµruCÛáuÄâ!ï7¼åæ&vGïSΦju¹ M8ÜT¾ zÜ"ãÁXlG9» KÙdAâÁ¾Fâ©Ù«ð$»M¥ã:/cáë?nzâ§¼ý»VS,àâÉ< {·Ñx¦é°]<nGqºßSJÀåþï6\ÿMAeìr§«eõqÂJCHîG ½GÔAÜûh±âþB4{Äc·ÅÉósþ>¬>AamÑâìc÷¢Ùcð$rt¨ÝH@94Y>©[ÉÍmïÍß·@(Ô©kÍméD¡ãABýðùzÜðéOWÐÝu¡ýPÄn<?®ûx %ÿÅðf9æ~3Nkks$íhúæ¥è~ú:Áz¸l%0§¦)>;J]Ç"4·¸\¢aáiö8Åýb9å®\zÝ]¿{ ¤· ~ Õ rñ%ÖÂ:¦î$Ñ{LÇt`÷TÒN Vç ù#Ç"¸wwØ×xûDx&p7¯§¢8ë³±ÜY95"<ÀQ\ãmÄÛh<Á½pÄ{Ï<Âë2`û¡ÿÔ'_`ÙFÎ |
From: Dashamir H. <das...@us...> - 2003-08-16 01:05:18
|
Update of /cvsroot/phpwebapp/app1 In directory sc8-pr-cvs1:/tmp/cvs-serv31719 Modified Files: styles.css page3.html page2.html page1.html external_page.html Log Message: improvments of app1 Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/app1/styles.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** styles.css 21 Feb 2003 08:23:38 -0000 1.1.1.1 --- styles.css 15 Aug 2003 08:15:53 -0000 1.2 *************** *** 1,43 **** body { ! background-color:#EFE7D6; ! margin-top:20px; ! margin-left:20px; ! margin-right:20px; ! margin-bottom:20px; ! } ! ! .font ! { ! font-family: Arial, Helvetica, Sans-Se; ! font-size: 10pt; ! color:#000000; ! } ! ! .checkbox, .radio ! { ! } ! ! .text, .button ! { ! font-family: Arial, Helvetica, Sans-Se; ! font-size: 10pt; ! background-color: #EAEAEA; ! color: #006666; } ! .title { ! COLOR: #FFFFFF; ! FONT-FAMILY: Arial, Helvetica, Sans-Se; ! FONT-SIZE: 12px; ! FONT-WEIGHT: bold } ! .strong { ! COLOR: #000066; ! FONT-FAMILY: Arial, Helvetica, Sans-Se; ! FONT-SIZE: 16px; ! FONT-WEIGHT: bold } --- 1,23 ---- body { ! background-color: #efe7d6; ! margin-top: 20px; ! margin-left: 20px; ! margin-right: 20px; ! margin-bottom: 20px; ! font-family: arial, helvetica, sans-se; ! font-size: 12pt; ! color: #000000; } ! h1, h2 { ! text-align: center; } ! strong { ! color: #000066; ! font-size: 14px; ! font-weight: bold } Index: page3.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page3.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** page3.html 11 Aug 2003 16:39:02 -0000 1.2 --- page3.html 15 Aug 2003 08:15:53 -0000 1.3 *************** *** 1,24 **** <html> ! <head> ! <title> Page 3 </title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! </head> ! <body> ! <h2> Page 3 of the application </h2> ! <h3> Debugging Transitions </h3> ! If you open in an editor the file <i>config/const.Settings.php</i> ! you will see there a constant named <i>DEBUG_GOTO</i>. Make it ! <i>true</i> and notice that each time that you make a transition ! you get an alert about it. ! <p> ! Go To [ ! <a href="javascript: GoTo('page1.html')"> Page 1 </a> | ! <a href="javascript: GoTo('page2.html')"> Page 2 </a> ! | Page 3 ] ! <p> ! <a href="javascript: history.back()"><img src="img/back.png" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" border="0"></a> ! </body> </html> --- 1,27 ---- <html> ! <head> ! <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! </head> ! <body> ! <h2>Page 3 of the application</h2> ! ! <h3>Debugging Transitions</h3> + <p>If you open in an editor the file + <em>config/const.Debug.php</em> you will see there a constant + named <em>DEBUG_GOTO</em>. Make it <em>true</em> and notice that + each time that you make a transition you get an alert about + it.</p> + + <p>Go To + [ <a href="javascript:GoTo('page1.html')">Page 1</a> + | <a href="javascript:GoTo('page2.html')">Page 2</a> + | Page 3 + ]</p> + + <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> + <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> + </body> </html> Index: page2.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page2.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** page2.html 11 Aug 2003 16:39:02 -0000 1.2 --- page2.html 15 Aug 2003 08:15:53 -0000 1.3 *************** *** 1,26 **** <html> ! <head> ! <title> Page 2 </title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! </head> ! <body> ! <h2> Page 2 of the application </h2> ! <h3> External Pages </h3> ! The external pages are HTML pages that are outside the ! application. They are linked as usually in HTML, without using ! transitions and the function <b>GoTo()</b>. See the examples ! below and click the link to the <i>external page</i>. ! <li> <a href="http://www.yahoo.com/"> Yahoo! </a> ! <li> <a href="external_page.html"> external page </a> ! <p> ! Go To [ ! <a href="javascript: GoTo('page1.html')"> Page 1 </a> | ! Page 2 | ! <a href="javascript: GoTo('page3.html')"> Page 3 </a> ] ! <p> ! <a href="javascript: history.back()"><img src="img/back.png" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" border="0"></a> ! </body> </html> --- 1,32 ---- <html> ! <head> ! <title>Page 2</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! </head> ! <body> ! <h2>Page 2 of the application</h2> + <h3>External Pages</h3> + + <p>The external pages are HTML pages that are outside the + application. They are linked as usually in HTML, without using + transitions and the function <strong>GoTo()</strong>. See the + examples below and click the link to the <em>external + page</em>.</p> + + <ul> + <li><a href="http://www.yahoo.com/">Yahoo!</a></li> + <li><a href="external_page.html">external page</a></li> + </ul> + + <p>Go To + [ <a href="javascript:GoTo('page1.html')">Page 1</a> + | Page 2 + | <a href="javascript:GoTo('page3.html')">Page 3</a> + ]</p> + + <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> + <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> + </body> </html> Index: page1.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page1.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** page1.html 11 Aug 2003 16:39:02 -0000 1.2 --- page1.html 15 Aug 2003 08:15:53 -0000 1.3 *************** *** 1,44 **** <html> ! <head> ! <title> Page 1 </title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! <script language="javascript"> ! function on_test() ! { ! var msg; ! msg = "Function on_test() is called.\n" ! + "Here we can do input data validations etc.\n" ! + "Finally, if everything is OK, we call\n" ! + "GoTo('page1.html') to make the transition.\n"; ! alert(msg); ! GoTo('page1.html'); ! } ! </script> ! </head> ! <body> ! <h2> Page 1 of the application </h2> ! <h3> Transitions by GoTo() </h3> ! Transitions from one page of the application to another ! are done by using the javascript function <b>GoTo('page.html')</b>. ! This function is declared by the framework itself and is included ! automatically at the end of each page of the application. Make ! a 'View Source' now and see that there is some code appended to ! the page by the framework. ! <p> ! In real applications, usually <i>GoTo()</i> is called from inside ! a <i>JavaScript</i> function, after making some input data validations ! etc. E.g. try this link: <a href="javascript: on_test()">test</a> ! wich calls the <i>JavaScript</i> function <i>on_test()</i>. ! <p> ! Go To [ ! Page 1 | ! <a href="javascript: GoTo('page2.html')"> Page 2 </a> | ! <a href="javascript: GoTo('page3.html')"> Page 3 </a> ] ! <p> ! <a href="javascript: history.back()"><img src="img/back.png" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" border="0"></a> ! <p> ! </body> </html> --- 1,60 ---- <html> ! <head> ! <title>Page 1</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> ! <script language="javascript" type="text/javascript"> ! function on_test() ! { ! var msg; ! msg = "Function on_test() is called.\n" ! + "Here we can do input data validations etc.\n" ! + "Finally, if everything is OK, we call\n" ! + "GoTo('page1.html') to make the transition.\n"; ! alert(msg); ! GoTo('page1.html'); ! } ! </script> ! </head> ! <body> ! <h2>Page 1 of the application</h2> ! ! <h3>A phpWebApp Application is Like a State Machine</h3> ! ! <p>The <strong>phpWebApp</strong> thinks of a web application as ! a state machine, where each state is a web page. Each time the browser ! loads something new in its window, you see a snapshot of the application ! in a certain state. For example, this sample application can be ! described by the following state diagram:</p> ! ! <div align="center"> ! <img src="img/state_diagram.png" ! alt="A state diagram that represents three pages of the application as three states"> ! </div> ! ! <h3>Transitions by GoTo()</h3> ! ! <p>Transitions from one page of the application to another are ! done by using the javascript function ! <strong>GoTo('page.html')</strong>. This function is declared by ! the framework itself and is included automatically at the end of ! each page of the application. Make a 'View Source' now and see ! that there is some code appended to the page by the ! framework.</p> ! ! <p>In real applications, usually <em>GoTo()</em> is called from ! inside a <em>JavaScript</em> function, after making some input ! data validations etc. E.g. try this link: ! <a href="javascript:on_test()">test</a> wich calls the ! <em>JavaScript</em> function <em>on_test()</em>.</p> ! ! <p>Go To ! [ Page 1 ! | <a href="javascript:GoTo('page2.html')">Page 2</a> ! | <a href="javascript:GoTo('page3.html')">Page 3</a> ! ]</p> + <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> + <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> + </body> </html> Index: external_page.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/external_page.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** external_page.html 11 Aug 2003 16:39:02 -0000 1.2 --- external_page.html 15 Aug 2003 08:15:53 -0000 1.3 *************** *** 1,28 **** <html> ! <head> ! <title> External Page </title> ! </head> ! <body> ! <h3> External Page </h3> ! This page is not a part of the application <b>app1</b>, ! it is a simple HTML page, or the page of another application. ! <p> ! Here you cannot use the function <b>GoTo()</b> because it is ! undefined, e.g. if you try this link: ! <a href="javascript: GoTo('page1.html')"> GoTo('page1.html') </a> ! it will give a javascript error. ! <p> ! You can go to the page of the application from which ! you came here only by pressing the button <b>back</b> in the browser. ! If you try to link to it like this: ! <a href="page2.html"> page2.html </a>, it will not work, ! because the page will be openned in the browser as a simple ! html page (not as a page of the application <b>app1</b>). Try ! to click it and see that the transitions in 'page2.html' will ! not work. ! <p> ! <a href="javascript: history.back()"><img src="img/back.png" border="0"></a> ! </body> </html> --- 1,33 ---- <html> ! <head> ! <title>External Page</title> ! </head> ! <body> ! <h3>External Page</h3> ! ! <p>This page is not a part of the application ! <strong>app1</strong>, it is a simple HTML page, or the page of ! another application.</p> ! ! <p>Here you cannot use the function <strong>GoTo()</strong> ! because it is undefined, e.g. if you try this link: <a href= ! "javascript:GoTo('page1.html')">GoTo('page1.html')</a> you ! will get a javascript error.</p> ! ! <p>You can go to the page of the application from which you came ! here only by pressing the button <strong>back</strong> in the ! browser. If you try to link to it like this: <a href= ! "page2.html">page2.html</a> , it will not work, because the page ! will be openned in the browser as a simple html page (like this one) ! not as a page of the application <strong>app1</strong>. Try to click it ! and see that the transitions in 'page2.html' will not work. ! View the source of <a href="page2.html">page2.html</a> and notice ! that additional code added by the framework is missing (the logo ! is missing too).</p> + <a href="javascript:history.back()"> + <img src="img/back.png" alt="Back" border="0"> + </a> + </body> </html> |
From: Dashamir H. <das...@us...> - 2003-08-16 00:52:35
|
Update of /cvsroot/phpwebapp/app1/config In directory sc8-pr-cvs1:/tmp/cvs-serv31719/config Modified Files: const.Paths.php Log Message: improvments of app1 Index: const.Paths.php =================================================================== RCS file: /cvsroot/phpwebapp/app1/config/const.Paths.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** const.Paths.php 7 Aug 2003 15:58:49 -0000 1.2 --- const.Paths.php 15 Aug 2003 08:15:53 -0000 1.3 *************** *** 1,6 **** <?php //constants of the paths in the application ! define("WEBAPP_PATH", APP_PATH."../web_app/"); ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("TPL_PATH", APP_PATH); ?> --- 1,5 ---- <?php //constants of the paths in the application ! define("WEBAPP_PATH", UP_PATH."web_app/"); ! define("TPL_PATH", APP_PATH); ?> |
From: Dashamir H. <das...@us...> - 2003-08-15 19:39:42
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv19635 Modified Files: styles.css Log Message: - improved styles - removed some extra spaces Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/styles.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** styles.css 16 Jul 2003 09:28:00 -0000 1.2 --- styles.css 15 Aug 2003 07:05:08 -0000 1.3 *************** *** 1,34 **** .error_msg { ! COLOR: red; ! TEXT-DECORATION: none; ! font-family:"Verdana"; ! font-size:10px; ! font-weight:bold } .warning_msg { ! COLOR: brawn; ! TEXT-DECORATION: none; ! font-family:"Verdana"; ! font-size:10px; ! font-weight:bold } .whiteRow { ! COLOR: navy; ! FONT-FAMILY: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; ! FONT-SIZE: 12px; ! background-color:#ffffff; } .greyRow { ! COLOR: navy; ! FONT-FAMILY: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; ! FONT-SIZE: 12px; ! background-color:#f2f2f2; } --- 1,57 ---- + /* styles of [Powered by phpWebApp] logo */ + .webapp_logo + { + margin: 10 0; + padding: 0px; + } + .webapp_logo a + { + margin: 0; + padding: 2px; + font-family: arial, helvetica, sans-se; + font-size: 10pt; + font-weight: bold; + text-align: center; + text-decoration: none; + color: #008800; + background-color: #dddddd; + white-space: nowrap; + border: 1px solid #444488; + } + .webapp_logo a:hover + { + background-color: #eeeeee; + } + .error_msg { ! color: red; ! font-family: arial, helvetica, sans-se; ! font-size: 10px; ! font-weight: bold; } .warning_msg { ! color: brawn; ! font-family: arial, helvetica, sans-se; ! font-size: 10px; ! font-weight: bold; } .whiteRow { ! color: navy; ! font-family: arial, helvetica, sans-se; ! font-size: 12px; ! background-color: #ffffff; } .greyRow { ! color: navy; ! font-family: arial, helvetica, sans-se; ! font-size: 12px; ! background-color: #f2f2f2; } |
From: Dashamir H. <das...@us...> - 2003-08-15 09:37:22
|
Update of /cvsroot/phpwebapp/app2/config In directory sc8-pr-cvs1:/tmp/cvs-serv6630/config Modified Files: const.Paths.php Log Message: Index: const.Paths.php =================================================================== RCS file: /cvsroot/phpwebapp/app2/config/const.Paths.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** const.Paths.php 7 Aug 2003 16:00:59 -0000 1.2 --- const.Paths.php 15 Aug 2003 09:10:10 -0000 1.3 *************** *** 1,8 **** <?php //constants of the paths in the application ! define("WEBAPP_PATH", APP_PATH."../web_app/"); ! define("EVENTHANDLER_PATH", APP_PATH."event_handlers/"); ! define("IMG_URL", APP_URL."img/"); ! define("TPL_PATH", APP_PATH."templates/"); ! define("TPL_URL", APP_URL."templates/"); ?> --- 1,7 ---- <?php //constants of the paths in the application ! define("WEBAPP_PATH", UP_PATH."web_app/"); ! define("TPL_PATH", APP_PATH."templates/"); ! define("TPL_URL", APP_URL."templates/"); ! define("IMG_URL", APP_URL."img/"); ?> |
From: Dashamir H. <das...@us...> - 2003-08-15 09:30:40
|
Update of /cvsroot/phpwebapp/app2 In directory sc8-pr-cvs1:/tmp/cvs-serv6630 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/app2/webapp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webapp.php 7 Aug 2003 16:00:59 -0000 1.2 --- webapp.php 15 Aug 2003 09:10:10 -0000 1.3 *************** *** 4,9 **** $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $document_root = $_SERVER["DOCUMENT_ROOT"]; ! $app_url = str_replace($document_root, '', $app_path); define("APP_URL", $app_url); --- 4,9 ---- $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2003-08-15 09:20:13
|
Update of /cvsroot/phpwebapp/app1 In directory sc8-pr-cvs1:/tmp/cvs-serv5827 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/app1/webapp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webapp.php 7 Aug 2003 15:58:49 -0000 1.2 --- webapp.php 15 Aug 2003 09:03:22 -0000 1.3 *************** *** 4,9 **** $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $document_root = $_SERVER["DOCUMENT_ROOT"]; ! $app_url = str_replace($document_root, '', $app_path); define("APP_URL", $app_url); --- 4,9 ---- $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2003-08-15 09:18:23
|
Update of /cvsroot/phpwebapp/documentation In directory sc8-pr-cvs1:/tmp/cvs-serv5627 Modified Files: webapp.php Log Message: APP_URL fix Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/webapp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webapp.php 7 Aug 2003 15:54:14 -0000 1.2 --- webapp.php 15 Aug 2003 09:01:58 -0000 1.3 *************** *** 4,9 **** $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $document_root = $_SERVER["DOCUMENT_ROOT"]; ! $app_url = str_replace($document_root, '', $app_path); define("APP_URL", $app_url); --- 4,9 ---- $app_path = dirname($script_filename)."/"; define("APP_PATH", $app_path); ! $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2003-08-15 09:12:58
|
Update of /cvsroot/phpwebapp/app2/templates/page3 In directory sc8-pr-cvs1:/tmp/cvs-serv6504/templates/page3 Modified Files: tpl_2_2.html tpl_2_2.css tpl_2_1.html tpl_2_1.css tpl_2.html tpl_2.css tpl_1.html tpl_1.css tmpl.html tmpl.css page3.html Log Message: improvments in the styles and templates Index: tpl_2_2.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_2.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2_2.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2_2.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,9 **** <link rel="stylesheet" type="text/css" href="{{./}}tpl_2_2.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2_2">tpl_2_2.html</td></tr> ! <tr><td class="box_content_2_2"> ! tpl_2_2 <br> ! content ! </td></tr> </table> --- 1,9 ---- <link rel="stylesheet" type="text/css" href="{{./}}tpl_2_2.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2_2">tpl_2_2.html</td></tr> ! <tr><td class="box_content_2_2"> ! tpl_2_2 <br> ! content ! </td></tr> </table> Index: tpl_2_2.css =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_2.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2_2.css 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2_2.css 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 2,16 **** .box_title_2_2 { ! text-align: center; ! background-color: #663300; ! color: white } .box_content_2_2 { ! height: 100; ! border: thin solid #663300; ! background-color: white; ! text-align: center } --- 2,16 ---- .box_title_2_2 { ! text-align: center; ! background-color: #663300; ! color: white } .box_content_2_2 { ! height: 100; ! border: thin solid #663300; ! background-color: white; ! text-align: center } Index: tpl_2_1.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_1.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2_1.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2_1.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,9 **** <link rel="stylesheet" type="text/css" href="{{./}}tpl_2_1.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2_1">tpl_2_1.html</td></tr> ! <tr><td class="box_content_2_1"> ! tpl_2_1 <br> ! content ! </td></tr> </table> --- 1,9 ---- <link rel="stylesheet" type="text/css" href="{{./}}tpl_2_1.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2_1">tpl_2_1.html</td></tr> ! <tr><td class="box_content_2_1"> ! tpl_2_1 <br> ! content ! </td></tr> </table> Index: tpl_2_1.css =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_1.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2_1.css 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2_1.css 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 2,16 **** .box_title_2_1 { ! text-align: center; ! background-color: #660033; ! color: white } .box_content_2_1 { ! height: 100; ! border: thin solid #660033; ! background-color: white; ! text-align: center } --- 2,16 ---- .box_title_2_1 { ! text-align: center; ! background-color: #660033; ! color: white } .box_content_2_1 { ! height: 100; ! border: thin solid #660033; ! background-color: white; ! text-align: center } Index: tpl_2.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,15 **** <link rel="stylesheet" type="text/css" href="{{./}}tpl_2.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2">tpl_2.html</td></tr> ! <tr><td class="box_content_2"> ! <table width="100%" border="0" cellspacing="10" cellpadding="0"> ! <tr><td> ! <Include SRC="{{./}}tpl_2_1.html"/> ! </td></tr> ! <tr><td> ! <Include SRC="{{./}}tpl_2_2.html"/> ! </td></tr> ! </table> ! </td></tr> </table> --- 1,15 ---- <link rel="stylesheet" type="text/css" href="{{./}}tpl_2.css" /> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_2">tpl_2.html</td></tr> ! <tr><td class="box_content_2"> ! <table width="100%" border="0" cellspacing="10" cellpadding="0"> ! <tr><td> ! <Include SRC="{{./}}tpl_2_1.html"/> ! </td></tr> ! <tr><td> ! <Include SRC="{{./}}tpl_2_2.html"/> ! </td></tr> ! </table> ! </td></tr> </table> Index: tpl_2.css =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_2.css 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_2.css 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 2,13 **** .box_title_2 { ! text-align: center; ! background-color: #336600; ! color: white } .box_content_2 { ! background-color: #eeeeee; ! border: thin solid #336600 } --- 2,13 ---- .box_title_2 { ! text-align: center; ! background-color: #336600; ! color: white } .box_content_2 { ! background-color: #eeeeee; ! border: thin solid #336600 } Index: tpl_1.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_1.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_1.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_1.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,22 **** <link rel="stylesheet" type="text/css" href="{{./}}tpl_1.css" /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_1">tpl_1.html</td> ! </tr> ! <tr><td class="box_content_1" valign="top"> ! <p class="content_1"> ! <i>page3.html</i> is the same as <i>page2.html</i>, however it ! is implemented using the templates and the ! <strong><Include></strong> tag ! of the framework. Some of the benefits of separating pages ! into templates are: ! <ul> ! <li> <strong>Modularity</strong> -- the graphical ! designer can work with smaller pieces of code. ! <li> <strong>Reusability</strong> -- templates are ! easier to be reused in other pages or other ! applications. ! </ul> ! </p> ! </td></tr> </table> --- 1,22 ---- <link rel="stylesheet" type="text/css" href="{{./}}tpl_1.css" /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title_1">tpl_1.html</td> ! </tr> ! <tr><td class="box_content_1" valign="top"> ! <p class="content_1"> ! <i>page3.html</i> is the same as <i>page2.html</i>, however it ! is implemented using the templates and the ! <strong><Include></strong> tag ! of the framework. Some of the benefits of separating pages ! into templates are: ! <ul> ! <li> <strong>Modularity</strong> -- the graphical ! designer can work with smaller pieces of code. ! <li> <strong>Reusability</strong> -- templates are ! easier to be reused in other pages or other ! applications. ! </ul> ! </p> ! </td></tr> </table> Index: tpl_1.css =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_1.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tpl_1.css 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tpl_1.css 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 2,20 **** .box_title_1 { ! text-align: center; ! background-color: #006633; ! color: white } .box_content_1 { ! height: 250; ! background-color: #eeeeee; ! border: thin solid #006633 } .content_1 { ! padding: 10; ! font-family: arial } --- 2,20 ---- .box_title_1 { ! text-align: center; ! background-color: #006633; ! color: white } .box_content_1 { ! height: 250; ! background-color: #eeeeee; ! border: thin solid #006633 } .content_1 { ! padding: 10; ! font-family: arial } Index: tmpl.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tmpl.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tmpl.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tmpl.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,17 **** <link rel="stylesheet" type="text/css" href="{{./}}tmpl.css" /> <table width="95%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title">tpl.html</td></tr> ! <tr><td class="box_content"> ! <table width="100%" border="0" cellspacing="20" cellpadding="0"> ! <tr> ! <td width="60%" valign="top"> ! <Include SRC="{{./}}tpl_1.html"/> ! </td> ! <td valign="top"> ! <Include SRC="{{./}}tpl_2.html"/> ! </td> ! </tr> ! </table> ! </td></tr> </table> --- 1,17 ---- <link rel="stylesheet" type="text/css" href="{{./}}tmpl.css" /> <table width="95%" align="center" border="0" cellspacing="0" cellpadding="0"> ! <tr><td class="box_title">tpl.html</td></tr> ! <tr><td class="box_content"> ! <table width="100%" border="0" cellspacing="20" cellpadding="0"> ! <tr> ! <td width="60%" valign="top"> ! <Include SRC="{{./}}tpl_1.html"/> ! </td> ! <td valign="top"> ! <Include SRC="{{./}}tpl_2.html"/> ! </td> ! </tr> ! </table> ! </td></tr> </table> Index: tmpl.css =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tmpl.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tmpl.css 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- tmpl.css 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 2,14 **** .box_title { ! text-align: center; ! background-color: #003366; ! color: white } .box_content { ! height: 250; ! background-color: white; ! border: thin solid #003366 } --- 2,14 ---- .box_title { ! text-align: center; ! background-color: #003366; ! color: white } .box_content { ! height: 250; ! background-color: white; ! border: thin solid #003366 } Index: page3.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/page3.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** page3.html 21 Feb 2003 08:24:14 -0000 1.1.1.1 --- page3.html 15 Aug 2003 09:09:26 -0000 1.2 *************** *** 1,15 **** <html> ! <head> ! <title> Page 3 </title> ! <link rel="stylesheet" type="text/css" href="{{TPL_URL}}styles.css"> ! </head> ! ! <body> ! <Include SRC="{{TPL_PATH}}header.html"/> ! <h3> A Page Constructed by Subtemplates </h3> ! <Include SRC="{{./}}tmpl.html"/> ! <br><br> ! <Include SRC="{{TPL_PATH}}footer.html"/> ! </body> ! </html> --- 1,13 ---- <html> ! <head> ! <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="{{TPL_URL}}styles.css"> ! </head> ! <body> ! <Include SRC="{{TPL_PATH}}header.html"/> ! <h3>A Page Constructed by Subtemplates</h3> ! <Include SRC="{{./}}tmpl.html"/> ! <br><br> ! <Include SRC="{{TPL_PATH}}footer.html"/> ! </body> </html> |