phpwebapp-commits Mailing List for phpWebApp (Page 6)
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...> - 2005-10-26 14:37:11
|
Update of /cvsroot/phpwebapp/documentation/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2024/templates Modified Files: content.php Added Files: user_manual.html Log Message: new user manual, using DocBookWiki cache (HTML) files --- NEW FILE: user_manual.html --- <div class="white_box"> <include src="{{DOCBOOK_PATH}}docbook.html" /> </div> Index: content.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/content.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** content.php 25 Aug 2003 13:29:19 -0000 1.3 --- content.php 26 Oct 2005 14:36:58 -0000 1.4 *************** *** 37,41 **** break; case "user_manual": ! $content_file = "user_manual/user_manual.html"; break; case "developer_docs": --- 37,44 ---- break; case "user_manual": ! $content_file = "user_manual.html"; ! $cache_path = BOOKS_PATH.'content/books/cache/'; ! WebApp::setSVar('docbook->cache_path', $cache_path); ! WebApp::setSVar('docbook->book_id', 'phpwebapp_manual'); break; case "developer_docs": |
From: Dashamir H. <das...@us...> - 2005-10-26 14:37:10
|
Update of /cvsroot/phpwebapp/documentation/templates/user_manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2024/templates/user_manual Removed Files: user_manual.html notes.html manual_page.php manual_items.php Log Message: new user manual, using DocBookWiki cache (HTML) files --- user_manual.html DELETED --- --- notes.html DELETED --- --- manual_page.php DELETED --- --- manual_items.php DELETED --- |
From: Dashamir H. <das...@us...> - 2005-10-26 14:37:10
|
Update of /cvsroot/phpwebapp/documentation/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2024/config Modified Files: const.Paths.php const.Options.php Log Message: new user manual, using DocBookWiki cache (HTML) files Index: const.Paths.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/config/const.Paths.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** const.Paths.php 6 Jul 2005 15:27:24 -0000 1.8 --- const.Paths.php 26 Oct 2005 14:36:58 -0000 1.9 *************** *** 27,30 **** --- 27,31 ---- define("TPL_PATH", "templates/"); define("WOBJ_PATH", "webobjects/"); + define("BOOKS_PATH", UP_PATH."books/"); //define paths and URLs of the sample applications Index: const.Options.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/config/const.Options.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** const.Options.php 25 Aug 2003 13:29:19 -0000 1.3 --- const.Options.php 26 Oct 2005 14:36:58 -0000 1.4 *************** *** 69,73 **** */ define("DISPLAY_CGI_VARS", false); - - //etc. ?> \ No newline at end of file --- 69,71 ---- |
From: Dashamir H. <das...@us...> - 2005-10-26 14:33:41
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1312 Modified Files: const.Paths.php Log Message: Index: const.Paths.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/const.Paths.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** const.Paths.php 13 Jun 2005 06:55:21 -0000 1.7 --- const.Paths.php 26 Oct 2005 14:33:21 -0000 1.8 *************** *** 51,58 **** define("FILEVIEW_PATH", WEBBOX_PATH."fileView/"); define("CODEVIEWER_PATH", WEBBOX_PATH."codeViewer/"); //tools paths define("TOOLS_PATH", WEBAPP_PATH."tools/"); define("BROWSER_PATH", TOOLS_PATH."fileBrowser/"); - define("TIDY_PATH", TOOLS_PATH."tidy/"); ?> --- 51,59 ---- define("FILEVIEW_PATH", WEBBOX_PATH."fileView/"); define("CODEVIEWER_PATH", WEBBOX_PATH."codeViewer/"); + define("DOCBOOK_PATH", WEBBOX_PATH."docbook/"); + define("WEBNOTES_PATH", WEBBOX_PATH."webnotes/"); //tools paths define("TOOLS_PATH", WEBAPP_PATH."tools/"); define("BROWSER_PATH", TOOLS_PATH."fileBrowser/"); ?> |
From: Dashamir H. <das...@us...> - 2005-10-26 14:32:29
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1019/boxes/webnotes Added Files: webnotes.txt webnotes.php webnotes.js webnotes.html webnotes.db webnotes.css footer.html DB.php Log Message: The webbox 'webnotes' can be used to append comments or notes to documentation pages or to other web pages. --- NEW FILE: webnotes.txt --- The webbox 'webnotes' can be used to append comments or notes to documentation pages or to other web pages. It can be included like this: <include src="{{WEBNOTES_PATH}}webnotes.html" /> WEBNOTES_PATH is defined by the framework. This component uses the database, and, if not already installed (e.g. by another application), it should be installed like this: --scr bash$ cd webnotes/db/ bash$ mysql -p -u username < webnotes.sql ---- The database connection parameters at 'templates/docbook/view/webnotes/DB.php' need to be modified as well. The application or the webbox that includes it should also give a value to the state variable 'webnotes->page_id', which is used to select from the database the notes that will be displayed. --- NEW FILE: webnotes.php --- <?php /* This file is part of DocBookWiki. DocBookWiki is a web application that displays and edits DocBook documents. Copyright (C) 2004, 2005 Dashamir Hoxha, das...@us... DocBookWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DocBookWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with DocBookWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ //include DB support include_once dirname(__FILE__).'/DB.php'; class webnotes extends WebObject { function init() { $this->addSVar('page_id', ''); } function on_next($event_args) { $page = $event_args["page"]; WebApp::setSVar("page_notes->current_page", $page); } function onRender() { //set 'recount' to true WebApp::setSVar('page_notes->recount', 'true'); //change the date format $rs = WebApp::openRS('page_notes'); while (!$rs->EOF()) { $date = $rs->Field('date_modified'); $date = date('d-M-Y G:i', strtotime($date)); $rs->setFld('date_modified', $date); $rs->MoveNext(); } global $webPage; $webPage->addRecordset($rs); } } ?> --- NEW FILE: webnotes.js --- // -*-C-*- /* This file is part of DocBookWiki. DocBookWiki is a web application that displays and edits DocBook documents. Copyright (C) 2004, 2005 Dashamir Hoxha, das...@us... DocBookWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DocBookWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with DocBookWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function edit_note(note_id) { var event_args = 'note_id='+note_id+';'+'status='+status; SendEvent('editnote', 'edit', event_args); } --- NEW FILE: webnotes.html --- <webbox id="webnotes"> <div class="webnotes"> <include src="{{./}}editnote/editnote.html" /> <br /> <table class="header" cellspacing="0"> <tr> <td> T_("User Comments/Notes For the Page:") <strong>{{page_id}}</strong> </td> <td align="right"> <a class="button" href="javascript:add_note()">T_("Add a New Note")</a> </td> </tr> </table> <repeat rs="page_notes"> <ifempty><br/></ifempty> <var name="note">({{CurrentRowNr}} % 2 ? "note-1" : "note-2")</var> <a name="{{note_id}}"></a> <table class="{{note}}" cellpadding="2" cellspacing="0"> <tr class="note-title"> <td> {{date_modified}} <strong>{{email}}</strong> </td> <td align="right"> #{{note_id}} </td> </tr> <tr class="note-text"> <td colspan="2"><tt>{{note_text}}</tt></td> </tr> </table> </repeat> <include src="{{./}}footer.html" /> </div> </webbox> --- NEW FILE: webnotes.db --- <!--# -*-SQL-*- #tell emacs to use SQL mode #--> <Recordset ID="page_notes" type="PagedRS" recs_per_page="10"> <Query> SELECT * FROM webnotes WHERE page_id = '{{page_id}}' AND status = 'approved' </Query> </Recordset> --- NEW FILE: webnotes.css --- div.webnotes { } div.webnotes .button, div.webnotes a.button, div.webnotes a.button:hover { margin: 1px; border: none; padding: 1px 3px; background: #0088bb; color: #ffffff; font-weight: bold; } div.webnotes table { border: 0px; width: 100%; } div.webnotes tr { vertical-align: top; } div.webnotes td { font-family: Verdana, Arial; font-size: 10pt; padding: 4px; } div.webnotes .header { background-color: #e0e0e0; border: 1px outset #e0e0e0; } div.webnotes .note-1, div.webnotes .note-2 { border: 1px solid #aaaaaa; margin-top: 2px; margin-bottom: 2px; } .note-1 .note-title { background-color: #ddddd6; } .note-1 .note-text { background-color: #eeeee6; } .note-2 .note-title { background-color: #e6e6ee; } .note-2 .note-text { background-color: #f6f6f6; } --- NEW FILE: footer.html --- <rsnavig rs="page_notes"> <table width="100%" border="0" cellspacing="0" cellpading="3" bgcolor="#dddddd"> <tr> <td width="25%"> T_("Found: {{AllRecs}} Notes") </td> <td width="25%"> T_("Page {{CurrPage}} of {{LastPage}}") </td> <td> <if condition="'{{CurrPage}}' > '{{PrevPage}}'"> <a href="javascript:SendEvent('webnotes','next','page=1')"> T_("&lt;&lt;First") </a> <a href="javascript:SendEvent('webnotes','next','page={{PrevPage}}')"> T_("&lt;Prev") </a> </if> <if condition="'{{NextPage}}' > '{{CurrPage}}'"> <a href="javascript:SendEvent('webnotes','next','page={{NextPage}}')"> T_("Next&gt;") </a> <a href="javascript:SendEvent('webnotes','next','page={{LastPage}}')"> T_("Last&gt;&gt;") </a> </if> </td> <td align="right"> <a class="button" href="javascript:add_note()">T_("Add a New Note")</a> </td> </tr> </table> </rsnavig> --- NEW FILE: DB.php --- <?php //connection parameters $host = 'localhost'; $user = 'dasho'; $passwd = 'dasho'; $db = 'webnotes'; //include database classes include_once DB_PATH."class.MySQLCnn.php"; include_once DB_PATH."class.Recordset.php"; include_once DB_PATH."class.EditableRS.php"; include_once DB_PATH."class.PagedRS.php"; //create a global connection variable global $cnn; $cnn = new MySQLCnn($host, $user, $passwd, $db); ?> |
From: Dashamir H. <das...@us...> - 2005-10-26 14:32:29
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1019/boxes/webnotes/db Added Files: webnotes.sql dump.sh Log Message: The webbox 'webnotes' can be used to append comments or notes to documentation pages or to other web pages. --- NEW FILE: webnotes.sql --- -- MySQL dump 8.23 -- -- Host: localhost Database: webnotes --------------------------------------------------------- -- Server version 3.23.58 -- -- Current Database: webnotes -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ webnotes; USE webnotes; -- -- Table structure for table `webnotes` -- CREATE TABLE webnotes ( note_id int(10) unsigned NOT NULL auto_increment, page_id varchar(255) NOT NULL default '', email varchar(100) default '', ip varchar(100) default '', date_modified datetime default '0000-00-00 00:00:00', status varchar(100) default '', note_text text, PRIMARY KEY (note_id) ) TYPE=MyISAM; --- NEW FILE: dump.sh --- #!/bin/bash ### modify them as appropriate host=localhost user=inima dbname=webnotes ### dump the database $dbname into the file webnotes_backup.sql mysqldump --add-drop-table --allow-keyword \ --complete-insert --extended-insert \ --compress --host=$host --user=$user -p \ --result-file=webnotes_backup.sql --databases $dbname ### dump the structure of the database as well mysqldump --allow-keyword --no-data \ --host=$host --user=$user -p \ --result-file=webnotes.sql --databases $dbname ### create the database with the command: ### $ mysql -p -u $user < webnotes.sql ### ### restore the database with the command: ### $ mysql -p -u $user < webnotes_backup.sql |
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes/editnote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1019/boxes/webnotes/editnote Added Files: preview.html help.html editnote.php editnote.js editnote.html editnote.db editnote.css edit.html Log Message: The webbox 'webnotes' can be used to append comments or notes to documentation pages or to other web pages. --- NEW FILE: preview.html --- <br /><br /> <table class="note-1" cellpadding="2" cellspacing="0"> <tr class="note-title"> <td> {{date_modified}} <strong>{{email}}</strong> </td> <td align="right"> #{{note_id}} </td> </tr> <tr class="note-text"> <td colspan="2"><tt>{{note_text}}</tt></td> </tr> </table> <table cellpadding="4" cellspacing="0"> <tr> <td align="center" width="80%"> <input type="button" class="button" value="Edit" onclick="javascript:back()" /> <input type="button" class="button" value="Submit" onclick="javascript:submit()" /> </td> </tr> </table> --- NEW FILE: help.html --- <div class="note"> <xmp>T_("HTML tags that are allowed:") <b><i><a><br><p><ol><ul><li><hr><pre><xmp> T_("After you add your note, it will be queued for approval by a moderator.")</xmp> </div> --- NEW FILE: editnote.php --- <?php /* This file is part of DocBookWiki. DocBookWiki is a web application that displays and edits DocBook documents. Copyright (C) 2004, 2005 Dashamir Hoxha, das...@us... DocBookWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DocBookWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with DocBookWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ class editnote extends WebObject { function init() { $this->addSVar('state', 'hidden'); // hidden | edit | preview $this->addSVar('note_id', UNDEFINED); } function on_add($event_args) { $this->setSVar('state', 'edit'); $this->setSVar('note_id', UNDEFINED); } function on_edit($event_args) { $this->setSVar('state', 'edit'); $this->setSVar('note_id', $event_args['note_id']); } function on_save($event_args) { $params = $event_args; $allowed_tags = "<b><i><a><br><p><ol><ul><li><hr><pre><xmp>"; $note = $params["note_text"]; $params["note_text"] = strip_tags($note, $allowed_tags); $params["ip"] = $_SERVER["REMOTE_ADDR"]; $params["date_modified"] = date("d-Mon-Y h:m"); $note_id = $this->getSVar('note_id'); if ($note_id==UNDEFINED) { $this->insert_new_note($params); } else { WebApp::execDBCmd("update_note", $params); } } function insert_new_note($params) { //add a new note record WebApp::execDBCmd("insert_new_note", $params); //get the note_id of the new record $rs = WebApp::openRS("get_new_note_id", $params); $note_id = $rs->Field('note_id'); //set it to the statevar note_id $this->setSVar('note_id', $note_id); //update the status from 'new' to 'edit' WebApp::execDBCmd("set_note_status", array('status'=>'edit')); } function on_preview($event_args) { $this->on_save($event_args); $this->setSVar('state', 'preview'); } function on_cancel($event_args) { $this->setSVar('state', 'hidden'); } function on_submit($event_args) { WebApp::execDBCmd("set_note_status", array('status'=>'approved')); //hide the editnote webbox $this->setSVar('state', 'hidden'); } function onRender() { $note_id = $this->getSVar('note_id'); if ($note_id==UNDEFINED) { $email = (defined('EMAIL') ? EMAIL : ''); WebApp::addVars(array( 'email' => $email, 'note_text' => '' )); } else { $rs = WebApp::openRS("get_note"); //change the date format $date = $rs->Field('date_modified'); $date = date('d-M-Y G:i', strtotime($date)); $rs->setFld('date_modified', $date); WebApp::addVars($rs->Fields()); } } } ?> --- NEW FILE: editnote.js --- // -*-C-*- /* This file is part of DocBookWiki. DocBookWiki is a web application that displays and edits DocBook documents. Copyright (C) 2004, 2005 Dashamir Hoxha, das...@us... DocBookWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DocBookWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with DocBookWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function add_note() { SendEvent('editnote', 'add'); } function get_event_args() { var form = document.editnote; var email = form.email.value; var note_text = form.note_text.value; //encode_arg_value() is used to escape the semicolumns (;) inside the text var event_args = "email="+email+";"+"note_text="+encode_arg_value(note_text); return event_args; } function save() { SendEvent('editnote', 'save', get_event_args()); } function preview() { SendEvent('editnote', 'preview', get_event_args()); } function cancel() { var msg = T_("Any changes will be lost!"); if (confirm(msg)) SendEvent('editnote', 'cancel'); } function submit() { SendEvent("editnote", "submit"); } --- NEW FILE: editnote.html --- <webbox id="editnote"> <if condition="('{{state}}'=='edit')"> <div class="editnote"> <include src="{{./}}edit.html" /> <include src="{{./}}help.html" /> </div> </if> <if condition="('{{state}}'=='preview')"> <div class="editnote"> <include src="{{./}}preview.html" /> </div> </if> </webbox> --- NEW FILE: editnote.db --- <!--# -*-SQL-*- #tell emacs to use SQL mode #--> <Recordset ID="get_note"> <Query> SELECT * FROM webnotes WHERE note_id = '{{note_id}}' </Query> </Recordset> <dbCommand ID="get_new_note_id"> <Query> SELECT note_id FROM webnotes WHERE page_id = '{{page_id}}' AND email = '{{email}}' AND ip = '{{ip}}' AND status = 'new' AND note_text = '{{note_text}}' </Query> </dbCommand> <dbCommand ID="insert_new_note"> <Query> INSERT INTO webnotes SET page_id = '{{page_id}}', email = '{{email}}', ip = '{{ip}}', date_modified = NOW(), status = 'new', note_text = '{{note_text}}' </Query> </dbCommand> <dbCommand ID="update_note"> <Query> UPDATE webnotes SET page_id = '{{page_id}}', email = '{{email}}', ip = '{{ip}}', date_modified = NOW(), status = 'edit', note_text = '{{note_text}}' WHERE note_id = '{{note_id}}' </Query> </dbCommand> <dbCommand ID="set_note_status"> <Query> UPDATE webnotes SET status = '{{status}}' WHERE note_id = '{{note_id}}' </Query> </dbCommand> --- NEW FILE: editnote.css --- div.editnote { font-family:Verdana, Arial; font-size: 10pt; background: transparent; color: #000000; } div.editnote table.edit { border: solid 1px #666666; margin-top: 10px; margin-bottom: 10px; } table.edit tr.title { font-weight: bold; text-align: left; font-size: 120%; color: #444444; } table.edit tr.row-1 { background-color: #d8d8d8; } table.edit tr.row-2 { background-color: #e8e8e8; } div.editnote input { background: #f8f8f8; color: #000000; font-size: 11px; border: 1px solid #aaaaaa; padding: 3px; } div.editnote textarea { background: #f8f8f8; color: #000000; font-size: 11px; border: 1px solid #aaaaaa; overflow: auto; padding: 5px; } div.editnote div.note { background-color: #c8e0f8; border: 1px solid #4444aa; padding: 5px; margin-top: 10px; margin-bottom: 10px; } --- NEW FILE: edit.html --- <form name="editnote" onsubmit="send_note(); return false;"> <table class="edit"> <tr class="title"> <td colspan="2"><strong>T_("Add a New Note or Comment")</strong></td> </tr> <tr class="row-1"> <th>T_("Email")</th> <td> <input type="text" name="email" size="64" maxlength="128" value="{{email}}"/> </td> </tr> <tr class="row-2"> <th>T_("Note")</th> <td> <textarea type="text" name="note_text" rows="16" cols="72">{{note_text}}</textarea> </td> </tr> <tr> <td colspan="2" align="center" width="80%"> <input type="button" class="button" value="Save" onclick="javascript:save()" /> <input type="button" class="button" value="Preview" onclick="javascript:preview()" /> <input type="button" class="button" value="Cancel" onclick="javascript:cancel()" /> </td> </tr> </table> </form> |
From: Dashamir H. <das...@us...> - 2005-10-26 14:31:19
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv766/boxes/docbook Added Files: header.html footer.html docbook.txt docbook.php docbook.js docbook.html docbook.css Log Message: The 'docbook' webbox is used just to display the cache (HTML) files of a DocBookWiki application. It is useful for including a docbook document in an application. --- NEW FILE: header.html --- <table class="navheader" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="node_title" valign="bottom"> {{this_full_title}} </td> <td align="right" valign="bottom" nowrap="nowrap"> <a href="javascript:set_node('{{prev_path}}')"><img border="0" src="{{./}}img/go-prev.png" alt='T_("Previous")' /></a> <a href="javascript:set_node('{{up_path}}')"><img border="0" src="{{./}}img/go-up.png" alt='T_("Up")' /></a> <a href="javascript:set_node('{{toc_path}}')"><img border="0" src="{{./}}img/go-home.png" alt='T_("Home")' /></a> <a href="javascript:set_node('{{next_path}}')"><img border="0" width="16" src="{{./}}img/go-next.png" alt='T_("Next")' /></a> </td> </tr> </table> --- NEW FILE: footer.html --- <table class="navfooter" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" width="45%"> <a href="javascript:set_node('{{prev_path}}')"> <img border="0" src="{{./}}img/go-prev.png" alt="Previous" /> <span class="small_caps">{{prev_title}}</span> </a> </td> <td align="center" valign="top"> <a href="javascript:set_node('{{up_path}}')"> <img border="0" src="{{./}}img/go-up.png" alt="Up" /> </a> <a href="javascript:set_node('{{toc_path}}')"> <img border="0" src="{{./}}img/go-home.png" alt="Home" /> </a> </td> <td align="right" valign="middle" width="45%"> <a href="javascript:set_node('{{next_path}}')"> <span class="small_caps">{{next_title}}</span> <img border="0" src="{{./}}img/go-next.png" alt="Next" /> </a> </td> </tr> </table> --- NEW FILE: docbook.txt --- The 'docbook' webbox is used just to display the cache (HTML) files of a DocBookWiki application. It is useful for including a docbook document in an application. It can be included like this: <include src="{{DOCBOOK_PATH}}docbook.html" /> where DOCBOOK_PATH is defined by the framework itself. If you make a local copy of the webbox, then you have to use the right path. It has these state variables which can be initialized or changed by the application that includes it: docbook->cache_path -- the path of the HTML files (usually the directory 'contents/books/cache/' of the DocBookWiki docbook->book_id -- the id of the book docbook->node_path -- the path of the node to be displayed (default './') docbook->lng -- the language of the book (default 'en') The JS function set_node(node_path) can be used by the application to change the node that is currently displayed. If the constant WEBNOTES_ENABLE is defined as 'true', then webnotes will be appended at the end of each section (but first they must be installed and configured properly). This constant is set at the begining of 'docbook.php'. --- NEW FILE: docbook.php --- <?php /* This file is part of phpWebApp, which is a framework for building web application based on relational databases. Copyright 2001,2002,2003,2004 Dashamir Hoxha, das...@us... phpWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. phpWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with phpWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** append webnotes at the end of each section */ define('WEBNOTES_ENABLE', 'true'); class docbook extends WebObject { function init() { $this->addSVar('cache_path', UNDEFINED); $this->addSVar('book_id', UNDEFINED); $this->addSVar('node_path', './'); $this->addSVar('lng', 'en'); } function on_set_node($event_args) { $node_path = $event_args['node_path']; $this->setSVar('node_path', $node_path); } function onParse() { $cache_path = $this->getSVar('cache_path'); $book_id = $this->getSVar('book_id'); $node_path = $this->getSVar('node_path'); $lng = $this->getSVar('lng'); //add the variables {{content_html}} and {{subnodes_html}} $book_path = $cache_path.$book_id.'/'.$lng.'/'; $content_html = $book_path.$node_path."content.html"; $subnodes_html = $book_path.$node_path."subnodes.html"; WebApp::addVars(compact('content_html', 'subnodes_html')); } function onRender() { //add navigation variables $node_path = $this->getSVar('node_path'); $vars = $this->get_arr_navigation($node_path); if ($vars['this_full_title']=='') $vars['this_full_title'] = T_("Table Of Contents"); WebApp::addVars($vars); WebApp::addVar('toc_path', './'); //set the page_id of the webnotes, in case that webnotes are used if (WEBNOTES_ENABLE=='true') { $book_id = $this->getSVar('book_id'); $node_path = $this->getSVar('node_path'); $lng = $this->getSVar('lng'); ereg('([^/]+)/$', $node_path, $regs); $node_id = $regs[1]; $page_id = "$book_id/$node_id/$lng"; WebApp::setSVar('webnotes->page_id', $page_id); } } /** * Reads from cache 'navigation.txt' for the current node and * returns an associative array with the template variables * this_path, next_path, prev_path, up_path, toc_path, * this_title, next_title, prev_title, up_title, toc_title. */ function get_arr_navigation() { $cache_path = $this->getSVar('cache_path'); $book_id = $this->getSVar('book_id'); $node_path = $this->getSVar('node_path'); $lng = $this->getSVar('lng'); $arr_navigation = array(); //get the navigation file $book_path = $cache_path.$book_id.'/'.$lng.'/'; $fname = $book_path.$node_path."navigation.txt"; if (!file_exists($fname)) { $arr_navigation['next_path'] = './'; $arr_navigation['prev_path'] = './'; $arr_navigation['up_path'] = './'; return $arr_navigation; } //open it $lines = file($fname); //parse it for ($i=0; $i < sizeof($lines); $i++) { $line = $lines[$i]; list($var_name,$var_value) = split('=', $line, 2); if ($var_name=='') continue; $arr_navigation[$var_name] = trim($var_value); } return $arr_navigation; } } ?> --- NEW FILE: docbook.js --- // -*-C-*- /* This file is part of phpWebApp, which is a framework for building web application based on relational databases. Copyright 2001,2002,2003,2004 Dashamir Hoxha, das...@us... phpWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. phpWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with phpWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function set_node(node_path) { SendEvent("docbook", "set_node", "node_path="+node_path); } --- NEW FILE: docbook.html --- <webbox id="docbook"> <div class="docbook"> <include src="{{./}}header.html" /> <hr /> <include src="{{content_html}}" /> <include src="{{subnodes_html}}" /> <hr /> <include src="{{./}}footer.html" /> <if condition="{{WEBNOTES_ENABLE}}"> <include src="{{WEBNOTES_PATH}}webnotes.html" /> </if> </div> </webbox> --- NEW FILE: docbook.css --- @import url(css/contents.css); @import url(css/bookinfo.css); @import url(css/list.css); @import url(css/link.css); @import url(css/media.css); @import url(css/figure.css); @import url(css/preformated.css); @import url(css/admonitions.css); @import url(css/key_gui.css); @import url(css/inline.css); @import url(css/footnotes.css); p, div, span, li, dt { font-family: sans-serif; font-size: 10pt; color: #000066; } p.para { font-family: sans-serif; font-size: 10pt; color: #000066; } .title { color: #aa0000; font-family: sans-serif; font-size: 12pt; text-align: center; } .navheader, .navfooter { width: 100%; } .node_title { color: #aa0000; font-family: sans-serif; font-size: 12pt; } .small_caps { vertical-align: top; font: small-caps 10px arial; color: #000099; } hr { background-color: #cccccc; margin: 0; height: 1px; border: none; } |
From: Dashamir H. <das...@us...> - 2005-10-26 14:31:18
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv766/boxes/docbook/css Added Files: preformated.css media.css list.css link.css key_gui.css inline.css footnotes.css figure.css contents.css bookinfo.css admonitions.css Log Message: The 'docbook' webbox is used just to display the cache (HTML) files of a DocBookWiki application. It is useful for including a docbook document in an application. --- NEW FILE: preformated.css --- .screen { border: 1px solid #444444; padding: 2px; background-color: #777777; color: #ffffff; } .programlisting { border: 1px solid #4444cc; background-color: #8888ff; color: #ffff00; font-weight: bold; } .literallayout { } --- NEW FILE: media.css --- .imageobject { margin: 5px; } .imageobject .imagedata { padding: 5px; border: 1px solid #eeeeee; } .imagedata img { } .imageobject .caption { padding: 2px; text-align: center; color: #444444; } --- NEW FILE: list.css --- li.listitem { font-family: sans-serif; font-size: 10pt; color: #000066; } ul.itemizedlist { } ol.orderedlist { } --- NEW FILE: link.css --- a.ulink, a.xref { } a.ulink:link, a.xref:link { color: #0000aa; } a.ulink:visited, a.xref:visited { color: #0000bb; } a.ulink:active, a.xref:active, a.ulink:hover, a.xref:hover, a.ulink:focus, a.xref:focus { color: #0000ff; } --- NEW FILE: key_gui.css --- .menuchoice, .keycombo, .keycap, .shortcat { font-weight: bold; } .guilabel, .guibutton, .guiicon, .guimenu, .guisubmenu, .guimenuitem { font-weight: bold; } --- NEW FILE: inline.css --- .prompt { color: #882222; } .screen .prompt, .programlisting .prompt { color: #eeeeee; font-weight: bold; } .command, .application, .option { color: #222266; font-weight: bold; } .screen .command, .programlisting .command, .screen .application, .programlisting .application, .screen .option, .programlisting .option { color: #ffffff; font-weight: bold; } .computeroutput { } .screen .computeroutput, .programlisting .computeroutput { } .userinput, .replaceable, .varname { font-style: italic; } .screen .userinput, .programlisting .userinput, .screen .replaceable, .programlisting .replaceable, .screen .varname, .programlisting .varname { color: #ffffff; font-style: italic; font-weight: bold; } .filename { color: #226622; } .acronym { font-weight: bold; } .trademark, .firstterm, .wordasword { } .emphasis { font-style: italic; } .screen .emphasis, .programlisting .emphasis { font-style: normal; font-weight: bold; color: #ffffff; } --- NEW FILE: footnotes.css --- .footnote { font-size: 6px; vertical-align: super; } .footnotes { margin-top: 10px; margin-left: 20px; width: 90%; font-size: small; } .footnotes hr { } .footnote-body { } --- NEW FILE: figure.css --- .figure-screen { border: 1px solid #eeeeee; background-color: #f8f8f8; color: #000000; } .figure-title { text-align: center; color: #444444; } .example-title { text-align: center; color: #444444; } --- NEW FILE: contents.css --- dt.chapter { margin-top: 5px; } dt.chapter a { color: #884400; font-family: sans-serif; font-size: 11pt; text-decoration: underline; } dt.sect1 { margin-top: 2px; } dt.sect1 a { color: #006644; font-family: sans-serif; font-size: 10pt; font-weight: bold; } dt.sect2 a, dt.sect3 a, dt.sect4 a, dt.sect5 a, dt.simplesect a { color: #004466; } --- NEW FILE: bookinfo.css --- .bookinfo, .articleinfo { margin-top: 10px; margin-bottom: 10px; } .bookinfo .header, .articleinfo .header { font-weight: bold; } .bookinfo .para, .articleinfo .para, .bookinfo .date, .articleinfo .date, .bookinfo .release, .articleinfo .release, .bookinfo .author, .articleinfo .author, .bookinfo .abstract, .articleinfo .abstract, .bookinfo .keywordset, .articleinfo .keywordset { } .bookinfo .copyright, .articleinfo .copyright, .bookinfo .legalnotice, .articleinfo .legalnotice { font-style: italic; } .bookinfo hr, .articleinfo hr { margin-top: 10px; } --- NEW FILE: admonitions.css --- .note, .tip, .caution, .important, .warning { margin: 5px 20px; padding: 5px; border: 1px solid #ddcc00; background-color: #ffffee; } .note .para, .tip .para, .caution .para, .important .para, .warning .para { color: #222288; margin: 0px; } .note .title, .tip .title, .caution .title, .important .title, .warning .title { font-family: sans-serif; font-size: 10pt; font-weight: bold; text-align: left; color: #000066; } .tip { border: 1px solid #ccdd00; background-color: #eeffee; } .tip .para { color: #224488; } .tip .para { color: #224466; } .caution { border: 1px solid #ddcc22; background-color: #ffeeff; } .caution .para { color: #226666; } .caution .title { color: #224444; } .warning { border: 1px solid #ddcc00; background-color: #ffeeee; } .warning .para { color: #442288; } .warning .title { color: #442266; } .important { border: 1px solid #eedd00; background-color: #ffdddd; } .important .para { color: #442288; } .important .title { color: #442266; } |
From: Dashamir H. <das...@us...> - 2005-10-26 14:31:16
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv766/boxes/docbook/img Added Files: go-up.png go-prev.png go-next.png go-home.png Log Message: The 'docbook' webbox is used just to display the cache (HTML) files of a DocBookWiki application. It is useful for including a docbook document in an application. --- NEW FILE: go-up.png --- PNG --- NEW FILE: go-prev.png --- PNG Að´¬2ʤàzûaذh<·¤V0B¿eÙ;+[Ъ$ÁöÖ+`e4I æ«Ó8c ËãÞ4Âý{¯Æz²ÈÿýqëæËɺ~ínQJ)¡gÚ-NÊ ÝðCÏqêÓ³C¾Nç@mîøç£VÐÖu0c@I¬ {ßÕÁÇÑ¡ËáÚ ¬f i£Øn*ò<Æez»©ÈÞ¸óÆÔ7Lc5/å"/Û|°zi»½UçÑØ` 5ÏÑí4дÚb. --- NEW FILE: go-next.png --- PNG Çï|CÀ¿W¿Ðîìû{Ç,(íÖ!³ À$±Ôl=`¦Ô«7inq5¹`·qöì[öwïÓïÝÆ²VýÀ|.XÆFç= }ã¨NX¶K@D~OYB«þ1.=lË'La¹9qe9PÉÂf¹°É´¤R1¸ænç6ö[ÈÞö-«íÞ Ó=fúë²j x®½ÁF&f¥ £ñ9aðY Á,¡ÞpÉ Oÿ·ÕZ®YºÀ°¤Th4j`®E)rèïܧÕÞ`?±Õ°ÖU¦Äu¯©nN©Z&!Ñò!¹ Y{£7¹ ?b(Y^¬Ð¨[Ôê1£é¤åAø³¼¶ÿ;{GÇ¿R±`Nqm --- NEW FILE: go-home.png --- PNG wìxæð´>üÂÀ¾jyÛÞ±>'C;Þ_- 2¬@5z.Dâ°XO:¤°}sÏÝK¼´Úü¢¼.kÎùa©ó§#èUÕÚµ]ýýØ%öOú×ïzþPYÍk©Tæ·ïí·8Va0"É%Êy~æ¿5²FD_Â;÷ñ Åîìì<õLF$1ïØ~J_ßûHóïߪåþá¼oô°@ÀòÐdt»à1STRèø@q#ÊÄuîF¬ÿ{íuQÞO |
From: Dashamir H. <das...@us...> - 2005-10-26 14:23:36
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31205/boxes/docbook/css Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/docbook/css added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-26 14:23:36
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31205/boxes/webnotes/db Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/webnotes/db added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-26 14:23:36
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes/editnote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31205/boxes/webnotes/editnote Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/webnotes/editnote added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-26 14:23:36
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31205/boxes/docbook/img Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/docbook/img added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-26 14:22:40
|
Update of /cvsroot/phpwebapp/web_app/boxes/webnotes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30981/boxes/webnotes Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/webnotes added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-26 14:22:09
|
Update of /cvsroot/phpwebapp/web_app/boxes/docbook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30900/boxes/docbook Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/docbook added to the repository |
From: Dashamir H. <das...@us...> - 2005-10-21 12:18:10
|
Update of /cvsroot/phpwebapp/web_app/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21737/database Modified Files: class.PagedRS.php Log Message: Index: class.PagedRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.PagedRS.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** class.PagedRS.php 23 Jul 2004 09:40:17 -0000 1.14 --- class.PagedRS.php 21 Oct 2005 12:17:48 -0000 1.15 *************** *** 25,29 **** /** ! * Same as class Recordset, but gets from the DB only a certain * page out of all the results that can return the query. A page * is a group of consecutive records; all the pages have the same --- 25,29 ---- /** ! * Same as class EditableRS, but gets from the DB only a certain * page out of all the results that can return the query. A page * is a group of consecutive records; all the pages have the same |
From: Dashamir H. <das...@us...> - 2005-10-21 12:18:09
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21737/doc Modified Files: changes_2.txt changes_3.txt to_do.txt Log Message: Index: changes_2.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes_2.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** changes_2.txt 30 Sep 2003 07:11:20 -0000 1.5 --- changes_2.txt 21 Oct 2005 12:17:48 -0000 1.6 *************** *** 114,125 **** conditions and decide which page to construct), etc. --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- ! --------------------------------------------------------------- --- 114,116 ---- conditions and decide which page to construct), etc. --------------------------------------------------------------- ! Index: changes_3.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes_3.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** changes_3.txt 14 Jul 2004 14:45:41 -0000 1.2 --- changes_3.txt 21 Oct 2005 12:17:48 -0000 1.3 *************** *** 443,450 **** -------------------------------------------------------------------- - -------------------------------------------------------------------- - -------------------------------------------------------------------- - -------------------------------------------------------------------- - -------------------------------------------------------------------- - -------------------------------------------------------------------- - -------------------------------------------------------------------- --- 443,444 ---- Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** to_do.txt 31 Aug 2005 07:59:48 -0000 1.20 --- to_do.txt 21 Oct 2005 12:17:48 -0000 1.21 *************** *** 7,14 **** --- 7,18 ---- * - Write in DocBookWiki a programmer's guide for phpWebApp. + * - Regenerate the code documentation with doxygen and phpDocumentor. + * - Use the webbox docbook in the documentation of phpWebApp. * - Write more tutorials for phpWebApp. + * - Document the design of the framework, using UML models etc. + * ------------- Make a new release 1.3 |
From: Dashamir H. <das...@us...> - 2005-09-19 07:20:26
|
Update of /cvsroot/phpwebapp/top10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9870 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/webapp.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** webapp.php 23 Sep 2003 14:04:12 -0000 1.1.1.1 --- webapp.php 19 Sep 2005 07:20:17 -0000 1.2 *************** *** 33,37 **** define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 33,38 ---- define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-09-19 07:19:57
|
Update of /cvsroot/phpwebapp/documentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9697 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/webapp.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** webapp.php 6 Jul 2005 15:27:24 -0000 1.7 --- webapp.php 19 Sep 2005 07:19:49 -0000 1.8 *************** *** 34,38 **** $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 34,39 ---- $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-09-19 07:19:26
|
Update of /cvsroot/phpwebapp/app3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9586 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/app3/webapp.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** webapp.php 8 Sep 2003 13:25:41 -0000 1.3 --- webapp.php 19 Sep 2005 07:19:18 -0000 1.4 *************** *** 26,30 **** define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 26,31 ---- define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-09-19 07:19:04
|
Update of /cvsroot/phpwebapp/app2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9509 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/app2/webapp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** webapp.php 8 Sep 2003 13:24:59 -0000 1.5 --- webapp.php 19 Sep 2005 07:18:55 -0000 1.6 *************** *** 26,30 **** define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 26,31 ---- define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-09-19 07:18:43
|
Update of /cvsroot/phpwebapp/app1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9405 Modified Files: webapp.php Log Message: Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/app1/webapp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** webapp.php 8 Sep 2003 13:24:17 -0000 1.5 --- webapp.php 19 Sep 2005 07:18:35 -0000 1.6 *************** *** 26,30 **** define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 26,31 ---- define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-09-19 07:18:11
|
Update of /cvsroot/phpwebapp/empty-sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9215 Modified Files: webapp.php Log Message: bugfix; because of this, .js and .css files are not loaded properly in the browser, if the application is installed directly at document root Index: webapp.php =================================================================== RCS file: /cvsroot/phpwebapp/empty-sample/webapp.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** webapp.php 8 Sep 2003 13:23:30 -0000 1.3 --- webapp.php 19 Sep 2005 07:18:02 -0000 1.4 *************** *** 33,37 **** define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name)."/"; define("APP_URL", $app_url); --- 33,38 ---- define("APP_PATH", $app_path); $script_name = $_SERVER["SCRIPT_NAME"]; ! $app_url = dirname($script_name); ! if ($app_url!='/') $app_url.='/'; define("APP_URL", $app_url); |
From: Dashamir H. <das...@us...> - 2005-08-31 07:59:59
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30386/doc Modified Files: ToDo.txt changes.txt to_do.txt Added Files: changes_5.txt Log Message: --- NEW FILE: changes_5.txt --- Changes made to the application framework that the framework users should know: =========================================== ------------------------------------------------------------------- * The tag <textarea> is treated as preformated (similar to <pre>, <xmp> and <example>). This means that the indentation and the white-space of its contents are preserved by the framework. ------------------------------------------------------------------- * GoTo() can have a second optional parameter which specifies the action where the form is to be submitted. Default is the previous action. If it is 'index' then the filename will be removed from the previous action (ant the action will become in fact index.php in the path). ------------------------------------------------------------------- * WebApp::addSVar() or $this->addSVar() initialize a state variable by calling $session->addVar(). Now the behaviour of $session->addVar() is modified so that it will not re-initialize a variable (it will not change the value of a variable, if it already exists). This is done in order to be able to set some state variables of a webbox without being afraid that init() will override them. ------------------------------------------------------------------- * Added function: WebApp::fill_template($tpl_file, $vars) This function processes the given template, replacing any variables, including any other templates, etc. and returns the resulting string. The parameter $vars(optional) is an array of variables (associative array), which can be used to replace the template vars. This function is different from: WebApp::getHtmlPage($tpl_file) and from WebApp::constructHtmlPage($tpl_file) because they assume that the given template file is a main template (which has a prolog <?xml ...?> and an <html> root element), and also they append some extra things to the consructed page, like debug information, session variables, etc. ------------------------------------------------------------------- * Function WebApp::popup_window($name, $url, $features ='nil') can be used to open a pop-up window (in a new browser). Parameters $name, $url, and $features will be used in a javascript statement like this: $name = window.open($url, $name, $features); ------------------------------------------------------------------- * Added function: WebApp::GoTo($target_page, $target_object =UNDEFINED, $event_name =UNDEFINED, $event_args =UNDEFINED) This function stops constructing the current page and starts loading and constructing the given target page. Similar to the JS function GoTo(), it can also send an event to the new page that is going to be constructed. ------------------------------------------------------------------- * Added debug options DEBUG_INCLUDES and DEBUG_WEBOBJECTS. They should be included in 'config/const.Debug.php' like this: /** * if this constant is true, the framework outputs a box * around each file that is included in the page */ define("DEBUG_INCLUDES", false); /** * if this constant is true, the framework outputs a box * around each webobject that is used in the page */ define("DEBUG_WEBOBJECTS", false); ------------------------------------------------------------------- * Added the (framework) tag <unindented>. By default the framework indents all the templates that are processed or included. However sometimes may be usefull not to indent a part of a template. This can be done by including it inside the <unindeted> tag, like this: <unindented> {{file_revision}} </unindented> ------------------------------------------------------------------- * Added support for multiple languages to the framework. translation / internationalization (i18n) / localization (l10n) It can use any one of the packages: - PHP-gettext (http://savannah.nongnu.org/projects/php-gettext/) - GNU gettext (http://www.gnu.org/software/gettext/gettext.html, http://www.php.net/gettext) since both of them have some advantages or disadvantages. The disadvantages of GNU gettext are that it does not work if gettext package is not installed, or if the system is not configured for using translations of a language. Also, the gettext functions in the php seem not to be reliable, sometimes they get the translation from one place, sometimes from another (maybe this is a caching problem?). In general, it is a headache to make it work. The disadvantages of PHP-gettext are that it may not be as fast as GNU gettext, and there may be some gettext functionality that is not supported yet (not implemented yet). The application programer can choose the one that suits him best. The choice is made at 'config/const.Options.php': /** if true, then use the php-gettext instead of GNU gettext */ define('USE_PHP_GETTEXT', true); Other translation constants that are defined at the options file are LNG and CODESET: /** * The constants LNG and CODESET set a default language and codeset for * the application. They are used for the localization (translation) * of the messages. They can be changed by calling: * $l10n->set_lng($lng, $codeset) * where $l10n is a global variable and $codeset is optional. * LNG can be something like 'en_US' or 'en' or UNDEFINED. * CODESET can be UNDEFINED, 'iso-latin-1', etc. */ define('LNG', 'sq_AL'); define('CODESET', 'iso-latin-1'); LNG sets a default language for the application, but it can also be changed dynamically, calling $l10n->set_lng($lng). With GNU gettext, LNG can also be UNDEFINED, and in this case the system default will be used. However, with PHP-gettext it should have a value (or a value should be set with $l10n->set_lng()). CODESET is used in GNU gettext, but it is not needed by PHP-gettext, so it can also be UNDEFINED. See the documentation of gettext (`info gettext`) for more information about when and why it is needed. The framework allows to have separate translation (localization) files foreach template that is included and for each webobject. If the directory that contains the template (or webbox) contains also a subdirectory named 'l10n', then the framework will look inside this directory for the file that contains the translations of the messages of the template/webbox. It will look for the file l10n/lng/LC_MESSAGES/tplname.mo (or l10n/lng/LC_MESSAGES/webboxid.mo) which contains the translation messages of the template (or webbox). If the subdirectory 'l10n/' does not exist, the framework will look for the file tplname.mo (or webboxid.mo) in the first 'l10n/' in the parent directory or in the ancestors. If even the application directory does not contain a 'l10n/' subdir, then the last place to look for will be the system default (usually /usr/share/locale/). About the language code, if it is e.g. 'en_US', then it will search first the folder 'en_US/' and then the folder 'en/'. If the file tplname.mo (or webboxid.mo) is not found at all in the searched directories, then the last translation (*.mo) file that was found will be used for translating messages. This is usually the translation (*.mo) file of the containing template or webbox (from which this template/webbox is included directly or indirectly). This way of finding the translation files allows for modularity, because each webbox/template can have its own translation files, so using them in other applications can be done by just copying them there. But it is also flexible and does not enforce unnecessary or unneeded modularity, so that for example the whole application can have a single translation file, or sub-webbox-es can use the translation files of the main webbox. In general, translation files (*.mo) can be organized like this: - A single translation file 'app_name.mo' can be used for all the application. It can be placed in /usr/share/locale/lng/LC_MESSAGES/ or in app_path/l10n/lng/LC_MESSAGES/ - Generic webboxes, which are used in more that one application, can have their own translation file 'webbox_id.mo' (besides the application file 'app_name.mo'), which is placed in the same directory as the application file (see above). - Each important webbox can have a subdirectory 'l10n/', in which is placed the translation file of the webbox, in /path/to/webbox/l10n/lng/LC_MESSAGES/webbox.mo . This file can contain the translations of all the sub-webbox-es and sub-templates as well (the ones that are included from this webbox), or they (their translations) can be in separate files in the same directory, which are named according to the template name or the webbox id. - Each webbox can have its own 'l10n/' directory, which contains its own translation files. This is the most modular aproach but it may not be always needed. Other combinations are possible as well, so it is up to the application and its developer to decide about it. In order to make a string translatable, it should be placed as an argument of the T_() function and should be surrounded by double quotes, like this: T_("Hello!") . This can be used both in the PHP code and in the HTML templates (but not in JS files, because they are not processed by the framework). Then, the rest is the same as described by the gettext documentation (see `info gettext`): the translatable strings are extracted automatically from the PHP code and HTML templates using the xgettext program (see `info xgettext`), creating *.po files, then the strings are translated, then *.po files are converted to *.mo files using `msgfmt`, then they are installed (placed at the propper location in the application). The xgettext program should be called with the '-kT_' parameter, which means that 'T_' is the name of the function whose strings will be extracted. Tip: In order to translating attribute values, use a {{variable}} inside the attribute value, and then in the PHP code that adds the variable, get the appropriate translation. E.g. <input type="button" value="{{Search>>}}" /> (in HTML) WebApp::addVar('Search>>', T_("Search>>")); (in PHP) Tip: Some templates contain text, not just messages, which can also be mixed with HTML tags (see e.g. 'templates/search/help.html' in this case it is difficult to translate it using translation messages. The best way is to use a separate template for each language, like 'help_en_US.html', 'help_sq_AL.html', etc. When the template is included, something like this can be used: <include src="{{./}}help_{{lng}}.html" /> where {{lng}} can be defined in the php code like this: function onParse() { global $l10n; WebApp::addVar('lng', $l10n->lng); } Tip: Since xgettext has the C syntax in mind, for strings in multiple lines, it gives a warning: "unterminated string literal" and it does not get them right. To bypass this problem, a slash (\) can be added at the end of the lines, like in C strings. The framework will take care to remove it automatically and the lines will be as if there was no break between them. In case that you do want to preserve the break between the lines, then use '\n\' at the end of the lines. This is just a dirty trick, the clean solution would be to modify xgettext so that it reckognizes the syntax of php and html strings, but it is not so easy for me to do this, and until somebody does it, this trick solves the problem. ------------------------------------------------------------------- * Now it is possible to use translatable messages in the JS code (e.g. in the messages that are displayed by alert()). Same as in PHP and HTML, strings are translated by the function: T_("...."). Attention: double quotes must be used ("), otherwise xgettext will not be able to extract them. In order to have variables inside a message, you have to make some tricks. E.g., to make translatable this message: --code var new_node_id = prompt("Rename node '" + node_id + "' to:"); ---- It can be written like this: --code var msg = T_("Rename node 'v_node_id' to:").replace(/v_node_id/, node_id); //var msg = T_("Rename node 'v_node_id' to:"); //msg = msg.replace(/v_node_id/, node_id); var new_node_id = prompt(msg); ---- This allows the translator to change the position of the variable, if needed. Note: How it Works The JS function T_(msgid), which is included in the page by the framework, returns the translation msgstr of the given msgid. This translation is retrived from a list of translated messages, which is contained by the JS object l10n of class L10n, which is included in the page by the framework. If you view the source of the page, you will see near the end something like this: --code <script type="text/javascript" language="javascript" src="web_app/l10n/class.L10n.js"></script> <script type="text/javascript" language="javascript"> //<![CDATA[ l10n = new L10n(); l10n.addMsg("You are deleting this node and all the subnodes.", "You are deleting this node and all the subnodes."); l10n.addMsg("ID cannot be empty.", "ID cannot be empty."); l10n.addMsg("Title cannot be empty.", "Title cannot be empty."); l10n.addMsg("Please give an ID.", "Please give an ID."); l10n.addMsg("Please give a title.", "Please give a title."); l10n.addMsg("Rename 'v_item' to:", "Rename 'v_item' to:"); l10n.addMsg("Your are deleting 'v_item'!", "Your are deleting 'v_item'!"); l10n.addMsg("Uploading:", "Uploading:"); l10n.addMsg("Please wait...", "Please wait..."); //]]> </script> ---- This is generated automatically by the framework. For each JS file that it includes in the <head> of the page, it also scans it for translatable messages, gets their translation, and includes lines l10n.addMsg(msgid, msgstr), as above. ------------------------------------------------------------------- ------------------------------------------------------------------- ------------------------------------------------------------------- Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/ToDo.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ToDo.txt 13 Jun 2005 06:55:21 -0000 1.10 --- ToDo.txt 31 Aug 2005 07:59:48 -0000 1.11 *************** *** 55,64 **** again in the structure that they were before. ------------------------------------------------------------- - * - The messages of the framework (errors, warnings, etc) should - support multiple languages. - - - The messages displayed from JS code (alerts) should support - multiple languages. - ------------------------------------------------------------- * - Build a tool for the web (graphical) designer so that he can preview the templates. (The "browse.php" does this). --- 55,58 ---- Index: changes.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** changes.txt 22 Jun 2005 12:56:29 -0000 1.21 --- changes.txt 31 Aug 2005 07:59:48 -0000 1.22 *************** *** 5,298 **** ------------------------------------------------------------------- - * The tag <textarea> is treated as preformated (similar to <pre>, - <xmp> and <example>). This means that the indentation and the - white-space of its contents are preserved by the framework. - ------------------------------------------------------------------- - * GoTo() can have a second optional parameter which specifies the action - where the form is to be submitted. Default is the previous action. - If it is 'index' then the filename will be removed from the previous - action (ant the action will become in fact index.php in the path). - ------------------------------------------------------------------- - * WebApp::addSVar() or $this->addSVar() initialize a state variable - by calling $session->addVar(). Now the behaviour of $session->addVar() - is modified so that it will not re-initialize a variable (it will - not change the value of a variable, if it already exists). This is - done in order to be able to set some state variables of a webbox - without being afraid that init() will override them. - ------------------------------------------------------------------- - * Added function: - WebApp::fill_template($tpl_file, $vars) - This function processes the given template, replacing any variables, - including any other templates, etc. and returns the resulting - string. The parameter $vars(optional) is an array of variables - (associative array), which can be used to replace the template vars. - This function is different from: - WebApp::getHtmlPage($tpl_file) and from - WebApp::constructHtmlPage($tpl_file) - because they assume that the given template file is a main template - (which has a prolog <?xml ...?> and an <html> root element), - and also they append some extra things to the consructed page, - like debug information, session variables, etc. - ------------------------------------------------------------------- - * Function WebApp::popup_window($name, $url, $features ='nil') - can be used to open a pop-up window (in a new browser). - Parameters $name, $url, and $features will be used in a - javascript statement like this: - $name = window.open($url, $name, $features); - ------------------------------------------------------------------- - * Added function: - WebApp::GoTo($target_page, $target_object =UNDEFINED, - $event_name =UNDEFINED, $event_args =UNDEFINED) - This function stops constructing the current page and starts - loading and constructing the given target page. Similar to - the JS function GoTo(), it can also send an event to the new - page that is going to be constructed. - ------------------------------------------------------------------- - * Added debug options DEBUG_INCLUDES and DEBUG_WEBOBJECTS. They - should be included in 'config/const.Debug.php' like this: - - /** - * if this constant is true, the framework outputs a box - * around each file that is included in the page - */ - define("DEBUG_INCLUDES", false); - - /** - * if this constant is true, the framework outputs a box - * around each webobject that is used in the page - */ - define("DEBUG_WEBOBJECTS", false); - - ------------------------------------------------------------------- - * Added the (framework) tag <unindented>. By default the framework indents - all the templates that are processed or included. However sometimes may - be usefull not to indent a part of a template. This can be done by - including it inside the <unindeted> tag, like this: - <unindented> - {{file_revision}} - </unindented> - ------------------------------------------------------------------- - - * Added support for multiple languages to the framework. - translation / internationalization (i18n) / localization (l10n) - - It can use any one of the packages: - - PHP-gettext (http://savannah.nongnu.org/projects/php-gettext/) - - GNU gettext (http://www.gnu.org/software/gettext/gettext.html, - http://www.php.net/gettext) - since both of them have some advantages or disadvantages. - - The disadvantages of GNU gettext are that it does not work if gettext - package is not installed, or if the system is not configured for - using translations of a language. Also, the gettext functions in the php - seem not to be reliable, sometimes they get the translation from one - place, sometimes from another (maybe this is a caching problem?). - In general, it is a headache to make it work. - - The disadvantages of PHP-gettext are that it may not be as fast - as GNU gettext, and there may be some gettext functionality that is - not supported yet (not implemented yet). - - The application programer can choose the one that suits him best. - The choice is made at 'config/const.Options.php': - - /** if true, then use the php-gettext instead of GNU gettext */ - define('USE_PHP_GETTEXT', true); - - Other translation constants that are defined at the options file - are LNG and CODESET: - - /** - * The constants LNG and CODESET set a default language and codeset for - * the application. They are used for the localization (translation) - * of the messages. They can be changed by calling: - * $l10n->set_lng($lng, $codeset) - * where $l10n is a global variable and $codeset is optional. - * LNG can be something like 'en_US' or 'en' or UNDEFINED. - * CODESET can be UNDEFINED, 'iso-latin-1', etc. - */ - define('LNG', 'sq_AL'); - define('CODESET', 'iso-latin-1'); - - LNG sets a default language for the application, but it can also be - changed dynamically, calling $l10n->set_lng($lng). With GNU gettext, - LNG can also be UNDEFINED, and in this case the system default will - be used. However, with PHP-gettext it should have a value (or a - value should be set with $l10n->set_lng()). - CODESET is used in GNU gettext, but it is not needed by PHP-gettext, - so it can also be UNDEFINED. See the documentation of gettext - (`info gettext`) for more information about when and why it is needed. - - The framework allows to have separate translation (localization) files - foreach template that is included and for each webobject. If the - directory that contains the template (or webbox) contains also - a subdirectory named 'l10n', then the framework will look inside - this directory for the file that contains the translations of the - messages of the template/webbox. It will look for the file - l10n/lng/LC_MESSAGES/tplname.mo (or l10n/lng/LC_MESSAGES/webboxid.mo) - which contains the translation messages of the template (or webbox). - - If the subdirectory 'l10n/' does not exist, the framework will - look for the file tplname.mo (or webboxid.mo) in the first 'l10n/' - in the parent directory or in the ancestors. If even the application - directory does not contain a 'l10n/' subdir, then the last place - to look for will be the system default (usually /usr/share/locale/). - - About the language code, if it is e.g. 'en_US', then it will search - first the folder 'en_US/' and then the folder 'en/'. - - If the file tplname.mo (or webboxid.mo) is not found at all in - the searched directories, then the last translation (*.mo) file - that was found will be used for translating messages. This is usually - the translation (*.mo) file of the containing template or webbox - (from which this template/webbox is included directly or indirectly). - - This way of finding the translation files allows for modularity, - because each webbox/template can have its own translation files, - so using them in other applications can be done by just copying them - there. But it is also flexible and does not enforce unnecessary - or unneeded modularity, so that for example the whole application - can have a single translation file, or sub-webbox-es can use the - translation files of the main webbox. - - In general, translation files (*.mo) can be organized like this: - - - A single translation file 'app_name.mo' can be used for all the - application. It can be placed in /usr/share/locale/lng/LC_MESSAGES/ - or in app_path/l10n/lng/LC_MESSAGES/ - - - Generic webboxes, which are used in more that one application, - can have their own translation file 'webbox_id.mo' (besides - the application file 'app_name.mo'), which is placed in the - same directory as the application file (see above). - - - Each important webbox can have a subdirectory 'l10n/', - in which is placed the translation file of the webbox, - in /path/to/webbox/l10n/lng/LC_MESSAGES/webbox.mo . - This file can contain the translations of all the sub-webbox-es - and sub-templates as well (the ones that are included from this - webbox), or they (their translations) can be in separate - files in the same directory, which are named according to - the template name or the webbox id. - - - Each webbox can have its own 'l10n/' directory, which contains - its own translation files. This is the most modular aproach - but it may not be always needed. - - Other combinations are possible as well, so it is up to the - application and its developer to decide about it. - - In order to make a string translatable, it should be placed - as an argument of the T_() function and should be surrounded - by double quotes, like this: T_("Hello!") . This can be used - both in the PHP code and in the HTML templates (but not in - JS files, because they are not processed by the framework). - - Then, the rest is the same as described by the gettext documentation - (see `info gettext`): the translatable strings are extracted - automatically from the PHP code and HTML templates using the - xgettext program (see `info xgettext`), creating *.po files, - then the strings are translated, then *.po files are converted - to *.mo files using `msgfmt`, then they are installed (placed at - the propper location in the application). The xgettext program - should be called with the '-kT_' parameter, which means that - 'T_' is the name of the function whose strings will be extracted. - - Tip: In order to translating attribute values, use a {{variable}} - inside the attribute value, and then in the PHP code that - adds the variable, get the appropriate translation. E.g. - - <input type="button" value="{{Search>>}}" /> (in HTML) - - WebApp::addVar('Search>>', T_("Search>>")); (in PHP) - - Tip: Some templates contain text, not just messages, which can - also be mixed with HTML tags (see e.g. - 'templates/search/help.html' in this case it is difficult - to translate it using translation messages. The best way is - to use a separate template for each language, like - 'help_en_US.html', 'help_sq_AL.html', etc. - When the template is included, something like this can be - used: - <include src="{{./}}help_{{lng}}.html" /> - where {{lng}} can be defined in the php code like this: - function onParse() - { - global $l10n; - WebApp::addVar('lng', $l10n->lng); - } - - Tip: Since xgettext has the C syntax in mind, for strings - in multiple lines, it gives a warning: "unterminated string - literal" and it does not get them right. To bypass this - problem, a slash (\) can be added at the end of the lines, - like in C strings. The framework will take care to remove it - automatically and the lines will be as if there was no break - between them. In case that you do want to preserve the break - between the lines, then use '\n\' at the end of the lines. - - This is just a dirty trick, the clean solution would be to - modify xgettext so that it reckognizes the syntax of php and - html strings, but it is not so easy for me to do this, and - until somebody does it, this trick solves the problem. - - ------------------------------------------------------------------- - - * Now it is possible to use translatable messages in the JS code - (e.g. in the messages that are displayed by alert()). Same as - in PHP and HTML, strings are translated by the function: - T_("...."). - - Attention: double quotes must be used ("), otherwise - xgettext will not be able to extract them. - - In order to have variables inside a message, you have to make - some tricks. E.g., to make translatable this message: - --code - var new_node_id = prompt("Rename node '" + node_id + "' to:"); - ---- - It can be written like this: - --code - var msg = T_("Rename node 'v_node_id' to:").replace(/v_node_id/, node_id); - //var msg = T_("Rename node 'v_node_id' to:"); - //msg = msg.replace(/v_node_id/, node_id); - var new_node_id = prompt(msg); - ---- - This allows the translator to change the position of the variable, - if needed. - - Note: How it Works - The JS function T_(msgid), which is included in the page by - the framework, returns the translation msgstr of the given msgid. - This translation is retrived from a list of translated messages, - which is contained by the JS object l10n of class L10n, which is - included in the page by the framework. If you view the source of - the page, you will see near the end something like this: - --code - <script type="text/javascript" language="javascript" - src="web_app/l10n/class.L10n.js"></script> - <script type="text/javascript" language="javascript"> - //<![CDATA[ - l10n = new L10n(); - l10n.addMsg("You are deleting this node and all the subnodes.", - "You are deleting this node and all the subnodes."); - l10n.addMsg("ID cannot be empty.", "ID cannot be empty."); - l10n.addMsg("Title cannot be empty.", "Title cannot be empty."); - l10n.addMsg("Please give an ID.", "Please give an ID."); - l10n.addMsg("Please give a title.", "Please give a title."); - l10n.addMsg("Rename 'v_item' to:", "Rename 'v_item' to:"); - l10n.addMsg("Your are deleting 'v_item'!", - "Your are deleting 'v_item'!"); - l10n.addMsg("Uploading:", "Uploading:"); - l10n.addMsg("Please wait...", "Please wait..."); - //]]> - </script> - ---- - This is generated automatically by the framework. For each JS file - that it includes in the <head> of the page, it also scans it for - translatable messages, gets their translation, and includes lines - l10n.addMsg(msgid, msgstr), as above. - - ------------------------------------------------------------------- ------------------------------------------------------------------- ------------------------------------------------------------------- --- 5,8 ---- Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** to_do.txt 6 Jul 2005 14:07:21 -0000 1.19 --- to_do.txt 31 Aug 2005 07:59:48 -0000 1.20 *************** *** 1,3 **** --- 1,7 ---- * - Make i18n/l10n for the messages of the framework itself. + - The messages of the framework (errors, warnings, etc) should + support multiple languages. + - The messages displayed from JS code (alerts) should support + multiple languages. * - Write in DocBookWiki a programmer's guide for phpWebApp. |