[phpwebapp-commits] CVS: web_app/tools/fileBrowser panel.php,1.5,1.6 fileBrowser.php,1.2,1.3 file.ph
Brought to you by:
dashohoxha
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 ! } ! } } ?> |