phpwebapp-commits Mailing List for phpWebApp (Page 12)
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...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/webobjects/tabs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/webobjects/tabs Modified Files: tabs3.php tabs2.php tabs1.php Log Message: reformated and modified the copyleft notice Index: tabs3.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/tabs/tabs3.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tabs3.php 25 Aug 2003 14:37:19 -0000 1.5 --- tabs3.php 22 Jul 2004 16:25:35 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,81 **** { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs3-item-selected" : "tabs3-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> --- 29,82 ---- { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs3-item-selected" : "tabs3-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> Index: tabs2.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/tabs/tabs2.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tabs2.php 25 Aug 2003 14:37:19 -0000 1.5 --- tabs2.php 22 Jul 2004 16:25:35 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,81 **** { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs2-item-selected" : "tabs2-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> --- 29,82 ---- { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs2-item-selected" : "tabs2-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> Index: tabs1.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/tabs/tabs1.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tabs1.php 25 Aug 2003 14:37:19 -0000 1.5 --- tabs1.php 22 Jul 2004 16:25:35 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,81 **** { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs1-item-selected" : "tabs1-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> --- 29,82 ---- { function init() ! { ! $items_file = $this->params["items"]; ! $items_file = WebApp::replaceVars($items_file); ! $this->addSVar("items_file", $items_file); ! //set the first menu item as the selected item ! include $items_file; //read the menu items ! $first_item = key($menu_items); ! $this->addSVar("selected_item", $first_item); ! } function on_select($event_args) ! { ! $item = $event_args["item"]; ! $this->setSVar("selected_item", $item); ! } function onRender() ! { ! $this->add_items_list(); ! } function add_items_list() ! { ! $obj_vars = $this->getObjVars(); ! $obj_name = $obj_vars["obj_name"]; ! $obj_count = $obj_vars["obj_count"]; ! $rs = new EditableRS($obj_name."_items"); ! //read the menu items ! $items_file = $this->getSVar("items_file"); ! include $items_file; ! //fill the recordset ! $selected = $this->getSVar("selected_item"); ! while ( list($item, $label) = each($menu_items) ) ! { ! $css_class = ($item==$selected ? "tabs1-item-selected" : "tabs1-item"); ! $rec = array( ! "item" => $item, ! "label" => $label, ! "class" => $css_class ! ); ! $rs->addRec($rec); ! } ! //set the recordset to the page ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> |
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/webobjects/form In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/webobjects/form Modified Files: formWebObj.php Log Message: reformated and modified the copyleft notice Index: formWebObj.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/form/formWebObj.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** formWebObj.php 15 Jul 2004 13:36:13 -0000 1.8 --- formWebObj.php 22 Jul 2004 16:25:36 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,46 **** { function afterParse() ! { ! global $webPage; ! //prepend js code to the content of this template ! $form_url = WebApp::to_url(FORM_PATH); ! $js_code = "<script type=\"text/javascript\" language=\"javascript\" " ! . "src=\"".$form_url."formWebObj.js\"></script>\n"; ! $webPage->append_to_head($js_code); ! //append js code to the content of this template ! global $formData; //form data comes with transmitVar() as a global var ! if (isset($formData)) ! { ! $form_name = $this->get_form_name(); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ --- 29,47 ---- { function afterParse() ! { ! global $webPage; ! //prepend js code to the content of this template ! $form_url = WebApp::to_url(FORM_PATH); ! $js_code = "<script type=\"text/javascript\" language=\"javascript\" " ! . "src=\"".$form_url."formWebObj.js\"></script>\n"; ! $webPage->append_to_head($js_code); ! //append js code to the content of this template ! global $formData; //form data comes with transmitVar() as a global var ! if (isset($formData)) ! { ! $form_name = $this->get_form_name(); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ *************** *** 51,66 **** </script> "; ! $this->contents .= $js_code; ! } ! } /** finds and returns the name of the form in this template */ function get_form_name() ! { ! $pattern = '/<form[^>]*name=("|\')([^\\1]+)\\1/'; ! preg_match($pattern, $this->contents, $matches); ! $form_name = $matches[2]; ! return $form_name; ! } } ?> \ No newline at end of file --- 52,67 ---- </script> "; ! $this->contents .= $js_code; ! } ! } /** finds and returns the name of the form in this template */ function get_form_name() ! { ! $pattern = '/<form[^>]*name=("|\')([^\\1]+)\\1/'; ! preg_match($pattern, $this->contents, $matches); ! $form_name = $matches[2]; ! return $form_name; ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/tools/fileBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/tools/fileBrowser Modified Files: panel.php fileBrowser.php file.php Log Message: reformated and modified the copyleft notice Index: panel.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/tools/fileBrowser/panel.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** panel.php 15 Jul 2004 14:46:03 -0000 1.5 --- panel.php 22 Jul 2004 16:25:36 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 27,53 **** { function init() ! { ! $this->addSVar("folderVisible", "true"); ! $this->addSVar("codeView", "false"); ! } function onRender() ! { ! $codeView = $this->getSVar("codeView"); ! if ($codeView=="true") ! { ! WebApp::addVars( array( ! "codeView_checked" => 'checked="checked"', ! "preview_checked" => '' ! )); ! } ! else ! { ! WebApp::addVars( array( ! "codeView_checked" => '', ! "preview_checked" => 'checked="checked"' ! )); ! } ! } } ?> --- 28,54 ---- { function init() ! { ! $this->addSVar("folderVisible", "true"); ! $this->addSVar("codeView", "false"); ! } function onRender() ! { ! $codeView = $this->getSVar("codeView"); ! if ($codeView=="true") ! { ! WebApp::addVars( array( ! "codeView_checked" => 'checked="checked"', ! "preview_checked" => '' ! )); ! } ! else ! { ! WebApp::addVars( array( ! "codeView_checked" => '', ! "preview_checked" => 'checked="checked"' ! )); ! } ! } } ?> Index: fileBrowser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/tools/fileBrowser/fileBrowser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fileBrowser.php 11 Aug 2003 16:17:51 -0000 1.2 --- fileBrowser.php 22 Jul 2004 16:25:36 -0000 1.3 *************** *** 1,16 **** <?php ! /** ! * @package tools ! * @subpackage fileBrowser ! */ class fileBrowser extends WebObject { function on_file($event_args) ! { ! $root = WebApp::getSVar("folderListing->root"); ! $path = WebApp::getSVar("folderListing->currentPath"); ! $tpl_file = $event_args["file_name"]; ! WebApp::setSVar("fileView->file", $root.$path.$tpl_file); ! } } ?> \ No newline at end of file --- 1,32 ---- <?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 ! */ class fileBrowser extends WebObject { function on_file($event_args) ! { ! $root = WebApp::getSVar("folderListing->root"); ! $path = WebApp::getSVar("folderListing->currentPath"); ! $tpl_file = $event_args["file_name"]; ! WebApp::setSVar("fileView->file", $root.$path.$tpl_file); ! } } ?> \ No newline at end of file Index: file.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/tools/fileBrowser/file.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** file.php 25 Aug 2003 13:18:29 -0000 1.5 --- file.php 22 Jul 2004 16:25:36 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 27,66 **** { function init() ! { ! $current_path = WebApp::getVar("./"); ! WebApp::setSVar("fileView->file", $current_path."sample.html"); ! } function onRender() ! { ! $tpl_file = WebApp::getSVar("fileView->file"); ! $this->load_cfg_file($tpl_file); ! $file = ereg_replace("^".APP_PATH, '', $tpl_file); ! WebApp::addVar("file", $file); ! } function load_cfg_file($tpl_file) ! { ! $path = dirname($tpl_file); ! $fname = basename($tpl_file); ! if (!ereg("\.html?$", $fname)) ! { ! //not a template file ! return; ! } ! //get the config file name ! $fname = ereg_replace("\.html?$", ".cfg.php", $fname); ! $cfg_file = $path."/".$fname; ! //load the config file (if it exists) ! if (file_exists($cfg_file)) ! { ! include $cfg_file; ! $func_name = ereg_replace("\.html?$", "", basename($tpl_file)); ! $func_name .= "_config"; ! $func_name(); //call the config function ! } ! } } ?> --- 28,67 ---- { function init() ! { ! $current_path = WebApp::getVar("./"); ! WebApp::setSVar("fileView->file", $current_path."sample.html"); ! } function onRender() ! { ! $tpl_file = WebApp::getSVar("fileView->file"); ! $this->load_cfg_file($tpl_file); ! $file = ereg_replace("^".APP_PATH, '', $tpl_file); ! WebApp::addVar("file", $file); ! } function load_cfg_file($tpl_file) ! { ! $path = dirname($tpl_file); ! $fname = basename($tpl_file); ! if (!ereg("\.html?$", $fname)) ! { ! //not a template file ! return; ! } ! //get the config file name ! $fname = ereg_replace("\.html?$", ".cfg.php", $fname); ! $cfg_file = $path."/".$fname; ! //load the config file (if it exists) ! if (file_exists($cfg_file)) ! { ! include $cfg_file; ! $func_name = ereg_replace("\.html?$", "", basename($tpl_file)); ! $func_name .= "_config"; ! $func_name(); //call the config function ! } ! } } ?> |
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/webobjects/datebox In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/webobjects/datebox Modified Files: datebox.php Log Message: reformated and modified the copyleft notice Index: datebox.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/datebox/datebox.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** datebox.php 25 Aug 2003 13:18:29 -0000 1.4 --- datebox.php 22 Jul 2004 16:25:36 -0000 1.5 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,54 **** { function onRender() ! { ! //get parameters 'value' and 'format' ! $date = $this->params["value"]; ! $date = WebApp::replaceVars($date); ! $format = $this->params["format"]; ! $format = WebApp::replaceVars($format); ! //build and declare {{text_value}} ! $arr_date = explode("-", $date); ! if (sizeof($arr_date)<>3) ! { ! $text_value = $date; ! } ! else ! { ! list($year,$month,$day) = $arr_date; ! $text_value = $format; ! $text_value = str_replace("YYYY", $year, $text_value); ! $text_value = str_replace("MM", $month, $text_value); ! $text_value = str_replace("DD", $day, $text_value); ! } ! WebApp::addVar("text_value", $text_value); ! } } ?> \ No newline at end of file --- 29,55 ---- { function onRender() ! { ! //get parameters 'value' and 'format' ! $date = $this->params["value"]; ! $date = WebApp::replaceVars($date); ! $format = $this->params["format"]; ! $format = WebApp::replaceVars($format); ! //build and declare {{text_value}} ! $arr_date = explode("-", $date); ! if (sizeof($arr_date)<>3) ! { ! $text_value = $date; ! } ! else ! { ! list($year,$month,$day) = $arr_date; ! $text_value = $format; ! $text_value = str_replace("YYYY", $year, $text_value); ! $text_value = str_replace("MM", $month, $text_value); ! $text_value = str_replace("DD", $day, $text_value); ! } ! WebApp::addVar("text_value", $text_value); ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/timer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/timer Modified Files: class.Timer.php Log Message: reformated and modified the copyleft notice Index: class.Timer.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/timer/class.Timer.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** class.Timer.php 15 Jul 2004 14:46:04 -0000 1.8 --- class.Timer.php 22 Jul 2004 16:25:36 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 31,73 **** function Timer() ! { ! $this->info = array(); ! } function Start($processID, $comment) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["comment"] = $comment; ! $this->info[$processID]["startTime"] = microtime(); ! } function Stop($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["endTime"] = microtime(); ! } function GetTime($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $startTime = $this->info[$processID]["startTime"]; ! list($usec1, $sec1) = explode(" ", $startTime); ! $endTime = $this->info[$processID]["endTime"]; ! list($usec2, $sec2) = explode(" ", $endTime); ! $micro_sec = ($sec2 - $sec1)*1000000 + ($usec2 - $usec1); ! return $micro_sec / 1000; //return milisecs ! } function toHtmlTable() ! { ! if (!EXECUTION_TIME_INFO) return; ! $html = $this->JSTimer_toHtmlTable(); ! $html .= " <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> --- 32,74 ---- function Timer() ! { ! $this->info = array(); ! } function Start($processID, $comment) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["comment"] = $comment; ! $this->info[$processID]["startTime"] = microtime(); ! } function Stop($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["endTime"] = microtime(); ! } function GetTime($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $startTime = $this->info[$processID]["startTime"]; ! list($usec1, $sec1) = explode(" ", $startTime); ! $endTime = $this->info[$processID]["endTime"]; ! list($usec2, $sec2) = explode(" ", $endTime); ! $micro_sec = ($sec2 - $sec1)*1000000 + ($usec2 - $usec1); ! return $micro_sec / 1000; //return milisecs ! } function toHtmlTable() ! { ! if (!EXECUTION_TIME_INFO) return; ! $html = $this->JSTimer_toHtmlTable(); ! $html .= " <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> *************** *** 82,90 **** </tr>"; ! while ( list($processID, $timeInfo) = each($this->info) ) ! { ! $comment = $timeInfo["comment"]; ! $executionTime = $this->GetTime($processID); ! $html .= " <tr> <td bgcolor='#f9f9f9'> $processID </td> --- 83,91 ---- </tr>"; ! while ( list($processID, $timeInfo) = each($this->info) ) ! { ! $comment = $timeInfo["comment"]; ! $executionTime = $this->GetTime($processID); ! $html .= " <tr> <td bgcolor='#f9f9f9'> $processID </td> *************** *** 92,107 **** <td bgcolor='#f9f9f9'><xmp>$comment</xmp></td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } function JSTimer() ! { ! if (!EXECUTION_TIME_INFO) return ""; ! $timer_path = WebApp::to_url(TIMER_PATH); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\" src=\"".$timer_path."class.Timer.js\"></script> <script type=\"text/javascript\" language=\"javascript\"> --- 93,108 ---- <td bgcolor='#f9f9f9'><xmp>$comment</xmp></td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } function JSTimer() ! { ! if (!EXECUTION_TIME_INFO) return ""; ! $timer_path = WebApp::to_url(TIMER_PATH); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\" src=\"".$timer_path."class.Timer.js\"></script> <script type=\"text/javascript\" language=\"javascript\"> *************** *** 113,122 **** </script> "; ! return $js_code; ! } function JSTimer_toHtmlTable() ! { ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ --- 114,123 ---- </script> "; ! return $js_code; ! } function JSTimer_toHtmlTable() ! { ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ *************** *** 128,133 **** </script> "; ! return $js_code; ! } } ?> \ No newline at end of file --- 129,134 ---- </script> "; ! return $js_code; ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:18
|
Update of /cvsroot/phpwebapp/web_app/webobjects/listbox In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/webobjects/listbox Modified Files: listbox.php Log Message: reformated and modified the copyleft notice Index: listbox.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/webobjects/listbox/listbox.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** listbox.php 25 Aug 2003 13:18:28 -0000 1.3 --- listbox.php 22 Jul 2004 16:25:36 -0000 1.4 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 9,15 **** { function onRender() ! { ! } } ?> \ No newline at end of file --- 28,34 ---- { function onRender() ! { ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:52
|
Update of /cvsroot/phpwebapp/web_app/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/convert Modified Files: class.Template.php class.Render.php class.Parser.php Log Message: reformated and modified the copyleft notice Index: class.Template.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/class.Template.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** class.Template.php 20 Jul 2004 16:51:14 -0000 1.1 --- class.Template.php 22 Jul 2004 16:25:38 -0000 1.2 *************** *** 1,3 **** --- 1,24 ---- <?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 + */ + class Template { Index: class.Render.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/class.Render.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** class.Render.php 21 Jul 2004 17:04:31 -0000 1.2 --- class.Render.php 22 Jul 2004 16:25:38 -0000 1.3 *************** *** 1,3 **** --- 1,25 ---- <?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 + */ + + class Render { Index: class.Parser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/class.Parser.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** class.Parser.php 20 Jul 2004 16:51:14 -0000 1.1 --- class.Parser.php 22 Jul 2004 16:25:38 -0000 1.2 *************** *** 1,3 **** --- 1,25 ---- <?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 + */ + + class Parser { *************** *** 12,42 **** function Parser() ! { ! $this->tpl_stack = array(); ! $this->current_tpl = UNDEFINED; ! } function parse_file($filename) ! { ! if ( !file_exists($filename) ) ! { ! print "'$filename' not found\n"; ! return UNDEFINED; ! } ! $tpl = new Template; ! $this->fp = fopen($filename, "r"); //open file ! //parse the file into $tpl ! $this->push($tpl); ! $this->parse(); ! $tpl = $this->pop(); ! //close the file ! fclose($this->fp); ! return $tpl; ! } /** --- 34,64 ---- function Parser() ! { ! $this->tpl_stack = array(); ! $this->current_tpl = UNDEFINED; ! } function parse_file($filename) ! { ! if ( !file_exists($filename) ) ! { ! print "'$filename' not found\n"; ! return UNDEFINED; ! } ! $tpl = new Template; ! $this->fp = fopen($filename, "r"); //open file ! //parse the file into $tpl ! $this->push($tpl); ! $this->parse(); ! $tpl = $this->pop(); ! //close the file ! fclose($this->fp); ! return $tpl; ! } /** *************** *** 45,57 **** */ function parse() ! { ! $closing_tag = false; ! while (!$closing_tag and !feof($this->fp)) ! { ! $line = $this->get_line(); ! if ($line=='') continue; ! $closing_tag = $this->parse_line($line); ! } ! } /** --- 67,79 ---- */ function parse() ! { ! $closing_tag = false; ! while (!$closing_tag and !feof($this->fp)) ! { ! $line = $this->get_line(); ! if ($line=='') continue; ! $closing_tag = $this->parse_line($line); ! } ! } /** *************** *** 62,93 **** */ function parse_line($line) ! { ! $tag = Parser::get_tag_name($line); ! switch ($tag) ! { ! default: ! $this->add_line($line); ! break; ! case "<Repeat": ! $this->parse_Repeat($line); ! break; ! case "</Repeat": ! $this->add_line($line); ! return true; ! break; ! case "<Header": ! case "<Footer": ! $this->parse_Repeat_subtpl($line); ! break; ! case "</Header": ! case "</Footer": ! return true; ! break; ! } ! return false; ! } /** --- 84,115 ---- */ function parse_line($line) ! { ! $tag = Parser::get_tag_name($line); ! switch ($tag) ! { ! default: ! $this->add_line($line); ! break; ! case "<Repeat": ! $this->parse_Repeat($line); ! break; ! case "</Repeat": ! $this->add_line($line); ! return true; ! break; ! case "<Header": ! case "<Footer": ! $this->parse_Repeat_subtpl($line); ! break; ! case "</Header": ! case "</Footer": ! return true; ! break; ! } ! return false; ! } /** *************** *** 96,106 **** */ function push(&$tpl) ! { ! //push the current_tpl on tpl_stack ! array_push($this->tpl_stack, $this->current_tpl); ! //make current the new template ! $this->current_tpl = &$tpl; ! } /** --- 118,128 ---- */ function push(&$tpl) ! { ! //push the current_tpl on tpl_stack ! array_push($this->tpl_stack, $this->current_tpl); ! //make current the new template ! $this->current_tpl = &$tpl; ! } /** *************** *** 109,177 **** */ function pop() ! { ! //pop the last template from tpl_stack into current_tpl ! $tpl = $this->current_tpl; ! $last = count($this->tpl_stack) - 1; ! $this->current_tpl = &$this->tpl_stack[$last]; ! array_pop($this->tpl_stack); ! //add the template in the template collection ! global $tpl_collection; ! $tpl_collection[$tpl->id] = $tpl; ! return $tpl; ! } function parse_Repeat($line) ! { ! $tpl = new Template('RepeatTpl'); ! $tpl->header = new Template; ! $tpl->footer = new Template; ! //set a pointer from this template to the new template ! $this->add_line("##\n"); ! $this->add_line($tpl->id."\n"); ! //parse the new template into $tpl ! $this->push($tpl); ! $this->add_line($line); ! $this->parse(); ! $this->pop(); ! } /** Parse <Header> and <Footer> */ function parse_Repeat_subtpl($line) ! { ! $tag = Parser::get_tag_name($line); ! $tag = substr($tag, 1); ! $tpl = new Template; ! $this->push($tpl); ! $this->parse(); ! $tpl = $this->pop(); ! switch ($tag) ! { ! case "Header": ! $this->current_tpl->header = $tpl; ! break; ! case "Footer": ! $this->current_tpl->footer = $tpl; ! break; ! } ! } /** returns a line from the file that is being parsed */ function get_line() ! { ! $line = fgets($this->fp,896); ! return $line; ! } /** add a line to the current template */ function add_line($line) ! { ! $this->current_tpl->content[] = $line; ! } /** --- 131,199 ---- */ function pop() ! { ! //pop the last template from tpl_stack into current_tpl ! $tpl = $this->current_tpl; ! $last = count($this->tpl_stack) - 1; ! $this->current_tpl = &$this->tpl_stack[$last]; ! array_pop($this->tpl_stack); ! //add the template in the template collection ! global $tpl_collection; ! $tpl_collection[$tpl->id] = $tpl; ! return $tpl; ! } function parse_Repeat($line) ! { ! $tpl = new Template('RepeatTpl'); ! $tpl->header = new Template; ! $tpl->footer = new Template; ! //set a pointer from this template to the new template ! $this->add_line("##\n"); ! $this->add_line($tpl->id."\n"); ! //parse the new template into $tpl ! $this->push($tpl); ! $this->add_line($line); ! $this->parse(); ! $this->pop(); ! } /** Parse <Header> and <Footer> */ function parse_Repeat_subtpl($line) ! { ! $tag = Parser::get_tag_name($line); ! $tag = substr($tag, 1); ! $tpl = new Template; ! $this->push($tpl); ! $this->parse(); ! $tpl = $this->pop(); ! switch ($tag) ! { ! case "Header": ! $this->current_tpl->header = $tpl; ! break; ! case "Footer": ! $this->current_tpl->footer = $tpl; ! break; ! } ! } /** returns a line from the file that is being parsed */ function get_line() ! { ! $line = fgets($this->fp,896); ! return $line; ! } /** add a line to the current template */ function add_line($line) ! { ! $this->current_tpl->content[] = $line; ! } /** *************** *** 181,195 **** */ function get_tag_name($line) ! { ! $line = trim($line); ! if ( ereg("^(</?[^[:space:] >]*)", $line, $regs) ) ! { ! return $regs[1]; ! } ! else ! { ! return UNDEFINED; ! } ! } /** --- 203,217 ---- */ function get_tag_name($line) ! { ! $line = trim($line); ! if ( ereg("^(</?[^[:space:] >]*)", $line, $regs) ) ! { ! return $regs[1]; ! } ! else ! { ! return UNDEFINED; ! } ! } /** *************** *** 199,215 **** */ function get_attr_value($line, $attrib) ! { ! $line = trim($line); ! $pattern = '[[:space:]]+'.$attrib.'[[:space:]]*=[[:space:]]*"([^"]*)"'; ! if ( ereg($pattern, $line, $regs) ) ! { ! $attr = $regs[1]; ! return $attr; ! } ! else ! { ! return UNDEFINED; ! } ! } } ?> \ No newline at end of file --- 221,237 ---- */ function get_attr_value($line, $attrib) ! { ! $line = trim($line); ! $pattern = '[[:space:]]+'.$attrib.'[[:space:]]*=[[:space:]]*"([^"]*)"'; ! if ( ereg($pattern, $line, $regs) ) ! { ! $attr = $regs[1]; ! return $attr; ! } ! else ! { ! return UNDEFINED; ! } ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:52
|
Update of /cvsroot/phpwebapp/web_app/boxes/codeViewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/boxes/codeViewer Modified Files: codeViewer.php Log Message: reformated and modified the copyleft notice Index: codeViewer.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/codeViewer/codeViewer.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** codeViewer.php 25 Aug 2003 13:18:35 -0000 1.6 --- codeViewer.php 22 Jul 2004 16:25:39 -0000 1.7 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,43 **** { function onRender() ! { ! $file = $this->getSVar("codeFile"); ! $lines = $this->getSVar("showLines"); ! if ($lines==UNDEFINED) $lines=""; ! $highlights = $this->getSVar("highlightLines"); ! if ($highlights==UNDEFINED) $highlights=""; ! $this->add_line_recordset($file, $show_nr, $lines, $highlights); ! $show_nr = $this->getSVar("showLineNr"); ! if ($show_nr==UNDEFINED) $show_nr=false; ! WebApp::addVar("show_nr", ($show_nr ? "true" : "false")); ! } /** --- 29,44 ---- { function onRender() ! { ! $file = $this->getSVar("codeFile"); ! $lines = $this->getSVar("showLines"); ! if ($lines==UNDEFINED) $lines=""; ! $highlights = $this->getSVar("highlightLines"); ! if ($highlights==UNDEFINED) $highlights=""; ! $this->add_line_recordset($file, $show_nr, $lines, $highlights); ! $show_nr = $this->getSVar("showLineNr"); ! if ($show_nr==UNDEFINED) $show_nr=false; ! WebApp::addVar("show_nr", ($show_nr ? "true" : "false")); ! } /** *************** *** 46,128 **** */ function add_line_recordset($file, $show_nr, $lines, $highlights) ! { ! ////create a code colorizer object ! //$highlighter = $this->initColorizer(); ! $code_lines = file($file); ! if ($lines=="") //display all the lines ! { ! $display_ranges[] = array("start"=>1, "end"=>sizeof($code_lines) ); ! } ! else ! { ! $display_ranges = $this->getRanges($lines); ! } ! $highlight_ranges = $this->getRanges($highlights); ! $rs = new EditableRS("lines"); ! //for each range of lines ! $nr_ranges = sizeof($display_ranges); ! for ($r=1; $r <= $nr_ranges; $r++) ! { ! $range = $display_ranges[$r-1]; ! $start_line = $range["start"]; ! $end_line = $range["end"]; ! //for each line in the range ! for ($line_nr=$start_line; $line_nr<=$end_line; $line_nr++) ! { ! $line = $code_lines[$line_nr-1]; ! $html_line = $this->get_html_line($line); ! //if the line is highlighted use other styles ! if ($this->inRange($line_nr, $highlight_ranges)) ! { ! $cssClass_nr = "codeViewer-nr-highlighted"; ! $cssClass_line = "codeViewer-line-highlighted"; ! } ! else ! { ! $cssClass_nr = "codeViewer-nr"; ! $cssClass_line = "codeViewer-line"; ! } ! //add line to recordset ! $rec = array( ! "nr" => $line_nr, ! "class-nr" => $cssClass_nr, ! "line" => $html_line, ! "class-line" => $cssClass_line ! ); ! $rs->addRec($rec); ! } ! //add a separating line after each range ! //(except for the last one) ! if ($r < $nr_ranges) ! { ! $rec = array( ! "nr" => "--", ! "class-nr" => "codeViewer-nr", ! "line" => "----------", ! "class-line" => "codeViewer-line" ! ); ! $rs->addRec($rec); ! } ! } ! global $webPage; ! $webPage->addRecordset($rs); ! } function get_html_line($line) ! { ! $line = chop($line); ! $line = str_replace("\t", " ", $line); ! $line = str_replace("{{", "{{#", $line); ! $line = htmlentities($line); ! if ($line=="") $line=" "; ! return $line; ! } /** --- 47,129 ---- */ function add_line_recordset($file, $show_nr, $lines, $highlights) ! { ! ////create a code colorizer object ! //$highlighter = $this->initColorizer(); ! $code_lines = file($file); ! if ($lines=="") //display all the lines ! { ! $display_ranges[] = array("start"=>1, "end"=>sizeof($code_lines) ); ! } ! else ! { ! $display_ranges = $this->getRanges($lines); ! } ! $highlight_ranges = $this->getRanges($highlights); ! $rs = new EditableRS("lines"); ! //for each range of lines ! $nr_ranges = sizeof($display_ranges); ! for ($r=1; $r <= $nr_ranges; $r++) ! { ! $range = $display_ranges[$r-1]; ! $start_line = $range["start"]; ! $end_line = $range["end"]; ! //for each line in the range ! for ($line_nr=$start_line; $line_nr<=$end_line; $line_nr++) ! { ! $line = $code_lines[$line_nr-1]; ! $html_line = $this->get_html_line($line); ! //if the line is highlighted use other styles ! if ($this->inRange($line_nr, $highlight_ranges)) ! { ! $cssClass_nr = "codeViewer-nr-highlighted"; ! $cssClass_line = "codeViewer-line-highlighted"; ! } ! else ! { ! $cssClass_nr = "codeViewer-nr"; ! $cssClass_line = "codeViewer-line"; ! } ! //add line to recordset ! $rec = array( ! "nr" => $line_nr, ! "class-nr" => $cssClass_nr, ! "line" => $html_line, ! "class-line" => $cssClass_line ! ); ! $rs->addRec($rec); ! } ! //add a separating line after each range ! //(except for the last one) ! if ($r < $nr_ranges) ! { ! $rec = array( ! "nr" => "--", ! "class-nr" => "codeViewer-nr", ! "line" => "----------", ! "class-line" => "codeViewer-line" ! ); ! $rs->addRec($rec); ! } ! } ! global $webPage; ! $webPage->addRecordset($rs); ! } function get_html_line($line) ! { ! $line = chop($line); ! $line = str_replace("\t", " ", $line); ! $line = str_replace("{{", "{{#", $line); ! $line = htmlentities($line); ! if ($line=="") $line=" "; ! return $line; ! } /** *************** *** 131,146 **** */ function getRanges($line_ranges) ! { ! $ranges = explode(",", $line_ranges); ! while (list($i,$range) = each($ranges)) ! { ! list($start,$end) = explode("-", $range); ! if ($end=="") $end = $start; ! $arr_ranges[$i]["start"] = $start; ! $arr_ranges[$i]["end"] = $end; ! } ! return $arr_ranges; ! } /** --- 132,147 ---- */ function getRanges($line_ranges) ! { ! $ranges = explode(",", $line_ranges); ! while (list($i,$range) = each($ranges)) ! { ! list($start,$end) = explode("-", $range); ! if ($end=="") $end = $start; ! $arr_ranges[$i]["start"] = $start; ! $arr_ranges[$i]["end"] = $end; ! } ! return $arr_ranges; ! } /** *************** *** 149,178 **** */ function inRange($number, $arr_ranges) ! { ! while (list($i,$range) = each($arr_ranges)) ! { ! $start = $range["start"]; ! $end = $range["end"]; ! if (($number >= $start) and ($number <= $end)) ! { ! return true; ! } ! } ! return false; ! } /** load, initialize and return the code colorizer */ function initColorizer() ! { ! global $BEAUT_PATH; ! $BEAUT_PATH = CODEVIEWER_PATH."codeColorizer"; ! require_once "$BEAUT_PATH/Beautifier/Core.php"; ! require_once "$BEAUT_PATH/HFile/HFile_mixedphp.php"; ! require_once "$BEAUT_PATH/Output/Output_HTML.php"; ! $highlighter = new Core(new HFile_plain(), new Output_HTML()); ! return $highlighter; ! } } ?> \ No newline at end of file --- 150,179 ---- */ function inRange($number, $arr_ranges) ! { ! while (list($i,$range) = each($arr_ranges)) ! { ! $start = $range["start"]; ! $end = $range["end"]; ! if (($number >= $start) and ($number <= $end)) ! { ! return true; ! } ! } ! return false; ! } /** load, initialize and return the code colorizer */ function initColorizer() ! { ! global $BEAUT_PATH; ! $BEAUT_PATH = CODEVIEWER_PATH."codeColorizer"; ! require_once "$BEAUT_PATH/Beautifier/Core.php"; ! require_once "$BEAUT_PATH/HFile/HFile_mixedphp.php"; ! require_once "$BEAUT_PATH/Output/Output_HTML.php"; ! $highlighter = new Core(new HFile_plain(), new Output_HTML()); ! return $highlighter; ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:52
|
Update of /cvsroot/phpwebapp/web_app/boxes/folderListing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/boxes/folderListing Modified Files: folderListing.php Log Message: reformated and modified the copyleft notice Index: folderListing.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/folderListing/folderListing.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** folderListing.php 25 Aug 2003 13:18:33 -0000 1.4 --- folderListing.php 22 Jul 2004 16:25:39 -0000 1.5 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,96 **** { function init() ! { ! $this->addSVar("fileFilter", ".*"); ! $this->addSVar("root", APP_PATH); ! $this->addSVar("currentPath", ""); ! $this->addSVar("selectedFile", "{{FOLDERLISTING_PATH}}empty.html"); ! } function eventHandler($event) ! { ! switch ($event->name) ! { ! case "changeRoot": ! $root_folder = $event->args["root_folder"]; ! if (substr($root_folder, -1)<>"/") $root_folder .= "/"; ! $this->setSVar("root", $root_folder); ! $this->setSVar("currentPath", ""); ! break; ! case "path": ! $current_path = $event->args["path"]; ! $this->setSVar("currentPath", $current_path); ! break; ! case "up": ! $current_path = $this->getSVar("currentPath"); ! $current_path = ereg_replace("[^/]*/$", "", $current_path); ! $this->setSVar("currentPath", $current_path); ! break; ! case "root": ! $this->setSVar("currentPath", ""); ! break; ! case "folder": ! $folder_name = $event->args["folder_name"]; ! $current_path = $this->getSVar("currentPath"); ! $current_path .= $folder_name."/"; ! $this->setSVar("currentPath", $current_path); ! break; ! case "file": ! $root = $this->getSVar("root"); ! $path = $this->getSVar("currentPath"); ! $file_name = $event->args["file_name"]; ! $this->setSVar("selectedFile", $root.$path.$file_name); ! break; ! } ! } function onRender() ! { ! $root = $this->getSVar("root"); ! $path = $this->getSVar("currentPath"); ! $filter = $this->getSVar("fileFilter"); ! list($rs_folders,$rs_files) = $this->readFolder($root.$path, $filter); ! $rs_paths = $this->get_path_rs($path); ! $rs_paths->ID = "paths"; ! $rs_folders->ID = "folders"; ! $rs_files->ID = "files"; ! global $webPage; ! $webPage->addRecordset($rs_paths); ! $webPage->addRecordset($rs_folders); ! $webPage->addRecordset($rs_files); ! } /** --- 29,97 ---- { function init() ! { ! $this->addSVar("fileFilter", ".*"); ! $this->addSVar("root", APP_PATH); ! $this->addSVar("currentPath", ""); ! $this->addSVar("selectedFile", "{{FOLDERLISTING_PATH}}empty.html"); ! } function eventHandler($event) ! { ! switch ($event->name) ! { ! case "changeRoot": ! $root_folder = $event->args["root_folder"]; ! if (substr($root_folder, -1)<>"/") $root_folder .= "/"; ! $this->setSVar("root", $root_folder); ! $this->setSVar("currentPath", ""); ! break; ! case "path": ! $current_path = $event->args["path"]; ! $this->setSVar("currentPath", $current_path); ! break; ! case "up": ! $current_path = $this->getSVar("currentPath"); ! $current_path = ereg_replace("[^/]*/$", "", $current_path); ! $this->setSVar("currentPath", $current_path); ! break; ! case "root": ! $this->setSVar("currentPath", ""); ! break; ! case "folder": ! $folder_name = $event->args["folder_name"]; ! $current_path = $this->getSVar("currentPath"); ! $current_path .= $folder_name."/"; ! $this->setSVar("currentPath", $current_path); ! break; ! case "file": ! $root = $this->getSVar("root"); ! $path = $this->getSVar("currentPath"); ! $file_name = $event->args["file_name"]; ! $this->setSVar("selectedFile", $root.$path.$file_name); ! break; ! } ! } function onRender() ! { ! $root = $this->getSVar("root"); ! $path = $this->getSVar("currentPath"); ! $filter = $this->getSVar("fileFilter"); ! list($rs_folders,$rs_files) = $this->readFolder($root.$path, $filter); ! $rs_paths = $this->get_path_rs($path); ! $rs_paths->ID = "paths"; ! $rs_folders->ID = "folders"; ! $rs_files->ID = "files"; ! global $webPage; ! $webPage->addRecordset($rs_paths); ! $webPage->addRecordset($rs_folders); ! $webPage->addRecordset($rs_files); ! } /** *************** *** 99,160 **** */ function readFolder($folder_path, $filter) ! { ! if (filetype($folder_path) <> 'dir') ! { ! print WebApp::error_msg("'$folder_path' is not a folder."); ! return; ! } ! $dir = opendir($folder_path); ! if (!$dir) ! { ! print WebApp::error_msg("Cannot open folder '$folder_path'."); ! return; ! } ! $rs_folders = new EditableRS; ! $rs_folders->Open(); ! $rs_files = new EditableRS; ! $rs_files->Open(); ! if ( substr($folder_path, -1) <> "/" ) $folder_path .= "/"; ! while ($fname = readdir($dir)) ! { ! if (filetype($folder_path.$fname) == 'dir') ! { ! if ($fname=="." or $fname==".." or $fname=="CVS") continue; ! $rs_folders->addRec(array("folder"=>$fname)); ! } ! else if (filetype($folder_path.$fname) == 'file') ! { ! if ( eregi($filter,$fname) ) ! { ! $rs_files->addRec(array("file"=>$fname)); ! } ! } ! } ! closedir($dir); ! return array($rs_folders, $rs_files); ! } /** $path is a string like this: "folder1/folder2/folder3/" */ function get_path_rs($path) ! { ! $rs_paths = new EditableRS; ! $rs_paths->Open(); ! $rec = array("folder"=>"Root", "path"=>""); ! $rs_paths->addRec($rec); ! $folders = explode("/", $path); ! $folder_path = ""; ! for ($i=0; $i < sizeof($folders) - 1; $i++) ! { ! $folder_path .= $folders[$i] . "/"; ! $rec = array("folder"=>$folders[$i], "path"=>$folder_path); ! $rs_paths->addRec($rec); ! } ! return $rs_paths; ! } } ?> \ No newline at end of file --- 100,161 ---- */ function readFolder($folder_path, $filter) ! { ! if (filetype($folder_path) <> 'dir') ! { ! print WebApp::error_msg("'$folder_path' is not a folder."); ! return; ! } ! $dir = opendir($folder_path); ! if (!$dir) ! { ! print WebApp::error_msg("Cannot open folder '$folder_path'."); ! return; ! } ! $rs_folders = new EditableRS; ! $rs_folders->Open(); ! $rs_files = new EditableRS; ! $rs_files->Open(); ! if ( substr($folder_path, -1) <> "/" ) $folder_path .= "/"; ! while ($fname = readdir($dir)) ! { ! if (filetype($folder_path.$fname) == 'dir') ! { ! if ($fname=="." or $fname==".." or $fname=="CVS") continue; ! $rs_folders->addRec(array("folder"=>$fname)); ! } ! else if (filetype($folder_path.$fname) == 'file') ! { ! if ( eregi($filter,$fname) ) ! { ! $rs_files->addRec(array("file"=>$fname)); ! } ! } ! } ! closedir($dir); ! return array($rs_folders, $rs_files); ! } /** $path is a string like this: "folder1/folder2/folder3/" */ function get_path_rs($path) ! { ! $rs_paths = new EditableRS; ! $rs_paths->Open(); ! $rec = array("folder"=>"Root", "path"=>""); ! $rs_paths->addRec($rec); ! $folders = explode("/", $path); ! $folder_path = ""; ! for ($i=0; $i < sizeof($folders) - 1; $i++) ! { ! $folder_path .= $folders[$i] . "/"; ! $rec = array("folder"=>$folders[$i], "path"=>$folder_path); ! $rs_paths->addRec($rec); ! } ! return $rs_paths; ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:52
|
Update of /cvsroot/phpwebapp/web_app/boxes/fileView In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/boxes/fileView Modified Files: viewUnknown.php viewPHP.php viewImage.php fileView.php Log Message: reformated and modified the copyleft notice Index: viewUnknown.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/viewUnknown.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** viewUnknown.php 25 Aug 2003 13:18:33 -0000 1.4 --- viewUnknown.php 22 Jul 2004 16:25:39 -0000 1.5 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 9,18 **** { function onRender() ! { ! $file_path = WebApp::getSVar("fileView->file"); ! $url_path = WebApp::to_url($file_path); ! WebApp::addVar("url", $url_path); ! WebApp::addVar("fileName", basename($file_path)); ! } } ?> \ No newline at end of file --- 28,37 ---- { function onRender() ! { ! $file_path = WebApp::getSVar("fileView->file"); ! $url_path = WebApp::to_url($file_path); ! WebApp::addVar("url", $url_path); ! WebApp::addVar("fileName", basename($file_path)); ! } } ?> \ No newline at end of file Index: viewPHP.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/viewPHP.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** viewPHP.php 25 Aug 2003 13:18:33 -0000 1.3 --- viewPHP.php 22 Jul 2004 16:25:39 -0000 1.4 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 9,16 **** { function onRender() ! { ! $file_name = WebApp::getSVar("fileView->file"); ! show_source($file_name); ! } } ?> --- 28,35 ---- { function onRender() ! { ! $file_name = WebApp::getSVar("fileView->file"); ! show_source($file_name); ! } } ?> Index: viewImage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/viewImage.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** viewImage.php 25 Aug 2003 13:18:33 -0000 1.4 --- viewImage.php 22 Jul 2004 16:25:39 -0000 1.5 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 9,17 **** { function onRender() ! { ! $file_path = WebApp::getSVar("fileView->file"); ! $img_url = WebApp::to_url($file_path); ! WebApp::addVar("image_src", $img_url); ! } } ?> --- 28,36 ---- { function onRender() ! { ! $file_path = WebApp::getSVar("fileView->file"); ! $img_url = WebApp::to_url($file_path); ! WebApp::addVar("image_src", $img_url); ! } } ?> Index: fileView.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/fileView/fileView.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fileView.php 25 Aug 2003 13:18:33 -0000 1.5 --- fileView.php 22 Jul 2004 16:25:39 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,134 **** { function init() ! { ! $curr_path = dirname(__FILE__); ! $this->addSVar("file", $curr_path."/sample_file.html"); ! } function onParse() ! { ! $file_name = $this->getSVar("file"); ! $file_type = $this->get_file_type($file_name); ! $template = $this->get_template($file_type); ! //set the template that will be used to display the file ! WebApp::addVar("template", $template); ! } /** Returns the type of the given file. */ function get_file_type($file_name) ! { ! ereg("(\.[^.]*)$", $file_name, $regs); ! $ext = $regs[1]; ! switch ($ext) ! { ! case ".html": ! case ".htm": ! $file_type = "HTML"; ! break; ! case ".gif": ! case ".jpg": ! case ".png": ! $file_type = "IMG"; ! break; ! case ".txt": ! $file_type = "TXT"; ! break; ! case ".php": ! case ".php3": ! case ".php4": ! $file_type = "PHP"; ! break; ! case ".js": ! $file_type = "JS"; ! break; ! case ".css": ! $file_type = "CSS"; ! break; ! default: ! $file_type = "UNKNOWN"; ! break; ! } ! return $file_type; ! } /** Returns the template that will be used to display * a file of the given type */ function get_template($file_type) ! { ! global $session; ! $path = WebApp::getVar("./"); ! switch ($file_type) ! { ! case "PHP": ! //PHP is always displayed as code ! $template = $path."viewPHP.html"; ! break; ! case "IMG": ! //Images are always displayed in preview mode ! $template = $path."viewImage.html"; ! break; ! case "JS": ! case "CSS": ! case "TXT": ! //Text is always displayed in code view mode ! $file_name = $this->getSVar("file"); ! WebApp::setSVar("codeViewer->codeFile", $file_name); ! $template = CODEVIEWER_PATH."codeViewer.html"; ! break; ! case "HTML": ! //Html is displayed either in code view ! //or in preview mode, depending on 'codeView' variable ! $codeView = WebApp::getSVar("panel->codeView"); ! if ($codeView=="true") ! { ! $file_name = $this->getSVar("file"); ! WebApp::setSVar("codeViewer->codeFile", $file_name); ! $template = CODEVIEWER_PATH."codeViewer.html"; ! } ! else ! { ! $template = $path."viewHtml.html"; ! } ! break; ! default: ! case "UNKNOWN": ! $template = $path."viewUnknown.html"; ! break; ! } ! return $template; ! } } ?> --- 29,135 ---- { function init() ! { ! $curr_path = dirname(__FILE__); ! $this->addSVar("file", $curr_path."/sample_file.html"); ! } function onParse() ! { ! $file_name = $this->getSVar("file"); ! $file_type = $this->get_file_type($file_name); ! $template = $this->get_template($file_type); ! //set the template that will be used to display the file ! WebApp::addVar("template", $template); ! } /** Returns the type of the given file. */ function get_file_type($file_name) ! { ! ereg("(\.[^.]*)$", $file_name, $regs); ! $ext = $regs[1]; ! switch ($ext) ! { ! case ".html": ! case ".htm": ! $file_type = "HTML"; ! break; ! case ".gif": ! case ".jpg": ! case ".png": ! $file_type = "IMG"; ! break; ! case ".txt": ! $file_type = "TXT"; ! break; ! case ".php": ! case ".php3": ! case ".php4": ! $file_type = "PHP"; ! break; ! case ".js": ! $file_type = "JS"; ! break; ! case ".css": ! $file_type = "CSS"; ! break; ! default: ! $file_type = "UNKNOWN"; ! break; ! } ! return $file_type; ! } /** Returns the template that will be used to display * a file of the given type */ function get_template($file_type) ! { ! global $session; ! $path = WebApp::getVar("./"); ! switch ($file_type) ! { ! case "PHP": ! //PHP is always displayed as code ! $template = $path."viewPHP.html"; ! break; ! case "IMG": ! //Images are always displayed in preview mode ! $template = $path."viewImage.html"; ! break; ! case "JS": ! case "CSS": ! case "TXT": ! //Text is always displayed in code view mode ! $file_name = $this->getSVar("file"); ! WebApp::setSVar("codeViewer->codeFile", $file_name); ! $template = CODEVIEWER_PATH."codeViewer.html"; ! break; ! case "HTML": ! //Html is displayed either in code view ! //or in preview mode, depending on 'codeView' variable ! $codeView = WebApp::getSVar("panel->codeView"); ! if ($codeView=="true") ! { ! $file_name = $this->getSVar("file"); ! WebApp::setSVar("codeViewer->codeFile", $file_name); ! $template = CODEVIEWER_PATH."codeViewer.html"; ! } ! else ! { ! $template = $path."viewHtml.html"; ! } ! break; ! default: ! case "UNKNOWN": ! $template = $path."viewUnknown.html"; ! break; ! } ! return $template; ! } } ?> |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:51
|
Update of /cvsroot/phpwebapp/web_app/append In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/append Modified Files: wbMessages.php wbDebug.php wbDbgTemplates.php wbDbgStatevars.php Log Message: reformated and modified the copyleft notice Index: wbMessages.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/wbMessages.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wbMessages.php 25 Aug 2003 13:18:37 -0000 1.3 --- wbMessages.php 22 Jul 2004 16:25:39 -0000 1.4 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 8,16 **** { function onRender() ! { ! global $webPage; ! $messages = $webPage->messages_to_js(); ! WebApp::addVar("MESSAGES", $messages); ! } } ?> \ No newline at end of file --- 27,35 ---- { function onRender() ! { ! global $webPage; ! $messages = $webPage->messages_to_js(); ! WebApp::addVar("MESSAGES", $messages); ! } } ?> \ No newline at end of file Index: wbDebug.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/wbDebug.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wbDebug.php 15 Jul 2004 13:36:13 -0000 1.6 --- wbDebug.php 22 Jul 2004 16:25:39 -0000 1.7 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 8,15 **** { function onRender() ! { ! global $webPage; ! $debug_goto = ' <script type="text/javascript" language="javascript"> //<![CDATA[ --- 27,34 ---- { function onRender() ! { ! global $webPage; ! $debug_goto = ' <script type="text/javascript" language="javascript"> //<![CDATA[ *************** *** 18,32 **** </script> '; ! WebApp::addVar("debug_goto", $debug_goto); ! $webPage->print_dbg_messages(); ! $debug_recordsets = (DEBUG_RECORDSETS ? $webPage->recordsets_to_html() : ""); ! WebApp::addVar("debug_recordsets", $debug_recordsets); ! $webPage->timer->Stop("WebApp"); ! $timer_results = (EXECUTION_TIME_INFO ? $webPage->timer->toHtmlTable() : ""); ! WebApp::addVar("timer_results", $timer_results); ! } } ?> \ No newline at end of file --- 37,51 ---- </script> '; ! WebApp::addVar("debug_goto", $debug_goto); ! $webPage->print_dbg_messages(); ! $debug_recordsets = (DEBUG_RECORDSETS ? $webPage->recordsets_to_html() : ""); ! WebApp::addVar("debug_recordsets", $debug_recordsets); ! $webPage->timer->Stop("WebApp"); ! $timer_results = (EXECUTION_TIME_INFO ? $webPage->timer->toHtmlTable() : ""); ! WebApp::addVar("timer_results", $timer_results); ! } } ?> \ No newline at end of file Index: wbDbgTemplates.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/wbDbgTemplates.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wbDbgTemplates.php 25 Aug 2003 13:18:38 -0000 1.3 --- wbDbgTemplates.php 22 Jul 2004 16:25:39 -0000 1.4 *************** *** 1,4 **** <?php ! /* This file is part of phpWebApp. */ /** --- 1,23 ---- <?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 ! */ /** *************** *** 8,18 **** { function onRender() ! { ! if (!DEBUG_TEMPLATES) return; ! global $webPage; ! print $webPage->tpl_to_tree(); ! print $webPage->template_list(); ! } } ?> \ No newline at end of file --- 27,37 ---- { function onRender() ! { ! if (!DEBUG_TEMPLATES) return; ! global $webPage; ! print $webPage->tpl_to_tree(); ! print $webPage->template_list(); ! } } ?> \ No newline at end of file Index: wbDbgStatevars.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/wbDbgStatevars.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wbDbgStatevars.php 15 Jul 2004 14:46:04 -0000 1.8 --- wbDbgStatevars.php 22 Jul 2004 16:25:39 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 27,122 **** { function onRender() ! { ! if (!DEBUG_STATEVARS) return; ! print $this->webobjects_to_tree(); ! print $this->webobjects_to_html(); ! } function webobjects_to_tree() ! { ! $tree = "<hr />\n"; ! $tree .= "<a name='tree' id='tree'> </a>"; ! $tree .= "<strong>WebObjects and their state variables:</strong>\n"; ! $tree .= "<pre>"; ! global $webPage; ! $id = $webPage->rootTpl->id; ! $tpl = $webPage->rootTpl->body; ! $indent = " "; ! $tree .= $indent."+--><a href='#session'>".$id."</a>\n"; ! $arr_tpl_id = $tpl->get_subtemplates(); ! for ($i=0; $i < sizeof($arr_tpl_id); $i++) ! { ! $tpl_id = $arr_tpl_id[$i]; ! //don't display the webobjects of append ! if (strpos('append.html', $tpl_id)) ! { ! $tree .= "</pre>\n"; ! return $tree; ! } ! $subtpl = $webPage->getTemplate($tpl_id); ! //increase the indentation if the template is a webobject ! $indent_1 = ($subtpl->type=="WebObjectTpl") ! ? $indent . "| " ! : $indent; ! $tree .= $this->webobj_to_tree($subtpl, $indent_1); ! } ! $tree .= "</pre>\n"; ! return $tree; ! } /** returns the structure of the parsed objects as a tree */ function webobj_to_tree($tpl, $indent) ! { ! global $webPage; ! //display only if it is a webobject template ! if ($tpl->type=="WebObjectTpl") ! { ! $tree = $indent."|\n"; ! $tree .= $indent."+--><a href='#".$tpl->id."'>".$tpl->id."</a>\n"; ! } ! $arr_tpl_id = $tpl->get_subtemplates(); ! for ($i=0; $i < sizeof($arr_tpl_id); $i++) ! { ! $tpl_id = $arr_tpl_id[$i]; ! $subtpl = $webPage->getTemplate($tpl_id); ! //increase the indentation if the template is a webobject ! $indent_1 = ( ($subtpl->type=="WebObjectTpl") ? ! $indent . "| " ! : $indent ); ! $tree .= $this->webobj_to_tree($subtpl, $indent_1); ! } ! return $tree; ! } function webobjects_to_html() ! { ! global $session, $webPage; ! $html = $session->to_HTML_table(); ! reset($webPage->tpl_collection); ! while ( list($tplId,$tpl) = each($webPage->tpl_collection) ) ! { ! //don't display the webobjects of append ! if (ereg('web_app/append/append.html$', $tplId)) ! { ! return $html; ! $html .= "<hr />\n"; ! } ! if ($tpl->type=="WebObjectTpl") ! { ! $html .= $tpl->state2html(); ! } ! } ! $html .= "<hr />\n"; ! return $html; ! } } ?> \ No newline at end of file --- 28,123 ---- { function onRender() ! { ! if (!DEBUG_STATEVARS) return; ! print $this->webobjects_to_tree(); ! print $this->webobjects_to_html(); ! } function webobjects_to_tree() ! { ! $tree = "<hr />\n"; ! $tree .= "<a name='tree' id='tree'> </a>"; ! $tree .= "<strong>WebObjects and their state variables:</strong>\n"; ! $tree .= "<pre>"; ! global $webPage; ! $id = $webPage->rootTpl->id; ! $tpl = $webPage->rootTpl->body; ! $indent = " "; ! $tree .= $indent."+--><a href='#session'>".$id."</a>\n"; ! $arr_tpl_id = $tpl->get_subtemplates(); ! for ($i=0; $i < sizeof($arr_tpl_id); $i++) ! { ! $tpl_id = $arr_tpl_id[$i]; ! //don't display the webobjects of append ! if (strpos('append.html', $tpl_id)) ! { ! $tree .= "</pre>\n"; ! return $tree; ! } ! $subtpl = $webPage->getTemplate($tpl_id); ! //increase the indentation if the template is a webobject ! $indent_1 = ($subtpl->type=="WebObjectTpl") ! ? $indent . "| " ! : $indent; ! $tree .= $this->webobj_to_tree($subtpl, $indent_1); ! } ! $tree .= "</pre>\n"; ! return $tree; ! } /** returns the structure of the parsed objects as a tree */ function webobj_to_tree($tpl, $indent) ! { ! global $webPage; ! //display only if it is a webobject template ! if ($tpl->type=="WebObjectTpl") ! { ! $tree = $indent."|\n"; ! $tree .= $indent."+--><a href='#".$tpl->id."'>".$tpl->id."</a>\n"; ! } ! $arr_tpl_id = $tpl->get_subtemplates(); ! for ($i=0; $i < sizeof($arr_tpl_id); $i++) ! { ! $tpl_id = $arr_tpl_id[$i]; ! $subtpl = $webPage->getTemplate($tpl_id); ! //increase the indentation if the template is a webobject ! $indent_1 = ( ($subtpl->type=="WebObjectTpl") ? ! $indent . "| " ! : $indent ); ! $tree .= $this->webobj_to_tree($subtpl, $indent_1); ! } ! return $tree; ! } function webobjects_to_html() ! { ! global $session, $webPage; ! $html = $session->to_HTML_table(); ! reset($webPage->tpl_collection); ! while ( list($tplId,$tpl) = each($webPage->tpl_collection) ) ! { ! //don't display the webobjects of append ! if (ereg('web_app/append/append.html$', $tplId)) ! { ! return $html; ! $html .= "<hr />\n"; ! } ! if ($tpl->type=="WebObjectTpl") ! { ! $html .= $tpl->state2html(); ! } ! } ! $html .= "<hr />\n"; ! return $html; ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:50
|
Update of /cvsroot/phpwebapp/web_app/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/database Modified Files: package.DB.php class.TableRS.php class.StaticRS.php class.Recordset.php class.PagedRS.php class.MySQLCnn.php class.EditableRS.php class.Connection.php Log Message: reformated and modified the copyleft notice Index: package.DB.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/package.DB.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** package.DB.php 14 Jul 2004 14:45:41 -0000 1.9 --- package.DB.php 22 Jul 2004 16:25:38 -0000 1.10 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ Index: class.TableRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.TableRS.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** class.TableRS.php 8 Sep 2003 13:18:24 -0000 1.6 --- class.TableRS.php 22 Jul 2004 16:25:38 -0000 1.7 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 34,47 **** { function TableRS() ! { ! } function commit() ! { ! } function abord() ! { ! } } ?> \ No newline at end of file --- 35,48 ---- { function TableRS() ! { ! } function commit() ! { ! } function abord() ! { ! } } ?> \ No newline at end of file Index: class.StaticRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.StaticRS.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** class.StaticRS.php 8 Sep 2003 13:18:24 -0000 1.6 --- class.StaticRS.php 22 Jul 2004 16:25:38 -0000 1.7 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 38,57 **** function StaticRS($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! $this->Recordset($id, $query, $conn); ! $this->type = "StaticRS"; ! $this->opened = false; ! } function Open($conn =UNDEFINED) ! { ! if ($this->opened) ! { ! $this->MoveFirst(); ! return; //don't open it a second time ! } ! if ($this->query<>"") Recordset::Open($conn); ! $this->opened = true; ! } /** --- 39,58 ---- function StaticRS($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! $this->Recordset($id, $query, $conn); ! $this->type = "StaticRS"; ! $this->opened = false; ! } function Open($conn =UNDEFINED) ! { ! if ($this->opened) ! { ! $this->MoveFirst(); ! return; //don't open it a second time ! } ! if ($this->query<>"") Recordset::Open($conn); ! $this->opened = true; ! } /** Index: class.Recordset.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.Recordset.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.Recordset.php 22 Jul 2004 09:41:25 -0000 1.12 --- class.Recordset.php 22 Jul 2004 16:25:38 -0000 1.13 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 52,83 **** function EOF() ! { ! return $this->pos >= $this->count; ! } function BOF() ! { ! return $this->pos < 0; ! } function MoveNext() ! { ! if ( !$this->EOF() ) $this->pos++; ! } function MovePrev() ! { ! if ( !$this->BOF() ) $this->pos--; ! } function MoveFirst() ! { ! $this->pos = 0; ! } function MoveLast() ! { ! $this->pos = $this->count - 1; ! } /** --- 53,84 ---- function EOF() ! { ! return $this->pos >= $this->count; ! } function BOF() ! { ! return $this->pos < 0; ! } function MoveNext() ! { ! if ( !$this->EOF() ) $this->pos++; ! } function MovePrev() ! { ! if ( !$this->BOF() ) $this->pos--; ! } function MoveFirst() ! { ! $this->pos = 0; ! } function MoveLast() ! { ! $this->pos = $this->count - 1; ! } /** *************** *** 86,124 **** */ function Field($fld_name) ! { ! if ( isset($this->contents[$this->pos][$fld_name]) ) ! return $this->contents[$this->pos][$fld_name]; ! else ! return UNDEFINED; ! } /** Returns all the fields at the current position as an associated array. */ function Fields() ! { ! $fields = $this->contents[$this->pos]; ! if (!is_array($fields)) $fields = array(); ! return $fields; ! } /** Constructor */ function Recordset($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! global $cnn; ! $this->ID = $id; ! $this->query = $query; ! if ($conn==UNDEFINED) ! { ! $this->cnn = &$cnn; ! } ! else ! { ! $this->cnn = $conn; ! } ! $this->contents = array(); ! $this->count = 0; ! $this->pos = 0; ! $this->type = "Recordset"; ! } /** --- 87,125 ---- */ function Field($fld_name) ! { ! if ( isset($this->contents[$this->pos][$fld_name]) ) ! return $this->contents[$this->pos][$fld_name]; ! else ! return UNDEFINED; ! } /** Returns all the fields at the current position as an associated array. */ function Fields() ! { ! $fields = $this->contents[$this->pos]; ! if (!is_array($fields)) $fields = array(); ! return $fields; ! } /** Constructor */ function Recordset($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! global $cnn; ! $this->ID = $id; ! $this->query = $query; ! if ($conn==UNDEFINED) ! { ! $this->cnn = &$cnn; ! } ! else ! { ! $this->cnn = $conn; ! } ! $this->contents = array(); ! $this->count = 0; ! $this->pos = 0; ! $this->type = "Recordset"; ! } /** *************** *** 127,165 **** */ function Open($conn =UNDEFINED) ! { ! $query = $this->query; ! if ($query==UNDEFINED) return; ! $this->Close(); //empty the content ! $query = WebApp::replaceVars($query); ! if ($conn==UNDEFINED) ! { ! $result = $this->cnn->execQuery($query, $this->ID); ! } ! else ! { ! $result = $conn->execQuery($query, $this->ID); ! } ! if (is_array($result)) ! { ! $this->contents = $result; ! $this->count = count($result); ! $this->pos = 0; ! return; ! } ! else ! { ! return $result; ! } ! } function Close() ! { ! if (isset($this->contents)) unset($this->contents); ! $this->count = 0; ! $this->pos = 0; ! } /** --- 128,166 ---- */ function Open($conn =UNDEFINED) ! { ! $query = $this->query; ! if ($query==UNDEFINED) return; ! $this->Close(); //empty the content ! $query = WebApp::replaceVars($query); ! if ($conn==UNDEFINED) ! { ! $result = $this->cnn->execQuery($query, $this->ID); ! } ! else ! { ! $result = $conn->execQuery($query, $this->ID); ! } ! if (is_array($result)) ! { ! $this->contents = $result; ! $this->count = count($result); ! $this->pos = 0; ! return; ! } ! else ! { ! return $result; ! } ! } function Close() ! { ! if (isset($this->contents)) unset($this->contents); ! $this->count = 0; ! $this->pos = 0; ! } /** *************** *** 168,191 **** */ function slice($offset =0, $length =UNDEFINED) ! { ! $slice = array(); ! if ($length===UNDEFINED) ! { ! $slice = array_slice($this->contents, $offset); ! } ! else ! { ! $slice = array_slice($this->contents, $offset, $length); ! } ! //create a new recordset of the same type as this ! $rs = new $this->type; ! $rs->contents = $slice; ! $rs->count = sizeof($slice); ! $rs->pos = 0; ! return $rs; ! } /** --- 169,192 ---- */ function slice($offset =0, $length =UNDEFINED) ! { ! $slice = array(); ! if ($length===UNDEFINED) ! { ! $slice = array_slice($this->contents, $offset); ! } ! else ! { ! $slice = array_slice($this->contents, $offset, $length); ! } ! //create a new recordset of the same type as this ! $rs = new $this->type; ! $rs->contents = $slice; ! $rs->count = sizeof($slice); ! $rs->pos = 0; ! return $rs; ! } /** *************** *** 198,226 **** */ function match($condition, $pos=UNDEFINED) ! { ! //get the field name, pattern and match type from $condition ! list($fld_name,$pattern) = split("=", $condition, 2); ! $fld_name = trim($fld_name); ! $pattern = trim($pattern); ! $match_type = substr($pattern, 0, 1); //get first char ! //remove first and last chars ! $pattern = substr($pattern, 1, sizeof($pattern)-2); ! //get the field value ! if ($pos===UNDEFINED) $pos = $this->pos; ! $fld_value = $this->contents[$pos][$fld_name]; ! //match with pattern ! if ($match_type=="'") ! { ! $result = ($fld_value==$pattern); ! } ! else ! { ! $result = ereg($pattern, $fld_value); ! } ! return $result; ! } /** --- 199,227 ---- */ function match($condition, $pos=UNDEFINED) ! { ! //get the field name, pattern and match type from $condition ! list($fld_name,$pattern) = split("=", $condition, 2); ! $fld_name = trim($fld_name); ! $pattern = trim($pattern); ! $match_type = substr($pattern, 0, 1); //get first char ! //remove first and last chars ! $pattern = substr($pattern, 1, sizeof($pattern)-2); ! //get the field value ! if ($pos===UNDEFINED) $pos = $this->pos; ! $fld_value = $this->contents[$pos][$fld_name]; ! //match with pattern ! if ($match_type=="'") ! { ! $result = ($fld_value==$pattern); ! } ! else ! { ! $result = ereg($pattern, $fld_value); ! } ! return $result; ! } /** *************** *** 233,250 **** */ function filter($condition) ! { ! $rs = new $this->type; ! $rs->Open(); ! for ($i=0; $i < $this->count; $i++) ! { ! if ($this->match($condition, $i)) ! { ! $rec = $this->contents[$i]; ! $rs->addRec($rec); ! } ! } ! $rs->MoveFirst(); ! return $rs; ! } /** --- 234,251 ---- */ function filter($condition) ! { ! $rs = new $this->type; ! $rs->Open(); ! for ($i=0; $i < $this->count; $i++) ! { ! if ($this->match($condition, $i)) ! { ! $rec = $this->contents[$i]; ! $rs->addRec($rec); ! } ! } ! $rs->MoveFirst(); ! return $rs; ! } /** *************** *** 258,265 **** */ function find($condition =UNDEFINED) ! { ! if ($condition<>UNDEFINED) $this->search($condition); ! return $this->find_next(); ! } /** --- 259,266 ---- */ function find($condition =UNDEFINED) ! { ! if ($condition<>UNDEFINED) $this->search($condition); ! return $this->find_next(); ! } /** *************** *** 270,284 **** */ function search($condition) ! { ! $this->found_positions = array(); ! $this->current_found = -1; ! for ($i=0; $i < $this->count; $i++) ! { ! if ($this->match($condition, $i)) ! { ! $this->found_positions[] = $i; ! } ! } ! } /** --- 271,285 ---- */ function search($condition) ! { ! $this->found_positions = array(); ! $this->current_found = -1; ! for ($i=0; $i < $this->count; $i++) ! { ! if ($this->match($condition, $i)) ! { ! $this->found_positions[] = $i; ! } ! } ! } /** *************** *** 289,320 **** */ function find_next() ! { ! $found_nr = sizeof($this->found_positions); ! if ($this->current_found + 1 < $found_nr ) ! { ! $this->current_found += 1; ! $idx = $this->current_found; ! $this->pos = $this->found_positions[$idx]; ! return true; ! } ! else ! { ! return false; ! } ! } /** Returns an array with the values of the specified field. */ function getColumn($fld_name) ! { ! $column = array(); ! for ($i=0; $i < $this->count; $i++) ! { ! if ( isset($this->contents[$i][$fld_name]) ) ! { ! $column[] = $this->contents[$i][$fld_name]; ! } ! } ! return $column; ! } /** --- 290,321 ---- */ function find_next() ! { ! $found_nr = sizeof($this->found_positions); ! if ($this->current_found + 1 < $found_nr ) ! { ! $this->current_found += 1; ! $idx = $this->current_found; ! $this->pos = $this->found_positions[$idx]; ! return true; ! } ! else ! { ! return false; ! } ! } /** Returns an array with the values of the specified field. */ function getColumn($fld_name) ! { ! $column = array(); ! for ($i=0; $i < $this->count; $i++) ! { ! if ( isset($this->contents[$i][$fld_name]) ) ! { ! $column[] = $this->contents[$i][$fld_name]; ! } ! } ! return $column; ! } /** *************** *** 323,343 **** */ function getColumns($fld_names) ! { ! $rs = new $this->type; ! $rs->Open(); ! $arr_flds = explode(",", $fld_names); ! for ($i=0; $i < $this->count; $i++) ! { ! $rec = array(); ! for ($j=0; $j < sizeof($arr_flds); $j++) ! { ! $fld = $arr_flds[$j]; ! $rec[$fld] = $this->contents[$i][$fld]; ! } ! $rs->addRec($rec); ! } ! $rs->MoveFirst(); ! return $rs; ! } /** --- 324,344 ---- */ function getColumns($fld_names) ! { ! $rs = new $this->type; ! $rs->Open(); ! $arr_flds = explode(",", $fld_names); ! for ($i=0; $i < $this->count; $i++) ! { ! $rec = array(); ! for ($j=0; $j < sizeof($arr_flds); $j++) ! { ! $fld = $arr_flds[$j]; ! $rec[$fld] = $this->contents[$i][$fld]; ! } ! $rs->addRec($rec); ! } ! $rs->MoveFirst(); ! return $rs; ! } /** *************** *** 346,358 **** */ function toHtmlTable() ! { ! $type = $this->type; ! if ($type=="PagedRS") ! { ! $type .= "(current_page='$this->current_page'," ! ." recs_per_page='$this->recs_per_page'," ! ."nr_of_recs='$this->nr_of_recs')"; ! } ! $htmlTable = " <br /> <table border='0' cellspacing='1' cellpadding='0'> --- 347,359 ---- */ function toHtmlTable() ! { ! $type = $this->type; ! if ($type=="PagedRS") ! { ! $type .= "(current_page='$this->current_page'," ! ." recs_per_page='$this->recs_per_page'," ! ."nr_of_recs='$this->nr_of_recs')"; ! } ! $htmlTable = " <br /> <table border='0' cellspacing='1' cellpadding='0'> *************** *** 376,402 **** <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> "; ! if ($this->count > 0) ! { ! $this->MoveFirst(); ! $rec = $this->Fields(); ! $htmlTable .= "\t<tr>\n"; ! while ( list($fld_name, $fld_value) = each($rec) ) ! { ! $htmlTable .= "\t\t<th bgcolor='#eeeeee'> $fld_name </th>\n"; ! } ! $htmlTable .= "\t</tr>\n"; ! while (!$this->EOF()) ! { ! $rec = $this->Fields(); ! $htmlTable .= "\t<tr>\n"; ! while ( list($fld_name, $fld_value) = each($rec) ) ! { ! $htmlTable .= "\t\t<td bgcolor='white'> $fld_value </td>\n"; ! } ! $htmlTable .= "\t</tr>\n"; ! $this->MoveNext(); ! } ! } ! $htmlTable .= " </table> </td></tr> --- 377,403 ---- <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> "; ! if ($this->count > 0) ! { ! $this->MoveFirst(); ! $rec = $this->Fields(); ! $htmlTable .= "\t<tr>\n"; ! while ( list($fld_name, $fld_value) = each($rec) ) ! { ! $htmlTable .= "\t\t<th bgcolor='#eeeeee'> $fld_name </th>\n"; ! } ! $htmlTable .= "\t</tr>\n"; ! while (!$this->EOF()) ! { ! $rec = $this->Fields(); ! $htmlTable .= "\t<tr>\n"; ! while ( list($fld_name, $fld_value) = each($rec) ) ! { ! $htmlTable .= "\t\t<td bgcolor='white'> $fld_value </td>\n"; ! } ! $htmlTable .= "\t</tr>\n"; ! $this->MoveNext(); ! } ! } ! $htmlTable .= " </table> </td></tr> *************** *** 404,410 **** "; ! $this->MoveFirst(); ! return $htmlTable; ! } } ?> \ No newline at end of file --- 405,411 ---- "; ! $this->MoveFirst(); ! return $htmlTable; ! } } ?> \ No newline at end of file Index: class.PagedRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.PagedRS.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.PagedRS.php 22 Jul 2004 09:41:25 -0000 1.12 --- class.PagedRS.php 22 Jul 2004 16:25:38 -0000 1.13 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 47,56 **** function PagedRS($id, $query =UNDEFINED, $rp =UNDEFINED, $conn =UNDEFINED) ! { ! $this->EditableRS($id, $query, $conn); ! $this->type = "PagedRS"; ! $this->recs_per_page = ($rp==UNDEFINED ? 0 : $rp); ! $this->current_page = $this->get_current_page(); ! } /** --- 48,57 ---- function PagedRS($id, $query =UNDEFINED, $rp =UNDEFINED, $conn =UNDEFINED) ! { ! $this->EditableRS($id, $query, $conn); ! $this->type = "PagedRS"; ! $this->recs_per_page = ($rp==UNDEFINED ? 0 : $rp); ! $this->current_page = $this->get_current_page(); ! } /** *************** *** 59,112 **** */ function get_current_page() ! { ! $cp = WebApp::getSVar($this->ID."->current_page"); ! if ($cp==UNDEFINED) ! { ! $cp = 1; ! WebApp::setSVar($this->ID."->current_page", $cp); ! } ! return $cp; ! } /** Executes the query and puts the result into $this->contents. */ function Open($cp =UNDEFINED, $conn =UNDEFINED) ! { ! if ($this->opened) ! { ! $this->MoveFirst(); ! return; //don't open it a second time ! } ! if ($cp==UNDEFINED) ! { ! //default is to get it from SVars ! $this->current_page = $this->get_current_page(); ! } ! else ! { ! $this->current_page = $cp; ! } ! $this->nr_of_recs = $this->get_nr_of_recs(); ! $nr_of_pages = ceil($this->nr_of_recs / $this->recs_per_page); ! if ($this->current_page > $nr_of_pages) $this->current_page = $nr_of_pages; ! //modify and execute the query ! $first_rec_idx = ($this->current_page - 1)*$this->recs_per_page; ! $query = WebApp::replaceVars($this->query); ! $query .= " LIMIT $first_rec_idx, ".$this->recs_per_page; ! if ($conn==UNDEFINED) ! { ! $result = $this->cnn->execQuery($query, $this->ID); ! } ! else ! { ! $result = $conn->execQuery($query, $this->ID); ! } ! $this->contents = $result; ! $this->count = count($result); ! $this->pos = 0; ! $this->opened = true; ! } /** --- 60,113 ---- */ function get_current_page() ! { ! $cp = WebApp::getSVar($this->ID."->current_page"); ! if ($cp==UNDEFINED) ! { ! $cp = 1; ! WebApp::setSVar($this->ID."->current_page", $cp); ! } ! return $cp; ! } /** Executes the query and puts the result into $this->contents. */ function Open($cp =UNDEFINED, $conn =UNDEFINED) ! { ! if ($this->opened) ! { ! $this->MoveFirst(); ! return; //don't open it a second time ! } ! if ($cp==UNDEFINED) ! { ! //default is to get it from SVars ! $this->current_page = $this->get_current_page(); ! } ! else ! { ! $this->current_page = $cp; ! } ! $this->nr_of_recs = $this->get_nr_of_recs(); ! $nr_of_pages = ceil($this->nr_of_recs / $this->recs_per_page); ! if ($this->current_page > $nr_of_pages) $this->current_page = $nr_of_pages; ! //modify and execute the query ! $first_rec_idx = ($this->current_page - 1)*$this->recs_per_page; ! $query = WebApp::replaceVars($this->query); ! $query .= " LIMIT $first_rec_idx, ".$this->recs_per_page; ! if ($conn==UNDEFINED) ! { ! $result = $this->cnn->execQuery($query, $this->ID); ! } ! else ! { ! $result = $conn->execQuery($query, $this->ID); ! } ! $this->contents = $result; ! $this->count = count($result); ! $this->pos = 0; ! $this->opened = true; ! } /** *************** *** 115,156 **** */ function getPageVars() ! { ! $nr_of_pages = ceil($this->nr_of_recs / $this->recs_per_page); ! if ($this->current_page>$nr_of_pages) $this->current_page=$nr_of_pages; ! if ($this->current_page==$nr_of_pages) ! $next_page = "1"; //next page of the last page is the first page ! else ! $next_page = $this->current_page + 1; ! if ($this->current_page==1) ! $prev_page = 1; //previous page of the first page is the first page itself ! else ! $prev_page = $this->current_page - 1; ! $first_rec = 1 + ($this->current_page - 1)*$this->recs_per_page; ! $last_rec = $this->current_page * $this->recs_per_page; ! if ($first_rec > $this->nr_of_recs) $first_rec = $this->nr_of_recs; ! if ($last_rec > $this->nr_of_recs) $last_rec = $this->nr_of_recs; ! $page_vars = ! array( ! //the number of the first record of the page ! "FirstRec" => $first_rec, ! //the number of the last record of the page ! "LastRec" => $last_rec, ! //the number of all records that can be retrieved by the query ! "AllRecs" => $this->nr_of_recs, ! //current page of records that is retrieved ! "CurrPage" => $this->current_page, ! //the number of the next page ! "NextPage" => $next_page, ! //the number of the previous page ! "PrevPage" => $prev_page, ! //the number of the last page ! "LastPage" => $nr_of_pages ! ); ! return $page_vars; ! } /** --- 116,157 ---- */ function getPageVars() ! { ! $nr_of_pages = ceil($this->nr_of_recs / $this->recs_per_page); ! if ($this->current_page>$nr_of_pages) $this->current_page=$nr_of_pages; ! if ($this->current_page==$nr_of_pages) ! $next_page = "1"; //next page of the last page is the first page ! else ! $next_page = $this->current_page + 1; ! if ($this->current_page==1) ! $prev_page = 1; //previous page of the first page is the first page itself ! else ! $prev_page = $this->current_page - 1; ! $first_rec = 1 + ($this->current_page - 1)*$this->recs_per_page; ! $last_rec = $this->current_page * $this->recs_per_page; ! if ($first_rec > $this->nr_of_recs) $first_rec = $this->nr_of_recs; ! if ($last_rec > $this->nr_of_recs) $last_rec = $this->nr_of_recs; ! $page_vars = ! array( ! //the number of the first record of the page ! "FirstRec" => $first_rec, ! //the number of the last record of the page ! "LastRec" => $last_rec, ! //the number of all records that can be retrieved by the query ! "AllRecs" => $this->nr_of_recs, ! //current page of records that is retrieved ! "CurrPage" => $this->current_page, ! //the number of the next page ! "NextPage" => $next_page, ! //the number of the previous page ! "PrevPage" => $prev_page, ! //the number of the last page ! "LastPage" => $nr_of_pages ! ); ! return $page_vars; ! } /** *************** *** 159,186 **** */ function get_nr_of_recs() ! { ! //get it from session ! $nrRecs = WebApp::getSVar($this->ID."->nrRecs"); ! $recount = WebApp::getSVar($this->ID."->recount"); ! //if the number of the records is undefined ! //or the recount is requested explicitly by the application ! //find the number of recs by executing a COUNT query ! if ( ($nrRecs==UNDEFINED) ! or ($recount=="true") ) ! { ! $query = WebApp::replaceVars($this->query); ! $query = $this->get_count_query($query); ! $rs = new Recordset($this->ID."_countQuery", $query); ! $rs->Open(); ! $nrRecs = $rs->Field("COUNT_OF_RECS"); ! //save it in session and turn off recounting ! WebApp::setSVar($this->ID."->nrRecs", $nrRecs); ! WebApp::setSVar($this->ID."->recount", "false"); ! } ! return $nrRecs; ! } /** --- 160,187 ---- */ function get_nr_of_recs() ! { ! //get it from session ! $nrRecs = WebApp::getSVar($this->ID."->nrRecs"); ! $recount = WebApp::getSVar($this->ID."->recount"); ! //if the number of the records is undefined ! //or the recount is requested explicitly by the application ! //find the number of recs by executing a COUNT query ! if ( ($nrRecs==UNDEFINED) ! or ($recount=="true") ) ! { ! $query = WebApp::replaceVars($this->query); ! $query = $this->get_count_query($query); ! $rs = new Recordset($this->ID."_countQuery", $query); ! $rs->Open(); ! $nrRecs = $rs->Field("COUNT_OF_RECS"); ! //save it in session and turn off recounting ! WebApp::setSVar($this->ID."->nrRecs", $nrRecs); ! WebApp::setSVar($this->ID."->recount", "false"); ! } ! return $nrRecs; ! } /** *************** *** 191,219 **** */ function get_count_query($query) ! { ! $query = eregi_replace("[[:space:]]from[[:space:]]", " FROM ", $query); ! $from_pos = strpos($query, " FROM "); ! $before_from = substr($query, 0, $from_pos); ! $after_from = substr($query, $from_pos); ! if (eregi("GROUP +BY", $after_from)) ! { ! $after_from = eregi_replace("ORDER +BY.*", "", $after_from); ! eregi("GROUP +BY(.*)", $after_from, $regs); ! $group_by_fields = $regs[1]; ! $after_from = eregi_replace("GROUP +BY.*", "", $after_from); ! $count_query = "SELECT COUNT(DISTINCT $group_by_fields) AS COUNT_OF_RECS $after_from"; ! } ! else if (eregi("SELECT +DISTINCT", $before_from)) ! { ! $before_from = eregi_replace("SELECT +(DISTINCT.*)", "SELECT COUNT(\\1) AS COUNT_OF_RECS", $before_from); ! $count_query = $before_from.$after_from; ! } ! else ! { ! $count_query = "SELECT COUNT(1) AS COUNT_OF_RECS" . $after_from; ! } ! return $count_query; ! } } ?> \ No newline at end of file --- 192,220 ---- */ function get_count_query($query) ! { ! $query = eregi_replace("[[:space:]]from[[:space:]]", " FROM ", $query); ! $from_pos = strpos($query, " FROM "); ! $before_from = substr($query, 0, $from_pos); ! $after_from = substr($query, $from_pos); ! if (eregi("GROUP +BY", $after_from)) ! { ! $after_from = eregi_replace("ORDER +BY.*", "", $after_from); ! eregi("GROUP +BY(.*)", $after_from, $regs); ! $group_by_fields = $regs[1]; ! $after_from = eregi_replace("GROUP +BY.*", "", $after_from); ! $count_query = "SELECT COUNT(DISTINCT $group_by_fields) AS COUNT_OF_RECS $after_from"; ! } ! else if (eregi("SELECT +DISTINCT", $before_from)) ! { ! $before_from = eregi_replace("SELECT +(DISTINCT.*)", "SELECT COUNT(\\1) AS COUNT_OF_RECS", $before_from); ! $count_query = $before_from.$after_from; ! } ! else ! { ! $count_query = "SELECT COUNT(1) AS COUNT_OF_RECS" . $after_from; ! } ! return $count_query; ! } } ?> \ No newline at end of file Index: class.MySQLCnn.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.MySQLCnn.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** class.MySQLCnn.php 14 Jul 2004 14:45:41 -0000 1.8 --- class.MySQLCnn.php 22 Jul 2004 16:25:38 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 35,42 **** function MySQLCnn($host =DBHOST, $user =DBUSER, $passw =DBPASS, $db_name =DBNAME) ! { ! $this->cnn = mysql_pconnect($host, $user, $passw); ! mysql_select_db($db_name) or die("unable to select db"); ! } /** --- 36,43 ---- function MySQLCnn($host =DBHOST, $user =DBUSER, $passw =DBPASS, $db_name =DBNAME) ! { ! $this->cnn = mysql_pconnect($host, $user, $passw); ! mysql_select_db($db_name) or die("unable to select db"); ! } /** *************** *** 45,99 **** */ function exec_query($query) ! { ! $result = mysql_query($query, $this->cnn); ! $this->show_error($query); ! if ( ereg("Resource", $result) ) ! { ! //the query was a 'select' and has returned some records, ! //convert the results to a two dimentional table ! $table = $this->result2table($result); ! return $table; ! } ! else ! { ! //the query was a command (insert, delete, update, etc.) ! //and it has returned TRUE or FALSE indicating success or failure ! return $result; ! } ! } /** Convert the mysql $result to a two-dimentional table. */ function result2table(&$result) ! { ! if (!$result) ! { ! print WebApp::error_msg("Query was not executed successfully."); ! return; ! } ! $arr_result = array(); ! $i = 0; ! while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) ! { ! while ( list($fld_name, $fld_value) = each($row) ) ! { ! if (!isset($fld_value)) $fld_value = NULL_VALUE; ! $arr_result[$i][$fld_name] = $fld_value; ! } ! $i++; //next row ! } ! mysql_free_result($result); ! return $arr_result; ! } function show_error($query = "") ! { ! if (mysql_errno()==0) return; //no error ! if (mysql_errno()==1062) return; //ignore this error ! if (mysql_errno()==1136) return; //ignore this error ! print "Query: '$query' <br /> \n"; ! print mysql_errno().": ".mysql_error()." <br /> \n"; ! } } ?> \ No newline at end of file --- 46,100 ---- */ function exec_query($query) ! { ! $result = mysql_query($query, $this->cnn); ! $this->show_error($query); ! if ( ereg("Resource", $result) ) ! { ! //the query was a 'select' and has returned some records, ! //convert the results to a two dimentional table ! $table = $this->result2table($result); ! return $table; ! } ! else ! { ! //the query was a command (insert, delete, update, etc.) ! //and it has returned TRUE or FALSE indicating success or failure ! return $result; ! } ! } /** Convert the mysql $result to a two-dimentional table. */ function result2table(&$result) ! { ! if (!$result) ! { ! print WebApp::error_msg("Query was not executed successfully."); ! return; ! } ! $arr_result = array(); ! $i = 0; ! while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) ! { ! while ( list($fld_name, $fld_value) = each($row) ) ! { ! if (!isset($fld_value)) $fld_value = NULL_VALUE; ! $arr_result[$i][$fld_name] = $fld_value; ! } ! $i++; //next row ! } ! mysql_free_result($result); ! return $arr_result; ! } function show_error($query = "") ! { ! if (mysql_errno()==0) return; //no error ! if (mysql_errno()==1062) return; //ignore this error ! if (mysql_errno()==1136) return; //ignore this error ! print "Query: '$query' <br /> \n"; ! print mysql_errno().": ".mysql_error()." <br /> \n"; ! } } ?> \ No newline at end of file Index: class.EditableRS.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.EditableRS.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** class.EditableRS.php 13 Jul 2004 13:18:08 -0000 1.9 --- class.EditableRS.php 22 Jul 2004 16:25:38 -0000 1.10 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 31,39 **** { function EditableRS($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! $this->StaticRS($id, $query, $conn); ! $this->type = "EditableRS"; ! $this->opened = ($query==UNDEFINED ? true : false); ! } /** --- 32,40 ---- { function EditableRS($id =UNDEFINED, $query =UNDEFINED, $conn =UNDEFINED) ! { ! $this->StaticRS($id, $query, $conn); ! $this->type = "EditableRS"; ! $this->opened = ($query==UNDEFINED ? true : false); ! } /** *************** *** 43,87 **** */ function apply($fun_name) ! { ! for ($i=0; $i < $this->count; $i++) ! { ! $fun_name($this->contents[$i]); ! } ! } /** Sets a new value to the given field (in the current record). */ function setFld($fld_name, $fld_value) ! { ! if ($this->EOF()) ! { ! $msg = "EditableRS::setFld(): pointer is at EOF.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! if ($this->BOF()) ! { ! $msg = "EditableRS::setFld(): pointer is at BOF.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! $rec = &$this->contents[$this->pos]; ! if (!isset($rec[$fld_name])) ! { ! $msg = "EditableRS::setFld(): field '$fld_name' does not exist.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! $rec[$fld_name] = $fld_value; ! } /** Changes some fields of the current recordset. */ function setFlds($arr_flds) ! { ! while (list($fld_name,$fld_value) = each($arr_flds)) ! { ! $this->setFld($fld_name,$fld_value); ! } ! } /** --- 44,88 ---- */ function apply($fun_name) ! { ! for ($i=0; $i < $this->count; $i++) ! { ! $fun_name($this->contents[$i]); ! } ! } /** Sets a new value to the given field (in the current record). */ function setFld($fld_name, $fld_value) ! { ! if ($this->EOF()) ! { ! $msg = "EditableRS::setFld(): pointer is at EOF.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! if ($this->BOF()) ! { ! $msg = "EditableRS::setFld(): pointer is at BOF.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! $rec = &$this->contents[$this->pos]; ! if (!isset($rec[$fld_name])) ! { ! $msg = "EditableRS::setFld(): field '$fld_name' does not exist.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! $rec[$fld_name] = $fld_value; ! } /** Changes some fields of the current recordset. */ function setFlds($arr_flds) ! { ! while (list($fld_name,$fld_value) = each($arr_flds)) ! { ! $this->setFld($fld_name,$fld_value); ! } ! } /** *************** *** 90,125 **** */ function addRec($rec) ! { ! if ($this->count==0) //recordset empty ! { ! $this->count++; ! $this->contents[0] = $rec; ! $this->pos = 0; ! return; ! } ! //for a non-empty recordset ! for ($i=$this->count; $i > ($this->pos+1); $i--) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! if (!$this->BOF()) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! $this->count++; ! $this->pos++; ! if ($this->EOF()) $this->pos--; ! $this->setFlds($rec); ! } function addRecs($arr_recs) ! { ! for ($i=0; $i < sizeof($arr_recs); $i++) ! { ! $rec = $arr_recs[$i]; ! $this->addRec($rec); ! } ! } /** --- 91,126 ---- */ function addRec($rec) ! { ! if ($this->count==0) //recordset empty ! { ! $this->count++; ! $this->contents[0] = $rec; ! $this->pos = 0; ! return; ! } ! //for a non-empty recordset ! for ($i=$this->count; $i > ($this->pos+1); $i--) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! if (!$this->BOF()) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! $this->count++; ! $this->pos++; ! if ($this->EOF()) $this->pos--; ! $this->setFlds($rec); ! } function addRecs($arr_recs) ! { ! for ($i=0; $i < sizeof($arr_recs); $i++) ! { ! $rec = $arr_recs[$i]; ! $this->addRec($rec); ! } ! } /** *************** *** 128,182 **** */ function insRec($rec) ! { ! if ($this->count==0) //recordset empty ! { ! $this->count++; ! $this->contents[0] = $rec; ! $this->pos = 0; ! return; ! } ! //for a non-empty recordset ! for ($i=$this->count; $i > ($this->pos + 1); $i--) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! if (!$this->BOF()) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! $this->count++; ! if ($this->BOF()) $this->pos++; ! $this->setFlds($rec); ! } function insRecs($arr_recs) ! { ! for ($i=0; $i < sizeof($arr_recs); $i++) ! { ! $rec = $arr_recs[$i]; ! $this->insRec($rec); ! } ! } /** Append the content of the given $rs to $this RS. */ function append($rs) ! { ! $pos = $this->pos; ! $this->MoveLast(); ! $rs->MoveFirst(); ! while (!$rs->EOF()) ! { ! $rec = $rs->Fields(); ! $this->addRec($rec); ! $rs->MoveNext(); ! } ! $this->pos = $pos; ! } function rmRec() ! { ! $this->rmRecs(1); ! } /** --- 129,183 ---- */ function insRec($rec) ! { ! if ($this->count==0) //recordset empty ! { ! $this->count++; ! $this->contents[0] = $rec; ! $this->pos = 0; ! return; ! } ! //for a non-empty recordset ! for ($i=$this->count; $i > ($this->pos + 1); $i--) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! if (!$this->BOF()) ! { ! $this->contents[$i] = $this->contents[$i-1]; ! } ! $this->count++; ! if ($this->BOF()) $this->pos++; ! $this->setFlds($rec); ! } function insRecs($arr_recs) ! { ! for ($i=0; $i < sizeof($arr_recs); $i++) ! { ! $rec = $arr_recs[$i]; ! $this->insRec($rec); ! } ! } /** Append the content of the given $rs to $this RS. */ function append($rs) ! { ! $pos = $this->pos; ! $this->MoveLast(); ! $rs->MoveFirst(); ! while (!$rs->EOF()) ! { ! $rec = $rs->Fields(); ! $this->addRec($rec); ! $rs->MoveNext(); ! } ! $this->pos = $pos; ! } function rmRec() ! { ! $this->rmRecs(1); ! } /** *************** *** 187,222 **** */ function rmRecs($nr =UNDEFINED) ! { ! if ( ($nr===UNDEFINED) or ! ($this->pos + $nr > $this->count) ) ! { ! //set $nr to the number of all remaining ! //recs up to the EOF (including the current rec) ! $nr = $this->count - $this->pos; ! } ! //get the number of the remaining elements ! //from the current rec up to the EOF ! $rem = $this->count - $this->pos - $nr; ! //move up all the recs that will remain ! for ($i=0; $i < $rem; $i++) ! { ! $i1 = $this->pos + $i; //new position ! $i2 = $this->pos + $i + $nr; //old position ! if ($i1 >= 0) //at BOF, $this->pos is -1 ! { ! $this->contents[$i1] = $this->contents[$i2]; ! } ! } ! //delete the last recs ! for ($i=$this->pos+$rem; $i < $this->count; $i++) ! { ! unset($this->contents[$i]); ! } ! //update the count of the recs ! $this->count -= $nr; ! } /** --- 188,223 ---- */ function rmRecs($nr =UNDEFINED) ! { ! if ( ($nr===UNDEFINED) or ! ($this->pos + $nr > $this->count) ) ! { ! //set $nr to the number of all remaining ! //recs up to the EOF (including the current rec) ! $nr = $this->count - $this->pos; ! } ! //get the number of the remaining elements ! //from the current rec up to the EOF ! $rem = $this->count - $this->pos - $nr; ! //move up all the recs that will remain ! for ($i=0; $i < $rem; $i++) ! { ! $i1 = $this->pos + $i; //new position ! $i2 = $this->pos + $i + $nr; //old position ! if ($i1 >= 0) //at BOF, $this->pos is -1 ! { ! $this->contents[$i1] = $this->contents[$i2]; ! } ! } ! //delete the last recs ! for ($i=$this->pos+$rem; $i < $this->count; $i++) ! { ! unset($this->contents[$i]); ! } ! //update the count of the recs ! $this->count -= $nr; ! } /** *************** *** 225,236 **** */ function addCol($fld_name, $default_value =UNDEFINED) ! { ! if (isset($this->contents[0][$fld_name])) return; ! for ($i=0; $i < $this->count; $i++) ! { ! $this->contents[$i][$fld_name] = $default_value; ! } ! } /** --- 226,237 ---- */ function addCol($fld_name, $default_value =UNDEFINED) ! { ! if (isset($this->contents[0][$fld_name])) return; ! for ($i=0; $i < $this->count; $i++) ! { ! $this->contents[$i][$fld_name] = $default_value; ! } ! } /** *************** *** 238,256 **** */ function renameCol($fld_name, $new_fld_name) ! { ! if (isset($this->contents[0][$new_fld_name])) ! { ! $msg = "EditableRS::renameCol(): there is already" ! . " a field named '$new_fld_name'.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! for ($i=0; $i < $this->count; $i++) ! { ! $this->contents[$i][$new_fld_name] = $this->contents[$i][$fld_name]; ! unset($this->contents[$i][$fld_name]); ! } ! } } ?> \ No newline at end of file --- 239,257 ---- */ function renameCol($fld_name, $new_fld_name) ! { ! if (isset($this->contents[0][$new_fld_name])) ! { ! $msg = "EditableRS::renameCol(): there is already" ! . " a field named '$new_fld_name'.\n"; ! print WebApp::error_msg($msg); ! return; ! } ! for ($i=0; $i < $this->count; $i++) ! { ! $this->contents[$i][$new_fld_name] = $this->contents[$i][$fld_name]; ! unset($this->contents[$i][$fld_name]); ! } ! } } ?> \ No newline at end of file Index: class.Connection.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/database/class.Connection.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** class.Connection.php 25 Aug 2003 13:18:32 -0000 1.7 --- class.Connection.php 22 Jul 2004 16:25:38 -0000 1.8 *************** *** 1,30 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ - - /** - * This class is used for opening a connection with a database - * and for executing a query. This is like an interface, which - * is implemented by DB specific classes. - * - * @package database - */ class Connection { --- 1,23 ---- <?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 */ class Connection { *************** *** 41,47 **** function Connection($host =DBHOS... [truncated message content] |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:50
|
Update of /cvsroot/phpwebapp/web_app/boxes/folderManager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/boxes/folderManager Modified Files: folderEditing.php Log Message: reformated and modified the copyleft notice Index: folderEditing.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/folderManager/folderEditing.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** folderEditing.php 25 Aug 2003 13:18:33 -0000 1.4 --- folderEditing.php 22 Jul 2004 16:25:38 -0000 1.5 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 28,53 **** { function eventHandler($event) ! { ! global $session; ! extract($event->args); ! $root = $session->Vars["folderListing.root"]; ! $path = $session->Vars["folderListing.currentPath"]; ! $currentFolder = $root.$path; ! switch ($event->name) ! { ! case "rename": ! $fromFolder = $currentFolder.$fromFolder; ! $toFolder = $currentFolder.$toFolder; ! rename($fromFolder, $toFolder); ! break; ! case "delete": ! rmdir($currentFolder.$delFolder); ! break; ! case "addNew": ! mkdir($currentFolder.$newFolder, 0700); ! break; ! } ! } } ?> \ No newline at end of file --- 29,54 ---- { function eventHandler($event) ! { ! global $session; ! extract($event->args); ! $root = $session->Vars["folderListing.root"]; ! $path = $session->Vars["folderListing.currentPath"]; ! $currentFolder = $root.$path; ! switch ($event->name) ! { ! case "rename": ! $fromFolder = $currentFolder.$fromFolder; ! $toFolder = $currentFolder.$toFolder; ! rename($fromFolder, $toFolder); ! break; ! case "delete": ! rmdir($currentFolder.$delFolder); ! break; ! case "addNew": ! mkdir($currentFolder.$newFolder, 0700); ! break; ! } ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:50
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224 Modified Files: const.Paths.php class.WebApp.php WebApp.php Log Message: reformated and modified the copyleft notice Index: const.Paths.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/const.Paths.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** const.Paths.php 11 May 2004 06:53:22 -0000 1.5 --- const.Paths.php 22 Jul 2004 16:25:39 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** class.WebApp.php 15 Jul 2004 13:36:13 -0000 1.19 --- class.WebApp.php 22 Jul 2004 16:25:39 -0000 1.20 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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. [...1038 lines suppressed...] ! $err_msg = " <div class='xml_error'> <strong>XML Error:</strong> $error_string. At <strong>$fname</strong>, *************** *** 598,603 **** "; ! return $err_msg; ! } } ?> \ No newline at end of file --- 599,604 ---- "; ! return $err_msg; ! } } ?> \ No newline at end of file Index: WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/WebApp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WebApp.php 25 Aug 2003 13:18:39 -0000 1.5 --- WebApp.php 22 Jul 2004 16:25:39 -0000 1.6 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:50
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/parser Modified Files: package.ParseRender.php class.WebPage.php class.WebObjectTpl.php class.WebObject.php class.WebClassTpl.php class.VarStack.php class.Template.php class.RepeatTpl.php class.Render.php class.RSNavigTpl.php class.Parser.php class.MainTpl.php class.IfTpl.php class.FileTpl.php Log Message: reformated and modified the copyleft notice Index: package.ParseRender.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/package.ParseRender.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** package.ParseRender.php 13 Jul 2004 16:14:48 -0000 1.4 --- package.ParseRender.php 22 Jul 2004 16:25:37 -0000 1.5 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ Index: class.WebPage.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebPage.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.WebPage.php 15 Jul 2004 14:46:04 -0000 1.12 --- class.WebPage.php 22 Jul 2004 16:25:37 -0000 1.13 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 55,84 **** function WebPage() ! { ! $this->collect = false; ! $this->html_page = ""; ! $this->tpl_collection = array(); ! $this->rs_collection = array(); ! $this->messages = array(); ! $this->dbg_messages = array(); ! $this->timer = new Timer; ! } /** Append the given string to the content of the <head> element. */ function append_to_head($str) ! { ! $contents = $this->tpl_collection["HeadTpl"]->contents; ! $contents = ereg_replace('</head>', $str.'</head>', $contents); ! $this->tpl_collection["HeadTpl"]->contents = $contents; ! } /** Append the given string to the content of the <body> element. */ function append_to_body($str) ! { ! $this->tpl_collection["BodyTpl"]->contents .= $str; ! } /** --- 56,85 ---- function WebPage() ! { ! $this->collect = false; ! $this->html_page = ""; ! $this->tpl_collection = array(); ! $this->rs_collection = array(); ! $this->messages = array(); ! $this->dbg_messages = array(); ! $this->timer = new Timer; ! } /** Append the given string to the content of the <head> element. */ function append_to_head($str) ! { ! $contents = $this->tpl_collection["HeadTpl"]->contents; ! $contents = ereg_replace('</head>', $str.'</head>', $contents); ! $this->tpl_collection["HeadTpl"]->contents = $contents; ! } /** Append the given string to the content of the <body> element. */ function append_to_body($str) ! { ! $this->tpl_collection["BodyTpl"]->contents .= $str; ! } /** *************** *** 87,105 **** */ function link_to_body(&$tpl) ! { ! $this->tpl_collection["BodyTpl"]->contents .= '&&'.$tpl->id.';;'; ! } /** Adds a template in the template collection. */ function addTemplate($tpl) ! { ! if (!isset($tpl->id)) ! { ! print "Error:WebPage:addTemplate: unidentified template.\n"; ! $tpl->toText(); ! return; ! } ! $this->tpl_collection[$tpl->id] = $tpl; ! } /** --- 88,106 ---- */ function link_to_body(&$tpl) ! { ! $this->tpl_collection["BodyTpl"]->contents .= '&&'.$tpl->id.';;'; ! } /** Adds a template in the template collection. */ function addTemplate($tpl) ! { ! if (!isset($tpl->id)) ! { ! print "Error:WebPage:addTemplate: unidentified template.\n"; ! $tpl->toText(); ! return; ! } ! $this->tpl_collection[$tpl->id] = $tpl; ! } /** *************** *** 108,122 **** */ function getTemplate($tpl_id) ! { ! if ( !isset($this->tpl_collection[$tpl_id]) ) ! { ! return UNDEFINED; ! } ! else ! { ! $tpl = &$this->tpl_collection[$tpl_id]; ! return $tpl; ! } ! } /** --- 109,123 ---- */ function getTemplate($tpl_id) ! { ! if ( !isset($this->tpl_collection[$tpl_id]) ) ! { ! return UNDEFINED; ! } ! else ! { ! $tpl = &$this->tpl_collection[$tpl_id]; ! return $tpl; ! } ! } /** *************** *** 125,161 **** */ function getObject($obj_id) ! { ! $tpl = $this->getTemplate($obj_id); ! if ($tpl==UNDEFINED) ! { ! return UNDEFINED; ! } ! else if ($tpl->type=="WebObjectTpl") ! { ! return $tpl; ! } ! else ! { ! return UNDEFINED; ! } ! } /** Adds a recordset in the recordset collection. */ function addRecordset(&$rs) ! { ! static $rsId = "recordset_00"; ! if (!isset($rs->ID)) ! { ! print WebApp::error_msg("Error:WebPage::addRecordset(): unidentified recordset.\n"); ! print $rs->toHtmlTable(); ! return; ! } ! else if ($rs->ID==UNDEFINED) ! { ! $rsId++; ! $rs->ID = $rsId; ! } ! $this->rs_collection[$rs->ID] = $rs; ! } /** --- 126,162 ---- */ function getObject($obj_id) ! { ! $tpl = $this->getTemplate($obj_id); ! if ($tpl==UNDEFINED) ! { ! return UNDEFINED; ! } ! else if ($tpl->type=="WebObjectTpl") ! { ! return $tpl; ! } ! else ! { ! return UNDEFINED; ! } ! } /** Adds a recordset in the recordset collection. */ function addRecordset(&$rs) ! { ! static $rsId = "recordset_00"; ! if (!isset($rs->ID)) ! { ! print WebApp::error_msg("Error:WebPage::addRecordset(): unidentified recordset.\n"); ! print $rs->toHtmlTable(); ! return; ! } ! else if ($rs->ID==UNDEFINED) ! { ! $rsId++; ! $rs->ID = $rsId; ! } ! $this->rs_collection[$rs->ID] = $rs; ! } /** *************** *** 164,186 **** */ function getRecordset($rs_id) ! { ! if ( !isset($this->rs_collection[$rs_id]) ) ! { ! return UNDEFINED; ! } ! else ! { ! $rs = &$this->rs_collection[$rs_id]; ! return $rs; ! } ! } /** Add a debug message to the list of debug messages. */ function addDbgMsg($dbg_msg, $comment ="") ! { ! $len = sizeof($this->dbg_messages); ! $this->dbg_messages[$len]["dbg_msg"] = $dbg_msg; ! $this->dbg_messages[$len]["comment"] = $comment; ! } /** --- 165,187 ---- */ function getRecordset($rs_id) ! { ! if ( !isset($this->rs_collection[$rs_id]) ) ! { ! return UNDEFINED; ! } ! else ! { ! $rs = &$this->rs_collection[$rs_id]; ! return $rs; ! } ! } /** Add a debug message to the list of debug messages. */ function addDbgMsg($dbg_msg, $comment ="") ! { ! $len = sizeof($this->dbg_messages); ! $this->dbg_messages[$len]["dbg_msg"] = $dbg_msg; ! $this->dbg_messages[$len]["comment"] = $comment; ! } /** *************** *** 189,226 **** */ function messages_to_js() ! { ! if (sizeof($this->messages)==0) return ""; ! $js = "<script type=\"text/javascript\" language=\"javascript\">\n"; ! $js .= "//<![CDATA[\n"; ! for ($i=0; $i < sizeof($this->messages); $i++) ! { ! $msg = $this->messages[$i]; ! $msg = str_replace("\n", '\n', $msg); //replace new lines with '\n' ! $msg = str_replace("'", "\\'", $msg); //escape single quotes ! $js .= "\talert('$msg');\n"; ! } ! $js .= "//]]>\n"; ! $js .= "</script>\n"; ! return $js; ! } function print_dbg_messages() ! { ! $nr = sizeof($this->dbg_messages); ! if ($nr==0) return; ! print "\n<hr/>\n"; ! print "<strong>Debug Messages:</strong><br/>\n"; ! for ($i=0; $i < $nr; $i++) ! { ! $dbg_msg = $this->dbg_messages[$i]["dbg_msg"]; ! $comment = $this->dbg_messages[$i]["comment"]; ! if ($comment<>"") print $comment." : "; ! print $dbg_msg."<br/>\n"; ! } ! print "\n<hr/>\n"; ! } /*------------------ debug functions --------------------------*/ --- 190,227 ---- */ function messages_to_js() ! { ! if (sizeof($this->messages)==0) return ""; ! $js = "<script type=\"text/javascript\" language=\"javascript\">\n"; ! $js .= "//<![CDATA[\n"; ! for ($i=0; $i < sizeof($this->messages); $i++) ! { ! $msg = $this->messages[$i]; ! $msg = str_replace("\n", '\n', $msg); //replace new lines with '\n' ! $msg = str_replace("'", "\\'", $msg); //escape single quotes ! $js .= "\talert('$msg');\n"; ! } ! $js .= "//]]>\n"; ! $js .= "</script>\n"; ! return $js; ! } function print_dbg_messages() ! { ! $nr = sizeof($this->dbg_messages); ! if ($nr==0) return; ! print "\n<hr/>\n"; ! print "<strong>Debug Messages:</strong><br/>\n"; ! for ($i=0; $i < $nr; $i++) ! { ! $dbg_msg = $this->dbg_messages[$i]["dbg_msg"]; ! $comment = $this->dbg_messages[$i]["comment"]; ! if ($comment<>"") print $comment." : "; ! print $dbg_msg."<br/>\n"; ! } ! print "\n<hr/>\n"; ! } /*------------------ debug functions --------------------------*/ *************** *** 228,272 **** /** (debug) Outputs the data of each template in $this->tpl_collection. */ function template_list() ! { ! $html = "<a name='top' id='top'> </a>\n"; ! $html .= "<div class='webapp'>\n"; ! $html .= "<strong>List of Templates of the Page:</strong>\n"; ! $html .= "<ul>\n"; ! reset($this->tpl_collection); ! while ( list($tpl_id, $tpl) = each($this->tpl_collection) ) ! { ! //don't output the appended templates ! if (ereg('web_app/append/append.html$', $tpl->id)) break; ! $html .= "\t<li><a href='#$tpl->id'>$tpl->id</a></li>\n"; ! } ! $html .= "</ul>\n"; ! $html .= "</div>\n"; ! //print each template ! reset($this->tpl_collection); ! while ( list($tplID, $tpl) = each($this->tpl_collection) ) ! { ! //don't output the appended templates ! if (ereg('web_app/append/append.html$', $tpl->id)) break; ! $html .= $tpl->toHtmlTable(); ! } ! $html .= "<hr />\n"; ! return $html; ! } /** (debug) Returns the structure of the loaded templates as a tree. */ function tpl_to_tree() //for debugging parse() ! { ! $tree = "<hr />\n"; ! $tree .= "<a name='top' id='top'> </a>\n"; ! $tree .= "<pre class='webapp'>\n"; ! $tree .= "<strong>The tree structure of the templates:</strong>\n\n"; ! $tree .= $this->rootTpl->to_tree(""); ! $tree .= "</pre>\n"; ! return $tree; ! } /** --- 229,273 ---- /** (debug) Outputs the data of each template in $this->tpl_collection. */ function template_list() ! { ! $html = "<a name='top' id='top'> </a>\n"; ! $html .= "<div class='webapp'>\n"; ! $html .= "<strong>List of Templates of the Page:</strong>\n"; ! $html .= "<ul>\n"; ! reset($this->tpl_collection); ! while ( list($tpl_id, $tpl) = each($this->tpl_collection) ) ! { ! //don't output the appended templates ! if (ereg('web_app/append/append.html$', $tpl->id)) break; ! $html .= "\t<li><a href='#$tpl->id'>$tpl->id</a></li>\n"; ! } ! $html .= "</ul>\n"; ! $html .= "</div>\n"; ! //print each template ! reset($this->tpl_collection); ! while ( list($tplID, $tpl) = each($this->tpl_collection) ) ! { ! //don't output the appended templates ! if (ereg('web_app/append/append.html$', $tpl->id)) break; ! $html .= $tpl->toHtmlTable(); ! } ! $html .= "<hr />\n"; ! return $html; ! } /** (debug) Returns the structure of the loaded templates as a tree. */ function tpl_to_tree() //for debugging parse() ! { ! $tree = "<hr />\n"; ! $tree .= "<a name='top' id='top'> </a>\n"; ! $tree .= "<pre class='webapp'>\n"; ! $tree .= "<strong>The tree structure of the templates:</strong>\n\n"; ! $tree .= $this->rootTpl->to_tree(""); ! $tree .= "</pre>\n"; ! return $tree; ! } /** *************** *** 276,290 **** */ function recordsets_to_html() ! { ! $html_recs = "<hr />\n"; ! $html_recs .= "<b> THE RECORDSETS OF THE PAGE: </b><br />\n"; ! reset($this->rs_collection); ! while ( list($rsId,$rs) = each($this->rs_collection) ) ! { ! $html_recs .= $rs->toHtmlTable(); ! } ! $html_recs .= "<hr />\n"; ! return $html_recs; ! } } ?> \ No newline at end of file --- 277,291 ---- */ function recordsets_to_html() ! { ! $html_recs = "<hr />\n"; ! $html_recs .= "<b> THE RECORDSETS OF THE PAGE: </b><br />\n"; ! reset($this->rs_collection); ! while ( list($rsId,$rs) = each($this->rs_collection) ) ! { ! $html_recs .= $rs->toHtmlTable(); ! } ! $html_recs .= "<hr />\n"; ! return $html_recs; ! } } ?> \ No newline at end of file Index: class.WebObjectTpl.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebObjectTpl.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** class.WebObjectTpl.php 13 Jul 2004 13:18:08 -0000 1.8 --- class.WebObjectTpl.php 22 Jul 2004 16:25:37 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 46,82 **** /** Constructor */ function WebObjectTpl($webObjId) ! { ! //call constructor of the superclass ! $this->Template($webObjId, "WebObjectTpl"); ! //increment the object counter of the class and set the count ! $this->class->obj_count++; ! $this->obj_count = $this->class->obj_count; ! } /** This is called before the template of the WebObject is parsed. */ function before_parse() ! { ! //add the state vars of this webobj to the current scope ! global $tplVars; ! $tplVars->addVars($this->getSVars()); ! //save the current scope of the var stack ! $this->scope = $tplVars->getCurrentScope(); ! //call the event handler ! $this->handle_event(); ! //call the function onParse ! $this->onParse(); ! } /** This is called after the template of the WebObject is parsed. */ function after_parse() ! { ! $this->scope = 0; ! //call the function afterParse ! $this->afterParse(); ! } /** --- 47,83 ---- /** Constructor */ function WebObjectTpl($webObjId) ! { ! //call constructor of the superclass ! $this->Template($webObjId, "WebObjectTpl"); ! //increment the object counter of the class and set the count ! $this->class->obj_count++; ! $this->obj_count = $this->class->obj_count; ! } /** This is called before the template of the WebObject is parsed. */ function before_parse() ! { ! //add the state vars of this webobj to the current scope ! global $tplVars; ! $tplVars->addVars($this->getSVars()); ! //save the current scope of the var stack ! $this->scope = $tplVars->getCurrentScope(); ! //call the event handler ! $this->handle_event(); ! //call the function onParse ! $this->onParse(); ! } /** This is called after the template of the WebObject is parsed. */ function after_parse() ! { ! $this->scope = 0; ! //call the function afterParse ! $this->afterParse(); ! } /** *************** *** 89,147 **** */ function handle_event() ! { ! global $event; ! if ( $event->target==$this->id ! or $event->target=="any" ) ! { ! $method_name = "on_".$event->name; ! if (method_exists($this, $method_name)) ! { ! //the webclass has declared a specific ! //event handler for this event, call it ! $this->$method_name($event->args); ! } ! else ! { ! //call the general event handler of the webox ! $this->eventHandler($event); ! } ! } ! } /** Returns an array with all the evaluated parameters. */ function getParams() ! { ! $params = $this->params; ! reset($params); ! while ( list($p_name,$expr) = each($params) ) ! { ! $expr = WebApp::replaceVars($expr); ! //$params[$p_name] = WebApp::evaluate($expr); ! $params[$p_name] = $expr; ! } ! return $params; ! } function is_webbox() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return true; ! else return false; ! } function get_obj_name() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return $this->id; //this is a webbox ! else return substr($this->id, $pos+2); ! } function get_class_name() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return $this->id; //this is a webbox ! else return substr($this->id, 0, $pos); ! } /** --- 90,148 ---- */ function handle_event() ! { ! global $event; ! if ( $event->target==$this->id ! or $event->target=="any" ) ! { ! $method_name = "on_".$event->name; ! if (method_exists($this, $method_name)) ! { ! //the webclass has declared a specific ! //event handler for this event, call it ! $this->$method_name($event->args); ! } ! else ! { ! //call the general event handler of the webox ! $this->eventHandler($event); ! } ! } ! } /** Returns an array with all the evaluated parameters. */ function getParams() ! { ! $params = $this->params; ! reset($params); ! while ( list($p_name,$expr) = each($params) ) ! { ! $expr = WebApp::replaceVars($expr); ! //$params[$p_name] = WebApp::evaluate($expr); ! $params[$p_name] = $expr; ! } ! return $params; ! } function is_webbox() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return true; ! else return false; ! } function get_obj_name() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return $this->id; //this is a webbox ! else return substr($this->id, $pos+2); ! } function get_class_name() ! { ! $pos = strpos($this->id, "::"); ! if ($pos===false) return $this->id; //this is a webbox ! else return substr($this->id, 0, $pos); ! } /** *************** *** 151,172 **** */ function getObjVars() ! { ! $vars = array( ! "obj_count" => $this->obj_count, ! "obj_id" => $this->id, ! "obj_name" => $this->get_obj_name(), ! "class_name"=> $this->get_class_name() ! ); ! return $vars; ! } /** debug */ function attribs2html() { ! reset($this->params); ! while ( list($p_name,$expr) = each($this->params) ) ! { ! $params .= " $p_name=($expr); "; ! } ! $html = Template::attribs2html() . " <tr> <td bgcolor='#eeeeee' valign='top' align='right'>Params:</td> --- 152,173 ---- */ function getObjVars() ! { ! $vars = array( ! "obj_count" => $this->obj_count, ! "obj_id" => $this->id, ! "obj_name" => $this->get_obj_name(), ! "class_name"=> $this->get_class_name() ! ); ! return $vars; ! } /** debug */ function attribs2html() { ! reset($this->params); ! while ( list($p_name,$expr) = each($this->params) ) ! { ! $params .= " $p_name=($expr); "; ! } ! $html = Template::attribs2html() . " <tr> <td bgcolor='#eeeeee' valign='top' align='right'>Params:</td> *************** *** 178,183 **** </tr> "; ! return $html; ! } } ?> \ No newline at end of file --- 179,184 ---- </tr> "; ! return $html; ! } } ?> \ No newline at end of file Index: class.WebObject.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebObject.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** class.WebObject.php 15 Jul 2004 14:46:04 -0000 1.9 --- class.WebObject.php 22 Jul 2004 16:25:37 -0000 1.10 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 73,147 **** /** empty constructor */ function WebObject() ! { ! //if the class that extends WebObject defines a constructor, ! //this one will not be called during the creation of the object, ! //and if it does not define a constructor this one will be called; ! //that is why the construction of this object is not done here ! //but is done in another function that is called explicitly from ! //the parser ! } function construct_WebObject($id) ! { ! //call the constructor of the superclass ! $this->WebObjectTpl($id); ! //save the current scope ! global $tplVars; ! $this->scope = $tplVars->getCurrentScope(); ! } function getStateVars() ! { ! $sVars = $this->getSVars(); ! if (sizeof($sVars)==0) ! { ! //this is the first time that this webobj is ! //created (during the session), call init() ! $this->init(); ! //this variable is set so that the next time ! //init is not called again ! $this->addSVar("initialized", "true"); ! } ! } /** Add state var (session var). */ function addSVar($var_name, $var_value, $db =false) ! { ! global $session; ! $v_name = $this->id."->".$var_name; ! $session->addVar($v_name, $var_value, $db); ! } /** $arr_vars is a list of vars (an associative array). */ function addSVars($arr_vars, $db =false) ! { ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! $this->addSVar($var_name, $var_value, $db); ! } ! } /** get a state var of the webobj */ function getSVar($var_name) ! { ! $v_name = $this->id."->".$var_name; ! global $session; ! $var_value = $session->getVar($v_name); ! return $var_value; ! } /** set a state var of the webobj */ function setSVar($var_name, $var_value) ! { ! //set it in the session ! $v_name = $this->id."->".$var_name; ! WebApp::setSVar($v_name, $var_value); ! //change it to the var stack as well ! global $tplVars; ! $tplVars->addVar($var_name, $var_value, $this->scope); ! } /** --- 74,148 ---- /** empty constructor */ function WebObject() ! { ! //if the class that extends WebObject defines a constructor, ! //this one will not be called during the creation of the object, ! //and if it does not define a constructor this one will be called; ! //that is why the construction of this object is not done here ! //but is done in another function that is called explicitly from ! //the parser ! } function construct_WebObject($id) ! { ! //call the constructor of the superclass ! $this->WebObjectTpl($id); ! //save the current scope ! global $tplVars; ! $this->scope = $tplVars->getCurrentScope(); ! } function getStateVars() ! { ! $sVars = $this->getSVars(); ! if (sizeof($sVars)==0) ! { ! //this is the first time that this webobj is ! //created (during the session), call init() ! $this->init(); ! //this variable is set so that the next time ! //init is not called again ! $this->addSVar("initialized", "true"); ! } ! } /** Add state var (session var). */ function addSVar($var_name, $var_value, $db =false) ! { ! global $session; ! $v_name = $this->id."->".$var_name; ! $session->addVar($v_name, $var_value, $db); ! } /** $arr_vars is a list of vars (an associative array). */ function addSVars($arr_vars, $db =false) ! { ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! $this->addSVar($var_name, $var_value, $db); ! } ! } /** get a state var of the webobj */ function getSVar($var_name) ! { ! $v_name = $this->id."->".$var_name; ! global $session; ! $var_value = $session->getVar($v_name); ! return $var_value; ! } /** set a state var of the webobj */ function setSVar($var_name, $var_value) ! { ! //set it in the session ! $v_name = $this->id."->".$var_name; ! WebApp::setSVar($v_name, $var_value); ! //change it to the var stack as well ! global $tplVars; ! $tplVars->addVar($var_name, $var_value, $this->scope); ! } /** *************** *** 153,196 **** */ function getSVars($type =UNDEFINED) ! { ! global $session; ! switch ($type) ! { ! case "DB": ! $arr_vars = $session->dbVars; ! break; ! case "JS": ! $arr_vars = $session->Vars; ! break; ! default: ! print WebApp::warning_msg("WebObject::getSVars(): unreckognized \$type '$type'."); ! 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; ! } /** $arr_vars is an associative array */ function setSVars($arr_vars) ! { ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! $this->setSVar($var_name, $var_value); ! } ! } /** --- 154,197 ---- */ function getSVars($type =UNDEFINED) ! { ! global $session; ! switch ($type) ! { ! case "DB": ! $arr_vars = $session->dbVars; ! break; ! case "JS": ! $arr_vars = $session->Vars; ! break; ! default: ! print WebApp::warning_msg("WebObject::getSVars(): unreckognized \$type '$type'."); ! 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; ! } /** $arr_vars is an associative array */ function setSVars($arr_vars) ! { ! while (list($var_name,$var_value) = each($arr_vars)) ! { ! $this->setSVar($var_name, $var_value); ! } ! } /** *************** *** 199,204 **** */ function state2html() ! { ! $html = " <br /> <a name='$this->id' id='$this->id'> </a>[<a href='tree'>Top</a>] --- 200,205 ---- */ function state2html() ! { ! $html = " <br /> <a name='$this->id' id='$this->id'> </a>[<a href='tree'>Top</a>] *************** *** 213,220 **** </tr>"; ! $sVars = $this->getSVars("JS"); ! while (list($var_name,$var_value) = each($sVars)) ! { ! $html .= " <tr> <td bgcolor='#f9f9f9'> </td> --- 214,221 ---- </tr>"; ! $sVars = $this->getSVars("JS"); ! while (list($var_name,$var_value) = each($sVars)) ! { ! $html .= " <tr> <td bgcolor='#f9f9f9'> </td> *************** *** 222,230 **** <td bgcolor='#f9f9ff'>$var_value</td> </tr>"; ! } ! $sVars = $this->getSVars("DB"); ! while (list($var_name,$var_value) = each($sVars)) ! { ! $html .= " <tr> <td bgcolor='#f9f9f9'>DB</td> --- 223,231 ---- <td bgcolor='#f9f9ff'>$var_value</td> </tr>"; ! } ! $sVars = $this->getSVars("DB"); ! while (list($var_name,$var_value) = each($sVars)) ! { ! $html .= " <tr> <td bgcolor='#f9f9f9'>DB</td> *************** *** 232,240 **** <td bgcolor='#f9f9ff'>$var_value</td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } } ?> \ No newline at end of file --- 233,241 ---- <td bgcolor='#f9f9ff'>$var_value</td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } } ?> \ No newline at end of file Index: class.WebClassTpl.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.WebClassTpl.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** class.WebClassTpl.php 15 Jul 2004 13:36:13 -0000 1.10 --- class.WebClassTpl.php 22 Jul 2004 16:25:37 -0000 1.11 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 39,75 **** function WebClassTpl($id, $path =UNDEFINED) ! { ! $this->Template($id, "WebClassTpl"); ! $this->path = $path; ! $this->params = array(); ! $this->obj_count = 0; ! } function before_parse() ! { ! //load the .db file of the webclass ! $this->parse_db_file(); ! //include the PHP class of the webClass ! $this->include_php_class(); ! //include the JS code of the webClass ! $this->include_js_code(); ! //include the CSS code of the webClass ! $this->include_css_code(); ! } /** Parse the .db file of the webclass, if it exists. */ function parse_db_file() ! { ! $fname = $this->path.$this->id.".db"; ! if (file_exists($fname)) ! { ! //parse the file ! global $parser; ! $parser->parse_file($fname); ! } ! } /** --- 40,76 ---- function WebClassTpl($id, $path =UNDEFINED) ! { ! $this->Template($id, "WebClassTpl"); ! $this->path = $path; ! $this->params = array(); ! $this->obj_count = 0; ! } function before_parse() ! { ! //load the .db file of the webclass ! $this->parse_db_file(); ! //include the PHP class of the webClass ! $this->include_php_class(); ! //include the JS code of the webClass ! $this->include_js_code(); ! //include the CSS code of the webClass ! $this->include_css_code(); ! } /** Parse the .db file of the webclass, if it exists. */ function parse_db_file() ! { ! $fname = $this->path.$this->id.".db"; ! if (file_exists($fname)) ! { ! //parse the file ! global $parser; ! $parser->parse_file($fname); ! } ! } /** *************** *** 79,97 **** */ function include_php_class() ! { ! $fname = $this->path."/".$this->id.".php"; ! if (file_exists($fname)) ! { ! include_once $fname; ! } ! else ! { ! //create a dummy class for this WebClass ! $class_name = $this->id; ! $arr_methods = get_class_methods($class_name); ! if (sizeof($arr_methods)==0) ! { ! $dummy_class_definition = ! "class $class_name extends WebObject { /** --- 80,98 ---- */ function include_php_class() ! { ! $fname = $this->path."/".$this->id.".php"; ! if (file_exists($fname)) ! { ! include_once $fname; ! } ! else ! { ! //create a dummy class for this WebClass ! $class_name = $this->id; ! $arr_methods = get_class_methods($class_name); ! if (sizeof($arr_methods)==0) ! { ! $dummy_class_definition = ! "class $class_name extends WebObject { /** *************** *** 105,112 **** } }"; ! eval($dummy_class_definition); ! } ! } ! } /** --- 106,113 ---- } }"; ! eval($dummy_class_definition); ! } ! } ! } /** *************** *** 116,129 **** */ function include_js_code() ! { ! $fname = $this->path.$this->id.".js"; ! if (file_exists($fname)) ! { ! global $webPage; ! $fname = WebApp::to_url($fname); ! $include_js = " <script type=\"text/javascript\" language=\"javascript\" src=\"$fname\"></script>\n"; ! $webPage->append_to_head($include_js); ! } ! } /** --- 117,130 ---- */ function include_js_code() ! { ! $fname = $this->path.$this->id.".js"; ! if (file_exists($fname)) ! { ! global $webPage; ! $fname = WebApp::to_url($fname); ! $include_js = " <script type=\"text/javascript\" language=\"javascript\" src=\"$fname\"></script>\n"; ! $webPage->append_to_head($include_js); ! } ! } /** *************** *** 133,156 **** */ function include_css_code() ! { ! $fname = $this->path.$this->id.".css"; ! if (file_exists($fname)) ! { ! global $webPage; ! $fname = WebApp::to_url($fname); ! $include_css = " <link type=\"text/css\" rel=\"stylesheet\" href=\"$fname\" />\n"; ! $webPage->append_to_head($include_css); ! } ! } /** for debug */ function attribs2html() ! { ! reset($this->params); ! while ( list($p_name,$expr) = each($this->params) ) ! { ! $params .= " $p_name=($expr); "; ! } ! $html = Template::attribs2html() . " <tr> <td bgcolor='#eeeeee' valign='top' align='right'>Path:</td> --- 134,157 ---- */ function include_css_code() ! { ! $fname = $this->path.$this->id.".css"; ! if (file_exists($fname)) ! { ! global $webPage; ! $fname = WebApp::to_url($fname); ! $include_css = " <link type=\"text/css\" rel=\"stylesheet\" href=\"$fname\" />\n"; ! $webPage->append_to_head($include_css); ! } ! } /** for debug */ function attribs2html() ! { ! reset($this->params); ! while ( list($p_name,$expr) = each($this->params) ) ! { ! $params .= " $p_name=($expr); "; ! } ! $html = Template::attribs2html() . " <tr> <td bgcolor='#eeeeee' valign='top' align='right'>Path:</td> *************** *** 162,167 **** </tr> "; ! return $html; ! } } ?> \ No newline at end of file --- 163,168 ---- </tr> "; ! return $html; ! } } ?> \ No newline at end of file Index: class.VarStack.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.VarStack.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** class.VarStack.php 22 Jul 2004 09:41:24 -0000 1.7 --- class.VarStack.php 22 Jul 2004 16:25:37 -0000 1.8 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 31,56 **** function VarStack() ! { ! $this->vars = array(); ! $this->pushScope(); ! } function pushScope() ! { ! array_push($this->vars, array()); ! } function popScope() ! { ! array_pop($this->vars); ! } /** Returns a number, which is the index of the current scope. */ function getCurrentScope() ! { ! $len = count($this->vars); ! $curr_scope = $len - 1; ! return $curr_scope; ! } /** --- 32,57 ---- function VarStack() ! { ! $this->vars = array(); ! $this->pushScope(); ! } function pushScope() ! { ! array_push($this->vars, array()); ! } function popScope() ! { ! array_pop($this->vars); ! } /** Returns a number, which is the index of the current scope. */ function getCurrentScope() ! { ! $len = count($this->vars); ! $curr_scope = $len - 1; ! return $curr_scope; ! } /** *************** *** 59,99 **** */ function addVar($var_name, $var_value, $scope_nr=UNDEFINED) ! { ! if ($scope_nr==UNDEFINED) //no scope is given ! { ! $scope_nr = $this->getCurrentScope(); ! $current_scope = &$this->vars[$scope_nr]; ! $current_scope[$var_name] = $var_value; ! } ! else ! { ! $len = count($this->vars); ! if ($scope_nr >= $len) return; ! $scope = &$this->vars[$scope_nr]; ! $scope[$var_name] = $var_value; ! } ! } /** Add a variable to the first scope. */ function addGlobalVar($var_name, $var_value) ! { ! $first_scope = &$this->vars[0]; ! $first_scope[$var_name] = $var_value; ! } /** Add a list of vars to the current scope. */ function addVars($arrVars) ! { ! $len = count($this->vars); ! $current_scope = &$this->vars[$len-1]; ! $current_scope = array_merge($current_scope, $arrVars); ! } /** Add a list of vars to the first scope. */ function addGlobalVars($arrVars) ! { ! $first_scope = &$this->vars[0]; ! $first_scope = array_merge($first_scope, $arrVars); ! } /** --- 60,100 ---- */ function addVar($var_name, $var_value, $scope_nr=UNDEFINED) ! { ! if ($scope_nr==UNDEFINED) //no scope is given ! { ! $scope_nr = $this->getCurrentScope(); ! $current_scope = &$this->vars[$scope_nr]; ! $current_scope[$var_name] = $var_value; ! } ! else ! { ! $len = count($this->vars); ! if ($scope_nr >= $len) return; ! $scope = &$this->vars[$scope_nr]; ! $scope[$var_name] = $var_value; ! } ! } /** Add a variable to the first scope. */ function addGlobalVar($var_name, $var_value) ! { ! $first_scope = &$this->vars[0]; ! $first_scope[$var_name] = $var_value; ! } /** Add a list of vars to the current scope. */ function addVars($arrVars) ! { ! $len = count($this->vars); ! $current_scope = &$this->vars[$len-1]; ! $current_scope = array_merge($current_scope, $arrVars); ! } /** Add a list of vars to the first scope. */ function addGlobalVars($arrVars) ! { ! $first_scope = &$this->vars[0]; ! $first_scope = array_merge($first_scope, $arrVars); ! } /** *************** *** 103,122 **** */ function getVar($var_name) ! { ! $found = false; ! $len = count($this->vars); ! for ($i = $len-1; $i>=0; $i--) ! { ! $scope = &$this->vars[$i]; ! if (isset($scope[$var_name])) ! { ! $found = true; ! $var_value = &$scope[$var_name]; ! break; ! } ! } ! if ($found) return $var_value; ! else return UNDEFINED; ! } ///////////////////////////////////////////////////////////////// --- 104,123 ---- */ function getVar($var_name) ! { ! $found = false; ! $len = count($this->vars); ! for ($i = $len-1; $i>=0; $i--) ! { ! $scope = &$this->vars[$i]; ! if (isset($scope[$var_name])) ! { ! $found = true; ! $var_value = &$scope[$var_name]; ! break; ! } ! } ! if ($found) return $var_value; ! else return UNDEFINED; ! } ///////////////////////////////////////////////////////////////// *************** *** 124,141 **** /** For debug; returns the var stack as an HTML table. */ function toHtmlTable() ! { ! $html = "<strong>VarStack</strong>\n"; ! $html .= "<table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'>"; ! $len = count($this->vars); ! for ($i = $len-1; $i>=0; $i--) ! { ! $html .= " <tr> <td bgcolor='#eeeeff' colspan='2' align='center'>Scope $i</td> </tr>"; ! $scope = &$this->vars[$i]; ! while (list($var_name,$var_value) = each($scope)) ! { ! $html .= " <tr> <td bgcolor='#eeeeee' align='right'>$var_name</td> --- 125,142 ---- /** For debug; returns the var stack as an HTML table. */ function toHtmlTable() ! { ! $html = "<strong>VarStack</strong>\n"; ! $html .= "<table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'>"; ! $len = count($this->vars); ! for ($i = $len-1; $i>=0; $i--) ! { ! $html .= " <tr> <td bgcolor='#eeeeff' colspan='2' align='center'>Scope $i</td> </tr>"; ! $scope = &$this->vars[$i]; ! while (list($var_name,$var_value) = each($scope)) ! { ! $html .= " <tr> <td bgcolor='#eeeeee' align='right'>$var_name</td> *************** *** 143,170 **** </tr> "; ! } ! reset($scope); ! } ! $html .= "</table>\n"; ! return $html; ! } /** For test and debug */ function test() ! { ! $vars = new VarStack; ! //$vars->pushScope(); ! $vars->addVars(array("a"=>"XXX", "b"=>"BBB", "c"=>"")); ! $vars->pushScope(); ! $vars->addVar("a", "XXX"); ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"YYY")); ! $vars->pushScope(); ! $vars->addGlobalVar("g1", "GGG"); ! /* print " var a='".$vars->getVar("a")."' \n"; print " var c='".$vars->getVar("c")."' \n"; --- 144,171 ---- </tr> "; ! } ! reset($scope); ! } ! $html .= "</table>\n"; ! return $html; ! } /** For test and debug */ function test() ! { ! $vars = new VarStack; ! //$vars->pushScope(); ! $vars->addVars(array("a"=>"XXX", "b"=>"BBB", "c"=>"")); ! $vars->pushScope(); ! $vars->addVar("a", "XXX"); ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"YYY")); ! $vars->pushScope(); ! $vars->addGlobalVar("g1", "GGG"); ! /* print " var a='".$vars->getVar("a")."' \n"; print " var c='".$vars->getVar("c")."' \n"; *************** *** 172,181 **** $vars->printOut(); return; ! */ ! $vars->popScope(); ! $vars->popScope(); ! /* print " var a='".$vars->getVar("a")."' \n"; print " var c='".$vars->getVar("c")."' \n"; --- 173,182 ---- $vars->printOut(); return; ! */ ! $vars->popScope(); ! $vars->popScope(); ! /* print " var a='".$vars->getVar("a")."' \n"; print " var c='".$vars->getVar("c")."' \n"; *************** *** 183,204 **** $vars->printOut(); return; ! */ ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"BBB")); ! $vars->pushScope(); ! $vars->addGlobalVar("g2", "GGG2"); ! $vars->addGlobalVar("g1", "GGG1"); ! $vars->addVar("a", "XXX"); ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"YYY")); ! print " var g1='".$vars->getVar("g1")."' \n"; ! print " var a='".$vars->getVar("a")."' \n"; ! print " var c='".$vars->getVar("c")."' \n"; ! print " var x='".$vars->getVar("x")."' \n"; ! $vars->printOut(); ! return; ! } } --- 184,205 ---- $vars->printOut(); return; ! */ ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"BBB")); ! $vars->pushScope(); ! $vars->addGlobalVar("g2", "GGG2"); ! $vars->addGlobalVar("g1", "GGG1"); ! $vars->addVar("a", "XXX"); ! $vars->pushScope(); ! $vars->addVars(array("a"=>"AAA", "b"=>"YYY")); ! print " var g1='".$vars->getVar("g1")."' \n"; ! print " var a='".$vars->getVar("a")."' \n"; ! print " var c='".$vars->getVar("c")."' \n"; ! print " var x='".$vars->getVar("x")."' \n"; ! $vars->printOut(); ! return; ! } } Index: class.Template.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Template.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.Template.php 15 Jul 2004 14:46:04 -0000 1.12 --- class.Template.php 22 Jul 2004 16:25:37 -0000 1.13 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! 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 */ --- 1,22 ---- <?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 */ *************** *** 49,79 **** /** Constructor */ function Template($tplId =UNDEFINED, $type ="Template") ! { ! static $default_id = "Template_01"; ! $this->id = ($tplId<>UNDEFINED ? $tplId : $default_id++); ! $this->type = $type; ! $this->vars = array(); ! } /** Adds a new variable in the array of variables. */ function addVar($var_name, $expression) ! { ! $var_name = $var_name; ! $this->vars[$var_name] = $expression; ! } /** Returns an array with all the evaluated variables. */ function getVars() ! { ! reset($this->vars); ! $tplVars = $this->vars; ! while ( list($var_name,$expr) = each($tplVars) ) ! { ! $expr = WebApp::replaceVars($expr); ! $tplVars[$var_name] = WebApp::evaluate($expr); ! } ! return $tplVars; ! } /** --- 50,80 ---- /** Constructor */ function Template($tplId =UNDEFINED, $type ="Template") ! { ! static $default_id = "Template_01"; ! $this->id = ($tplId<>UNDEFINED ? $tplId : $default_id++); ! $this->type = $type; ! $this->vars = array(); ! } /** Adds a new variable in the array of variables. */ function addVar($var_name, $expression) ! { ! $var_name = $var_name; ! $this->vars[$var_name] = $expression; ! } /** Returns an array with all the evaluated variables. */ function getVars() ! { ! reset($this->vars); ! $tplVars = $this->vars; ! while ( list($var_name,$expr) = each($tplVars) ) ! { ! $expr = WebApp::replaceVars($expr); ! $tplVars[$var_name] = WebApp::evaluate($expr); ! } ! return $tplVars; ! } /** *************** *** 103,160 **** */ function normalize_space() ! { ! $str = $this->contents; ! //if there are 2 or more empty lines, replace them by a single one ! $str = preg_replace('/\n([ \t]*\n){2,}/', "\n\n", $str); ! //remove any empty lines in the begining ! $str = preg_replace('/^\s*\n/', '', $str); ! //remove any empty lines in the end ! $str = preg_replace('/\n\s*$/', '', $str); ! //Trim the indentation from the beginning of each line. ! //get the indentation o... [truncated message content] |
From: Dashamir H. <das...@us...> - 2004-07-22 16:25:49
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/boxes/menu/edit Modified Files: edit_menu.php Log Message: reformated and modified the copyleft notice Index: edit_menu.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/menu/edit/edit_menu.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_menu.php 16 Jul 2004 07:41:39 -0000 1.1 --- edit_menu.php 22 Jul 2004 16:25:38 -0000 1.2 *************** *** 1,35 **** <?php class edit_menu extends WebObject { function init() ! { ! //the menu item that is being edited, initially the root ! $this->addSVar('item_id', 'menu'); ! } /** select an item for editing */ function on_select($event_args) ! { ! $item_id = $event_args['item_id']; ! $this->setSVar('item_id', $item_id); ! } function transform_menu($transformer, $arr_params =array()) ! { ! //apply the transformer and get the new menu ! $new_menu = $this->transform($transformer, $arr_params); ! //save the transformed menu to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $new_menu); ! fclose($fp); ! //move to menu.xml and set permissions ! $menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper mv $tmpfname $menu_xml"); ! shell_exec("./wrapper chown dasho.dasho $menu_xml"); ! shell_exec("./wrapper chmod 664 $menu_xml"); ! } /** --- 1,56 ---- <?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 + */ + class edit_menu extends WebObject { function init() ! { ! //the menu item that is being edited, initially the root ! $this->addSVar('item_id', 'menu'); ! } /** select an item for editing */ function on_select($event_args) ! { ! $item_id = $event_args['item_id']; ! $this->setSVar('item_id', $item_id); ! } function transform_menu($transformer, $arr_params =array()) ! { ! //apply the transformer and get the new menu ! $new_menu = $this->transform($transformer, $arr_params); ! //save the transformed menu to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $new_menu); ! fclose($fp); ! //move to menu.xml and set permissions ! $menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper mv $tmpfname $menu_xml"); ! shell_exec("./wrapper chown dasho.dasho $menu_xml"); ! shell_exec("./wrapper chmod 664 $menu_xml"); ! } /** *************** *** 38,185 **** */ function transform($transformer, $arr_params =array()) ! { ! //construct the string $params ! $params = ''; ! while (list($p_name, $p_value) = each($arr_params)) ! { ! $params .= "--stringparam $p_name \"$p_value\" "; ! } ! //apply the $transformer with $params to menu.xml ! $menu_xml = MENU.'edit/menu.xml'; ! $xsl_file = MENU."edit/xsl/$transformer"; ! $result = shell_exec("xsltproc $params $xsl_file $menu_xml 2>&1"); ! //print "<xmp>$result</xmp>\n"; ! return $result; ! } /** save modifications in id and caption of the current item */ function on_update($event_args) ! { ! //if the id has changed, check that the new id does not exist ! $item_id = $this->getSVar('item_id'); ! $new_id = $event_args['new_id']; ! $output = $this->transform('get_id.xsl', array('id'=>$new_id)); ! if ($new_id <> $item_id and $output==$new_id) ! { ! WebApp::message("Another menu item with id '$new_id' already exists."); ! return; ! } ! $params = $event_args; ! $params['id'] = $item_id; ! $this->transform_menu('update.xsl', $params); ! $this->setSVar('item_id', $new_id); ! } /** delete the current item and set the parent item as the current one */ function on_delete($event_args) ! { ! $params['id'] = $this->getSVar('item_id'); ! $parent_id = $this->transform('get_parent_id.xsl', $params); ! $this->transform_menu('delete.xsl', $params); ! $this->setSVar('item_id', $parent_id); ! } /** move the current item up */ function on_move_up($event_args) ! { ! $params['id'] = $event_args['item_id']; ! $this->transform_menu('move_up.xsl', $params); ! } /** move the current item down */ function on_move_down($event_args) ! { ! $params['id'] = $event_args['item_id']; ! $this->transform_menu('move_down.xsl', $params); ! } /** add a new subitem to the current item */ function on_add_subitem($event_args) ! { ! //check that the new id does not exist ! $new_id = $event_args['new_id']; ! $output = $this->transform('get_id.xsl', array('id'=>$new_id)); ! if ($output==$new_id) ! { ! WebApp::message("Another menu item with id '$new_id' already exists."); ! return; ! } ! $params = $event_args; ! $params['id'] = $this->getSVar('item_id'); ! $this->transform_menu('add_subitem.xsl', $params); ! } /** apply the modifications to the main menu */ function on_apply($event_args) ! { ! $menu_xml = MENU.'menu.xml'; ! $edit_menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper cp $edit_menu_xml $menu_xml"); ! //get menu_items.js ! $menu_items = $this->transform('menu_items.xsl'); ! //save it to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $menu_items); ! fclose($fp); ! //move to menu_items.js and set permissions ! $menu_items_js = MENU.'menu_items.js'; ! shell_exec("./wrapper mv $tmpfname $menu_items_js"); ! shell_exec("./wrapper chown dasho.dasho $menu_items_js"); ! shell_exec("./wrapper chmod 664 $menu_items_js"); ! //get book_list.php ! $book_list = $this->transform('book_list.xsl'); ! //save it to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $book_list); ! fclose($fp); ! //move to book_list_php and set permissions ! $book_list_php = MENU.'book_list.php'; ! shell_exec("./wrapper mv $tmpfname $book_list_php"); ! shell_exec("./wrapper chown dasho.dasho $book_list_php"); ! shell_exec("./wrapper chmod 664 $book_list_php"); ! } /** discard any modifications and get a copy of the main menu */ function on_cancel($event_args) ! { ! $menu_xml = MENU.'menu.xml'; ! $edit_menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper cp $menu_xml $edit_menu_xml"); ! } function onRender() ! { ! //this variable makes visible the edit menu in menu.html ! WebApp::addGlobalVar('edit_menu_visible', 'true'); ! $item_id = $this->getSVar('item_id'); ! //get the selected item and subitems ! $items = $this->transform('subitems.xsl', array('id'=>$item_id)); ! $arr_lines = explode("\n", $items); ! //get the caption of the selected item (from the first line) ! list($id, $item_caption) = split(' ', $arr_lines[0], 2); ! WebApp::addVar('item_caption', $item_caption); ! //create a recordset with id-s and captions of the subitems ! $rs = new EditableRS('subitems'); ! for ($i=1; $i < sizeof($arr_lines); $i++) ! { ! list($id, $caption) = split(' ', $arr_lines[$i], 2); ! if ($id=='') continue; ! $rs->addRec(compact('id','caption')); ! } ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> \ No newline at end of file --- 59,206 ---- */ function transform($transformer, $arr_params =array()) ! { ! //construct the string $params ! $params = ''; ! while (list($p_name, $p_value) = each($arr_params)) ! { ! $params .= "--stringparam $p_name \"$p_value\" "; ! } ! //apply the $transformer with $params to menu.xml ! $menu_xml = MENU.'edit/menu.xml'; ! $xsl_file = MENU."edit/xsl/$transformer"; ! $result = shell_exec("xsltproc $params $xsl_file $menu_xml 2>&1"); ! //print "<xmp>$result</xmp>\n"; ! return $result; ! } /** save modifications in id and caption of the current item */ function on_update($event_args) ! { ! //if the id has changed, check that the new id does not exist ! $item_id = $this->getSVar('item_id'); ! $new_id = $event_args['new_id']; ! $output = $this->transform('get_id.xsl', array('id'=>$new_id)); ! if ($new_id <> $item_id and $output==$new_id) ! { ! WebApp::message("Another menu item with id '$new_id' already exists."); ! return; ! } ! $params = $event_args; ! $params['id'] = $item_id; ! $this->transform_menu('update.xsl', $params); ! $this->setSVar('item_id', $new_id); ! } /** delete the current item and set the parent item as the current one */ function on_delete($event_args) ! { ! $params['id'] = $this->getSVar('item_id'); ! $parent_id = $this->transform('get_parent_id.xsl', $params); ! $this->transform_menu('delete.xsl', $params); ! $this->setSVar('item_id', $parent_id); ! } /** move the current item up */ function on_move_up($event_args) ! { ! $params['id'] = $event_args['item_id']; ! $this->transform_menu('move_up.xsl', $params); ! } /** move the current item down */ function on_move_down($event_args) ! { ! $params['id'] = $event_args['item_id']; ! $this->transform_menu('move_down.xsl', $params); ! } /** add a new subitem to the current item */ function on_add_subitem($event_args) ! { ! //check that the new id does not exist ! $new_id = $event_args['new_id']; ! $output = $this->transform('get_id.xsl', array('id'=>$new_id)); ! if ($output==$new_id) ! { ! WebApp::message("Another menu item with id '$new_id' already exists."); ! return; ! } ! $params = $event_args; ! $params['id'] = $this->getSVar('item_id'); ! $this->transform_menu('add_subitem.xsl', $params); ! } /** apply the modifications to the main menu */ function on_apply($event_args) ! { ! $menu_xml = MENU.'menu.xml'; ! $edit_menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper cp $edit_menu_xml $menu_xml"); ! //get menu_items.js ! $menu_items = $this->transform('menu_items.xsl'); ! //save it to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $menu_items); ! fclose($fp); ! //move to menu_items.js and set permissions ! $menu_items_js = MENU.'menu_items.js'; ! shell_exec("./wrapper mv $tmpfname $menu_items_js"); ! shell_exec("./wrapper chown dasho.dasho $menu_items_js"); ! shell_exec("./wrapper chmod 664 $menu_items_js"); ! //get book_list.php ! $book_list = $this->transform('book_list.xsl'); ! //save it to a tmp file ! $tmpfname = tempnam("/tmp", "menu"); ! $fp = fopen($tmpfname, 'w'); ! fputs($fp, $book_list); ! fclose($fp); ! //move to book_list_php and set permissions ! $book_list_php = MENU.'book_list.php'; ! shell_exec("./wrapper mv $tmpfname $book_list_php"); ! shell_exec("./wrapper chown dasho.dasho $book_list_php"); ! shell_exec("./wrapper chmod 664 $book_list_php"); ! } /** discard any modifications and get a copy of the main menu */ function on_cancel($event_args) ! { ! $menu_xml = MENU.'menu.xml'; ! $edit_menu_xml = MENU.'edit/menu.xml'; ! shell_exec("./wrapper cp $menu_xml $edit_menu_xml"); ! } function onRender() ! { ! //this variable makes visible the edit menu in menu.html ! WebApp::addGlobalVar('edit_menu_visible', 'true'); ! $item_id = $this->getSVar('item_id'); ! //get the selected item and subitems ! $items = $this->transform('subitems.xsl', array('id'=>$item_id)); ! $arr_lines = explode("\n", $items); ! //get the caption of the selected item (from the first line) ! list($id, $item_caption) = split(' ', $arr_lines[0], 2); ! WebApp::addVar('item_caption', $item_caption); ! //create a recordset with id-s and captions of the subitems ! $rs = new EditableRS('subitems'); ! for ($i=1; $i < sizeof($arr_lines); $i++) ! { ! list($id, $caption) = split(' ', $arr_lines[$i], 2); ! if ($id=='') continue; ! $rs->addRec(compact('id','caption')); ! } ! global $webPage; ! $webPage->addRecordset($rs); ! } } ?> \ No newline at end of file |
From: Dashamir H. <das...@us...> - 2004-07-22 16:02:04
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3884/parser Modified Files: class.Render.php Log Message: Index: class.Render.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Render.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.Render.php 16 Jul 2004 07:37:05 -0000 1.12 --- class.Render.php 22 Jul 2004 16:01:37 -0000 1.13 *************** *** 424,427 **** --- 424,428 ---- //render the separator $this->render_tpl($tpl->separator); + $this->output("\n"); } |
From: Dashamir H. <das...@us...> - 2004-07-22 16:02:04
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3884/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.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** to_do.txt 22 Jul 2004 09:41:25 -0000 1.9 --- to_do.txt 22 Jul 2004 16:01:38 -0000 1.10 *************** *** 1,6 **** - Use the new framework with the other web applications ! (top10, smewapp, ilar, kushtetuta, doc-book, etc.) ! in order to test the new parser (and the conversion tool). - Fix some bugs in the documentation application and improve its --- 1,5 ---- - Use the new framework with the other web applications ! (smewapp etc.) in order to test the new parser (and the conversion tool). - Fix some bugs in the documentation application and improve its |
From: Dashamir H. <das...@us...> - 2004-07-22 14:17:09
|
Update of /cvsroot/phpwebapp/top10/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19514/db Added Files: Tag: maisp inima_top10.sql Log Message: --- NEW FILE: inima_top10.sql --- # phpMyAdmin SQL Dump # version 2.5.4 # http://www.phpmyadmin.net # # Host: localhost # Generation Time: Feb 07, 2004 at 02:07 PM # Server version: 4.0.16 # PHP Version: 4.3.4 # # Database : `inima_top10` # CREATE DATABASE IF NOT EXISTS inima_top10; USE inima_top10; # -------------------------------------------------------- # # Table structure for table `categories` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS categories; CREATE TABLE categories ( category varchar(50) NOT NULL default '' ) TYPE=MyISAM; # # Dumping data for table `categories` # INSERT INTO categories (category) VALUES ('web application framework'), ('content managment system'), ('document managment system'), ('groupware'), ('wiki'); # -------------------------------------------------------- # # Table structure for table `comments` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS comments; CREATE TABLE comments ( comment_id int(10) unsigned NOT NULL auto_increment, proj_id varchar(100) NOT NULL default '', username varchar(30) NOT NULL default '', title varchar(255) NOT NULL default '', comment text NOT NULL, date date NOT NULL default '0000-00-00', ip varchar(20) NOT NULL default '', PRIMARY KEY (comment_id) ) TYPE=MyISAM AUTO_INCREMENT=1 ; # # Dumping data for table `comments` # # -------------------------------------------------------- # # Table structure for table `languages` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS languages; CREATE TABLE languages ( prog_lang varchar(30) NOT NULL default '' ) TYPE=MyISAM; # # Dumping data for table `languages` # INSERT INTO languages (prog_lang) VALUES ('PHP'), ('Perl'), ('JSP'), ('Java'); # -------------------------------------------------------- # # Table structure for table `licenses` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS licenses; CREATE TABLE licenses ( license varchar(50) NOT NULL default '' ) TYPE=MyISAM; # # Dumping data for table `licenses` # INSERT INTO licenses (license) VALUES ('GPL'), ('LGPL'); # -------------------------------------------------------- # # Table structure for table `preference_list` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS preference_list; CREATE TABLE preference_list ( proj_id varchar(100) NOT NULL default '', username varchar(30) NOT NULL default '', position smallint(4) NOT NULL default '0', PRIMARY KEY (proj_id,username) ) TYPE=MyISAM; # # Dumping data for table `preference_list` # INSERT INTO preference_list (proj_id, username, position) VALUES ('doulos', 'test', 10), ('webdocwf', 'test', 9), ('struts-menu', 'dashohoxha', 0), ('echo', 'dasho', 1), ('echopoint', 'dasho', 0), ('eservices', 'test', 8), ('htmltable', 'test', 7), ('jspwidget', 'test', 6), ('wact', 'test', 5), ('ojbc', 'test', 4), ('nunitasp', 'test', 3), ('j-tr', 'test', 2), ('realmethods', 'test', 1), ('obliquid', 'test', 0), ('tapestry', 'test', 11), ('aft', 'test', 12), ('doulos', 'dashohoxha', 2), ('tapestry', 'dashohoxha', 3), ('phpmvc', 'dashohoxha', 4), ('ojbc', 'dashohoxha', 5), ('wact', 'dashohoxha', 6); # -------------------------------------------------------- # # Table structure for table `proj_list` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 17, 2004 at 05:21 PM # DROP TABLE IF EXISTS proj_list; CREATE TABLE proj_list ( proj_id varchar(100) NOT NULL default '', proj_name varchar(100) NOT NULL default '', proj_descr text NOT NULL, url1 varchar(255) default NULL, url2 varchar(255) default NULL, category varchar(100) NOT NULL default '', status varchar(10) NOT NULL default '', license varchar(100) NOT NULL default '', prog_lang varchar(100) NOT NULL default '', register_date date default NULL, group_id varchar(10) NOT NULL default '', points int(11) NOT NULL default '0', nr_comments int(11) NOT NULL default '0', PRIMARY KEY (proj_id) ) TYPE=MyISAM; # # Dumping data for table `proj_list` # INSERT INTO proj_list (proj_id, proj_name, proj_descr, url1, url2, category, status, license, prog_lang, register_date, group_id, points, nr_comments) VALUES ('GLUE', 'GNU Internet groupware project', 'The GNU GLUE (GNU Links Users Everywhere) projects will create a distributed groupware application framework based on emerging new Internet standards such as XML, WebDAV, and RTSP, suitable for both synchronous and asynchronous and both on-line and disconnected operation.', 'http://www.gnu.org/directory/glue.html', 'http://www.gnu.org/software/glue/glue.html', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-15', '', 0, 0), ('SXML', 'SXML', 'SXML defines and implements a markup language. When the program is given a document containing user defined tags and their definition, it produces a new document, which is generated by replacing the tags with their definition (you can asssociate functions to tags).', 'http://www.gnu.org/directory/sxml.html', 'http://medialab.di.unipi.it/Project/SXML/', 'web application framework', 'approved', 'GPL', 'Perl', '2004-01-17', '', 0, 0), ('Metahtml', 'Metahtml', 'Meta-HTML is a powerful, extensible server-side programming language specifically designed for working on the World Wide Web. It resembles a cross between HTML and Lisp and has a huge existing function library, including support for sockets, image creation, Perl, GNU plot, etc. It is extensible in both Meta-HTML and other languages (C, etc.)', 'http://www.gnu.org/directory/metahtml.html', 'http://www.metahtml.org/', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('Roxen', 'Roxen', 'Roxen WebServer is a full-featured open-source web server distributed under the GPL license. It runs on a number of different operating systems including Windows, Linux, Solaris and Mac OS X.', 'http://www.gnu.org/directory/roxen.html', 'http://www.roxen.com/products/webserver/', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('OpenACS', 'OpenACS', 'OpenACS (Open ArsDigita Community System) is an advanced toolkit for building scalable, community-oriented web applications for the Oracle RDBMS, ported to PostgreSQL. It is an advanced Web toolkit that focuses on collaboration, and includes over 40 modules. It relies on AOLserver, a web/application server, and PostgreSQL, a true ACID-compliant RDBMS.', 'http://www.gnu.org/directory/openacs.html', 'http://openacs.org/', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('Gedafe', 'Generic Database Front-End', 'Gedafe is an application independent end-user web front-end for databases. This means that the front-end has no information about the structure and contents of the database. All application logic along with meta-information on how to present the data, is put into the database. The front-end gathers this information and uses it to build the user interface. This greatly reduces development time since you only have to develop the application at the database level', 'http://www.gnu.org/directory/gedafe.html', 'http://isg.ee.ethz.ch/tools/gedafe/', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('Bigwig', 'Bigwig', '\'bigwig\' is a high-level programming language for developing interactive Web services. Programs are compiled into a conglomerate of lower-level technologies such as C code, HTTP, HTML, JavaScript, and SSL, all running on top of a runtime system based on an Apache Web server module.', 'http://www.gnu.org/directory/bigwig.html', 'http://www.brics.dk/bigwig/oldindex.html', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('JWIG', 'Java Extensions for High-Level Web Service Development', 'JWIG is a Java-based development system for making advanced Web services. It integrates the central features of the <bigwig> language into Java by providing explicit support for Web service sessions and safe XHTML dynamic document construction.', 'http://www.brics.dk/JWIG/', '', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0), ('HTML::Mason', 'HTML::Mason', 'HTML::Mason is a web site development and delivery system that constructs web pages and sites from shared, reusable building blocks called components. Components contain a mix of Perl and HTML, and can call each other and pass values back and forth like subroutines. They increase modularity and eliminate repetitive work. HTML::Mason is most powerful when used in conjunction with mod_perl, but can be used in standalone applications as well.', 'http://www.gnu.org/directory/HTML-Mason.html', 'http://www.masonhq.com/', 'web application framework', 'approved', 'GPL', 'Perl', '2004-01-17', '', 0, 0), ('WDialog', 'WDialog', 'WDialog is a system to make dialog-centric Web applications. It imitates the behavior of widgets found in GUIs, but acts in an HTML/HTTP environment. It uses its own XML-based UI language, but callbacks are coded in either O\'Caml or Perl. WDialog is written in the programming language Objective Caml', 'http://www.gnu.org/directory/wdialog.html', 'http://wdialog.sourceforge.net/', 'web application framework', 'approved', 'GPL', 'PHP', '2004-01-17', '', 0, 0); # -------------------------------------------------------- # # Table structure for table `proj_members` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 17, 2004 at 05:20 PM # DROP TABLE IF EXISTS proj_members; CREATE TABLE proj_members ( proj_id varchar(100) NOT NULL default '', username varchar(30) NOT NULL default '', PRIMARY KEY (proj_id,username) ) TYPE=MyISAM; # # Dumping data for table `proj_members` # INSERT INTO proj_members (proj_id, username) VALUES ('Bigwig', 'amo...@br...'), ('Bigwig', 'br...@br...'), ('Bigwig', 'mi...@br...'), ('Bigwig', 'ol...@br...'), ('Bigwig', 'ri...@br...'), ('ezln23-service', '-'), ('Gedafe', 'dw...@ee...'), ('Gedafe', 'oe...@ee...'), ('Gedafe', 'za...@ee...'), ('GLUE', 'fl...@us...'), ('HTML::Mason', 'mas...@ma...'), ('jaffa', 'dashohoxha'), ('jaffa', 'test'), ('jwebunit', 'dashohoxha'), ('JWIG', 'amo...@br...'), ('JWIG', 'mi...@br...'), ('Metahtml', 'bf...@gn...'), ('OpenACS', 'be...@mi...'), ('Roxen', 'su...@ro...'), ('salmon', 'dasho'), ('salmon', 'test'), ('sslext', 'dasho'), ('strutsgenerator', 'dashohoxha'), ('SXML', 'cis...@di...'), ('test', 'usr1'), ('test', 'usr2'), ('WDialog', 'ge...@ge...'); # -------------------------------------------------------- # # Table structure for table `requests` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 15, 2004 at 04:57 PM # DROP TABLE IF EXISTS requests; CREATE TABLE requests ( request_id varchar(50) NOT NULL default '', time timestamp(14) NOT NULL, username varchar(30) NOT NULL default '', ip varchar(20) NOT NULL default '', type varchar(30) NOT NULL default '', data varchar(255) NOT NULL default '', status varchar(10) NOT NULL default '', PRIMARY KEY (request_id) ) TYPE=MyISAM; # # Dumping data for table `requests` # # -------------------------------------------------------- # # Table structure for table `session` # # Creation: Jan 05, 2004 at 05:22 PM # Last update: Jan 17, 2004 at 11:43 AM # DROP TABLE IF EXISTS session; CREATE TABLE session ( id varchar(255) NOT NULL default '', vars text NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM; # # Dumping data for table `session` # INSERT INTO session (id, vars) VALUES ('IP: 62.94.150.82; DATE: 2004-01-05 17:22:10', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-06 14:51:02', 'a:0:{}'), ('IP: 213.209.169.74; DATE: 2004-01-06 16:19:19', 'a:0:{}'), ('IP: 63.227.208.158; DATE: 2004-01-06 18:16:17', 'a:0:{}'), ('IP: 63.227.208.158; DATE: 2004-01-06 18:23:39', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-09 15:00:30', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-15 16:55:50', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-15 17:08:03', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-16 14:47:54', 'a:0:{}'), ('IP: 62.94.150.82; DATE: 2004-01-16 15:11:26', 'a:0:{}'), ('IP: 193.254.1.36; DATE: 2004-01-17 09:23:42', 'a:0:{}'), ('IP: 193.254.1.36; DATE: 2004-01-17 11:43:20', 'a:0:{}'); # -------------------------------------------------------- # # Table structure for table `users` # # Creation: Jan 15, 2004 at 04:57 PM # Last update: Jan 17, 2004 at 02:41 PM # DROP TABLE IF EXISTS users; CREATE TABLE users ( username varchar(30) NOT NULL default '', realname varchar(50) default NULL, email varchar(50) NOT NULL default '', homepage varchar(50) default NULL, status varchar(10) NOT NULL default 'private', KEY primarykey (username) ) TYPE=MyISAM; # # Dumping data for table `users` # INSERT INTO users (username, realname, email, homepage, status) VALUES ('rms', '', 'rm...@gn...', '', 'private'), ('karl', '', 'ka...@fr...', '', 'private'), ('dasho', 'Dashamir Hoxha', 'da...@so...', 'http://', 'private'); |
From: Dashamir H. <das...@us...> - 2004-07-22 14:10:08
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/templates/proj_list Modified Files: Tag: maisp proj_list.html Log Message: Index: proj_list.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/proj_list.html,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** proj_list.html 17 Jan 2004 10:18:07 -0000 1.2.2.2 --- proj_list.html 22 Jul 2004 14:09:28 -0000 1.2.2.3 *************** *** 1,14 **** ! <Include SRC="{{./}}filter/filter.html" /> ! <WebBox ID="proj_list"> ! <Repeat rs="proj_list_rs"> ! <IfEmpty> ! No Records Found! <br> <a class="button" href="javascript:add_new_project()">Add New Project</a> ! </IfEmpty> ! <Header> ! <table width="100%" cellspacing="1" cellpadding="2" bgcolor="#dddddd"> ! <form name="proj_list" onsubmit="return false;"> ! </Header> ! <RepeatBody> <tr> <td bgcolor="white" width="2%" align="center">{{CurrentRecNr}}</td> --- 1,12 ---- ! <include src="{{./}}filter/filter.html" /> ! <webbox id="proj_list"> ! <table width="100%" cellspacing="1" cellpadding="2" bgcolor="#dddddd"> ! <form name="proj_list" onsubmit="return false;"> ! <repeat rs="proj_list_rs"> ! <ifempty> ! No Records Found! <br /> <a class="button" href="javascript:add_new_project()">Add New Project</a> ! </ifempty> ! <repeatbody> <tr> <td bgcolor="white" width="2%" align="center">{{CurrentRecNr}}</td> *************** *** 21,33 **** <td bgcolor="white">{{proj_descr}}</td> <td bgcolor="white"> ! <input type="checkbox" name="project" value="{{proj_id}}"> </td> </tr> ! </RepeatBody> ! <Footer> ! </form> ! </table> ! <Include SRC="{{./}}footer/list_footer.html" /> ! </Footer> ! </Repeat> ! </WebBox> --- 19,29 ---- <td bgcolor="white">{{proj_descr}}</td> <td bgcolor="white"> ! <input type="checkbox" name="project" value="{{proj_id}}" /> </td> </tr> ! </repeatbody> ! </repeat> ! </form> ! </table> ! <include src="{{./}}footer/list_footer.html" /> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-22 14:10:08
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list/footer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/templates/proj_list/footer Modified Files: Tag: maisp list_footer.js list_footer.html Log Message: Index: list_footer.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.js,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** list_footer.js 17 Jan 2004 10:18:07 -0000 1.5.2.2 --- list_footer.js 22 Jul 2004 14:09:18 -0000 1.5.2.3 *************** *** 21,24 **** --- 21,29 ---- */ + function next_rs_page(page) + { + SendEvent('list_footer','next','page='+page); + } + function add_new_project() { Index: list_footer.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.html,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** list_footer.html 2 Oct 2003 07:09:40 -0000 1.5 --- list_footer.html 22 Jul 2004 14:09:28 -0000 1.5.2.1 *************** *** 1,42 **** ! <WebBox ID="list_footer"> <table class="footer-table"> <tr> ! <td> ! Found: {{AllRecs}} records ! </td> ! <td width="10"></td> ! <td> ! Page {{CurrPage}} of {{LastPage}} ! </td> ! <td width="10"></td> ! <td> ! <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> ! <input type="button" value="<<" ! onclick="SendEvent('list_footer','next','page=1')"> ! <input type="button" value=" < " ! onclick="SendEvent('list_footer','next','page={{PrevPage}}')"> ! </If> ! <If condition="'{{CurrPage}}'<>'{{LastPage}}'"> ! <input type="button" value=" > " ! onclick="SendEvent('list_footer','next','page={{NextPage}}')"> ! <input type="button" value=">>" ! onclick="SendEvent('list_footer','next','page={{LastPage}}')"> ! </If> ! </td> <td align="right"> <a class="button" href="javascript:add_new_project()">Add New Project</a> ! <If condition="'{{ADMIN}}'=='true'"> <a class="button" href="javascript:edit_selected()">Edit</a> <a class="button" href="javascript:del_selected()">Delete</a> ! <If condition="'{{filter->new}}'=='true'"> <a class="button" href="javascript:approve_selected()">Approve</a> <a class="button" href="javascript:approve_all()">Approve All</a> ! </If> ! </If> ! <If condition="'{{ADMIN}}'!='true'"> <a class="button" href="javascript:add_to_list()">Add to My List</a> ! </If> </td> </tr> </table> ! </WebBox> --- 1,44 ---- ! <webbox id="list_footer"> <table class="footer-table"> <tr> ! <rsnavig rs="proj_list_rs"> ! <td> ! Found: {{AllRecs}} records ! </td> ! <td width="10"></td> ! <td> ! Page {{CurrPage}} of {{LastPage}} ! </td> ! <td width="10"></td> ! <td> ! <if condition="'{{CurrPage}}'!='{{PrevPage}}'"> ! <input type="button" value="&lt;&lt;" ! onclick="next_rs_page(1)" /> ! <input type="button" value=" &lt; " ! onclick="next_rs_page({{PrevPage}})" /> ! </if> ! <if condition="'{{CurrPage}}'!='{{LastPage}}'"> ! <input type="button" value=" > " ! onclick="next_rs_page({{NextPage}})" /> ! <input type="button" value=">>" ! onclick="next_rs_page({{LastPage}})" /> ! </if> ! </td> ! </rsnavig> <td align="right"> <a class="button" href="javascript:add_new_project()">Add New Project</a> ! <if condition="'{{ADMIN}}'=='true'"> <a class="button" href="javascript:edit_selected()">Edit</a> <a class="button" href="javascript:del_selected()">Delete</a> ! <if condition="'{{filter->new}}'=='true'"> <a class="button" href="javascript:approve_selected()">Approve</a> <a class="button" href="javascript:approve_all()">Approve All</a> ! </if> ! </if> ! <if condition="'{{ADMIN}}'!='true'"> <a class="button" href="javascript:add_to_list()">Add to My List</a> ! </if> </td> </tr> </table> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-22 14:10:08
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/templates/proj_list/filter Modified Files: Tag: maisp filter.php filter.html Log Message: Index: filter.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/filter/filter.php,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** filter.php 14 Jan 2004 16:25:59 -0000 1.2.2.1 --- filter.php 22 Jul 2004 14:09:28 -0000 1.2.2.2 *************** *** 45,50 **** --- 45,57 ---- function onRender() { + WebApp::addVars( array( + 'points_selected' => '', + 'nr_comments_selected' => '', + 'proj_id_selected' => '', + 'register_date_selected' => '', + )); $order_by = $this->getSVar("order_by"); WebApp::addVar($order_by."_selected", "selected"); + if (ADMIN=='true') { Index: filter.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/filter/filter.html,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** filter.html 13 Jan 2004 14:13:50 -0000 1.3.2.1 --- filter.html 22 Jul 2004 14:09:28 -0000 1.3.2.2 *************** *** 1,4 **** ! <Include SRC="{{LISTBOX_PATH}}listbox.html" /> ! <WebBox ID="filter"> <table class="filter-table"> <form name="filter" onsubmit="return false;"> --- 1,4 ---- ! <include src="{{LISTBOX_PATH}}listbox.html" /> ! <webbox id="filter"> <table class="filter-table"> <form name="filter" onsubmit="return false;"> *************** *** 9,18 **** <td align="right">Category:</td> <td> ! <WebObject Class="listbox" Name="category" onchange="set_category(this)" /> </td> <td align="right">License:</td> <td> ! <WebObject Class="listbox" Name="license" width="------" onchange="set_license(this)" /> --- 9,18 ---- <td align="right">Category:</td> <td> ! <webobject class="listbox" name="category" onchange="set_category(this)" /> </td> <td align="right">License:</td> <td> ! <webobject class="listbox" name="license" width="------" onchange="set_license(this)" /> *************** *** 20,24 **** <td align="right">Language:</td> <td> ! <WebObject Class="listbox" Name="language" width="------" onchange="set_language(this)" /> --- 20,24 ---- <td align="right">Language:</td> <td> ! <webobject class="listbox" name="language" width="------" onchange="set_language(this)" /> *************** *** 36,54 **** <input type="text" size="10" name="search_term" value="{{search_term}}" ! onblur="set_search_term(this)"> </td> <td align="right">Order by:</td> <td> <select onchange="set_order(this)"> ! <option value="points" {{points_selected}}> Number of Points </option> ! <option value="nr_comments" {{nr_comments_selected}}> Nr of Comments </option> ! <option value="proj_id" {{proj_id_selected}}> Project id </option> ! <option value="register_date" {{register_date_selected}}> Register Date </option> --- 36,54 ---- <input type="text" size="10" name="search_term" value="{{search_term}}" ! onblur="set_search_term(this)" /> </td> <td align="right">Order by:</td> <td> <select onchange="set_order(this)"> ! <option value="points" selected="{{points_selected}}"> Number of Points </option> ! <option value="nr_comments" selected="{{nr_comments_selected}}"> Nr of Comments </option> ! <option value="proj_id" selected="{{proj_id_selected}}"> Project id </option> ! <option value="register_date" selected="{{register_date_selected}}"> Register Date </option> *************** *** 56,62 **** </td> <td> ! <If condition="'{{ADMIN}}'=='true'"> ! New:<input type="checkbox" {{new_checked}} onclick="set_new(this)"> ! </If> </td> <td> --- 56,62 ---- </td> <td> ! <if condition="'{{ADMIN}}'=='true'"> ! New:<input type="checkbox" checked="{{new_checked}}" onclick="set_new(this)" /> ! </if> </td> <td> *************** *** 69,71 **** </form> </table> ! </WebBox> --- 69,71 ---- </form> </table> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-22 14:09:42
|
Update of /cvsroot/phpwebapp/top10/templates/confirm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/templates/confirm Modified Files: Tag: maisp confirm.html Log Message: Index: confirm.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/confirm/confirm.html,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** confirm.html 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- confirm.html 22 Jul 2004 14:09:30 -0000 1.1.1.1.2.1 *************** *** 2,12 **** <head> <title>Top 10 Web Application Projects: Request Confirmation</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <link rel="stylesheet" href="{{TPL_URL}}styles.css" type="text/css"> </head> <body> ! <WebBox ID="confirm"> ! <Include SRC="{{file}}" /> ! </WebBox> <p> Go to <a href="{{APP_URL}}">Top10 Web Application Projects</a>, --- 2,12 ---- <head> <title>Top 10 Web Application Projects: Request Confirmation</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <link rel="stylesheet" href="{{TPL_URL}}styles.css" type="text/css" /> </head> <body> ! <webbox id="confirm"> ! <include src="{{file}}" /> ! </webbox> <p> Go to <a href="{{APP_URL}}">Top10 Web Application Projects</a>, |
From: Dashamir H. <das...@us...> - 2004-07-22 14:09:42
|
Update of /cvsroot/phpwebapp/top10/templates/about In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/templates/about Modified Files: Tag: maisp about.html Log Message: Index: about.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/about/about.html,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** about.html 14 Jan 2004 16:26:00 -0000 1.1.1.1.2.1 --- about.html 22 Jul 2004 14:09:30 -0000 1.1.1.1.2.2 *************** *** 1,3 **** ! <WebBox ID="about"> <h2>What is Top 10</h2> --- 1,3 ---- ! <webbox id="about"> <h2>What is Top 10</h2> *************** *** 152,156 **** </p> ! <hr> ! </WebBox> --- 152,156 ---- </p> ! <hr /> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-22 14:09:42
|
Update of /cvsroot/phpwebapp/top10/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/config Modified Files: Tag: maisp const.DB.php Log Message: Index: const.DB.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/config/const.DB.php,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** const.DB.php 6 Jan 2004 15:22:42 -0000 1.1.1.1.2.1 --- const.DB.php 22 Jul 2004 14:09:30 -0000 1.1.1.1.2.2 *************** *** 6,8 **** define("DBPASS", "inima_top10"); define("DBNAME", "inima_top10"); ! ?> --- 6,8 ---- define("DBPASS", "inima_top10"); define("DBNAME", "inima_top10"); ! ?> \ No newline at end of file |