phpwebapp-commits Mailing List for phpWebApp
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...> - 2006-03-17 16:51:44
|
Update of /cvsroot/phpwebapp/books/content In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv937/content Modified Files: make-content.sh Log Message: Index: make-content.sh =================================================================== RCS file: /cvsroot/phpwebapp/books/content/make-content.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** make-content.sh 3 Nov 2005 10:43:32 -0000 1.2 --- make-content.sh 17 Mar 2006 16:51:31 -0000 1.3 *************** *** 19,20 **** --- 19,21 ---- ./import.sh initial_xml/${book_id}_en.xml $book_id done + |
From: Dashamir H. <das...@us...> - 2006-03-17 16:51:37
|
Update of /cvsroot/phpwebapp/books In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv937 Modified Files: ToDo.txt authenticate.php books.conf Removed Files: chown.c install.sh Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/books/ToDo.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ToDo.txt 7 Nov 2005 14:17:48 -0000 1.3 --- ToDo.txt 17 Mar 2006 16:51:30 -0000 1.4 *************** *** 1,2 **** --- 1,39 ---- + - Improve the installation, so that it becomes platform independent. + //- Try to install swish-e locally. + + - Automatic notification on commit (for subversion). + - Installation of ViewCVS for Subversion. + + - Update 'webnotes'. + + - docbookwiki_guide_en.xml still has problems, generation of pdf fails + + - Changing the structure of a book takes a long time (is very slow). + Maybe there is any problem or maybe it can be optimized. + + - In TextWiki mode: + + there is a small bug with nested lists + + the tag </xmp> inside --code is not displayed in html (because + it is inside an <xmp> element); it should be written < /xmp> + or </ xmp> + + the closing tag \</tagname\> has problems; it should be writen + \</ tagname\> or \< /tagname\> + + - The reader can hide or show user notes. + - The user that has approve rights can see a list of nodes that + he can approve (the modified ones). + + - Keep binary files (media, images etc.) in CVS as well. + + - Search about character encoding and fix some problems related + to them (change encoding to UTF-8 or ISO-8859-15). + + - See whether the certificates (https) can be used for authenticating + editors, admins, etc., instead of (username,password). + + - Make UML Diagrams that document the design of the application. + + + Improvments: *************** *** 42,45 **** --- 79,84 ---- //- Extend <xref/> to link to other books as well, to figures etc. Maybe any other tag should be used. + - Think about integrating DocBookWiki with RefDB + (http://refdb.sourceforge.net/). *************** *** 54,60 **** - Update 'webnotes'. - - explode/implode has some problems with entities (&amp;lt;) - and it does not preserve the CDATA sections. - - Fix chown.c (for some reason it was not working, and it was preventing the work in the other parts of the application, --- 93,96 ---- *************** *** 81,124 **** ----- ! - Fixed: When the validation of a section is done, it gives errors ! for xref-s to other sections. ! ! - Fixed: Automatic email notification on commit for SVN. ! ! - Improvment: Diffs are displayed in text/wiki mode. ! ! - Fixed: Added in docbookwiki_guide some instructions ! for installation of the subversion. ! ! - Fixed: Added some viewcvs installation instructions, ! so that it works with svn as well. ! ! - Improvment: Improves webnotes to: ! + make the moderation optional ! + filter the list of notes according to their status ! (e.g. if the admin wants to see only the notes that ! need to be approved) ! + optionally send email notification to admins ! when new notes are submited ! ! - Fixed: The path of the SVN is hardcoded and when the application ! is renamed, SVN operations fail. This is fixed by ! contents/svn_relocate.sh ! ! - Fixed: book tags ! The public copy of the book can be fixed at a certain revision or ! date. After that, the modifications in the workspace will not be ! published immediately, even when they are approved. ! ! Since it is not easy to remember certain dates or revision numbers, ! the tags can be used, to label a certain revision or date, and to mark ! important points in the development of the document. E.g. a tag can be ! created for each release of the program, if the document is the ! documentation of a program. ! ! To create a tag for a certain version of the document, first fix the ! book to this version (by revision number or by date), and then ! create a new tag for it, which is like a label for it. Then the tags ! can be selected conveniently from the list of tags. ! ! - Fixed: validation problem: warnings (W) should not prevent saving --- 117,120 ---- ----- ! - Improvment: Replaced nsgmls by xmllint for checking the DocBook validity ! of XML files. Index: authenticate.php =================================================================== RCS file: /cvsroot/phpwebapp/books/authenticate.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** authenticate.php 3 Nov 2005 10:43:32 -0000 1.2 --- authenticate.php 17 Mar 2006 16:51:30 -0000 1.3 *************** *** 29,37 **** $passwd = $_SERVER["PHP_AUTH_PW"]; ! if ($user=='superuser' and crypt($passwd,'6ueNQisonyc2o')=='6ueNQisonyc2o') { define('SU', 'true'); define('USER', $user); ! define('EMAIL', 'ad...@ex...'); return true; } --- 29,41 ---- $passwd = $_SERVER["PHP_AUTH_PW"]; ! //the crypted password can be generated from the command line ! //using the command: $ openssl passwd -1 password ! $su_passwd='$1$3Xv3XHQv$YlwXWWf5IzIhIIMOSognG/'; ! ! if ($user=='superuser' and crypt($passwd, $su_passwd)==$su_passwd) { define('SU', 'true'); define('USER', $user); ! define('EMAIL', ADMIN_EMAIL); return true; } *************** *** 82,84 **** if (!isset($_SERVER['PHP_AUTH_USER'])) authenticate(); else if (!is_valid()) authenticate(); ! ?> \ No newline at end of file --- 86,88 ---- if (!isset($_SERVER['PHP_AUTH_USER'])) authenticate(); else if (!is_valid()) authenticate(); ! ?> Index: books.conf =================================================================== RCS file: /cvsroot/phpwebapp/books/books.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** books.conf 3 Nov 2005 10:43:32 -0000 1.2 --- books.conf 17 Mar 2006 16:51:30 -0000 1.3 *************** *** 9,15 **** ### The username and email of the superuser - ADMIN='dasho' # ADMIN_EMAIL='das...@us...' ! ADMIN_EMAIL="$ADMIN" ### A list of languages that can be supported by the application; --- 9,14 ---- ### The username and email of the superuser # ADMIN_EMAIL='das...@us...' ! ADMIN_EMAIL="dasho" ### A list of languages that can be supported by the application; *************** *** 52,58 **** # SWISH-E program path. SWISH_E='/usr/local/bin/swish-e' - - # parameters of nsgmls - SGML_CATALOG='/etc/sgml/catalog' - XML_DCL='/usr/share/sgml/xml.dcl' - #XML_DCL='/usr/share/sgml/declaration/xml.dcl' --- 51,52 ---- --- chown.c DELETED --- --- install.sh DELETED --- |
From: Dashamir H. <das...@us...> - 2006-03-17 16:51:37
|
Update of /cvsroot/phpwebapp/books/templates/main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv937/templates/main Modified Files: main.php Log Message: Index: main.php =================================================================== RCS file: /cvsroot/phpwebapp/books/templates/main/main.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.php 3 Nov 2005 10:43:32 -0000 1.2 --- main.php 17 Mar 2006 16:51:31 -0000 1.3 *************** *** 71,75 **** //set book_title ! $book_id = $this->getSVar('book_id'); $book_title = $this->get_book_title($book_id, $lng); WebApp::setSVar('book_title', $book_title); --- 71,75 ---- //set book_title ! $book_id = WebApp::getSVar('docbook->book_id'); $book_title = $this->get_book_title($book_id, $lng); WebApp::setSVar('book_title', $book_title); |
From: Dashamir H. <das...@us...> - 2006-03-17 16:46:54
|
Update of /cvsroot/phpwebapp/books In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30500 Log Message: Update date 2006-03-17 Status: Vendor Tag: DocBookWiki Release Tags: books_0_8_3_2 U books/xref.php U books/webapp.php U books/index.php U books/global.php U books/edit.php U books/chown_norec.sh U books/chown.sh U books/browse.php C books/books.conf C books/authenticate.php U books/admin.php C books/ToDo.txt U books/README N books/Makefile U books/INSTALL U books/COPYING U books/.cvsignore U books/xsl_transform/implode/section2sect.xsl U books/xsl_transform/implode/implode.xsl U books/xsl_transform/explode/sect2section.xsl U books/xsl_transform/explode/index-xml.xsl U books/xsl_transform/explode/get_title.xsl U books/xsl_transform/explode/get_lang.xsl U books/xsl_transform/explode/get_id.xsl U books/xsl_transform/explode/content-xml.xsl U books/xsl_transform/edit_content/xml2xml1.xsl U books/xsl_transform/edit_content/xml2xml.xsl U books/xsl_transform/edit_content/xml2text.xsl U books/xsl_transform/edit_content/xml2latex.xsl U books/xsl_transform/edit_content/xml2html_normalize.xsl U books/xsl_transform/edit_content/xml2html_names.xsl U books/xsl_transform/edit_content/xml2html.xsl U books/xsl_transform/edit_content/html2xml_normalize.xsl U books/xsl_transform/edit_content/html2xml_names.xsl U books/xsl_transform/edit_content/html2xml.xsl U books/xsl_transform/edit_content/xml2text/menuchoice.xsl U books/xsl_transform/edit_content/xml2text/list.xsl U books/xsl_transform/edit_content/xml2text/inline.xsl U books/xsl_transform/edit_content/xml2text/info.xsl U books/xsl_transform/edit_content/xml2text/block.xsl U books/xsl_transform/edit/update_node.xsl U books/xsl_transform/edit/subsections.xsl U books/xsl_transform/edit/set_content_title.xsl U books/xsl_transform/edit/set_content_id.xsl U books/xsl_transform/edit/move_up.xsl U books/xsl_transform/edit/move_down.xsl U books/xsl_transform/edit/get_subnodes.xsl U books/xsl_transform/edit/get_node_type.xsl U books/xsl_transform/edit/get_node_path.xsl U books/xsl_transform/edit/get_node_id.xsl U books/xsl_transform/edit/get_navigation.xsl U books/xsl_transform/edit/get_id_list.xsl U books/xsl_transform/edit/delete.xsl U books/xsl_transform/edit/add_subnode.xsl U books/xsl_transform/edit/test/update_node.sh U books/xsl_transform/edit/test/subsections.sh U books/xsl_transform/edit/test/set_content_title.sh U books/xsl_transform/edit/test/set_content_id.sh U books/xsl_transform/edit/test/move_up.sh U books/xsl_transform/edit/test/move_down.sh U books/xsl_transform/edit/test/get_subnodes.sh U books/xsl_transform/edit/test/get_node_type.sh U books/xsl_transform/edit/test/get_node_id.sh U books/xsl_transform/edit/test/get_navigation.sh U books/xsl_transform/edit/test/delete.sh U books/xsl_transform/edit/test/add_subnode.sh U books/xsl_transform/common/section-level.xsl U books/xsl_transform/common/node-path.xsl U books/xsl_transform/common/node-id.xsl U books/xsl_transform/common/navigation.xsl U books/xsl_transform/common/get-title.xsl U books/xsl_transform/common/get-subnodes.xsl U books/xsl_transform/common/count.xsl U books/xsl_transform/cache/update_content.xsl U books/xsl_transform/cache/subnodes-html.xsl U books/xsl_transform/cache/navigation-txt.xsl U books/xsl_transform/cache/content-html.xsl U books/xsl_transform/cache/content_html/section.xsl U books/xsl_transform/cache/content_html/media.xsl U books/xsl_transform/cache/content_html/list.xsl U books/xsl_transform/cache/content_html/link.xsl U books/xsl_transform/cache/content_html/key_gui.xsl U books/xsl_transform/cache/content_html/footnotes.xsl U books/xsl_transform/cache/content_html/figure.xsl U books/xsl_transform/cache/content_html/bookinfo.xsl U books/webobjects/tabs/tabs1_items.php U books/webobjects/tabs/tabs1.txt U books/webobjects/tabs/tabs1.php U books/webobjects/tabs/tabs1.js U books/webobjects/tabs/tabs1.html U books/webobjects/tabs/tabs1.css U books/upload/upload_message.html U books/upload/upload.php U books/upload/media_file.php U books/upload/import_doc.php U books/templates/search/search.php U books/templates/search/search.js U books/templates/search/search.html U books/templates/search/search.css U books/templates/search/next_prev.html U books/templates/search/help_sq_AL.html U books/templates/search/help_en_US.html U books/templates/search/help.html U books/templates/search/l10n/search.po U books/templates/search/l10n/sq_AL/LC_MESSAGES/search.po U books/templates/menu/menu_tpl.js U books/templates/menu/menu_items.js U books/templates/menu/menu.xml U books/templates/menu/menu.js U books/templates/menu/menu.html U books/templates/menu/menu.css U books/templates/menu/book_list.php C books/templates/main/main.php U books/templates/main/main.js U books/templates/main/main.html U books/templates/main/main.css U books/templates/main/header.html U books/templates/main/footer.html U books/templates/main/css/list.css U books/templates/main/css/hidden_submit.css U books/templates/main/css/form.css U books/templates/main/css/filter.css U books/templates/main/css/button.css U books/templates/left/left.js U books/templates/left/left.html U books/templates/left/left.css U books/templates/langs/langs.php U books/templates/langs/langs.html U books/templates/langs/langs.css U books/templates/docbook/header.html U books/templates/docbook/funcs.php U books/templates/docbook/footer.html U books/templates/docbook/docbook.php U books/templates/docbook/docbook.js U books/templates/docbook/docbook.html U books/templates/docbook/docbook.css U books/templates/docbook/view/view.php U books/templates/docbook/view/view.html U books/templates/docbook/view/view.css U books/templates/docbook/view/webnotes/webnotes.php U books/templates/docbook/view/webnotes/webnotes.js U books/templates/docbook/view/webnotes/webnotes.html U books/templates/docbook/view/webnotes/webnotes.db U books/templates/docbook/view/webnotes/webnotes.css U books/templates/docbook/view/webnotes/DB.php U books/templates/docbook/view/webnotes/footer.html U books/templates/docbook/view/webnotes/filternotes/filternotes.php U books/templates/docbook/view/webnotes/filternotes/filternotes.js U books/templates/docbook/view/webnotes/filternotes/filternotes.html U books/templates/docbook/view/webnotes/editnote/preview.html U books/templates/docbook/view/webnotes/editnote/help.html U books/templates/docbook/view/webnotes/editnote/editnote.php U books/templates/docbook/view/webnotes/editnote/editnote.js U books/templates/docbook/view/webnotes/editnote/editnote.html U books/templates/docbook/view/webnotes/editnote/editnote.css U books/templates/docbook/view/webnotes/editnote/edit.html U books/templates/docbook/view/webnotes/db/dump.sh U books/templates/docbook/view/webnotes/db/webnotes.sql U books/templates/docbook/view/css/preformated.css U books/templates/docbook/view/css/media.css U books/templates/docbook/view/css/list.css U books/templates/docbook/view/css/link.css U books/templates/docbook/view/css/key_gui.css U books/templates/docbook/view/css/inline.css U books/templates/docbook/view/css/footnotes.css U books/templates/docbook/view/css/figure.css U books/templates/docbook/view/css/contents.css U books/templates/docbook/view/css/bookinfo.css U books/templates/docbook/view/css/admonitions.css U books/templates/docbook/l10n/docbook.po U books/templates/docbook/l10n/sq_AL/LC_MESSAGES/docbook.po U books/templates/docbook/edit/edit_funcs.php U books/templates/docbook/edit/edit.php U books/templates/docbook/edit/edit.js U books/templates/docbook/edit/edit.html U books/templates/docbook/edit/edit.css U books/templates/docbook/edit/media/edit_media.php U books/templates/docbook/edit/media/edit_media.js U books/templates/docbook/edit/media/edit_media.html U books/templates/docbook/edit/media/edit_media.css U books/templates/docbook/edit/content/validate.php U books/templates/docbook/edit/content/func.popup_window.php U books/templates/docbook/edit/content/edit_content.php U books/templates/docbook/edit/content/edit_content.js U books/templates/docbook/edit/content/edit_content.html U books/templates/docbook/edit/content/edit_content.css U books/templates/docbook/edit/content/convert_to_xml.php U books/templates/docbook/edit/content/convert_from_xml.php U books/templates/docbook/edit/content/text_to_xml/wiki_structure_conventions.txt U books/templates/docbook/edit/content/text_to_xml/wiki_conventions.txt U books/templates/docbook/edit/content/text_to_xml/package.WikiConverter.php U books/templates/docbook/edit/content/text_to_xml/fun.regex_replace.php U books/templates/docbook/edit/content/text_to_xml/class.WikiParser.php U books/templates/docbook/edit/content/text_to_xml/class.Tpl.php U books/templates/docbook/edit/content/text_to_xml/class.Text.php U books/templates/docbook/edit/content/text_to_xml/class.Paragraph.php U books/templates/docbook/edit/content/text_to_xml/class.Listing.php U books/templates/docbook/edit/content/text_to_xml/class.ListItem.php U books/templates/docbook/edit/content/text_to_xml/class.Info.php U books/templates/docbook/edit/content/text_to_xml/class.Block.php U books/templates/docbook/approve/approve.php U books/templates/docbook/approve/approve.js U books/templates/docbook/approve/approve.html U books/templates/docbook/approve/approve.css U books/templates/docbook/approve/revisions/revisions.php U books/templates/docbook/approve/revisions/revisions.js U books/templates/docbook/approve/revisions/revisions.html U books/templates/docbook/approve/revisions/revisions.css U books/templates/docbook/admin/admin.php U books/templates/docbook/admin/admin.js U books/templates/docbook/admin/admin.html U books/templates/docbook/admin/admin.css U books/templates/docbook/admin/svn_tags/tags.php U books/templates/docbook/admin/svn_tags/tags.js U books/templates/docbook/admin/svn_tags/tags.html U books/templates/docbook/admin/svn_tags/func.popup_window.php U books/templates/books/books.php U books/templates/books/books.js U books/templates/books/books.html U books/templates/admin/menu_items.php U books/templates/admin/header.html U books/templates/admin/admin.php U books/templates/admin/admin.js U books/templates/admin/admin.html U books/templates/admin/admin.css U books/templates/admin/users/users.html U books/templates/admin/users/filter/userFilter.php U books/templates/admin/users/filter/userFilter.js U books/templates/admin/users/filter/userFilter.html U books/templates/admin/users/filter/userFilter.css U books/templates/admin/users/list/userList.php U books/templates/admin/users/list/userList.js U books/templates/admin/users/list/userList.html U books/templates/admin/users/list/selected.png U books/templates/admin/users/list/notselected.png U books/templates/admin/users/list/footer.html U books/templates/admin/users/edit/userEdit.php U books/templates/admin/users/edit/userEdit.js U books/templates/admin/users/edit/userEdit.html U books/templates/admin/users/edit/menu.js U books/templates/admin/users/edit/menu.html U books/templates/admin/users/edit/header.html U books/templates/admin/user_data/user_data.php U books/templates/admin/user_data/user_data.js U books/templates/admin/user_data/user_data.html U books/templates/admin/user_data/user_data.css U books/templates/admin/user_data/modified_nodes/modified_nodes.php U books/templates/admin/user_data/modified_nodes/modified_nodes.js U books/templates/admin/user_data/modified_nodes/modified_nodes.html U books/templates/admin/user_data/modified_nodes/modified_nodes.css U books/templates/admin/user_data/edit_rights/edit_rights.php U books/templates/admin/user_data/edit_rights/edit_rights.html U books/templates/admin/user_data/edit_rights/edit_rights.css U books/templates/admin/scripts/user_data.php U books/templates/admin/scripts/users/get_user.sh U books/templates/admin/scripts/users/get_filtered_users.sh U books/templates/admin/scripts/users/get_all_users.sh U books/templates/admin/scripts/users/del_user.sh U books/templates/admin/scripts/users/count_filtered_users.sh U books/templates/admin/scripts/users/add_user.sh U books/templates/admin/scripts/books/get_user_rights.sh U books/templates/admin/scripts/books/get_user_nr.sh U books/templates/admin/scripts/books/get_user_list.sh U books/templates/admin/scripts/books/get_book_nodes.xsl U books/templates/admin/scripts/books/get_book_nodes.sh U books/templates/admin/scripts/books/del_user.sh U books/templates/admin/scripts/books/add_user.sh U books/templates/admin/scripts/book_admin/update_downloads.sh U books/templates/admin/l10n/admin.po U books/templates/admin/l10n/sq_AL/LC_MESSAGES/admin.po U books/templates/admin/edit_menu/subitems.html U books/templates/admin/edit_menu/new_menu_item.html U books/templates/admin/edit_menu/edit_menu_item.html U books/templates/admin/edit_menu/edit_menu.php U books/templates/admin/edit_menu/edit_menu.js U books/templates/admin/edit_menu/edit_menu.html U books/templates/admin/edit_menu/edit_menu.css U books/templates/admin/edit_menu/buttons.html U books/templates/admin/edit_menu/menu/menu_items.php U books/templates/admin/edit_menu/menu/menu.xml U books/templates/admin/edit_menu/menu/menu.js U books/templates/admin/edit_menu/menu/menu.html U books/templates/admin/edit_menu/menu/xsl/update.xsl U books/templates/admin/edit_menu/menu/xsl/subitems.xsl U books/templates/admin/edit_menu/menu/xsl/move_up.xsl U books/templates/admin/edit_menu/menu/xsl/move_down.xsl U books/templates/admin/edit_menu/menu/xsl/menu_items.xsl U books/templates/admin/edit_menu/menu/xsl/get_parent_id.xsl U books/templates/admin/edit_menu/menu/xsl/get_bookid.xsl U books/templates/admin/edit_menu/menu/xsl/edit_menu_items.xsl U books/templates/admin/edit_menu/menu/xsl/delete.xsl U books/templates/admin/edit_menu/menu/xsl/copy_item.xsl U books/templates/admin/edit_menu/menu/xsl/book_list.xsl U books/templates/admin/edit_menu/menu/xsl/add_subitem.xsl U books/templates/admin/edit_menu/menu/xsl/test/update.sh U books/templates/admin/edit_menu/menu/xsl/test/subitems.sh U books/templates/admin/edit_menu/menu/xsl/test/move_up.sh U books/templates/admin/edit_menu/menu/xsl/test/move_down.sh U books/templates/admin/edit_menu/menu/xsl/test/menu_items.sh U books/templates/admin/edit_menu/menu/xsl/test/get_parent_id.sh U books/templates/admin/edit_menu/menu/xsl/test/edit_menu_items.sh U books/templates/admin/edit_menu/menu/xsl/test/delete.sh U books/templates/admin/edit_menu/menu/xsl/test/copy_item.sh U books/templates/admin/edit_menu/menu/xsl/test/book_list.sh U books/templates/admin/edit_menu/menu/xsl/test/add_subitem.sh U books/templates/admin/css/list.css U books/templates/admin/css/hidden_submit.css U books/templates/admin/css/form.css U books/templates/admin/css/filter.css U books/templates/admin/css/button.css U books/templates/admin/books/books.php U books/templates/admin/books/books.js U books/templates/admin/books/books.html U books/templates/admin/books/books.css U books/templates/admin/book/book.html U books/templates/admin/book/uList/uList.php U books/templates/admin/book/uList/uList.js U books/templates/admin/book/uList/uList.html U books/templates/admin/book/uList/uList.css U books/templates/admin/book/uList/selected.png U books/templates/admin/book/uList/notselected.png U books/templates/admin/book/uList/footer.html U books/templates/admin/book/uList/adduser.html U books/templates/admin/book/uEdit/uEdit.php U books/templates/admin/book/uEdit/uEdit.js U books/templates/admin/book/uEdit/uEdit.html U books/templates/admin/book/uEdit/uEdit.css U books/templates/admin/book/uEdit/menu.js U books/templates/admin/book/uEdit/menu.html U books/templates/admin/book/uEdit/add_rights.html U books/templates/admin/addbook/id_lng.html U books/templates/admin/addbook/delete.html U books/templates/admin/addbook/create.html U books/templates/admin/addbook/addbook.php U books/templates/admin/addbook/addbook.js U books/templates/admin/addbook/addbook.html U books/templates/admin/addbook/addbook.css U books/templates/admin/addbook/GNU-FDL.xml U books/templates/admin/addbook/import_doc/import_doc.php U books/templates/admin/addbook/import_doc/import_doc.js U books/templates/admin/addbook/import_doc/import_doc.html U books/templates/admin/addbook/book_list/book_list.php U books/templates/admin/addbook/book_list/book_list.html U books/templates/admin/addbook/book_list/book_list.css U books/templates/admin/access_rights/users U books/search/tag_index.cfg U books/search/search.sh U books/search/make_index.sh U books/search/global_index.cfg U books/search/.cvsignore U books/l10n/xgettext.sh U books/l10n/msgmerge.sh U books/l10n/msginit.sh U books/l10n/get_app_name.sh U books/l10n/book.po U books/l10n/README U books/l10n/msgfmt.sh U books/l10n/sq_AL/LC_MESSAGES/book.po N books/install/set_su_passwd.sh N books/install/make-chown.sh N books/install/help.sh N books/install/chown.h N books/install/chown.c N books/install/configure.sh U books/graphics/header-logo.png U books/graphics/header-background.png U books/graphics/go-up.png U books/graphics/go-prev.png U books/graphics/go-next.png U books/graphics/go-home.png U books/graphics/flag-sq_AL.png U books/graphics/flag-it.png U books/graphics/flag-fr.png U books/graphics/flag-en.png U books/graphics/flag-al.png U books/content/svn_relocate.sh C books/content/make-content.sh U books/content/import.sh U books/content/clean.sh U books/content/book_list.sh U books/content/.cvsignore U books/content/initial_xml/transform_template.xsl U books/content/initial_xml/transform.xsl C books/content/initial_xml/tools_and_apps_en.xml C books/content/initial_xml/slackware_router_en.xml C books/content/initial_xml/phpwebapp_manual_en.xml C books/content/initial_xml/linux_server_config_en.xml U books/content/initial_xml/linux_server_admin.tgz C books/content/initial_xml/lcg_install_en.xml U books/content/initial_xml/kushtetuta_it.xml C books/content/initial_xml/kushtetuta_al.xml C books/content/initial_xml/install_exim_en.xml C books/content/initial_xml/inima_soft_server_en.xml C books/content/initial_xml/inima_gateway_server_en.xml C books/content/initial_xml/gateway_server_en.xml U books/content/initial_xml/docbookwiki_guide_en.xml U books/content/initial_xml/book_template_en.xml U books/content/initial_xml/article_template_en.xml U books/content/initial_xml/GNU-FDL.xml U books/content/initial_xml/.cvsignore U books/content/implode/section2sect.sh U books/content/implode/pre_process.php U books/content/implode/post_process.php U books/content/implode/implode.sh U books/content/implode/.cvsignore U books/content/explode/pre_process.php U books/content/explode/post_process.php U books/content/explode/explode.sh U books/content/explode/.cvsignore U books/content/downloads/xml_xsl.sh U books/content/downloads/sgml_dsssl.sh U books/content/downloads/make-downloads.sh U books/content/downloads/make-all-downloads.sh U books/content/downloads/checkout_xml_sources.sh U books/content/downloads/.cvsignore U books/content/cache/html2xhtml.php U books/content/cache/cache.sh U books/content/books_media/slackware_router/intro/problem/diagram3.png U books/content/books_media/slackware_router/intro/problem/diagram2.png U books/content/books_media/slackware_router/intro/problem/diagram1.png U books/content/books_media/gateway_server/intro/intro-story/diagram3.png U books/content/books_media/gateway_server/intro/intro-story/diagram2.png U books/content/books_media/gateway_server/intro/intro-story/diagram1.png U books/content/test/section2sect.sh U books/content/test/sect2section.sh U books/content/test/get_lang.sh U books/content/test/get_id.sh U books/content/SVN/update_all.sh U books/content/SVN/update.sh U books/content/SVN/txt_diff.sh U books/content/SVN/sync_all.sh U books/content/SVN/sync.sh U books/content/SVN/post-commit.tmpl U books/content/SVN/init.sh U books/content/SVN/get_url.sh U books/content/SVN/commit_all.sh U books/content/SVN/commit.sh U books/content/SVN/commit-email.pl U books/content/SVN/book_list.sh U books/content/SVN/README U books/content/SVN/.cvsignore U books/config/const.Paths.php U books/config/const.Options.php U books/config/const.Debug.php U books/codedoc/phpdoc.sh U books/codedoc/doxygen.cfg U books/codedoc/README.txt 15 conflicts created by this import. Use the following command to help the merge: cvs checkout -jDocBookWiki:yesterday -jDocBookWiki books ***** Bogus filespec: - Imported sources |
From: Dashamir H. <das...@us...> - 2006-03-08 12:32:11
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16806/boxes/webnotes Modified Files: DB.php Log Message: Index: DB.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/webnotes/DB.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB.php 2 Nov 2005 15:17:54 -0000 1.2 --- DB.php 8 Mar 2006 12:31:42 -0000 1.3 *************** *** 18,22 **** //create a global connection variable ! global $cnn; ! $cnn = new MySQLCnn($host, $user, $passwd, $db); ! ?> \ No newline at end of file --- 18,25 ---- //create a global connection variable ! if (WEBNOTES_ENABLE=='true') ! { ! global $cnn; ! $cnn = new MySQLCnn($host, $user, $passwd, $db); ! } ! ?> |
From: Dashamir H. <das...@us...> - 2006-02-11 11:05:51
|
Update of /cvsroot/phpwebapp/books/content/initial_xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9284 Modified Files: phpwebapp_manual_en.xml Log Message: Index: phpwebapp_manual_en.xml =================================================================== RCS file: /cvsroot/phpwebapp/books/content/initial_xml/phpwebapp_manual_en.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** phpwebapp_manual_en.xml 12 Nov 2005 12:15:20 -0000 1.3 --- phpwebapp_manual_en.xml 11 Feb 2006 11:05:38 -0000 1.4 *************** *** 4,8 **** "http://docbook.org/xml/4.2/docbookx.dtd"> ! <book id="phpwebapp_manual" lang="en"> <title>The phpWebApp Manual</title> <bookinfo> --- 4,8 ---- "http://docbook.org/xml/4.2/docbookx.dtd"> ! <book id="phpwebapp_manual"> <title>The phpWebApp Manual</title> <bookinfo> *************** *** 97,103 **** <para>It is clear that such a mix of codes is a bad thing and a bad practice and it must be avoided as much as possible. </para> <para>The HTML syntax offers a possibility to take out the JavaScript code and the CSS code in separate files. It is like this: </para> ! <programlisting>&lt;script language="javascript" src="file.js"&gt;&lt;/script&gt; ! &lt;link rel="stylesheet" href="file.css" type="text/css" /&gt; ! </programlisting> <para>However there is no standard way to clearly separate the HTML, PHP and SQL codes. You can try to keep the degree of mixing of HTML and PHP code at a minimum level by carefully designing the application. E.g. you can place all the PHP code unrelated to the HTML generation (the code that contains the logic of the application) in a separate file and keep the file that generates the HTML page as lean as possible. </para> <para>A better solution to separate the HTML and PHP codes is to use a template engine. It uses templates for generating the final HTML page. Each template is a pure HTML file, which also has some slots or variables in it. The values of these variables are calculated by the PHP code and they are passed to the engine. Then the engine reads the templates, replaces the variables by their values and thus generates an HTML page which is sent to the browser. </para> --- 97,105 ---- <para>It is clear that such a mix of codes is a bad thing and a bad practice and it must be avoided as much as possible. </para> <para>The HTML syntax offers a possibility to take out the JavaScript code and the CSS code in separate files. It is like this: </para> ! <programlisting> ! <![CDATA[<script language="javascript" src="file.js"></script> ! <link rel="stylesheet" href="file.css" type="text/css" /> ! ]]> ! </programlisting> <para>However there is no standard way to clearly separate the HTML, PHP and SQL codes. You can try to keep the degree of mixing of HTML and PHP code at a minimum level by carefully designing the application. E.g. you can place all the PHP code unrelated to the HTML generation (the code that contains the logic of the application) in a separate file and keep the file that generates the HTML page as lean as possible. </para> <para>A better solution to separate the HTML and PHP codes is to use a template engine. It uses templates for generating the final HTML page. Each template is a pure HTML file, which also has some slots or variables in it. The values of these variables are calculated by the PHP code and they are passed to the engine. Then the engine reads the templates, replaces the variables by their values and thus generates an HTML page which is sent to the browser. </para> *************** *** 143,147 **** <para>Except the usual XHTML tags, the templates can also contain extra elements (tags), which are reckognized and processed by the framework. For the framework it doesn't matter the case (upper/lower) of these tags, however it is good to keep them in lowercase, since all the other XHTML tags are required to be lowercase (by the XHTML standard). </para> <para>So, the templates may not be fully compliant to the XHTML standard, due to the additional things that are supported by the framework. However, the page that the framework generates from them and which is sent to the browser, is a valid XHTML page. </para> ! <para>The framework preserves any CDATA marks that are found in the templates (this means that they still apear in the resulting page). This is important because the javascript code in an XHTML page needs to be written inside a CDATA section and, if the framework did not preserve the CDATA marks, the resulting page could not be a valid XHTML page. </para> <para>Another issue related to XML is this: each xml parser is required to process the entities: &amp; &lt; &gt; &quot; and &apos; and to return the corresponding character instead of the entity itself. For this reason, in order to include e.g. an ampersand in a page, it is not enough to write it in template as <emphasis>&amp;</emphasis> but it should be written as <emphasis>&amp;amp;</emphasis> . The same goes for &amp;lt;, &amp;quot;, etc. </para> </section> --- 145,149 ---- <para>Except the usual XHTML tags, the templates can also contain extra elements (tags), which are reckognized and processed by the framework. For the framework it doesn't matter the case (upper/lower) of these tags, however it is good to keep them in lowercase, since all the other XHTML tags are required to be lowercase (by the XHTML standard). </para> <para>So, the templates may not be fully compliant to the XHTML standard, due to the additional things that are supported by the framework. However, the page that the framework generates from them and which is sent to the browser, is a valid XHTML page. </para> ! <para>The framework preserves any CDATA marks that are found in the templates (this means that they still apear in the resulting page). This is important because the javascript code in an XHTML page needs to be written inside a CDATA section and, if the framework did not preserve the CDATA marks, the resulting page would not be a valid XHTML page. </para> <para>Another issue related to XML is this: each xml parser is required to process the entities: &amp; &lt; &gt; &quot; and &apos; and to return the corresponding character instead of the entity itself. For this reason, in order to include e.g. an ampersand in a page, it is not enough to write it in template as <emphasis>&amp;</emphasis> but it should be written as <emphasis>&amp;amp;</emphasis> . The same goes for &amp;lt;, &amp;quot;, etc. </para> </section> *************** *** 188,192 **** <para>Use <emphasis>!=</emphasis> instead of <emphasis><></emphasis> in the expression of the condition, because the xml parser complains about the characters < and > inside the value of an attribute. ! <programlisting>This is wrong: <![CDATA[<if condition="'{{CurrPage}}'<>'{{PrevPage}}'">...</if>]]></programlisting><programlisting>This is right: <![CDATA[<if condition="'{{CurrPage}}'!='{{PrevPage}}'">...</if>]]></programlisting></para> </tip> </section> --- 190,194 ---- <para>Use <emphasis>!=</emphasis> instead of <emphasis><></emphasis> in the expression of the condition, because the xml parser complains about the characters < and > inside the value of an attribute. ! <programlisting>This is wrong: <![CDATA[<if condition="'{CurrPage}'<>'{PrevPage}'">...</if>]]></programlisting><programlisting>This is right: <![CDATA[<if condition="'{CurrPage}'!='{PrevPage}'">...</if>]]></programlisting></para> </tip> </section> *************** *** 235,240 **** </programlisting> <para>The value of the "rs" attribute can also contain variables, like this: ! <programlisting><![CDATA[<repeat rs="{{rs_id}}"> . . . </repeat> ! ]]></programlisting> This allows a repeat block to use different queries in different cases (according to the logic of the program). These variables are evaluated in render time (it should be assigned in the function onParse(), or it should be a state variable or global variable). </para> </section> --- 237,241 ---- </programlisting> <para>The value of the "rs" attribute can also contain variables, like this: ! <programlisting><![CDATA[<repeat rs="{{rs_id}}"> . . . </repeat>]]></programlisting> This allows a repeat block to use different queries in different cases (according to the logic of the program). These variables are evaluated in render time (it should be assigned in the function onParse(), or it should be a state variable or global variable). </para> </section> *************** *** 270,274 **** <para>It also has a <Query> element, which contains the query to be executed. The query may contain variables, which are replaced at the time that the query is executed. </para> <tip> ! <para>If there is any <emphasis>smaller-than</emphasis> operator (<) in the contents of a <Query> element, then either replace it by &lt; or enclose the query in CDATA marks.</para> </tip> <para>There is also a <emphasis><dbCommand></emphasis> element, which is in fact identical to <recordset> but is usually used for insert/update/delete queries (which usually do not give a result other that successful/unsuccessful and cannot be used to construct a <emphasis>Recordset</emphasis> object). </para> --- 271,276 ---- <para>It also has a <Query> element, which contains the query to be executed. The query may contain variables, which are replaced at the time that the query is executed. </para> <tip> ! <para>If there is any <emphasis>smaller-than</emphasis> operator (<) in the contents of a <Query> element, then either replace ! it by &lt; or enclose the query in CDATA marks.</para> </tip> <para>There is also a <emphasis><dbCommand></emphasis> element, which is in fact identical to <recordset> but is usually used for insert/update/delete queries (which usually do not give a result other that successful/unsuccessful and cannot be used to construct a <emphasis>Recordset</emphasis> object). </para> *************** *** 277,281 **** <title>Types of Recordsets</title> <para>The <Recordset> can also have a "type" attribute: ! <programlisting><![CDATA[<Recordset id="rs-id" type="rs-type"\>]]></programlisting></para> <para>This attribute can have one of the values: (EditableRS | StaticRS | DynamicRS | PagedRS). The default value (if the attribute is missing) is 'EditableRS'. </para> <para>An 'EditableRS' is a recordset that can be modified from the PHP code. The programer can retrive the results of a query from DB and then modify them, or start with an empty RS and fill it programatically. It makes possible to use recordsets even for results that don't come from DB. </para> --- 279,283 ---- <title>Types of Recordsets</title> <para>The <Recordset> can also have a "type" attribute: ! <programlisting><![CDATA[<Recordset id="rs-id" type="rs-type">]]></programlisting></para> <para>This attribute can have one of the values: (EditableRS | StaticRS | DynamicRS | PagedRS). The default value (if the attribute is missing) is 'EditableRS'. </para> <para>An 'EditableRS' is a recordset that can be modified from the PHP code. The programer can retrive the results of a query from DB and then modify them, or start with an empty RS and fill it programatically. It makes possible to use recordsets even for results that don't come from DB. </para> *************** *** 287,291 **** <title>rsNavig</title> <para>Suppose that we have a <repeat> which is connected to a paged recordset. Then just records of one page (the current page) of the recordset are displayed in the XHTML page. In order to navigate to the other pages of the recordset we need to know what is the next page, previous page, last page, etc. </para> ! <para>In this case the element <emphasis><rsNavig></emphasis> is useful: <programlisting><![CDATA[<rsNavig rs="paged-rs-id"> ... </rsNavig>]]></programlisting></para> <para>The attribute "rs" of <rsNavig> contains the id of a <emphasis>PagedRS</emphasis> recordset. The framework gets from the recordset some navigation variables and makes them available in the scope of <rsNavig>. These variables are: </para> --- 289,293 ---- <title>rsNavig</title> <para>Suppose that we have a <repeat> which is connected to a paged recordset. Then just records of one page (the current page) of the recordset are displayed in the XHTML page. In order to navigate to the other pages of the recordset we need to know what is the next page, previous page, last page, etc. </para> ! <para>n this case the element <emphasis><rsNavig></emphasis> is useful: <programlisting><![CDATA[<rsNavig rs="paged-rs-id"> ... </rsNavig>]]></programlisting></para> <para>The attribute "rs" of <rsNavig> contains the id of a <emphasis>PagedRS</emphasis> recordset. The framework gets from the recordset some navigation variables and makes them available in the scope of <rsNavig>. These variables are: </para> *************** *** 402,406 **** <title>Var</title> <para><emphasis><Var></emphasis> elements declare variables that can be used anywhere in the template in the current scope and in the scopes inside it: ! <programlisting><![CDATA[<var name="SUM">({{field1}} + {{field2}} + {{field3}})</var>]]></programlisting></para> <para>They are identified by their name, and their value is calculated using their content as an expression. The value of the expression is calculated in this way: first, any template variable inside it is found and replaced, then the resulting string is evaluated as a PHP expression. </para> <para>The value of the expression is evaluated at the time that the template is rendered. So, if a variable is inside a <repeat> element, then it may have different values for different iterations: --- 404,409 ---- <title>Var</title> <para><emphasis><Var></emphasis> elements declare variables that can be used anywhere in the template in the current scope and in the scopes inside it: ! <programlisting><![CDATA[<var name="SUM">({{field1}} + {{field2}} + {{field3}})</var> ! ]]></programlisting></para> <para>They are identified by their name, and their value is calculated using their content as an expression. The value of the expression is calculated in this way: first, any template variable inside it is found and replaced, then the resulting string is evaluated as a PHP expression. </para> <para>The value of the expression is evaluated at the time that the template is rendered. So, if a variable is inside a <repeat> element, then it may have different values for different iterations: *************** *** 441,451 **** <chapter id="transitions"> <title>Transitions</title> ! <para>A transition is the move of the application from one state to another (usually from one page to another). A state of the application is composed of a certain main template file and some state variables (persistent variables of the application whose lifetime may be as long as the time that the application is active). A transition is usually triggered by a client-side event in the browser, such as: clicking a link, pressing a button, submitting a form, timeout of a javascript timer, etc. </para> ! <section id="trans-how"> <title>How is Done a Transition</title> ! <para>In the phpWebApp a transition is done by calling the function <emphasis>GoTo()</emphasis> which is declared by the framework itself, e.g. ! <programlisting>GoTo('page1.html')</programlisting></para> ! <para>In this case, the GoTo() function sends a request to the web-server for another page. This request is processed by the framework, which loads the template <filename>page1.html</filename> (found in the templates folder of the application) processes it and sends it to the browser. </para> ! <para>If a path is specified for the template, e.g. <emphasis>GoTo('folder1/page1.html')</emphasis> , then this path is relative to the TPL_PATH. If the page that is to be loaded is the same as the current page (e.g. we are in page <filename>page1.html</filename> and we want to load again the page <filename>page1.html</filename>), then this syntax can be used: GoTo('thisPage'); the framework remembers itself what is the current page and loads it again. This syntax is handy in the case of generic weboxes which may be included in several pages, and they don't know in which page they will be included. </para> <para>Usually, before making a transition you need to make some validations (e.g. when the user fills a form and submits it to the application). These data validations can be done in the client-side by using a javascript function. For example: <programlisting><![CDATA[<a href="javascript: on_link()"> Link </a> --- 444,475 ---- <chapter id="transitions"> <title>Transitions</title> ! <para>A transition is the move of the application from one state to another (usually from one page to another). A state of the application is composed of a certain template file and some session variables (session variables are persistent variables of the application whose lifetime may be as long as the time that the application is active). A transition is usually triggered by a client-side event in the browser, such as: clicking a link, pressing a button, submiting a form, timeout of a javascript timer, etc. </para> ! <caution> ! <para>Although the transitions seem quite similar to the HTML links, ! they are actually very different. An HTML link requests a page from ! a web-server, while a transition requests a page of the application ! from the framework. So, all the pages of the application should ! refer to each-other only by using transitions, and to the external ! pages (pages outside the application) only by using links. If a page ! of the application refers to another page of the application by a ! link, this may break the consistency of the application. Such a ! mistake may happen if the page has an HTML form, because this form ! usually submits to its action, by not using a transition. To overcome ! this, we should declare the form like this: ! ! <programlisting><![CDATA[<form name="form1" onSubmit="return false;"> or ! <form name="form1" onSubmit="on_submit(); return false;"> ! ]]></programlisting></para> ! </caution> ! <section id="goto"> <title>How is Done a Transition</title> ! <para>In the phpWebApp a transition is done by calling the JavaScript function <emphasis>GoTo()</emphasis> which is declared by the framework itself, e.g. ! <programlisting>GoTo('page1.html');</programlisting> ! In this case, the <emphasis>GoTo()</emphasis> function sends a request to the web-server for another page. This request is processed by the framework, which loads the template <filename>page1.html</filename> (in the folder TPL of the application) processes it and sends it to the browser. </para> ! <para>If a path is specified for the template, e.g. ! <programlisting>GoTo('folder1/page1.html');</programlisting> ! then this path is found in the folder TPL. If the page that is to be loaded is the same as the current page (e.g. we are in page <filename>page1.html</filename> and we want to load again the page <filename>page1.html</filename>), then this syntax can be used: ! <programlisting>GoTo('thisPage');</programlisting> ! the framework remembers itself what is the current page and loads it again. This syntax is handy in the case of generic webboxes which may be included in several pages, and they don't know in which page they will be included. </para> <para>Usually, before making a transition you need to make some validations (e.g. when the user fills a form and submits it to the application). These data validations can be done in the client-side by using a javascript function. For example: <programlisting><![CDATA[<a href="javascript: on_link()"> Link </a> *************** *** 453,487 **** <form onSubmit="on_submit(); return false;"> ]]></programlisting> ! The functions on_link(), on_button() and on_submit() usually do some client-side validations and error checkings and then, if everything is OK, they cause a transition by calling the function GoTo(). </para> </section> ! <section id="trans-phpvars"> <title>Sending PHP Variables to the Application</title> ! <para>Like usual links which can send variables to the server, like this: ! <programlisting><![CDATA[<a href="page1.php?var1=val1&var2=val2"> Link </a>]]></programlisting> ! a transition can send variables as well: ! <programlisting><![CDATA[<a href="javascript: GoTo('page1.html?var1=val1&var2=val2')"> Link </a>]]></programlisting> ! These variables will be declared as PHP global variables by the framework and may be used in the PHP code of the application. However the use of these global variables is discouraged, because there are better ways to send variables to the application. </para> ! </section> ! <section id="trans-sendevent"> ! <title>Sending an Event to the Application</title> ! <para>An important variable that is sent to the application almost in each transition is the variable 'event'. This variable sends to the application a server-side event that should be handled by the application. The format of an event variable is like this: ! <programlisting><![CDATA[event=targetBox.eventName(arg1=val1;arg2=val2;arg3=val3)]]></programlisting> ! When the framework gets the variable 'event', it builds an object of class Event and forwards it to the appropriate WebBox for handling. </para> ! </section> ! <section id="trans-links"> ! <title>The Difference Between Transitions and Links</title> ! <para>Caution: Although the transitions seem quite similar to the HTML links, they are actually very different. An HTML link requests a page from a web-server, while a transition requests a page of the application from the framework. So, all the pages of the application should refer to each-other only by using transitions, and to the external pages (pages outside the application) only by using links. If a page of the application refers to another page of the application by a link, this may break the consistency of the application. Such a mistake may happen if the page has an HTML form, because this form usually submits to its action, by not using a transition. To overcome this, we should declare the form like this: ! <programlisting><![CDATA[<form name="form1" onSubmit="return false;"> or ! <form name="form1" onSubmit="on_submit(); return false;"> ]]></programlisting></para> </section> </chapter> ! <chapter id="webbox-es"> <title>WebBox-es</title> ! <para/> </chapter> <chapter id="webclass-es"> <title>WebClass-es and WebObject-s</title> ! <para/> </chapter> <chapter id="events"> --- 477,742 ---- <form onSubmit="on_submit(); return false;"> ]]></programlisting> ! The functions <emphasis>on_link()</emphasis>, <emphasis>on_button()</emphasis> and <emphasis>on_submit()</emphasis> usually do some client-side validations and error checkings and then, if everything is OK, they cause a transition by calling the function <emphasis>GoTo()</emphasis>. </para> </section> ! <section id="sending-variables"> <title>Sending PHP Variables to the Application</title> ! <para>Usual links can send variables to application (on the server), like this: ! <programlisting><![CDATA[<a href="page1.php?var1=val1&var2=val2"> Link </a> ! ]]></programlisting></para> ! <para>Similarly, a transition as well can send variables to the application, like this: ! <programlisting><![CDATA[<a href="javascript: GoTo('page1.html?var1=val1&var2=val2')"> Link </a> ]]></programlisting></para> + <para>These variables will be declared as PHP global variables by the framework and may be used in the PHP code of the application. </para> + <tip> + <para>The use of these global variables is discouraged, because there are better ways to send variables to the application.</para> + </tip> + <note> + <title>Sending an Event to the Application</title> + <para>An important variable that is sent to the application almost in each transition is the variable <emphasis>event</emphasis> . This variable sends to the application a server-side event that should be handled by the application. The format of an event variable is like this: + + <programlisting>event=targetBox.eventName(arg1=val1;arg2=val2;arg3=val3)</programlisting> + When the framework gets the variable <emphasis>event</emphasis> , it builds an object of class <emphasis>Event</emphasis> and forwards it to the appropriate WebBox for handling. (For more details on events see <xref linkend="events"/> .)</para> + </note> </section> </chapter> ! <chapter id="webbox"> <title>WebBox-es</title> ! <para>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. </para> ! <para>Each page of a WebApp should contain at least a webbox, unless it is very simple (doesn't have server-side logic). A webbox can be composed of other webboxes. WebBox-es are the components that are used to build a web application. (Component in OOP is called a class that has only one object). </para> ! <para>It is denoted by the tag <emphasis><WebBox></emphasis> and it has an ID attribute: ! <programlisting><![CDATA[ <webbox id="boxId"> ! <!-- content of WebBox --> ! </webbox> ! ]]></programlisting></para> ! <para>The identifier of the box is very important and must be different for each box used in the application. </para> ! <section id="webbox-files"> ! <title>The Files Related to a WebBox</title> ! <para>The files related to the webox <emphasis>boxId</emphasis> are: <filename>boxId.php</filename> , <filename>boxId.db</filename> , <filename>boxId.js</filename> , <filename>boxId.css</filename> , etc. All of them are optional, only the template (HTML) of a WebBox is required. They are included automatically by the framework, if they exist in the same folder with the webbox. Other related files may be subtemplates, images etc., which are not included automatically by the framework. </para> ! <caution> ! <para>All the files of a WebBox (.php, .js, .css, .db, etc.) must have the same name as the ID of the WebBox, otherwise the framework will not reckognize them as belonging to this WebBox.</para> ! </caution> ! <itemizedlist> ! <listitem> ! <para>The file <filename>boxId.js</filename> contains the javascript functions of the webox (which is just usual JS code). It is included automatically by the framework at the <head> of the page. The framework looks for the file <filename>boxId.js</filename> 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: ! <programlisting><![CDATA[<script type="text/javascript" language="javascript" src="path/to/boxId.js"></script>]]></programlisting></para> ! </listitem> ! <listitem> ! <para>Similarly, the file <filename>boxId.css</filename> contains any stylesheet (CSS code) that is specific to the WebBox. If the file <filename>boxId.css</filename> exists, the framework includes in the <head> of the page a line like this: ! <programlisting><![CDATA[<link type="text/css" rel="stylesheet" src="path/to/boxId.css" />]]></programlisting></para> ! </listitem> ! <listitem> ! <para>The file <filename>boxId.db</filename> contains the <dbCommand> and <Recordset> elements that are used in the PHP code or in the template. If it exists, it is included automatically by the framework, before the template of the WebBox is parsed. (See the documentation about interacting with the database for more details). </para> ! </listitem> ! <listitem> ! <para>The file <filename>boxId.php</filename> contains the PHP code of the WebBox. Similarly, if it exists, it is included automatically by the framework, before the template of the WebBox is parsed. (See the following section, <xref linkend="webbox-phpcode"/> , for more details.) </para> ! </listitem> ! </itemizedlist> ! <para>Some tips: </para> ! <tip> ! <para>You can place more than one WebBox in a template file, however it is recomended to place each WebBox in a separate template, without other HTML code that does not belong to it. It is recomended to name this template <emphasis>boxId.html</emphasis> .</para> ! </tip> ! <tip> ! <para>A WebBox (and its related files) can be placed in any directory, together with other WebBox-es and templates; the framework has no restrictions about this. However, it is recomended to place all the files related to a WebBox in a separate folder, named <emphasis>boxId</emphasis> , for better readability and structure of the application.</para> ! </tip> ! </section> ! <section id="webbox-phpcode"> ! <title>The PHP Code of a WebBox</title> ! <para>The PHP code of a WebBox is placed in the file <filename>boxId.php</filename> which is in the same folder as the template containing the WebBox. Most of the PHP code and the logic of the WebBox is encapsulated inside a PHP class name <emphasis>boxId</emphasis> , which extends the interface (or the abstract class) WebObject, like this: ! <programlisting>class boxId extends WebObject { . . . }</programlisting> ! This makes the PHP code of the application more object-oriented and better organized. </para> ! <para>The class <emphasis>boxId</emphasis> can override the functions of the interface WebObject: eventHandler($event), onParse(), onRender(), etc., or can define other functions that can be used inside these functions. It can also define handle functions for each of the WebBox events. </para> ! <para>The functions of WebObject that can be overriden by the WebBox are these: </para> ! <itemizedlist> ! <listitem> ! <para><programlisting>function init()</programlisting> ! Called only the first time that the WebBox is loaded (only once in a session). Can be used to initialize the state variables of the WebBox. </para> ! </listitem> ! <listitem> ! <para><programlisting>function onParse()</programlisting> ! Called by the framework before the WebBox is parsed. It is usually used to give value to some template variables that affect the parsing. E.g. if we have this line in a template: ! <programlisting><![CDATA[ <include src="{{content_file}}" />]]></programlisting> ! then the variable <emphasis>{{#content_file}}</emphasis> must have a value before this line is parsed, and usually this value is given in the onParse() function, according to the application logic. </para> ! </listitem> ! <listitem> ! <para><programlisting>function afterParse()</programlisting> ! Called by the framework after the WebBox is parsed. </para> ! </listitem> ! <listitem> ! <para><programlisting>function onRender()</programlisting> ! Called by the framework before the WebBox is rendered. It is usually used to add {{#variables}} that are used in the template. </para> ! </listitem> ! <listitem> ! <para><programlisting>function eventHandler($event)</programlisting> ! Called by the framework to handle an event of the WebBox that does not have a specific event handler. It typically has a switch statement on the variable '$event->name', and performs some actions depending on the case. It also can extract and use the arguments of the event from the '$event->args'. </para> ! </listitem> ! </itemizedlist> ! <para>The class may also contain functions like this: ! <programlisting><![CDATA[ function on_eventName($event_args) ! ]]></programlisting> ! for each event of the WebBox, where <emphasis>eventName</emphasis> is the name of the event, and the parameter $event_args is an associative array that contains the event arguments and their values. The value of the arguments can be accessed like this: ! <programlisting><![CDATA[ $var_value = $event_args['var_name']; ! ]]></programlisting> ! Or, all the arguments can be extracted in the current scope like this (see the PHP function <emphasis>extract()</emphasis> ): ! <programlisting> extract($event_args);</programlisting></para> ! </section> ! <section id="webbox-statevars"> ! <title>State Vars of the WebBox</title> ! <para>Each webox can have its own state (session/persistent) vars. </para> ! <para>Usually, the initialization of the state vars of the webbox is done in the function <emphasis>init()</emphasis> , using the function <emphasis>WebObject::addSVar()</emphasis> or <emphasis>WebObject::addSVars()</emphasis> , like this: ! <programlisting> $this->addSVar('var_name', $var_value); ! $this->addSVars($associated_array); ! </programlisting></para> ! <important> ! <para>A state var is initialized only once! This means that in case that addSVar() is called for a state variable that already exists (is already initialized), then it will not change its value.</para> ! </important> ! <para>Inside the class (PHP code) of the webbox, its state vars can be modified and accessed like this: ! <programlisting> $this->setSVar('var_name', $var_value); ! $this->setSVars($associated_array); ! $var_value = $this->getSVar('var_name'); ! $assoc_arr = $this->getSVars(); ! </programlisting></para> ! <para>Outside the class of the webbox <emphasis>boxId</emphasis> , its state variables can be accessed like this: ! <programlisting> WebApp::setSVar('boxId->var_name', $var_value); ! $var_value = WebApp::getSVar('boxId->var_name'); ! </programlisting></para> ! <para>It is also possible to initialize a state variable of a webbox from outside of the webbox (e.g. from the init() of the parent webbox), like this: ! <programlisting> WebApp::addSVar('boxId->var_name', $var_value); ! </programlisting></para> ! <para>All the state variables of a webbox can be retrieved as an associative array: ! <programlisting> $vars = WebApp::getSVars('boxId'); ! extract($vars); ! </programlisting></para> ! <para>The state vars of the webbox can be accessed from the JS code as well, like this: ! <programlisting> session.setVar('boxId->var_name', var_value); ! var_value = session.getVar('boxId->var_name'); ! </programlisting></para> ! <para>The state variables of the webbox can be used in the template of the webbox in the usual way: {{#var_name}} and they are valid only in the scope of this webbox (and shadow any other {{#variables}} with the same name that are defined in the enclosing scopes. In case that a state variable of a webbox needs to be used in a template outside its own webox, then its full name should be used, like this: <emphasis>{{#boxId->var_name}}</emphasis></para> ! <para>If the constant DEBUG_STATEVARS in <filename>config/const.Debug.php</filename> is set to <emphasis>true</emphasis> , then the framework outputs at the end of the page the state variables for each webbox and their values, which helps to debug them. </para> ! </section> ! <section id="webbox-processing"> ! <title>How a WebBox is Processesed</title> ! <para>In order to use the webbox features correctly, it is usefull to know the steps that the framework follows for calling the PHP code of the WebBox. In general, the framework constructs the HTML page (that is sent to the browser) in two phases: first it parses (loads) all the relevant templates and builds a structure in memory, then it uses these templates to render (generate) the HTML page. The following list describes these steps according to the order that they happen: </para> ! <orderedlist numeration="arabic"> ! <listitem> ! <para>At the time that the framework is about to load (parse) the WebBox, it includes the file <filename>boxId.php</filename> (if it exists). </para> ! </listitem> ! <listitem> ! <para>If this is the first time that this WebBox is loaded (in this session), then it calls the function <emphasis>init()</emphasis> , which can be used to initialize the state variables of the WebBox. </para> ! </listitem> ! <listitem> ! <para>If there is an event sent to this WebBox, the framework calls the corresponding event handler <emphasis>on_eventName($event_args)</emphasis> . If such a function is not defined, it calls the general event handler of the WebBox: <emphasis>eventHandler($event)</emphasis> . </para> ! </listitem> ! <listitem> ! <para>The framework calls the function <emphasis>onParse()</emphasis> which may define any parse-time template variables. </para> ! </listitem> ! <listitem> ! <para>The framework parses the template (HTML code) of the WebBox and loads it in a structure in memory. Any parse-time variables can be used during the parse. </para> ! </listitem> ! <listitem> ! <para>The function <emphasis>afterParse()</emphasis> is called. </para> ! </listitem> ! <listitem> ! <para>After all WebBox-es and templates of the application are parsed, the framework starts to render (generate) the HTML page that is sent to the browser. </para> ! </listitem> ! <listitem> ! <para>The function <emphasis>onRender()</emphasis> is called before starting to render the template of the WebBox. Any <emphasis>render-time</emphasis> template variables are defined here. </para> ! </listitem> ! <listitem> ! <para>Finally, the template of the WebBox is rendered and any {{#variables}} in it are replaced by their value. </para> ! </listitem> ! </orderedlist> ! </section> </chapter> <chapter id="webclass-es"> <title>WebClass-es and WebObject-s</title> ! <para>The concept of WebClass and WebObject is similar to the classes and objects in the OOP (Object-Oriented Programing). </para> ! <section id="webcl-template"> ! <title>The Template Syntax</title> ! <para>The element <WebClass> defines a web class, but it by itself does not produce any HTML output in the rendered page. The element <WebObject> declares an object of the class and the content (the template) of the <WebClass> is used to render this object. They are used like this: </para> ! <programlisting> ! <![CDATA[ <webclass id="classId" path="path/to/classId.php"> ! <parameter name="param1" default="default value" /> ! <parameter name="param2" /> ! <!--# . . . . . . . . . . . . . . . . #--> ! <!--# the template of the web class #--> ! <!--# . . . . . . . . . . . . . . . . #--> ! </webclass> ! ! <webobject class="classId" name="wObj1" param1="value1" param2="value2" /> ! <webobject class="classId" name="wObj2" param2="value2" /> ! <webobject class="classId" name="wObj3" param1="{{nr}}+1" param2="red" /> ! ]]> ! </programlisting> ! <para>The <emphasis>path</emphasis> attribute of the <WebClass> declares the path of the file that defines the PHP code of the WebClass. It is optional, and if it is not given, then the current folder (the folder of the template that contains the <WebClass> definition) is searched for the file <filename>classId.php</filename></para> ! <para>The <Parameter> elements declare the names and optionally the default values of the parameters of the webobjects. These parameters can be used inside the template of the webclass like template variables, e.g. {{#param1}}. If a parameter doesn't get a value in the <WebObject> declaration, then its default value is used (if it doesn't have a default value, then it is handled like an undefined variable). When a <WebObject> is rendered, the value of the parameters is evaluated as a <emphasis>mixed expression</emphasis> (a PHP expression that contains {{#template vars}}). </para> ! <caution> ! <para>When several objects of the same class are declared, the template of the webclass is repeated for each of them. The webclass designer should take this into account when building the webclass. E.g. if there is such an input in the webclass template: ! ! <programlisting><![CDATA[ <input type="text" name="staff"> ! ]]></programlisting> ! Then there will be several such inputs in the HTML code, and its value cannot be accessed like this: ! ! <programlisting> document.form.staff.value</programlisting></para> ! </caution> ! <para>To help the webclass designers to avoid the problem described above, the framework declares for each webobject these variables: ! <itemizedlist><listitem><para>{{#class_name}} -- the name of the class </para></listitem><listitem><para>{{#obj_name}} -- the name of the object </para></listitem><listitem><para>{{#obj_id}} -- the object id ('{{#class_name}}::{{#obj_name}}') </para></listitem><listitem><para>{{#obj_count}} -- count of the objects of the same class, starting from 1 </para></listitem></itemizedlist> ! These vars can be used inside the template of the webclass, if the webclass designer needs them, e.g.: ! <programlisting><![CDATA[ <input type="text" name="staff_{{obj_count}}"> ! ]]></programlisting></para> ! </section> ! <section id="webcl-vars"> ! <title>WebObject Variables</title> ! <para>When several objects of the same class are declared, the template of the webclass is repeated for each of them. The webclass designer should take this into account when building the webclass. E.g. if there is such an input in the webclass template: ! <programlisting><![CDATA[ <input type="text" name="staff"> ! ]]></programlisting> ! Then there will be several such inputs in the HTML code, and its value cannot be accessed like this: ! <programlisting> document.form.staff.value</programlisting></para> ! <para>To help the webclass designers to avoid the problem described above, the framework declares for each webobject these variables: ! <itemizedlist><listitem><para>{{#class_name}} -- the name of the class </para></listitem><listitem><para>{{#obj_name}} -- the name of the object </para></listitem><listitem><para>{{#obj_id}} -- the object id ('{{#class_name}}::{{#obj_name}}') </para></listitem><listitem><para>{{#obj_count}} -- count of the objects of the same class, starting from 1 </para></listitem></itemizedlist> ! These vars can be used inside the template of the webclass, if the webclass designer needs them, e.g.: ! <programlisting><![CDATA[ <input type="text" name="staff_{{obj_count}}"> ! ]]></programlisting></para> ! <para>Other variables that can be used in the template of the webclass are its parameters, its state variables, and the variables that are declared in the PHP code (similar to WebBox-es). </para> ! </section> ! <section id="webcl-php"> ! <title>The PHP Code</title> ! <para>The PHP code of the webclass <emphasis><WebClass ID="classId"></emphasis> is contained in the file <filename>classId.php</filename> . The framework includes it automatically, if it exists. This file defines a class named <emphasis>classId</emphasis> which extends the class <emphasis>WebObject</emphasis> , and which is very similar to the PHP code of a WebBox: </para> ! <programlisting> ! <![CDATA[<? ! class classId extends WebObject ! { ! . . . . . ! } ! ?> ! ]]> ! </programlisting> ! <para>The same as in the case of a WebBox, this class can override the functions of <emphasis>WebObject</emphasis> , which are called by the framework at certain moments during the time that the webobject is processed. </para> ! <para>These functions are: </para> ! <itemizedlist> ! <listitem> ! <para>init() -- called only the first time that a WebObject is loaded </para> ! </listitem> ! <listitem> ! <para>onParse() -- called before the template of the WebClass is parsed </para> ! </listitem> ! <listitem> ! <para>afterParse() -- called after the template of the WebClass is parsed </para> ! </listitem> ! <listitem> ! <para>onRender() -- called before the HTML of a WebObject is rendered </para> ! </listitem> ! <listitem> ! <para>on <emphasis>eventName($event</emphasis> args) -- called to handle an event of a WebObject </para> ! </listitem> ! <listitem> ! <para>eventHandler($event) -- generic event handler, if no special event handler exists </para> ! </listitem> ! </itemizedlist> ! <para>A WebObject can also have its own state variables, which are similar to the state variables of a WebBox. </para> ! </section> ! <section id="webcl-webbox"> ! <title>WebBox-es</title> ! <para/> ! </section> </chapter> <chapter id="events"> |
From: Dashamir H. <das...@us...> - 2006-01-31 08:06:39
|
Update of /cvsroot/phpwebapp/web_app/webobjects/form In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20311/webobjects/form Modified Files: formWebObj.php formWebObj.txt Log Message: Index: formWebObj.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/form/formWebObj.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** formWebObj.php 4 Jan 2006 08:32:38 -0000 1.11 --- formWebObj.php 31 Jan 2006 08:06:23 -0000 1.12 *************** *** 84,97 **** /** * $record is an associative array where keys are named after ! * the fields of the table. $key is the name of the primary key. * The function builds and executes a query that updates the * fields given in the $record (which includes the primary key as well). */ ! function update_record($record, $table, $key) ! { $record = $this->fix_record($record, $table); $values = $this->get_query_values($record); ! $val = $record[$key]; ! $query = "UPDATE $table\n SET\n $values\n WHERE $key = '$val'"; WebApp::execQuery($query); } --- 84,108 ---- /** * $record is an associative array where keys are named after ! * the fields of the table. $keys is the fields of the primary key. * The function builds and executes a query that updates the * fields given in the $record (which includes the primary key as well). */ ! function update_record($record, $table, $keys) ! { $record = $this->fix_record($record, $table); $values = $this->get_query_values($record); ! ! //build the WHERE condition of the primary key ! $arr_keys = explode(',', $keys); ! $arr_conditions = array(); ! for ($i=0; $i < sizeof($arr_keys); $i++) ! { ! $key = $arr_keys[$i]; ! $val = $record[$key]; ! $arr_conditions[] = "($key = '$val')"; ! } ! $condition = implode(' AND ', $arr_conditions); ! ! $query = "UPDATE $table\n SET\n $values\n WHERE $condition"; WebApp::execQuery($query); } *************** *** 163,174 **** * From the items of the given array create a listbox recordset * (with the fields 'id' and 'label'), and insert it in the $webPage. */ ! function add_listbox_rs($rs_id, $arr_labels) { $rs = new EditableRS($rs_id); ! for ($i=0; $i < sizeof($arr_labels); $i++) { ! $label = $arr_labels[$i]; ! $rs->addRec(array('id' => $label, 'label' => $label)); } global $webPage; --- 174,190 ---- * From the items of the given array create a listbox recordset * (with the fields 'id' and 'label'), and insert it in the $webPage. + * $arr_options can be an associated array, a simple array, or mixed. + * In case of the associated array, the keys are used as id-s and + * the values are used as labels. */ ! function add_listbox_rs($rs_id, $arr_options) { $rs = new EditableRS($rs_id); ! $arr_keys = array_keys($arr_options); ! for ($i=0; $i < sizeof($arr_keys); $i++) { ! $key = $arr_keys[$i]; ! $value = $arr_options[$key]; ! $rs->addRec(array('id' => $key, 'label' => $value)); } global $webPage; Index: formWebObj.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/form/formWebObj.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** formWebObj.txt 4 Jan 2006 08:32:38 -0000 1.5 --- formWebObj.txt 31 Jan 2006 08:06:23 -0000 1.6 *************** *** 94,96 **** --- 94,99 ---- * From the items of the given array create a listbox recordset * (with the fields 'id' and 'label'), and insert it in the $webPage. + * $arr_options can be an associated array, a simple array, or mixed. + * In case of the associated array, the keys are used as id-s and + * the values are used as labels. */ |
From: Dashamir H. <das...@us...> - 2006-01-31 08:06:39
|
Update of /cvsroot/phpwebapp/web_app/webobjects/tabs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20311/webobjects/tabs Modified Files: tabs3.css Log Message: Index: tabs3.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/tabs/tabs3.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tabs3.css 23 Feb 2003 14:23:16 -0000 1.1 --- tabs3.css 31 Jan 2006 08:06:23 -0000 1.2 *************** *** 26,30 **** display: block; font-family: sans-serif; - font-size: 80%; text-align: left; text-decoration: none; --- 26,29 ---- *************** *** 42,46 **** display: block; font-family: sans-serif; - font-size: 80%; text-align: left; text-decoration: none; --- 41,44 ---- |
From: Dashamir H. <das...@us...> - 2006-01-31 08:06:39
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20311/doc Modified Files: changes.txt Log Message: Index: changes.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** changes.txt 1 Nov 2005 14:19:57 -0000 1.24 --- changes.txt 31 Jan 2006 08:06:23 -0000 1.25 *************** *** 74,77 **** --- 74,87 ---- ------------------------------------------------------------------- + + * - function formWebObj::add_listbox_rs($rs_id, $arr_options) + /** + * From the items of the given array create a listbox recordset + * (with the fields 'id' and 'label'), and insert it in the $webPage. + * $arr_options can be an associated array, a simple array, or mixed. + * In case of the associated array, the keys are used as id-s and + * the values are used as labels. + */ + ------------------------------------------------------------------- ------------------------------------------------------------------- |
From: Dashamir H. <das...@us...> - 2006-01-31 08:06:38
|
Update of /cvsroot/phpwebapp/web_app/webobjects/dbTable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20311/webobjects/dbTable Modified Files: dbTable.html editRecord.css editRecord.db editRecord.html editRecord.js Added Files: dbTable.css records.html Log Message: --- NEW FILE: dbTable.css --- .dbTable-table { border: none; background-color: #aaaaaa; } .dbTable-header { background-color: #eeeeee; } .dbTable-row-normal { background-color: #fffff8; } .dbTable-row-selected { background-color: #f3f3ff; } .dbTable-table .button, .dbTable-table .button:hover { border: solid 1px #8888aa; } --- NEW FILE: records.html --- <table class="dbTable-table" cellspacing="1" cellpadding="2"> <tr class="dbTable-header"> <if condition="{{selectable}}"> <th> <a href="javascript:dbTable_select('{{obj_id}}', '{{UNDEFINED}}')"> <img border="0" src="{{./}}select.png" /> </a> </th> </if> <repeat rs="{{table}}->fields"> <th>{{fld_name}}</th> </repeat> <if condition="{{editable}}"> <th> <a class="button" href="javascript:dbTable_add('{{obj_id}}')">A</a> </th> <th> <a class="button" href="javascript:dbTable_rmAll('{{obj_id}}')">X</a> </th> </if> </tr> <repeat rs="{{table}}->records"> <var name="row">( '{{rec_id}}' == '{{selected_rec}}' ? 'selected' : 'normal' )</var> <tr class="dbTable-row-{{row}}"> <if condition="{{selectable}}"> <td> <a href="javascript: dbTable_select('{{obj_id}}', '{{rec_id}}')"> <img border="0" src="{{./}}select.png" /> </a> </td> </if> <repeat rs="{{table}}->fields"> <td>{{{{fld_name}}}}</td> </repeat> <if condition="{{editable}}"> <td> <a class="button" href="javascript:dbTable_edit('{{obj_id}}','{{rec_id}}')"> T_("E")</a> </td> <td> <a class="button" href="javascript:dbTable_rm('{{obj_id}}','{{rec_id}}')"> T_("X")</a> </td> </if> </tr> </repeat> </table> Index: dbTable.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/dbTable/dbTable.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dbTable.html 21 Jul 2004 17:04:30 -0000 1.7 --- dbTable.html 31 Jan 2006 08:06:23 -0000 1.8 *************** *** 2,60 **** <webclass id="dbTable"> ! <parameter name="table" default="{{obj_name}}" /> ! <parameter name="fields" default="*" /> ! <parameter name="where" default="" /> <parameter name="selectable" default="false" /> ! <parameter name="editable" default="false" /> ! <table bgcolor="#aaaaaa" border="0" cellspacing="1" cellpadding="2"> <tr> ! <if condition="{{editable}}"> ! <th bgcolor="#eeeeee"> ! <a href="javascript: dbTable_rmAll('{{obj_id}}')">X</a> ! </th> ! <th bgcolor="#eeeeee"> ! <a href="javascript: dbTable_add('{{obj_id}}')">A</a> ! </th> ! </if> ! <if condition="{{selectable}}"> ! <th bgcolor="#eeeeee"> ! <a href="javascript: dbTable_select('{{obj_id}}', '{{UNDEFINED}}')"> ! <img border="0" src="{{./}}select.png" /> ! </a> ! </th> ! </if> ! <repeat rs="{{table}}->fields"> ! <th bgcolor="#eeeeee"> {{fld_name}} </th> ! </repeat> </tr> - <repeat rs="{{table}}->records"> - <var name="bgcolor">("{{rec_id}}"=="{{selected_rec}}" ? - "#f3f3ff" : "white")</var> - <tr> - <if condition="{{editable}}"> - <td bgcolor="{{bgcolor}}"> - <a href="javascript: dbTable_rm('{{obj_id}}', '{{rec_id}}')">X</a> - </td> - <td bgcolor="{{bgcolor}}"> - <a href="javascript: dbTable_edit('{{obj_id}}', '{{rec_id}}')">E</a> - </td> - </if> - <if condition="{{selectable}}"> - <td bgcolor="{{bgcolor}}"> - <a href="javascript: dbTable_select('{{obj_id}}', '{{rec_id}}')"> - <img border="0" src="{{./}}select.png" /> - </a> - </td> - </if> - <repeat rs="{{table}}->fields"> - <td bgcolor="{{bgcolor}}"> {{{{fld_name}}}} </td> - </repeat> - </tr> - </repeat> </table> - - <br /> - <webobject class="editRecord" name="{{obj_name}}" /> - </webclass> --- 2,22 ---- <webclass id="dbTable"> ! <parameter name="table" default="{{obj_name}}" /> ! <parameter name="fields" default="*" /> ! <parameter name="where" default="" /> <parameter name="selectable" default="false" /> ! <parameter name="editable" default="false" /> ! <table> <tr> ! <td valign="top"> ! <strong>T_("Edit Table: '{{table}}'")</strong> ! <include src="{{./}}records.html" /> ! </td> ! <td width="20"></td> ! <td valign="top"> ! <webobject class="editRecord" name="{{obj_name}}" /> ! </td> </tr> </table> </webclass> Index: editRecord.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/dbTable/editRecord.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editRecord.css 11 May 2004 06:45:29 -0000 1.2 --- editRecord.css 31 Jan 2006 08:06:23 -0000 1.3 *************** *** 1,11 **** ! .editRecord_field { ! font-family: Arial, Helvetica, sans-serif; ! font-size: 9pt; ! width: 100px; ! border-style: solid; ! border-top-width: 1px; ! border-right-width: 1px; ! border-bottom-width: 1px; ! border-left-width: 1px } --- 1,22 ---- ! ! .editRecord-table { ! background-color: #aaaaaa; ! } ! ! .editRecord-fieldname ! { ! background-color: #eeeeee; ! text-align: right; ! } ! ! .editRecord-fieldvalue ! { ! background-color: #fffff8; ! } ! ! .editRecord-fieldvalue input ! { ! border: none; ! background-color: #fffff8; } Index: editRecord.db =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/dbTable/editRecord.db,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** editRecord.db 21 Feb 2003 08:17:06 -0000 1.1.1.1 --- editRecord.db 31 Jan 2006 08:06:23 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + <!--# -*-SQL-*- tell emacs to use the SQL mode #--> + <dbCommand ID="editRecord::insert"> <Query> Index: editRecord.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/dbTable/editRecord.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** editRecord.html 23 Jul 2004 09:40:16 -0000 1.7 --- editRecord.html 31 Jan 2006 08:06:23 -0000 1.8 *************** *** 1,19 **** <webclass id="editRecord"> ! <if condition="!('{{state}}'=='hidden')"> <form name="{{obj_name}}" id="{{obj_name}}" onsubmit="return false;"> ! <table bgcolor="#aaaaaa" border="0" cellspacing="0" cellpadding="0"> <repeat rs="{{table}}->fields"> <tr> ! <td bgcolor="#eeeeee" align="right">{{fld_name}}:</td> ! <td> ! <input type="text" class="editRecord_field" ! name="{{fld_name}}" id="{{fld_name}}" value="{{{{fld_name}}}}" /> </td> </tr> </repeat> </table> ! [<a href="javascript: editRecord_save('{{obj_name}}')">Save</a>] ! [<a href="javascript: editRecord_cancel('{{obj_id}}')">Cancel</a>] </form> </if> </webclass> --- 1,33 ---- <webclass id="editRecord"> ! ! <if condition="'{{state}}'!='hidden'"> ! ! <if condition="'{{state}}'=='add'"><strong>T_("Add Record")</strong></if> ! <if condition="'{{state}}'=='edit'"><strong>T_("Edit Record")</strong></if> ! <form name="{{obj_name}}" id="{{obj_name}}" onsubmit="return false;"> ! <input type="submit" class="hidden_submit" value="" ! onclick="this.focus(); editRecord_save('{{obj_name}}');" /> ! ! <table class="editRecord-table" border="0" cellspacing="1" cellpadding="2"> <repeat rs="{{table}}->fields"> <tr> ! <td class="editRecord-fieldname">{{fld_name}}:</td> ! <td class="editRecord-fieldvalue"> ! <input type="text" name="{{fld_name}}" id="{{fld_name}}" ! value="{{{{fld_name}}}}" /> </td> </tr> </repeat> </table> ! </form> + + <a class="button" href="javascript:editRecord_save('{{obj_name}}')"> + T_("Save")</a> + <a class="button" href="javascript:editRecord_cancel('{{obj_id}}')"> + T_("Cancel")</a> + </if> + </webclass> Index: editRecord.js =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/dbTable/editRecord.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editRecord.js 4 Nov 2005 06:54:14 -0000 1.5 --- editRecord.js 31 Jan 2006 08:06:23 -0000 1.6 *************** *** 48,54 **** elem = form.elements[i]; if (elem.type=="text") ! { ! args.push(elem.name + "=" + elem.value); ! } } --- 48,54 ---- elem = form.elements[i]; if (elem.type=="text") ! { ! args.push(elem.name + "=" + elem.value); ! } } |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:50
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661 Modified Files: class.WebApp.php Log Message: Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** class.WebApp.php 4 Nov 2005 06:54:13 -0000 1.29 --- class.WebApp.php 4 Jan 2006 08:32:38 -0000 1.30 *************** *** 336,339 **** --- 336,354 ---- /** + * Get all the state variables of a webobject + * and return them as an associative array. + * The optional parameter $type accepts the values "DB" + * and "JS", and depending on this parameter the function + * returns DB vars, JS vars or all of them (if undefined). + * @see getSVar(), setSVar() + */ + function getSVars($obj_id, $type =UNDEFINED) + { + global $session; + $arr_vars = $session->getObjVars($obj_id, $type); + return $arr_vars; + } + + /** * Returns the web object with the given id, * or UNDEFINED. *************** *** 674,683 **** * in a javascript statement like this: * name = window.open(url, name, features); ! * and $html_content is an html code that is displayed in the * window, like this: * name.document.write(content); */ function popup_window($name, $url, $html_content =UNDEFINED, ! $features =UNDEFINED) { global $webPage; --- 689,699 ---- * in a javascript statement like this: * name = window.open(url, name, features); ! * $html_content is an html code that is displayed in the * window, like this: * name.document.write(content); + * $timeout is a timeout for closing the window (in milisecs) */ function popup_window($name, $url, $html_content =UNDEFINED, ! $features =UNDEFINED, $timeout =UNDEFINED) { global $webPage; *************** *** 685,688 **** --- 701,705 ---- $webPage->popup_windows[$name]['html_content'] = $html_content; $webPage->popup_windows[$name]['features'] = $features; + $webPage->popup_windows[$name]['timeout'] = $timeout; } |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:49
|
Update of /cvsroot/phpwebapp/web_app/timer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/timer Modified Files: class.Timer.php Log Message: Index: class.Timer.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/timer/class.Timer.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.Timer.php 4 Nov 2005 06:54:14 -0000 1.12 --- class.Timer.php 4 Jan 2006 08:32:38 -0000 1.13 *************** *** 92,98 **** $html .= " <tr> ! <td bgcolor='#f9f9f9'> $processID </td> ! <td bgcolor='#f9f9ff'> $executionTime </td> ! <td bgcolor='#f9f9f9'><xmp>$comment</xmp></td> </tr>"; } --- 92,98 ---- $html .= " <tr> ! <td bgcolor='#f9f9f9' valign='top'> $processID </td> ! <td bgcolor='#f9f9ff' valign='top'> $executionTime </td> ! <td bgcolor='#f9f9f9' valign='top'><xmp>$comment</xmp></td> </tr>"; } |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:49
|
Update of /cvsroot/phpwebapp/web_app/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/session Modified Files: class.Session.php Log Message: Index: class.Session.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/session/class.Session.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** class.Session.php 4 Nov 2005 06:54:14 -0000 1.16 --- class.Session.php 4 Jan 2006 08:32:38 -0000 1.17 *************** *** 269,272 **** --- 269,310 ---- /** + * Get all the state variables of a webobject + * and return them as an associative array. + * The optional parameter $type accepts the values "DB" + * and "JS", and depending on this parameter the function + * returns DB vars, JS vars or all of them (if undefined). + */ + function getObjVars($obj_id, $type =UNDEFINED) + { + switch ($type) + { + case "DB": + $arr_vars = $this->dbVars; + break; + case "JS": + $arr_vars = $this->Vars; + break; + default: + print WebApp::warning_msg("WebObject::getSVars(): unreckognized \$type '$type'."); + case UNDEFINED: + $arr_vars = array_merge($this->Vars, $this->dbVars); + break; + } + + $stateVars = array(); + $pattern = "^".$obj_id."->(.*)"; + while (list($var_name,$var_value) = each($arr_vars)) + { + if (ereg($pattern, $var_name, $regs)) + { + $v_name = $regs[1]; + $stateVars[$v_name] = $var_value; + } + } + + return $stateVars; + } + + /** * Builds and returns the variable $session_vars which is used to insert * the session vars inside the page as JavaScript code. |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:49
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/parser Modified Files: class.WebObject.php class.WebPage.php Log Message: Index: class.WebObject.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebObject.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.WebObject.php 4 Nov 2005 06:54:14 -0000 1.13 --- class.WebObject.php 4 Jan 2006 08:32:38 -0000 1.14 *************** *** 157,189 **** { global $session; ! ! switch ($type) ! { ! case "DB": ! $arr_vars = $session->dbVars; ! break; ! case "JS": ! $arr_vars = $session->Vars; ! break; ! default: ! $msg = TF_("unreckognized \$type 'v_type'"); ! $msg = str_replace('v_type', $type, $msg); ! print WebApp::warning_msg("WebObject::getSVars(): $msg."); ! case UNDEFINED: ! $arr_vars = array_merge($session->Vars, $session->dbVars); ! break; ! } ! ! $stateVars = array(); ! $pattern = "^".$this->id."->(.*)"; ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! if (ereg($pattern, $var_name, $regs)) ! { ! $v_name = $regs[1]; ! $stateVars[$v_name] = $var_value; ! } ! } ! return $stateVars; } --- 157,161 ---- { global $session; ! $stateVars = $session->getObjVars($this->id, $type); return $stateVars; } Index: class.WebPage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebPage.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** class.WebPage.php 4 Nov 2005 06:54:14 -0000 1.22 --- class.WebPage.php 4 Jan 2006 08:32:38 -0000 1.23 *************** *** 63,68 **** * Keeps a list of windows that are poped up after the page is loaded. * It is a two dimensional array, indexed by name and with columns for ! * 'url', 'features' and 'html_content'. ! * @see WebApp::popup_window($name, $url, $features, $html_content) */ var $popup_windows; --- 63,68 ---- * Keeps a list of windows that are poped up after the page is loaded. * It is a two dimensional array, indexed by name and with columns for ! * 'url', 'html_content', 'features' and 'timeout'. ! * @see WebApp::popup_window($name, $url, $html_content, $features, $timeout) */ var $popup_windows; *************** *** 298,302 **** { //open the window - $url = $data['url']; $features = $data['features']; if ($features==UNDEFINED) --- 298,301 ---- *************** *** 310,319 **** { $html_content = WebApp::js_encode($html_content); ! $js .= " $name.document.write('$html_content');"; ! $js .= " $name.document.close();"; } if ($url!='') { ! $js .= " $name.location.href=\"$url\";"; } } --- 309,328 ---- { $html_content = WebApp::js_encode($html_content); ! $js .= " $name.document.write('$html_content');\n"; ! $js .= " $name.document.close();\n"; } + + //set the timeout of the window + $timeout = $data['timeout']; + if ($timeout!=UNDEFINED) + { + $js .= " $name.setTimeout('window.close()', $timeout);\n"; + } + + //load the url in the window, if it is not empty + $url = $data['url']; if ($url!='') { ! $js .= " $name.location.href=\"$url\";\n"; } } |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:49
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/doc Modified Files: to_do.txt Log Message: Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** to_do.txt 1 Nov 2005 14:19:58 -0000 1.23 --- to_do.txt 4 Jan 2006 08:32:38 -0000 1.24 *************** *** 1,3 **** - * - Regenerate the code documentation with doxygen and phpDocumentor. * - Write in DocBookWiki a programmer's guide for phpWebApp. --- 1,2 ---- |
From: Dashamir H. <das...@us...> - 2006-01-04 08:32:48
|
Update of /cvsroot/phpwebapp/web_app/webobjects/form In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/webobjects/form Modified Files: formWebObj.php formWebObj.txt Log Message: Index: formWebObj.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/form/formWebObj.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** formWebObj.php 4 Nov 2005 06:54:14 -0000 1.10 --- formWebObj.php 4 Jan 2006 08:32:38 -0000 1.11 *************** *** 65,68 **** --- 65,178 ---- return $form_name; } + + /** + * $record is an associative array where keys are named after + * the fields of the table. It is assumed that $table has + * a primary key that is an autoincrement number. + * The function builds and executes a query that inserts a row + * in the table. + */ + function insert_record($record, $table) + { + $record = $this->fix_record($record, $table); + $record = $this->pad_record($record, $table); + $values = $this->get_query_values($record); + $query = "INSERT INTO $table\n SET\n $values\n"; + WebApp::execQuery($query); + } + + /** + * $record is an associative array where keys are named after + * the fields of the table. $key is the name of the primary key. + * The function builds and executes a query that updates the + * fields given in the $record (which includes the primary key as well). + */ + function update_record($record, $table, $key) + { + $record = $this->fix_record($record, $table); + $values = $this->get_query_values($record); + $val = $record[$key]; + $query = "UPDATE $table\n SET\n $values\n WHERE $key = '$val'"; + WebApp::execQuery($query); + } + + /** + * $record is an associative array with values for some fields of + * the given table. This function removes any fields that are not + * in the table. + */ + function fix_record($record, $table_name) + { + //get an array of the field names of the table + $rs = WebApp::execQuery("SHOW FIELDS FROM $table_name"); + $arr_fields = $rs->getColumn('Field'); + + //remove from the record any fields that does not exist in the table + while (list($fld_name,$fld_value) = each($record)) + { + if (!in_array($fld_name,$arr_fields)) unset($record[$fld_name]); + } + + return $record; + } + + /** + * $record is an associative array with values for some fields of + * the given table. This function adds empty values for the missing fields. + */ + function pad_record($record, $table_name) + { + //get an array of the field names of the table + $rs = WebApp::execQuery("SHOW FIELDS FROM $table_name"); + $arr_fields = $rs->getColumn('Field'); + + //pad with empty values any missing fields + for ($i=0; $i < sizeof($arr_fields); $i++) + { + $fld_name = $arr_fields[$i]; + if (!isset($record[$fld_name])) $record[$fld_name] = ''; + } + + return $record; + } + + /** + * $record is an associative array of field names and their values. + * The function constructs and returns a list of values that can be + * used in an insert or update query, like this: + * fld1='val1', fld2='val2', fld3='val3' + */ + function get_query_values($record) + { + while (list($fld_name, $fld_value) = each($record)) + { + if ($fld_value=='NULL') + { + $arr_values[] = "$fld_name = NULL"; + } + else + { + $arr_values[] = "$fld_name = '$fld_value'"; + } + } + $values = implode(",\n ", $arr_values); + return $values; + } + + /** + * From the items of the given array create a listbox recordset + * (with the fields 'id' and 'label'), and insert it in the $webPage. + */ + function add_listbox_rs($rs_id, $arr_labels) + { + $rs = new EditableRS($rs_id); + for ($i=0; $i < sizeof($arr_labels); $i++) + { + $label = $arr_labels[$i]; + $rs->addRec(array('id' => $label, 'label' => $label)); + } + global $webPage; + $webPage->addRecordset($rs); + } } ?> \ No newline at end of file Index: formWebObj.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/form/formWebObj.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** formWebObj.txt 15 Jul 2004 14:46:03 -0000 1.4 --- formWebObj.txt 4 Jan 2006 08:32:38 -0000 1.5 *************** *** 57,58 **** --- 57,96 ---- function setFormData(form, formData) //fills the form with the given data + + In the PHP code of the webbox, these functions can be used: + + + function insert_record($record, $table) + /** + * $record is an associative array where keys are named after + * the fields of the table. It is assumed that $table has + * a primary key that is an autoincrement number. + * The function builds and executes a query that inserts a row + * in the table. + */ + + + function update_record($record, $table, $key) + /** + * $record is an associative array where keys are named after + * the fields of the table. $key is the name of the primary key. + * The function builds and executes a query that updates the + * fields given in the $record (which includes the primary key as well). + */ + + + function fix_record($record, $table_name) + /** + * $record is an associative array with values for some fields of + * the given table. This function removes any fields that are not + * in the table. + */ + + + function pad_record($record, $table_name) + /** + * $record is an associative array with values for some fields of + * the given table. This function adds empty values for the missing fields. + */ + + + function add_listbox_rs($rs_id, $arr_labels) + /** + * From the items of the given array create a listbox recordset + * (with the fields 'id' and 'label'), and insert it in the $webPage. + */ |
From: Dashamir H. <das...@us...> - 2005-11-12 12:15:28
|
Update of /cvsroot/phpwebapp/books/content/initial_xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31350/content/initial_xml Modified Files: phpwebapp_manual_en.xml Log Message: Index: phpwebapp_manual_en.xml =================================================================== RCS file: /cvsroot/phpwebapp/books/content/initial_xml/phpwebapp_manual_en.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** phpwebapp_manual_en.xml 12 Nov 2005 12:12:04 -0000 1.2 --- phpwebapp_manual_en.xml 12 Nov 2005 12:15:20 -0000 1.3 *************** *** 124,233 **** <title>Templates</title> <para>Templates are XHTML files which can contain some additional tags and some variables. These tags and variables are processed by the framework and are replaced with HTML code when the web page is created. These templates allow the web page designer to work almost independently from the database designer and from the PHP programmer that implements the logic of the application. </para> ! <para>Some of the extra tags that can be used in templates are: <Include>, &amp;lt;If&amp;gt;, &amp;lt;Repeat&amp;gt;, &amp;lt;WebBox&amp;gt;, &amp;lt;Recordset&amp;gt;, etc. They can be mixed and nested without problem (except for some special cases). </para> <section id="xhtml"> <title>The XHTML Standard</title> <para>The main (root) template of the page should start like this: ! <programlisting>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt; ! &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; ! &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="EN"&gt; ! </programlisting> ! because if no DOCTYPE is defined, the parser will have problems with reckognizing entities (&amp;amp;nbsp; &amp;amp;amp; etc.), and there may be any other problems as well. </para> <para>For the other templates (which are included from another one), these headers shoud not be added, because the parser will add them automatically, so that they become well-formed xml and are parsed successfully. The headers that will be added to the other templates will be a copy of the headers of the main template. </para> <para>If the included templates do have the prolog and the root element, it has no effect in the generated page, because the framework will just discard them. On the other hand, it is not practical to include the prolog and the root element in each template; some of them may be just small templates, like this one: ! <programlisting>&lt;tr&gt; ! &lt;td&gt;...&lt;/td&gt; ! &lt;/tr&gt; ! </programlisting></para> ! <para>The templates must be well-formed XML files. This is required by the framework because it uses an XML parser to parse them, and if a template is not well-formed, the parser will not be able to parse it and will display an error. E.g. <emphasis>&amp;lt;br/&amp;gt;</emphasis> must be used instead of <emphasis>&amp;lt;br&amp;gt;</emphasis> , <emphasis>&amp;lt;img ... /&amp;gt;</emphasis> instead of <emphasis>&amp;lt;img ...&amp;gt;</emphasis> , etc. (see <ulink url="http://www.w3schools.com/xhtml/xhtml_html.asp">XHTML vs HTML</ulink> for more details about these). </para> <para>Except the usual XHTML tags, the templates can also contain extra elements (tags), which are reckognized and processed by the framework. For the framework it doesn't matter the case (upper/lower) of these tags, however it is good to keep them in lowercase, since all the other XHTML tags are required to be lowercase (by the XHTML standard). </para> <para>So, the templates may not be fully compliant to the XHTML standard, due to the additional things that are supported by the framework. However, the page that the framework generates from them and which is sent to the browser, is a valid XHTML page. </para> ! <para>The framework preserves any CDATA marks that are found in the templates (this means that they still apear in the resulting page). This is important because the javascript code in an XHTML page needs to be written inside a CDATA section and, if the framework did not preserve the CDATA marks, the resulting page would not be a valid XHTML page. </para> ! <para>Another issue related to XML is this: each xml parser is required to process the entities: &amp;amp;amp; &amp;amp;lt; &amp;amp;gt; &amp;amp;quot; and &amp;amp;apos; and to return the corresponding character instead of the entity itself. For this reason, in order to include e.g. an ampersand in a page, it is not enough to write it in template as <emphasis>&amp;amp;amp;</emphasis> but it should be written as <emphasis>&amp;amp;amp;amp;</emphasis> . The same goes for &amp;amp;amp;lt;, &amp;amp;amp;quot;, etc. </para> </section> <section id="tpl-comments"> <title>Comments</title> <para>Template comments are just like usual XHTML comments, but they are discarded by the framework when the template is processed. They are denoted by adding a diesis after the opening mark: </para> ! <programlisting>&lt;!--# Such comments are not included in the XHTML file that is generated and sent to the browser. ! --&gt; ! &lt;!-- Usual XHTML comments (like this one) are passed to the XHTML file that is generated from the template. ! --&gt; ! </programlisting> </section> <section id="tpl-include"> <title>Include</title> ! <para>The <emphasis>&amp;lt;Include&amp;gt;</emphasis> element is used to include a template inside another template: ! <programlisting>&lt;include src="templates/header.html" /&gt; ! &lt;include src="{{content_file}}" /&gt; ! &lt;include src="{{./}}edit/cluster_edit.html" /&gt; ! </programlisting></para> <para>It 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. </para> <para>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. The variables used here are evaluated when the template is parsed, so they should be parse-time variables (see later about what this means). </para> <tip> ! <para>Note in the last example the variable <emphasis>{{#./}}</emphasis> . It is defined automatically by the framework and it allways keeps the path of the current directory (the directory of the template that contains the <emphasis>&amp;lt;include&amp;gt;</emphasis> ). This allows the usage of relative paths in the "src" attribute, and it makes the application more flexible. So, the directory containing the template can be renamed or moved to another location, however the paths of the included files need not to be changed since they are relative to the current directory.</para> </tip> </section> <section id="tpl-if"> <title>If</title> ! <para>The content of the element <emphasis>&amp;lt;If&amp;gt;</emphasis> is included in the resulting page conditionally. If the value of the attribute "condition" is true, then it is included, otherwise it is skiped. </para> ! <programlisting>&lt;if condition="!{{admin}}"&gt; ! &lt;a class="button" href="javascript:edit()"&gt;Edit&lt;/a&gt; ! &lt;/if&gt; ! </programlisting> <para>The value of the condition is calculated as a PHP expression (after the template variables have been replaced). The evaluation of the condition is done at the render time (when the page is generated, see later about parse and render), so they should be render-time variables. </para> <tip> ! <para>Use <emphasis>!=</emphasis> instead of <emphasis>&amp;lt;&amp;gt;</emphasis> in the expression of the condition, because the xml parser complains about the characters &amp;lt; and &amp;gt; inside the value of an attribute. ! <programlisting>This is wrong: &lt;if condition="'{CurrPage}'&lt;&gt;'{PrevPage}'"&gt;...&lt;/if&gt;</programlisting><programlisting>This is right: &lt;if condition="'{CurrPage}'!='{PrevPage}'"&gt;...&lt;/if&gt;</programlisting></para> </tip> </section> <section id="tpl-repeat"> <title>Repeat</title> ! <para>The <emphasis>&amp;lt;Repeat&amp;gt;</emphasis> element is used to repeat a part of the template several times: ! <programlisting>&lt;table&gt; ! &lt;repeat rs="rs_id"&gt; ! &lt;tr&gt;&lt;td&gt;{{field_name}}&lt;/td&gt;&lt;/tr&gt; ! &lt;/repeat&gt; ! &lt;/table&gt; ! </programlisting></para> ! <para>It is useful e.g. for constructing tables, when you want to add a row for each record in the result of a DB query. The attribute <emphasis>rs</emphasis> is the id of a recordset<footnote><para>A recordset is an object that contains the results of a DB query.</para></footnote> . The body of the &amp;lt;repeat&amp;gt; will be repeated for each record of the recordset. Each time, the fields of the record will be used as template variables for it. </para> ! <para>In case that the recordset is empty, the content of the element <emphasis>&amp;lt;IfEmpty&amp;gt;</emphasis> (if present) is displayed instead of the body. The <emphasis>&amp;lt;Separator&amp;gt;</emphasis> element is displayed between two repetitions of the body of the &amp;lt;Repeat&amp;gt;. It is optional. </para> ! <para>The elements &amp;lt;IfEmpty&amp;gt; and &amp;lt;Separator&amp;gt; can be placed anywhere inside the &amp;lt;Repeat&amp;gt;. Everything inside the &amp;lt;Repeat&amp;gt; element and outside the elements &amp;lt;IfEmpty&amp;gt; and &amp;lt;Separator&amp;gt; is considered as body of the &amp;lt;Repeat&amp;gt; and is processed for each record of the recordset. To make it more readable, the tag <emphasis>&amp;lt;RepeatBody&amp;gt;</emphasis> may be used, but it is just "syntactic sugar" and doesn't effect anything. It is optional and usually is omitted. </para> ! <programlisting>&lt;table&gt; ! &lt;repeat rs="rs_id"&gt; ! &lt;ifempty&gt; ! &lt;!--# &lt;IfEmpty&gt; is included in the page in case ! that recordset specified has no records #--&gt; ! &lt;tr&gt; ! &lt;td&gt;No articles found!&lt;/td&gt; ! &lt;/tr&gt; ! &lt;/ifempty&gt; ! &lt;repeatbody&gt; ! &lt;!--# Here comes the part that is repeated for each record in the recordset. The tag ! &lt;RepeatBody&gt; is optional and may be omitted ! #--&gt; ! &lt;tr&gt; ! &lt;td&gt; {{TI}} &lt;/td&gt; ! &lt;td&gt; {{AU}} &lt;/td&gt; . . . ! &lt;/tr&gt; ! &lt;/repeatbody&gt; ! &lt;separator&gt; ! &lt;!--# &lt;Separator&gt; is processed between ! two repetitions of the &lt;RepeatBody&gt; #--&gt; ! &lt;tr&gt;&lt;td colspan="3"&gt; &lt;hr width="90%" /&gt; &lt;/td&gt;&lt;/tr&gt; ! &lt;/separator&gt; ! &lt;/repeat&gt; ! &lt;/table&gt; ! </programlisting> <para>The value of the "rs" attribute can also contain variables, like this: ! <programlisting>&lt;repeat rs="{{rs_id}}"&gt; . . . &lt;/repeat&gt;</programlisting> This allows a repeat block to use different queries in different cases (according to the logic of the program). These variables are evaluated in render time (it should be assigned in the function onParse(), or it should be a state variable or global variable). </para> </section> --- 124,240 ---- <title>Templates</title> <para>Templates are XHTML files which can contain some additional tags and some variables. These tags and variables are processed by the framework and are replaced with HTML code when the web page is created. These templates allow the web page designer to work almost independently from the database designer and from the PHP programmer that implements the logic of the application. </para> ! <para>Some of the extra tags that can be used in templates are: <Include>, <If>, <Repeat>, <WebBox>, <Recordset>, etc. They can be mixed and nested without problem (except for some special cases). </para> <section id="xhtml"> <title>The XHTML Standard</title> <para>The main (root) template of the page should start like this: ! <programlisting><![CDATA[<?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> ! ]]></programlisting> ! because if no DOCTYPE is defined, the parser will have problems with reckognizing entities (&nbsp; &amp; etc.), and there may be any other problems as well. </para> <para>For the other templates (which are included from another one), these headers shoud not be added, because the parser will add them automatically, so that they become well-formed xml and are parsed successfully. The headers that will be added to the other templates will be a copy of the headers of the main template. </para> <para>If the included templates do have the prolog and the root element, it has no effect in the generated page, because the framework will just discard them. On the other hand, it is not practical to include the prolog and the root element in each template; some of them may be just small templates, like this one: ! <programlisting><![CDATA[<tr> ! <td>...</td> ! </tr> ! ]]></programlisting></para> ! <para>The templates must be well-formed XML files. This is required by the framework because it uses an XML parser to parse them, and if a template is not well-formed, the parser will not be able to parse it and will display an error. E.g. <emphasis><br/></emphasis> must be used instead of <emphasis><br></emphasis> , <emphasis><img ... /></emphasis> instead of <emphasis><img ...></emphasis> , etc. (see <ulink url="http://www.w3schools.com/xhtml/xhtml_html.asp">XHTML vs HTML</ulink> for more details about these). </para> <para>Except the usual XHTML tags, the templates can also contain extra elements (tags), which are reckognized and processed by the framework. For the framework it doesn't matter the case (upper/lower) of these tags, however it is good to keep them in lowercase, since all the other XHTML tags are required to be lowercase (by the XHTML standard). </para> <para>So, the templates may not be fully compliant to the XHTML standard, due to the additional things that are supported by the framework. However, the page that the framework generates from them and which is sent to the browser, is a valid XHTML page. </para> ! <para>The framework preserves any CDATA marks that are found in the templates (this means that they still apear in the resulting page). This is important because the javascript code in an XHTML page needs to be written inside a CDATA section and, if the framework did not preserve the CDATA marks, the resulting page could not be a valid XHTML page. </para> ! <para>Another issue related to XML is this: each xml parser is required to process the entities: &amp; &lt; &gt; &quot; and &apos; and to return the corresponding character instead of the entity itself. For this reason, in order to include e.g. an ampersand in a page, it is not enough to write it in template as <emphasis>&amp;</emphasis> but it should be written as <emphasis>&amp;amp;</emphasis> . The same goes for &amp;lt;, &amp;quot;, etc. </para> </section> <section id="tpl-comments"> <title>Comments</title> <para>Template comments are just like usual XHTML comments, but they are discarded by the framework when the template is processed. They are denoted by adding a diesis after the opening mark: </para> ! <programlisting> ! <![CDATA[<!--# 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. ! --> ! ]]> ! </programlisting> </section> <section id="tpl-include"> <title>Include</title> ! <para>The <emphasis><Include></emphasis> element is used to include a template inside another template: ! <programlisting><![CDATA[<include src="templates/header.html" /> ! <include src="{{content_file}}" /> ! <include src="{{./}}edit/cluster_edit.html" /> ! ]]></programlisting></para> <para>It 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. </para> <para>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. The variables used here are evaluated when the template is parsed, so they should be parse-time variables (see later about what this means). </para> <tip> ! <para>Note in the last example the variable <emphasis>{{#./}}</emphasis> . It is defined automatically by the framework and it allways keeps the path of the current directory (the directory of the template that contains the <emphasis><include></emphasis> ). This allows the usage of relative paths in the "src" attribute, and it makes the application more flexible. So, the directory containing the template can be renamed or moved to another location, however the paths of the included files need not to be changed since they are relative to the current directory.</para> </tip> </section> <section id="tpl-if"> <title>If</title> ! <para>The content of the element <emphasis><If></emphasis> is included in the resulting page conditionally. If the value of the attribute "condition" is true, then it is included, otherwise it is skiped. </para> ! <programlisting> ! <![CDATA[<if condition="!{{admin}}"> ! <a class="button" href="javascript:edit()">Edit</a> ! </if> ! ]]> ! </programlisting> <para>The value of the condition is calculated as a PHP expression (after the template variables have been replaced). The evaluation of the condition is done at the render time (when the page is generated, see later about parse and render), so they should be render-time variables. </para> <tip> ! <para>Use <emphasis>!=</emphasis> instead of <emphasis><></emphasis> in the expression of the condition, because the xml parser complains about the characters < and > inside the value of an attribute. ! <programlisting>This is wrong: <![CDATA[<if condition="'{{CurrPage}}'<>'{{PrevPage}}'">...</if>]]></programlisting><programlisting>This is right: <![CDATA[<if condition="'{{CurrPage}}'!='{{PrevPage}}'">...</if>]]></programlisting></para> </tip> </section> <section id="tpl-repeat"> <title>Repeat</title> ! <para>The <emphasis><Repeat></emphasis> element is used to repeat a part of the template several times: ! <programlisting><![CDATA[<table> ! <repeat rs="rs_id"> ! <tr><td>{{field_name}}</td></tr> ! </repeat> ! </table> ! ]]></programlisting></para> ! <para>It is useful e.g. for constructing tables, when you want to add a row for each record in the result of a DB query. The attribute <emphasis>rs</emphasis> is the id of a recordset<footnote><para>A recordset is an object that contains the results of a DB query.</para></footnote> . The body of the <repeat> will be repeated for each record of the recordset. Each time, the fields of the record will be used as template variables for it. </para> ! <para>In case that the recordset is empty, the content of the element <emphasis><IfEmpty></emphasis> (if present) is displayed instead of the body. The <emphasis><Separator></emphasis> element is displayed between two repetitions of the body of the <Repeat>. It is optional. </para> ! <para>The elements <IfEmpty> and <Separator> can be placed anywhere inside the <Repeat>. Everything inside the <Repeat> element and outside the elements <IfEmpty> and <Separator> is considered as body of the <Repeat> and is processed for each record of the recordset. To make it more readable, the tag <emphasis><RepeatBody></emphasis> may be used, but it is just "syntactic sugar" and doesn't effect anything. It is optional and usually is omitted. </para> ! <programlisting> ! <![CDATA[<table> ! <repeat rs="rs_id"> ! <ifempty> ! <!--# <IfEmpty> is included in the page in case ! that recordset specified has no records #--> ! <tr> ! <td>No articles found!</td> ! </tr> ! </ifempty> ! <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> ! </repeat> ! </table> ! ]]> ! </programlisting> <para>The value of the "rs" attribute can also contain variables, like this: ! <programlisting><![CDATA[<repeat rs="{{rs_id}}"> . . . </repeat> ! ]]></programlisting> This allows a repeat block to use different queries in different cases (according to the logic of the program). These variables are evaluated in render time (it should be assigned in the function onParse(), or it should be a state variable or global variable). </para> </section> *************** *** 235,245 **** <title>Identation</title> <para>The framework tries to indent the generated XHTML page as well as possible. If you view the source of a page that is generated by the framework, usually you will see a well-indented XHTML code that is easy to read and to copy/paste. </para> ! <para>The framework does not modify the indentation of the HTML code inside the templates, however it tries to keep the indentation of the &amp;lt;include&amp;gt; elements. That is, all the included code is indented with the same indentation as the &amp;lt;include&amp;gt; element. </para> ! <para>Most of the time this is good, however sometimes it has undesirable effects. For example, for the XHTML elements &amp;lt;pre&amp;gt;, &amp;lt;xmp&amp;gt; and &amp;lt;textarea&amp;gt;, it would add unwanted extra spaces at the begining of each line. This would be wrong because their contents is 'preformated' and it should not be modified. The framework corrects this by reckognizing these tags and adding no extra indentation to their contents. </para> ! <para>Sometimes it may be usefull to add no indentation to a part of a template. This can be done by including it inside the &amp;lt;unindented&amp;gt; tag, like this: ! <programlisting>&lt;unindented&gt; {{file_revision}} ! &lt;/unindented&gt; ! </programlisting> It will turn off the extra indentation that is done by the framework. </para> </section> --- 242,252 ---- <title>Identation</title> <para>The framework tries to indent the generated XHTML page as well as possible. If you view the source of a page that is generated by the framework, usually you will see a well-indented XHTML code that is easy to read and to copy/paste. </para> ! <para>The framework does not modify the indentation of the HTML code inside the templates, however it tries to keep the indentation of the <include> elements. That is, all the included code is indented with the same indentation as the <include> element. </para> ! <para>Most of the time this is good, however sometimes it has undesirable effects. For example, for the XHTML elements <pre>, <xmp> and <textarea>, it would add unwanted extra spaces at the begining of each line. This would be wrong because their contents is 'preformated' and it should not be modified. The framework corrects this by reckognizing these tags and adding no extra indentation to their contents. </para> ! <para>Sometimes it may be usefull to add no indentation to a part of a template. This can be done by including it inside the <unindented> tag, like this: ! <programlisting><![CDATA[<unindented> {{file_revision}} ! </unindented> ! ]]></programlisting> It will turn off the extra indentation that is done by the framework. </para> </section> *************** *** 249,285 **** <section id="tpl-db-recordset"> <title>Recordset, Query, dbCommand</title> ! <para>The <emphasis>&amp;lt;Recordset&amp;gt;</emphasis> element can be used to define a DB query, which can be executed later by the framework and the result can be used to construct a <emphasis>Recordset</emphasis> object. It can be used like this: </para> ! <programlisting>&lt;Recordset id="rs-id"&gt; ! &lt;Query&gt; SELECT field1, {{field_name}} FROM table-name WHERE id = '{{id}}' ! &lt;/Query&gt; ! &lt;/Recordset&gt; ! </programlisting> ! <para>Each &amp;lt;recordset&amp;gt; has a unique ID. Later, when we use this recordset (e.g. in &amp;lt;repeat&amp;gt;) we refer to it by this ID. </para> ! <para>It also has a &amp;lt;Query&amp;gt; element, which contains the query to be executed. The query may contain variables, which are replaced at the time that the query is executed. </para> <tip> ! <para>If there is any <emphasis>smaller-than</emphasis> operator (&amp;lt;) in the contents of a &amp;lt;Query&amp;gt; element, then either replace ! it by &amp;amp;lt; or enclose the query in CDATA marks.</para> </tip> ! <para>There is also a <emphasis>&amp;lt;dbCommand&amp;gt;</emphasis> element, which is in fact identical to &amp;lt;recordset&amp;gt; but is usually used for insert/update/delete queries (which usually do not give a result other that successful/unsuccessful and cannot be used to construct a <emphasis>Recordset</emphasis> object). </para> </section> <section id="tpl-db-type"> <title>Types of Recordsets</title> ! <para>The &amp;lt;Recordset&amp;gt; can also have a "type" attribute: ! <programlisting>&lt;Recordset id="rs-id" type="rs-type"&gt;</programlisting></para> <para>This attribute can have one of the values: (EditableRS | StaticRS | DynamicRS | PagedRS). The default value (if the attribute is missing) is 'EditableRS'. </para> <para>An 'EditableRS' is a recordset that can be modified from the PHP code. The programer can retrive the results of a query from DB and then modify them, or start with an empty RS and fill it programatically. It makes possible to use recordsets even for results that don't come from DB. </para> <para>A 'StaticRS' is a recordset that is opened only once in a page. It is more efficient for recordsets that are used many times in a page without changing (e.g. when a recordset fills a listbox and this listbox is used many times in the page). An editable RS is also static, so a recordset is by default static (if the "type" attribute is missing). This type needs to be declared explicitly only when for some reason we don't want the recordset to be editable (it just gets the results from the DB and it cannot be modified from the PHP code). </para> ! <para>A 'DynamicRS' is a recordset that executes its query each time that it is opened. Since the query can contain {{variables}} and the variables of the query are evaluated and replaced just before the execution, the result of the query can be different each time that it is executed. It is useful e.g when we have a &amp;lt;repeat&amp;gt; nested inside another &amp;lt;repeat&amp;gt;: the recordset of the inner &amp;lt;repeat&amp;gt; will be opened and refreshed for each record of the outer recordset, and since it can contain variables that are defined by the outer &amp;lt;repeat&amp;gt;, it can have different results each time that it is repeated. </para> <para>A 'PagedRS' is a recordset that divides the results of the query into pages of certain size and retrives from DB only one page of them. A page is a group of consecutive records. All the pages (except the last one) have the same number of records and they form a partition of all the records of the query. If the recordset is of type 'PagedRS' then the attribute 'recs_per_page' must be defined as well, which specifies the size of the page. This type of recordset is usually used to display queries that have many results which usually cannot fit in a single HTML page. </para> </section> <section id="tpl-db-rsnavig"> <title>rsNavig</title> ! <para>Suppose that we have a &amp;lt;repeat&amp;gt; which is connected to a paged recordset. Then just records of one page (the current page) of the recordset are displayed in the XHTML page. In order to navigate to the other pages of the recordset we need to know what is the next page, previous page, last page, etc. </para> ! <para>n this case the element <emphasis>&amp;lt;rsNavig&amp;gt;</emphasis> is useful: ! <programlisting>&lt;rsNavig rs="paged-rs-id"&gt; ... &lt;/rsNavig&gt;</programlisting></para> ! <para>The attribute "rs" of &amp;lt;rsNavig&amp;gt; contains the id of a <emphasis>PagedRS</emphasis> recordset. The framework gets from the recordset some navigation variables and makes them available in the scope of &amp;lt;rsNavig&amp;gt;. These variables are: </para> <itemizedlist> <listitem> --- 256,293 ---- <section id="tpl-db-recordset"> <title>Recordset, Query, dbCommand</title> ! <para>The <emphasis><Recordset></emphasis> element can be used to define a DB query, which can be executed later by the framework and the result can be used to construct a <emphasis>Recordset</emphasis> object. It can be used like this: </para> ! <programlisting> ! <![CDATA[<Recordset id="rs-id"> ! <Query> SELECT field1, {{field_name}} FROM table-name WHERE id = '{{id}}' ! </Query> ! </Recordset> ! ]]> ! </programlisting> ! <para>Each <recordset> has a unique ID. Later, when we use this recordset (e.g. in <repeat>) we refer to it by this ID. </para> ! <para>It also has a <Query> element, which contains the query to be executed. The query may contain variables, which are replaced at the time that the query is executed. </para> <tip> ! <para>If there is any <emphasis>smaller-than</emphasis> operator (<) in the contents of a <Query> element, then either replace it by &lt; or enclose the query in CDATA marks.</para> </tip> ! <para>There is also a <emphasis><dbCommand></emphasis> element, which is in fact identical to <recordset> but is usually used for insert/update/delete queries (which usually do not give a result other that successful/unsuccessful and cannot be used to construct a <emphasis>Recordset</emphasis> object). </para> </section> <section id="tpl-db-type"> <title>Types of Recordsets</title> ! <para>The <Recordset> can also have a "type" attribute: ! <programlisting><![CDATA[<Recordset id="rs-id" type="rs-type"\>]]></programlisting></para> <para>This attribute can have one of the values: (EditableRS | StaticRS | DynamicRS | PagedRS). The default value (if the attribute is missing) is 'EditableRS'. </para> <para>An 'EditableRS' is a recordset that can be modified from the PHP code. The programer can retrive the results of a query from DB and then modify them, or start with an empty RS and fill it programatically. It makes possible to use recordsets even for results that don't come from DB. </para> <para>A 'StaticRS' is a recordset that is opened only once in a page. It is more efficient for recordsets that are used many times in a page without changing (e.g. when a recordset fills a listbox and this listbox is used many times in the page). An editable RS is also static, so a recordset is by default static (if the "type" attribute is missing). This type needs to be declared explicitly only when for some reason we don't want the recordset to be editable (it just gets the results from the DB and it cannot be modified from the PHP code). </para> ! <para>A 'DynamicRS' is a recordset that executes its query each time that it is opened. Since the query can contain {{variables}} and the variables of the query are evaluated and replaced just before the execution, the result of the query can be different each time that it is executed. It is useful e.g when we have a <repeat> nested inside another <repeat>: the recordset of the inner <repeat> will be opened and refreshed for each record of the outer recordset, and since it can contain variables that are defined by the outer <repeat>, it can have different results each time that it is repeated. </para> <para>A 'PagedRS' is a recordset that divides the results of the query into pages of certain size and retrives from DB only one page of them. A page is a group of consecutive records. All the pages (except the last one) have the same number of records and they form a partition of all the records of the query. If the recordset is of type 'PagedRS' then the attribute 'recs_per_page' must be defined as well, which specifies the size of the page. This type of recordset is usually used to display queries that have many results which usually cannot fit in a single HTML page. </para> </section> <section id="tpl-db-rsnavig"> <title>rsNavig</title> ! <para>Suppose that we have a <repeat> which is connected to a paged recordset. Then just records of one page (the current page) of the recordset are displayed in the XHTML page. In order to navigate to the other pages of the recordset we need to know what is the next page, previous page, last page, etc. </para> ! <para>In this case the element <emphasis><rsNavig></emphasis> is useful: ! <programlisting><![CDATA[<rsNavig rs="paged-rs-id"> ... </rsNavig>]]></programlisting></para> ! <para>The attribute "rs" of <rsNavig> contains the id of a <emphasis>PagedRS</emphasis> recordset. The framework gets from the recordset some navigation variables and makes them available in the scope of <rsNavig>. These variables are: </para> <itemizedlist> <listitem> *************** *** 305,347 **** </listitem> </itemizedlist> ! <para>In the following section there is an example of using &amp;lt;rsNavig&amp;gt;. </para> <section id="tpl-db-rsnavig-xmp"> <title>Example</title> ! <para>&amp;lt;rsNavig&amp;gt; is usually used in the header or footer of a paged list, in order to provide navigation to the other pages of a recordset. Here is an example of the footer of such a list: </para> ! <programlisting>&lt;rsnavig rs="tcards_rs"&gt; ! &lt;table class="list_footer" border="0" cellspacing="0"&gt; ! &lt;tr&gt; ! &lt;td width="25%"&gt; Found: {{AllRecs}} Technological Cards ! &lt;/td&gt; ! &lt;td width="25%"&gt; Page {{CurrPage}} of {{LastPage}} ! &lt;/td&gt; ! &lt;td&gt; ! &lt;if condition="'{{CurrPage}}' &gt; '{{PrevPage}}'"&gt; ! &lt;a href="javascript:SendEvent('tcardList','next','page=1')"&gt; ! &amp;amp;lt;&amp;amp;lt;First ! &lt;/a&gt; ! &amp;nbsp;&amp;nbsp; ! &lt;a href="javascript:SendEvent('tcardList','next','page={{PrevPage}}')"&gt; ! &amp;amp;lt;Prev ! &lt;/a&gt; ! &amp;nbsp;&amp;nbsp; ! &lt;/if&gt; ! &lt;if condition="'{{NextPage}}' &gt; '{{CurrPage}}'"&gt; ! &lt;a href="javascript:SendEvent('tcardList','next','page={{NextPage}}')"&gt; ! Next&amp;amp;gt; ! &lt;/a&gt; ! &amp;nbsp;&amp;nbsp; ! &lt;a href="javascript:SendEvent('tcardList','next','page={{LastPage}}')"&gt; ! Last&amp;amp;gt;&amp;amp;gt; ! &lt;/a&gt; ! &amp;nbsp;&amp;nbsp; ! &lt;/if&gt; ! &lt;/td&gt; ! &lt;/tr&gt; ! &lt;/table&gt; ! &lt;/rsnavig&gt; ! </programlisting> </section> </section> --- 313,357 ---- </listitem> </itemizedlist> ! <para>In the following section there is an example of using <rsNavig>. </para> <section id="tpl-db-rsnavig-xmp"> <title>Example</title> ! <para><rsNavig> is usually used in the header or footer of a paged list, in order to provide navigation to the other pages of a recordset. Here is an example of the footer of such a list: </para> ! <programlisting> ! <![CDATA[<rsnavig rs="tcards_rs"> ! <table class="list_footer" border="0" cellspacing="0"> ! <tr> ! <td width="25%"> Found: {{AllRecs}} Technological Cards ! </td> ! <td width="25%"> Page {{CurrPage}} of {{LastPage}} ! </td> ! <td> ! <if condition="'{{CurrPage}}' > '{{PrevPage}}'"> ! <a href="javascript:SendEvent('tcardList','next','page=1')"> ! &lt;&lt;First ! </a> ! ! <a href="javascript:SendEvent('tcardList','next','page={{PrevPage}}')"> ! &lt;Prev ! </a> ! ! </if> ! <if condition="'{{NextPage}}' > '{{CurrPage}}'"> ! <a href="javascript:SendEvent('tcardList','next','page={{NextPage}}')"> ! Next&gt; ! </a> ! ! <a href="javascript:SendEvent('tcardList','next','page={{LastPage}}')"> ! Last&gt;&gt; ! </a> ! ! </if> ! </td> ! </tr> ! </table> ! </rsnavig> ! ]]> ! </programlisting> </section> </section> *************** *** 353,384 **** <title>WebBox</title> <para>A WebBox is a template which has also some PHP 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 JavaScript code, CSS stylesheets, SQL queries etc., associated with it. </para> ! <para>It is denoted by the tag <emphasis>&amp;lt;WebBox&amp;gt;</emphasis> and it has an ID attribute: ! <programlisting>&lt;webbox id="box-id"&gt; ! &lt;!-- content of WebBox --&gt; ! &lt;/webbox&gt; ! </programlisting> The identifier must be different for each WebBox used in the application. </para> ! <para>A WebBox is defined inside a template file and the TPL code of the WebBox is inside the &amp;lt;WebBox&amp;gt; tag (is the content of the &amp;lt;WebBox&amp;gt; element). </para> </section> <section id="tpl-webclass"> <title>WebClass, WebObject</title> ! <para><emphasis>&amp;lt;WebClass&amp;gt;</emphasis> defines a web class and <emphasis>&amp;lt;WebObject&amp;gt;</emphasis> declares an object of the class: </para> ! <programlisting>&lt;WebClass ID="className" Path="path/to/className.php"&gt; ! &lt;Parameter name="param1" default="default value" /&gt; ! &lt;Parameter name="param2" /&gt; ! &lt;!--# . . . . . . . . . . . . . . . . #--&gt; ! &lt;!--# the template of the web class #--&gt; ! &lt;!--# . . . . . . . . . . . . . . . . #--&gt; ! &lt;/WebClass&gt; ! &lt;WebObject Class="className" name="wObj1" param1="value1" param2="value2" /&gt; ! &lt;WebObject Class="className" name="wObj2" param2="value2" /&gt; ! &lt;WebObject Class="className" name="wObj3" param1="{{nr}}+1" param2="red" /&gt; ! </programlisting> <para>The WebClass does not produce any output in the resulting XHTML page. A WebObject uses the template of its class. </para> ! <para>The "path" attribute of the &amp;lt;WebClass&amp;gt; declares the path of the file that contains the PHP code of the WebClass. It is optional, and if it is not given, the current folder is searched for the file <filename>className.php</filename> (the folder of the template that contains the &amp;lt;WebClass&amp;gt; definition). </para> ! <para>The &amp;lt;Parameter&amp;gt; elements declare the names and optionally the default values of the parameters of the webobjects. These parameters can be used inside the template of the webclass like template variables, e.g. {{#param1}}. If a parameter doesn't get a value in the &amp;lt;WebObject&amp;gt; declaration, then its default value is used (if it doesn't have a default value, then it is handled like an undefined variable). When a &amp;lt;WebObject&amp;gt; is rendered, the value of the parameters is evaluated as a mixed expression (a PHP expression that contains {{#template variables}}). </para> ! <para>When several objects of the same class are declared, the template of the webclass is repeated for each of them. The webclass designer should take this into account when building the webclass. E.g. if there is such an &amp;lt;input&amp;gt; in the webclass template: ! <programlisting>&lt;input type="text" name="staff"&gt;</programlisting> There will be several such inputs in the HTML code, and its value cannot be accessed like this: <emphasis>document.form.staff.value</emphasis></para> </section> --- 363,396 ---- <title>WebBox</title> <para>A WebBox is a template which has also some PHP 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 JavaScript code, CSS stylesheets, SQL queries etc., associated with it. </para> ! <para>It is denoted by the tag <emphasis><WebBox></emphasis> and it has an ID attribute: ! <programlisting><![CDATA[<webbox id="box-id"> ! <!-- content of WebBox --> ! </webbox> ! ]]></programlisting> The identifier must be different for each WebBox used in the application. </para> ! <para>A WebBox is defined inside a template file and the TPL code of the WebBox is inside the <WebBox> tag (is the content of the <WebBox> element). </para> </section> <section id="tpl-webclass"> <title>WebClass, WebObject</title> ! <para><emphasis><WebClass></emphasis> defines a web class and <emphasis><WebObject></emphasis> declares an object of the class: </para> ! <programlisting> ! <![CDATA[<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" /> ! ]]> ! </programlisting> <para>The WebClass does not produce any output in the resulting XHTML page. A WebObject uses the template of its class. </para> ! <para>The "path" attribute of the <WebClass> declares the path of the file that contains the PHP code of the WebClass. It is optional, and if it is not given, the current folder is searched for the file <filename>className.php</filename> (the folder of the template that contains the <WebClass> definition). </para> ! <para>The <Parameter> elements declare the names and optionally the default values of the parameters of the webobjects. These parameters can be used inside the template of the webclass like template variables, e.g. {{#param1}}. If a parameter doesn't get a value in the <WebObject> declaration, then its default value is used (if it doesn't have a default value, then it is handled like an undefined variable). When a <WebObject> is rendered, the value of the parameters is evaluated as a mixed expression (a PHP expression that contains {{#template variables}}). </para> ! <para>When several objects of the same class are declared, the template of the webclass is repeated for each of them. The webclass designer should take this into account when building the webclass. E.g. if there is such an <input> in the webclass template: ! <programlisting><![CDATA[<input type="text" name="staff">]]></programlisting> There will be several such inputs in the HTML code, and its value cannot be accessed like this: <emphasis>document.form.staff.value</emphasis></para> </section> *************** *** 389,428 **** <section id="tpl-var"> <title>Var</title> ! <para><emphasis>&amp;lt;Var&amp;gt;</emphasis> elements declare variables that can be used anywhere in the template in the current scope and in the scopes inside it: ! <programlisting>&lt;var name="SUM"&gt;({{field1}} + {{field2}} + {{field3}})&lt;/var&gt; ! </programlisting></para> <para>They are identified by their name, and their value is calculated using their content as an expression. The value of the expression is calculated in this way: first, any template variable inside it is found and replaced, then the resulting string is evaluated as a PHP expression. </para> ! <para>The value of the expression is evaluated at the time that the template is rendered. So, if a variable is inside a &amp;lt;repeat&amp;gt; element, then it may have different values for different iterations: ! <programlisting>&lt;var name="ROW_COLOR"&gt; ({{CurrentRowNr}}%2 ? "grey" : "white") ! &lt;/var&gt; ! &lt;tr class="{{ROW_COLOR}}"&gt; . . . &lt;/tr&gt; ! </programlisting></para> </section> <section id="tpl-tpl"> <title>Template</title> ! <para>The <emphasis>&amp;lt;template&amp;gt;</emphasis> element has no effect other then defining a new scope. E.g the variable defined below will be available only inside the body of &amp;lt;template&amp;gt;: ! <programlisting>&lt;template&gt; ! &lt;var name="test"&gt; . . . &lt;/var&gt; . . . ! &lt;/template&gt; ! </programlisting></para> </section> <section id="tpl-xmp"> <title>Example</title> ! <para>The <emphasis>&amp;lt;example&amp;gt;</emphasis> tag can be used for examples about the framework templates. It can be used like this: ! <programlisting>&lt;example style="border: 1px solid #eeeeee;"&gt; test ! &lt;b&gt;test&lt;/b&gt; {{test}} ! &lt;include src="{{content_html}}" /&gt; ! &lt;/example&gt; ! </programlisting></para> ! <para>It is converted by the framework to an &amp;lt;xmp&amp;gt; element, like this: ! <programlisting>&lt;xmp style="border: 1px solid #eeeeee;"&gt; test ! &lt;b&gt;test&lt;/b&gt; {{test}} ! &lt;include src="{{content_html}}" /&gt; ! &lt;/ xmp&gt; ! </programlisting></para> </section> </section> --- 401,439 ---- <section id="tpl-var"> <title>Var</title> ! <para><emphasis><Var></emphasis> elements declare variables that can be used anywhere in the template in the current scope and in the scopes inside it: ! <programlisting><![CDATA[<var name="SUM">({{field1}} + {{field2}} + {{field3}})</var>]]></programlisting></para> <para>They are identified by their name, and their value is calculated using their content as an expression. The value of the expression is calculated in this way: first, any template variable inside it is found and replaced, then the resulting string is evaluated as a PHP expression. </para> ! <para>The value of the expression is evaluated at the time that the template is rendered. So, if a variable is inside a <repeat> element, then it may have different values for different iterations: ! <programlisting><![CDATA[<var name="ROW_COLOR"> ({{CurrentRowNr}}%2 ? "grey" : "white") ! </var> ! <tr class="{{ROW_COLOR}}"> . . . </tr> ! ]]></programlisting></para> </section> <section id="tpl-tpl"> <title>Template</title> ! <para>The <emphasis><template></emphasis> element has no effect other then defining a new scope. E.g the variable defined below will be available only inside the body of <template>: ! <programlisting><![CDATA[<template> ! <var name="test"> . . . </var> . . . ! </template> ! ]]></programlisting></para> </section> <section id="tpl-xmp"> <title>Example</title> ! <para>The <emphasis><example></emphasis> tag can be used for examples about the framework templates. It can be used like this: ! <programlisting><![CDATA[<example style="border: 1px solid #eeeeee;"> test ! <b>test</b> {{test}} ! <include src="{{content_html}}" /> ! </example> ! ]]></programlisting></para> ! <para>It is converted by the framework to an <xmp> element, like this: ! <programlisting><![CDATA[<xmp style="border: 1px solid #eeeeee;"> test ! <b>test</b> {{test}} ! <include src="{{content_html}}" /> ! </ xmp> ! ]]></programlisting></para> </section> </section> *************** *** 430,449 **** <chapter id="transitions"> <title>Transitions</title> ! <para/> <section id="trans-how"> <title>How is Done a Transition</title> ! <para/> </section> <section id="trans-phpvars"> <title>Sending PHP Variables to the Application</title> ! <para/> </section> <section id="trans-sendevent"> <title>Sending an Event to the Application</title> ! <para/> </section> <section id="trans-links"> <title>The Difference Between Transitions and Links</title> ! <para/> </section> </chapter> --- 441,478 ---- <chapter id="transitions"> <title>Transitions</title> ! <para>A transition is the move of the application from one state to another (usually from one page to another). A state of the application is composed of a certain main template file and some state variables (persistent variables of the application whose lifetime may be as long as the time that the application is active). A transition is usually triggered by a client-side event in the browser, such as: clicking a link, pressing a button, submitting a form, timeout of a javascript timer, etc. </para> <section id="trans-how"> <title>How is Done a Transition</title> ! <para>In the phpWebApp a transition is done by calling the function <emphasis>GoTo()</emphasis> which is declared by the framework itself, e.g. ! <programlisting>GoTo('page1.html')</programlisting></para> ! <para>In this case, the GoTo() function sends a request to the web-server for another page. This request is processed by the framework, which loads the template <filename>page1.html</filename> (found in the templates folder of the application) processes it and sends it to the browser. </para> ! <para>If a path is specified for the template, e.g. <emphasis>GoTo('folder1/page1.html')</emphasis> , then this path is relative to the TPL_PATH. If the page that is to be loaded is the same as the current page (e.g. we are in page <filename>page1.html</filename> and we want to load again the page <filename>page1.html</filename>), then this syntax can be used: GoTo('thisPage'); the framework remembers itself what is the current page and loads it again. This syntax is handy in the case of generic weboxes which may be included in several pages, and they don't know in which page they will be included. </para> ! <para>Usually, before making a transition you need to make some validations (e.g. when the user fills a form and submits it to the application). These data validations can be done in the client-side by using a javascript function. For example: ! <programlisting><![CDATA[<a href="javascript: on_link()"> Link </a> ! <input type="button" value="Button" onClick="on_button()"> ! <form onSubmit="on_submit(); return false;"> ! ]]></programlisting> ! The functions on_link(), on_button() and on_submit() usually do some client-side validations and error checkings and then, if everything is OK, they cause a transition by calling the function GoTo(). </para> </section> <section id="trans-phpvars"> <title>Sending PHP Variables to the Application</title> ! <para>Like usual links which can send variables to the server, like this: ! <programlisting><![CDATA[<a href="page1.php?var1=val1&var2=val2"> Link </a>]]></programlisting> ! a transition can send variables as well: ! <programlisting><![CDATA[<a href="javascript: GoTo('page1.html?var1=val1&var2=val2')"> Link </a>]]></programlisting> ! These variables will be declared as PHP global variables by the framework and may be used in the PHP code of the application. However the use of these global variables is discouraged, because there are better ways to send variables to the application. </para> </section> <section id="trans-sendevent"> <title>Sending an Event to the Application</title> ! <para>An important variable that is sent to the application almost in each transition is the variable 'event'. This variable sends to the application a server-side event that should be handled by the application. The format of an event variable is like this: ! <programlisting><![CDATA[event=targetBox.eventName(arg1=val1;arg2=val2;arg3=val3)]]></programlisting> ! When the framework gets the variable 'event', it builds an object of class Event and forwards it to the appropriate WebBox for handling. </para> </section> <section id="trans-links"> <title>The Difference Between Transitions and Links</title> ! <para>Caution: Although the transitions seem quite similar to the HTML links, they are actually very different. An HTML link requests a page from a web-server, while a transition requests a page of the application from the framework. So, all the pages of the application should refer to each-other only by using transitions, and to the external pages (pages outside the application) only by using links. If a page of the application refers to another page of the application by a link, this may break the consistency of the application. Such a mistake may happen if the page has an HTML form, because this form usually submits to its action, by not using a transition. To overcome this, we should declare the form like this: ! <programlisting><![CDATA[<form name="form1" onSubmit="return false;"> or ! <form name="form1" onSubmit="on_submit(); return false;"> ! ]]></programlisting></para> </section> </chapter> |
From: Dashamir H. <das...@us...> - 2005-11-12 12:12:13
|
Update of /cvsroot/phpwebapp/books/content/initial_xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30772/content/initial_xml Modified Files: phpwebapp_manual_en.xml Log Message: Index: phpwebapp_manual_en.xml =================================================================== RCS file: /cvsroot/phpwebapp/books/content/initial_xml/phpwebapp_manual_en.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** phpwebapp_manual_en.xml 3 Nov 2005 10:43:32 -0000 1.1 --- phpwebapp_manual_en.xml 12 Nov 2005 12:12:04 -0000 1.2 *************** *** 124,128 **** <title>Templates</title> <para>Templates are XHTML files which can contain some additional tags and some variables. These tags and variables are processed by the framework and are replaced with HTML code when the web page is created. These templates allow the web page designer to work almost independently from the database designer and from the PHP programmer that implements the logic of the application. </para> ! <para>Some of the extra tags that can be used in templates are: &amp;lt;Include&amp;gt;, &amp;lt;If&amp;gt;, &amp;lt;Repeat&amp;gt;, &amp;lt;WebBox&amp;gt;, &amp;lt;Recordset&amp;gt;, etc. They can be mixed and nested without problem (except for some special cases). </para> <section id="xhtml"> <title>The XHTML Standard</title> --- 124,128 ---- <title>Templates</title> <para>Templates are XHTML files which can contain some additional tags and some variables. These tags and variables are processed by the framework and are replaced with HTML code when the web page is created. These templates allow the web page designer to work almost independently from the database designer and from the PHP programmer that implements the logic of the application. </para> ! <para>Some of the extra tags that can be used in templates are: <Include>, &amp;lt;If&amp;gt;, &amp;lt;Repeat&amp;gt;, &amp;lt;WebBox&amp;gt;, &amp;lt;Recordset&amp;gt;, etc. They can be mixed and nested without problem (except for some special cases). </para> <section id="xhtml"> <title>The XHTML Standard</title> *************** *** 431,434 **** --- 431,450 ---- <title>Transitions</title> <para/> + <section id="trans-how"> + <title>How is Done a Transition</title> + <para/> + </section> + <section id="trans-phpvars"> + <title>Sending PHP Variables to the Application</title> + <para/> + </section> + <section id="trans-sendevent"> + <title>Sending an Event to the Application</title> + <para/> + </section> + <section id="trans-links"> + <title>The Difference Between Transitions and Links</title> + <para/> + </section> </chapter> <chapter id="webbox-es"> |
From: Dashamir H. <das...@us...> - 2005-11-12 12:04:52
|
Update of /cvsroot/phpwebapp/documentation/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29366/templates Modified Files: content.php mainMenu_items.php Log Message: Index: content.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/content.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** content.php 26 Oct 2005 14:36:58 -0000 1.4 --- content.php 12 Nov 2005 12:04:42 -0000 1.5 *************** *** 36,39 **** --- 36,42 ---- $content_file = "tutorial/tutorial.html"; break; + case "old_user_manual": + $content_file = "user_manual/user_manual.html"; + break; case "user_manual": $content_file = "user_manual.html"; Index: mainMenu_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/mainMenu_items.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mainMenu_items.php 25 Aug 2003 13:29:19 -0000 1.4 --- mainMenu_items.php 12 Nov 2005 12:04:42 -0000 1.5 *************** *** 8,12 **** "about" => "About", "tutorial" => "Tutorial", ! "user_manual" => "User Manual", "webobjects" => "Web Objects", "developer_docs"=> "Developer Docs" --- 8,13 ---- "about" => "About", "tutorial" => "Tutorial", ! "old_user_manual" => "Old User Manual", ! "user_manual" => "New User Manual", "webobjects" => "Web Objects", "developer_docs"=> "Developer Docs" |
From: Dashamir H. <das...@us...> - 2005-11-12 12:04:52
|
Update of /cvsroot/phpwebapp/documentation/codedoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29366/codedoc Modified Files: generate-code-doc.sh Log Message: Index: generate-code-doc.sh =================================================================== RCS file: /cvsroot/phpwebapp/documentation/codedoc/generate-code-doc.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** generate-code-doc.sh 2 Nov 2005 15:23:04 -0000 1.1 --- generate-code-doc.sh 12 Nov 2005 12:04:42 -0000 1.2 *************** *** 9,19 **** ./phpdoc_pdf.sh - ### create downloadable files - mkdir -p download - tar cfz download/phpwebapp-phpdocu.tar.gz phpwebapp-phpdocu/ - cp download/documentation.pdf download/phpwebapp-phpdocu.pdf - gzip download/phpwebapp-phpdocu.pdf - mv download/documentation.pdf download/phpwebapp-phpdocu.pdf - ### generate HTML and PDF documentation using doxygen rm -rf phpwebapp-doxygen --- 9,12 ---- *************** *** 23,27 **** cd ../.. ! ### create downloadable files tar cfz download/phpwebapp-doxygen.tar.gz phpwebapp-doxygen/html/ cp phpwebapp-doxygen/latex/refman.pdf download/phpwebapp-doxygen.pdf --- 16,28 ---- cd ../.. ! ### create phpDocumentor downloadable files ! rm -rf download/ ! mkdir download ! tar cfz download/phpwebapp-phpdocu.tar.gz phpwebapp-phpdocu/ ! cp download/documentation.pdf download/phpwebapp-phpdocu.pdf ! gzip download/phpwebapp-phpdocu.pdf ! mv download/documentation.pdf download/phpwebapp-phpdocu.pdf ! ! ### create doxygen downloadable files tar cfz download/phpwebapp-doxygen.tar.gz phpwebapp-doxygen/html/ cp phpwebapp-doxygen/latex/refman.pdf download/phpwebapp-doxygen.pdf |
From: Dashamir H. <das...@us...> - 2005-11-12 12:02:33
|
Update of /cvsroot/phpwebapp/documentation/templates/user_manual/manual_pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28912/templates/user_manual/manual_pages Added Files: database.txt events.txt intro.txt misc.txt new_app.txt recordset.txt session.txt templates.txt transitions.txt variables.txt webclass.txt webox.txt Log Message: |
From: Dashamir H. <das...@us...> - 2005-11-12 12:01:34
|
Update of /cvsroot/phpwebapp/documentation/templates/user_manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28673/templates/user_manual Added Files: manual_items.php manual_page.php notes.html user_manual.html Log Message: |
From: Dashamir H. <das...@us...> - 2005-11-07 14:22:07
|
Update of /cvsroot/phpwebapp/books In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23568 Modified Files: README-1 Log Message: Index: README-1 =================================================================== RCS file: /cvsroot/phpwebapp/books/README-1,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README-1 3 Nov 2005 10:43:32 -0000 1.1 --- README-1 7 Nov 2005 14:21:55 -0000 1.2 *************** *** 72,74 **** sources". ! \ No newline at end of file --- 72,75 ---- sources". ! Note: The last release tag that is used is books_0_8_x_1 ! |
From: Dashamir H. <das...@us...> - 2005-11-07 14:18:00
|
Update of /cvsroot/phpwebapp/books In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22643 Modified Files: ToDo.txt Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/books/ToDo.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ToDo.txt 3 Nov 2005 10:43:32 -0000 1.2 --- ToDo.txt 7 Nov 2005 14:17:48 -0000 1.3 *************** *** 52,55 **** --- 52,60 ---- - Installation of ViewCVS for Subversion. + - Update 'webnotes'. + + - explode/implode has some problems with entities (&amp;lt;) + and it does not preserve the CDATA sections. + - Fix chown.c (for some reason it was not working, and it was preventing the work in the other parts of the application, *************** *** 117,119 **** can be selected conveniently from the list of tags. ! - Fixed: validation problem: warnings (W) should not prevent saving \ No newline at end of file --- 122,124 ---- can be selected conveniently from the list of tags. ! - Fixed: validation problem: warnings (W) should not prevent saving |
From: Dashamir H. <das...@us...> - 2005-11-07 14:18:00
|
Update of /cvsroot/phpwebapp/books/templates/admin/access_rights In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22643/templates/admin/access_rights Modified Files: users Log Message: Index: users =================================================================== RCS file: /cvsroot/phpwebapp/books/templates/admin/access_rights/users,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** users 3 Nov 2005 10:43:32 -0000 1.2 --- users 7 Nov 2005 14:17:48 -0000 1.3 *************** *** 1,2 **** guest:82eYayxaB/PEk:Guest:: ! dasho:HBjCfQ71W8FEk:Dashamir Hoxha:dasho:docbookwiki_guide,phpwebapp_manual,phpwebapp_tutorial,phpwebapp_design, --- 1,2 ---- guest:82eYayxaB/PEk:Guest:: ! dasho:HBjCfQ71W8FEk:Dashamir Hoxha:dasho:docbookwiki_guide,phpwebapp_manual,phpwebapp_tutorial,phpwebapp_design |