phpcms-plugins-cvs Mailing List for phpCMS-plugins (Page 10)
Brought to you by:
mjahn
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(40) |
Jun
(38) |
Jul
(36) |
Aug
(46) |
Sep
(13) |
Oct
(1) |
Nov
|
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
(19) |
Mar
|
Apr
(43) |
May
(119) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Martin J. <mj...@us...> - 2004-12-07 06:39:53
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/docs/admin4phpCMS/module_editor Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_editor added to the repository |
From: Martin J. <mj...@us...> - 2004-12-07 06:39:53
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_error In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/docs/admin4phpCMS/module_error Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_error added to the repository |
From: Martin J. <mj...@us...> - 2004-12-07 06:39:53
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/docs/admin4phpCMS/module_debug Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/docs/admin4phpCMS/module_debug added to the repository |
From: Martin J. <mj...@us...> - 2004-12-07 06:39:50
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs/__examplesource In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/docs/__examplesource Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/docs/__examplesource added to the repository |
From: Martin J. <mj...@us...> - 2004-12-07 06:37:59
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13888 Modified Files: .cvsignore Log Message: prepration of first Alpha-Preview Index: .cvsignore =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 7 Dec 2004 06:34:48 -0000 1.3 +++ .cvsignore 7 Dec 2004 06:37:44 -0000 1.4 @@ -1 +1,2 @@ pear +docs |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:30
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/user Modified Files: layout.user.xml class.module_user.php Added Files: class.phpcms_auth.php Removed Files: class.auth.php Log Message: prepration of first Alpha-Preview --- class.auth.php DELETED --- Index: layout.user.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/layout.user.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- layout.user.xml 29 Sep 2004 20:10:43 -0000 1.2 +++ layout.user.xml 7 Dec 2004 06:34:46 -0000 1.3 @@ -8,7 +8,7 @@ <ul id="userlist"> <layout:replace name="content" /> <li class="header"> - <span class="input"><img src="modules/filemanager/img/arrow.gif" width="16" height="16" alt="" class="input" /></span> + <span class="input"><img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />arrow.gif" width="16" height="16" alt="" class="input" /></span> <span class="input"><button type="submit" name="submit-deluser" value="-1" title="ausgewählte Benutzereinträge entfernen">ausgewählte Benutzer entfernen</button></span> </li> </ul> @@ -21,8 +21,8 @@ <![CDATA[ <li> <span class="input"><input type="checkbox" name="select-user-<layout:replace name="id" />" value="1" title="Benutzereintrag auswählen" /></span> - <span class="input"><button type="submit" name="submit-deluser" value="<layout:replace name="username" />" title="Benutzereintrag entfernen"><img src="modules/filemanager/img/delete.gif" width="16" height="16" alt="del" /></button></span> - <span class="input"><button type="submit" name="submit-edituser" value="<layout:replace name="username" />" title="Benutzereintrag editieren" ><img src="modules/filemanager/img/edit.gif" width="16" height="16" alt="edit" /></button></span> + <span class="input"><button type="submit" name="submit-deluser" value="<layout:replace name="username" />" title="Benutzereintrag entfernen"><img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />delete.gif" width="16" height="16" alt="del" /></button></span> + <span class="input"><button type="submit" name="submit-edituser" value="<layout:replace name="username" />" title="Benutzereintrag editieren" ><img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />edit.gif" width="16" height="16" alt="edit" /></button></span> <layout:replace name="username" /> </li> ]]> @@ -63,10 +63,12 @@ window.onload = document.getElementById ("username").focus(); ]]> </script> - <layout:replace name="content" /> - <label><select name="username"><layout:replace name="userlist" /></select>Benutzer </label> - <label><input type="password" name="password" value="" />Passwort </label> - <button type="submit" name="login-submit" value="1">Anmelden</button> + <div> + <layout:replace name="content" /> + <label><span>Benutzer</span><select name="username"><layout:replace name="userlist" /></select></label> + <label><span>Passwort</span><input type="password" name="password" value="" /></label> + <button type="submit" name="login-submit" value="1">Anmelden</button> + </div> </fieldset> ]]> </layout:insert> @@ -82,13 +84,15 @@ window.onload = document.getElementById ("username").focus(); ]]> </script> - <layout:replace name="content" /> -<!-- <label><input type="text" id="username" name="username" />Benutzer </label> --> - <label><input type="password" name="password" value="" />Passwort </label> - <input type="hidden" name="HMAC_use_js" id="HMAC_use_js" value="false" /> - <input type="hidden" name="HMAC_key" id="HMAC_key" value="<layout:replace name="hmac_key" default="" />" /> - <input type="hidden" name="HMAC_hash" id="HMAC_hash" /> - <button type="submit" name="login-submit" value="1">Anmelden</button> + <div> + <layout:replace name="content" /> +<!-- <label><input type="text" id="username" name="username" />Benutzer </label> --> + <label><input type="password" name="password" value="" />Passwort </label> + <input type="hidden" name="HMAC_use_js" id="HMAC_use_js" value="false" /> + <input type="hidden" name="HMAC_key" id="HMAC_key" value="<layout:replace name="hmac_key" default="" />" /> + <input type="hidden" name="HMAC_hash" id="HMAC_hash" /> + <button type="submit" name="login-submit" value="1">Anmelden</button> + </div> </fieldset> ]]> </layout:insert> --- NEW FILE: class.phpcms_auth.php --- <?php /** * User- and permissionmanagment * * authentication class * * <b>License</b> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.phpcms_auth.php,v 1.1 2004/12/07 06:34:46 mjahn Exp $ * @package admin4phpCMS * @subpackage module_user **/ /* * $Log: class.phpcms_auth.php,v $ * Revision 1.1 2004/12/07 06:34:46 mjahn * prepration of first Alpha-Preview * * Revision 1.1 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part * */ /** * include necessary PEAR-packages **/ include_once ('Auth.php'); /** * @author Martin Jahn <mj...@us...> * @package admin4phpCMS */ class phpCMSAuth extends Auth { function phpCMSAuth () { $this->__construct (); } function __construct () { parent::Auth (dirname (__FILE__).'/user.db'); } /** * Assign data from login form to internal values * * This function takes the values for username and password * from $HTTP_POST_VARS/$_POST and assigns them to internal variables. * If you wish to use another source apart from $HTTP_POST_VARS/$_POST, * you have to derive this function. * * @global $HTTP_POST_VARS, $_POST * @see Auth * @return void * @access private */ function assignData() { if (isset($this->post[$this->_postUsername]) && $this->post[$this->_postUsername] != '') { $this->username = (get_magic_quotes_gpc() == 1 ? stripslashes($this->post[$this->_postUsername]) : $this->post[$this->_postUsername]); } if (isset($this->post[$this->_postPassword]) && $this->post[$this->_postPassword] != '') { $this->password = (get_magic_quotes_gpc() == 1 ? stripslashes($this->post[$this->_postPassword]) : $this->post[$this->_postPassword] ); } } /** * Has the user been authenticated? * * @access public * @return bool True if the user is logged in, otherwise false. */ function getAuth() { if ( isset($this->session['registered']) ) { return true; } return false; } /** * Add user to the storage container * * @access public * @param string Username * @param string Password * @param mixed Additional parameters * @return mixed True on success, PEAR error object on error * and AUTH_METHOD_NOT_SUPPORTED otherwise. */ function addUser($username, $password, $additional = '') { $this->_loadStorage(); return $this->storage->addUser($username, $password, $additional); } /** * Change password for user in the storage container * * @access public * @param string Username * @param string The new password * @return mixed True on success, PEAR error object on error * and AUTH_METHOD_NOT_SUPPORTED otherwise. */ function changePassword($username, $password) { $this->_loadStorage(); return $this->storage->changePassword($username, $password); } } ?> Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- class.module_user.php 29 Sep 2004 20:10:43 -0000 1.9 +++ class.module_user.php 7 Dec 2004 06:34:46 -0000 1.10 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.10 2004/12/07 06:34:46 mjahn +* prepration of first Alpha-Preview +* * Revision 1.9 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part @@ -59,13 +62,8 @@ /** * include the authentication-class **/ -//include_once ('Auth.php'); -include_once (dirname (__FILE__).'/class.auth.php'); - -/** -* set the filename of the user-db -**/ -define ('PASSWD_FILE', dirname (__FILE__).'/user.db'); +include_once ('Auth.php'); +define ('US_IMGPATH', MODULE_PATH.'/filemanager/img/'); /** * Class for user- and permission-managment @@ -99,15 +97,14 @@ var $_USER; var $adminAction = ''; + var $_userdata = array ('isLoggedIn'=>false); + /** * Initialization of the module * * The module registers its own events and connects his methods to some actions **/ function init () { - $this->_USER = new SaferAuth('File', PASSWD_FILE); - $this->_USER->setShowLogin (false); - // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doParseMenuMain', 'getMenuMain'); @@ -122,6 +119,14 @@ $this->_registerEvent ('USER_GET_STATUS', 'doGetUserStatus'); $this->_registerAction ('doGetUserStatus', 'getUserStatus'); + // get module-config from config-module + $actiondata1 = array ('module'=>'user', 'format'=>'array'); + $this->_callEvent ('CONFIG_GET', $actiondata1); + $this->CONF =& $actiondata1 ['config']; + + $this->_USER = new Auth('File', dirname (__FILE__).'/'.$this->CONF ['userfile']); + $this->_USER->setShowLogin (false); + return true; } @@ -134,7 +139,9 @@ // start the user-managaer $this->_USER->start (); - //echo ($this->_USER->getAuth() ? 'true' : 'false'); + if ($this->_USER->checkAuth()) { + $this->_userdata ['isLoggedIn'] = $this->_USER->checkAuth (); + } // load our own extra template $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.user.xml'); @@ -197,7 +204,7 @@ } // if the user is not yet logged in - if (!$this->_USER->getAuth ()) { + if (!$this->_USER->checkAuth ()) { $this->action = 'login'; } // react onto the action @@ -234,7 +241,6 @@ function processAdmin (&$actiondata) { -// $this->_USER->setMode('sha'); //check for the correct action we have to do switch ($this->adminAction) { case 'delete-user': @@ -272,7 +278,7 @@ $root = $actiondata['_root']; - if (!$this->_USER->getAuth ()) { + if (!$this->_USER->checkAuth ()) { $actiondata1 = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Anmeldung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'extra'=>'class="active"'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); return true; @@ -293,7 +299,7 @@ * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getMenuSub (&$actiondata) { - if (!$this->_USER->getAuth ()) { + if (!$this->_USER->checkAuth ()) { return true; } @@ -332,7 +338,10 @@ $this->_callEvent ('ERROR_NOTICE', $actiondata1); } - $actiondata1 = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'action'=>'index.php'); + $actiondata1 = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'action'=>INDEX_FILE); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + + $actiondata1 = array ('_id'=>'formhidden', '_root'=>'loginform', '_type'=>'form_input_hidden', 'name'=>'method', 'value'=>'post'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); $users =$this->_USER->listUsers (); @@ -351,7 +360,7 @@ $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } } - + return true; } @@ -362,7 +371,7 @@ * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getStatusContent (&$actiondata) { - if ($this->_USER->getAuth () == 1) { + if ($this->_USER->checkAuth () == 1) { $root = $actiondata['_root']; @@ -391,7 +400,7 @@ $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_form2', '_type'=>'form_input_hidden', 'value'=>'user', 'name'=>'moduleid'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_list', '_type'=>'us_userlist'); + $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_list', 'imgpath' => US_IMGPATH, '_type'=>'us_userlist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); @$user =& $this->_USER->listUsers (); @@ -402,7 +411,7 @@ foreach ($user as $id=>$user) { - $actiondata1 = array ('_root'=>'us_list', '_id'=>'user-'.$id, '_type'=>'us_listentry', 'id'=>$id, 'username'=>$user ['username']); + $actiondata1 = array ('_root'=>'us_list', '_id'=>'user-'.$id, 'imgpath' => US_IMGPATH, '_type'=>'us_listentry', 'id'=>$id, 'username'=>$user ['username']); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } @@ -445,7 +454,7 @@ * @param array $actiondata **/ function getUserStatus (&$actiondata) { - $actiondata ['isLoggedIn'] = $this->_USER->getAuth (); + $actiondata = $this->_userdata; return true; } |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:28
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/layout Modified Files: layout.css layout.xml class.module_layout.php Log Message: prepration of first Alpha-Preview Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- class.module_layout.php 29 Sep 2004 20:10:43 -0000 1.12 +++ class.module_layout.php 7 Dec 2004 06:34:46 -0000 1.13 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.13 2004/12/07 06:34:46 mjahn +* prepration of first Alpha-Preview +* * Revision 1.12 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part @@ -73,7 +76,6 @@ include_once (PATH_TO_PEAR.'XML/Tree.php'); include_once (PATH_TO_PEAR.'XML/DTD/XmlValidator.php'); - /** * Layout-class * @@ -128,6 +130,7 @@ $this->_registerEvent ('DISPLAY_PARSE_ERROR', 'doParseError'); $this->_registerEvent ('DISPLAY_PARSE_CONTENT', 'doParseContent'); + $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doLayoutAddElement', 'addElement'); $this->_registerAction ('doLayoutAddTemplate', 'addTemplate'); $this->_registerAction ('doDisplay', 'displayLayout'); @@ -139,6 +142,21 @@ $this->_readLayoutFiles (dirname (__FILE__).'/layout.xml'); } + function parseParam (&$actiondata) { + $this->paramname = 'showvalue'; + $this->showtags = array ('mainmenu'=>'MENU_MAIN', 'statusbar'=>'STATUSBAR', 'submenu'=>'MENU_SUB', 'error'=>'ERROR', 'content'=>'CONTENT'); + + if (!isset ($_GET [$this->paramname])) { + $this->views = false; + return true; + } + + $this->views = htmlentities (strip_tags ($_GET [$this->paramname])); + $this->showtags = array ($this->views=>$this->showtags [$this->views]); + + unset ($_GET [$this->paramname]); + } + /** * Add an element to the elements-list * @@ -214,9 +232,9 @@ function displayLayout (&$actiondata) { $actiondata2 = array (); + // set tags that has to be replaced in the layout - $tags = array ('mainmenu'=>'MENU_MAIN', 'statusbar'=>'STATUSBAR', 'submenu'=>'MENU_SUB', 'error'=>'ERROR', 'content'=>'CONTENT'); - foreach ($tags as $tag=>$event) { + foreach ($this->showtags as $tag=>$event) { // set the container-element $actiondata1 = array ('_type'=>'empty', '_id'=>$tag); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); @@ -230,11 +248,21 @@ } } - // send output to browser - $actiondata2 ['_type'] = 'layout'; - $actiondata2 ['_id'] = 'admin4phpcms'; - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata2); - echo $this->displayElement ($this->_ids['admin4phpcms']); + if ($this->views !== false) { + if ($this->views == 'mainmenu') { + echo '<ul>'."\n"; + } + echo $this->displayElement ($this->_ids[$this->views]); + if ($this->views == 'mainmenu') { + echo '</ul>'."\n"; + } + } else { + // send output to browser + $actiondata2 ['_type'] = 'layout'; + $actiondata2 ['_id'] = 'admin4phpcms'; + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata2); + echo $this->displayElement ($this->_ids['admin4phpcms']); + } } /** Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- layout.xml 29 Sep 2004 20:10:42 -0000 1.8 +++ layout.xml 7 Dec 2004 06:34:46 -0000 1.9 @@ -41,8 +41,8 @@ <layout:replace name="content" /> </div> </div> - </body> -</html> +<!-- </body> +</html>--> ]]> </layout:insert> @@ -123,7 +123,7 @@ <layout:insert name="form"> <![CDATA[ -<form action="<layout:replace name="action" default="" />" <layout:replace name="extra" default="" /> method="<layout:replace name="method" default="post" />" enctype="x-form/multipart"> +<form action="<layout:replace name="action" default="/admin/index.de.htm" />" <layout:replace name="extra" default="" /> method="<layout:replace name="method" default="post" />" enctype="x-form/multipart"> <layout:replace name="content" /> </form> ]]> @@ -301,42 +301,6 @@ </layout:insert> - <layout:insert name="cachelist"> - <![CDATA[ - <div class="symbolleiste"> - <img src="modules/phpcms/img/cache/del-all.gif" width="16" height="16" alt="" title="Alle Dateien im Cache löschen" /> - <img src="modules/phpcms/img/cache/del-sel.gif" width="16" height="16" alt="" title="Ausgewählte Dateien im Cache löschen" /> - </div> - <ul id="cacheview"> - <layout:replace name="content" default="" /> - </ul> - ]]> - </layout:insert> - - <layout:insert name="cachedir"> - <![CDATA[ - <li class="subdir"> - <input type="checkbox" name="deletedir[<layout:replace name="cachedir" />]" value="1" /> - <layout:replace name="dirname" /> - <ul> - <layout:replace name="content" default="" /> - </ul> - </li> - ]]> - </layout:insert> - - <layout:insert name="cachefile"> - <![CDATA[ - <li> - <input type="checkbox" name="delete[<layout:replace name="cachefile" />]" value="1" /> - <span title="<layout:replace name="cachefile" />"><layout:replace name="filename" /></span> - <span class="<layout:replace name="cachetype" />">CACHE</span> - <span><layout:replace name="cachetime" /></span> - </li> - ]]> - </layout:insert> - - <layout:insert name="framebox"> <![CDATA[ <div class="iframe" style="width:<layout:replace name="width" default="100%" />; height:<layout:replace name="height" default="5em" />"> Index: layout.css =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.css,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- layout.css 29 Sep 2004 20:10:42 -0000 1.6 +++ layout.css 7 Dec 2004 06:34:46 -0000 1.7 @@ -399,3 +399,22 @@ li * { vertical-align:middle; } + +#taglist { + list-item-type:none; +} + +#taglist dt { + padding:0.2em; + color:#029544; + border-top:1px solid; +} + +#taglist dd { + padding:0 0.2em; + margin-left:3em; +} + +.iframe { + overflow:auto; +} \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:07
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/filemanager Modified Files: layout.filemanager.xml class.module_filemanager.php Log Message: prepration of first Alpha-Preview Index: layout.filemanager.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/layout.filemanager.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- layout.filemanager.xml 29 Sep 2004 20:10:46 -0000 1.2 +++ layout.filemanager.xml 7 Dec 2004 06:34:49 -0000 1.3 @@ -4,22 +4,101 @@ <layout:insert name="fm_list"> <![CDATA[ + <style> + <!-- + #filelist { + list-style-type:none; + padding:0; + margin:0.1em 0; + } + #filelist li, + #filelist li * { + font-family:monospace; + } + + #filelist li input, + #filelist li a, + #filelist li img { + float:left; + } + #filelist a.filename { + float:none; + text-decoration:none; + color:#029544; + } + #filelist li .filemtime, + #filelist li .filesize, + #filelist li .chmod { + float:right; + } + #filelist li .input { + margin-right:0.5em; + } + #filelist li { + max-width:50em; + clear:left; + clear:right; + padding-right:0.3em; + } + #filelist li.header, + #filelist li.footer { + border:1px outset #029544; + color:#029544; + background:#ddd; + margin:0.1em 0; + } + #filelist li.header *, + #filelist li.footer * { + color:#029544; + } + #filelist li.header { + padding-top:0.2em; + } + #filelist li.footer { + padding-top:0.1em; + padding-bottom:0,1em; + } + #fm-options { + margin-left:1em; + } + #fm-options { + font-family:monospace; + padding:0; + margin:1em 0; + } + .filename { + padding-left:1em; + line-height:16px; + } + .filemtime { + width:13em; + } + .filesize { + width:5em; + text-align:right; + } + .chmod { + width:7em; + text-align:right; + } + + --> + </style> <h2>Verzeichnis: <layout:replace name="basedir" default="" /></h2> - <div class="iconbar"> <a href="?moduleid=filemanager&basedir=/&action=viewdir" accesskey="h" alt="Alt+H" title="Heimatverzeichnis [Alt + H]">Home</a> <a href="#" onclick="Javascript:location.reload(); return false;" onkeypress="Javascript:location.reload(); return false;" accesskey="r" alt="Alt+R" title="Anzeige neu laden [Alt + R]">Reload</a> - <button type="submit" name="fm-delete-selection" title="Lösche ausgwählte Einträge">Löschen</button> + <button type="submit" name="fm-delete-selection" title="Lösche ausgwählte Einträge">Löschen</button> </div> <ul id="filelist"> <li class="header"> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: UID\nGruppe: GID">Rechte</span> - <span class="filesize" title="Dateigröße">Größe</span> - <span class="filemtime" title="Last modified">Letzte Änderung</span> + <span class="filesize" title="Dateigröße">Größe</span> + <span class="filemtime" title="Last modified">Letzte Änderung</span> <span class="filename">Name</span> </li> <layout:replace name="content" default="" /> @@ -32,14 +111,14 @@ <![CDATA[ <li <layout:replace name="extra" default="" />> <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" class="input" /> - <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="filename" default="" />&action=viewdir" title="Verzeichnis öffnen" > - <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="open" class="input" /> + <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&filename=<layout:replace name="filename" default="" />&action=viewdir" title="Verzeichnis öffnen" > + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="open" class="input" /> </a> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"> <layout:replace name="chmod" default="0000" /></span> - <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> + <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="" /></span> - <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="filename" default="" />&action=viewdir" title="Verzeichnis öffnen" class="filename"> + <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&filename=<layout:replace name="filename" default="" />&action=viewdir" title="Verzeichnis öffnen" class="filename"> <layout:replace name="filename" default="" /> </a> </li> @@ -50,11 +129,11 @@ <layout:insert name="fm_dir_inactive"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"> <layout:replace name="chmod" default="0000" /></span> - <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> + <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="" /></span> <span class="filename"><layout:replace name="filename" default="" /></span> </li> @@ -66,14 +145,14 @@ <![CDATA[ <li <layout:replace name="extra" default="" />> <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" class="input" /> - <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > - <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&filename=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> </a> - <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=editfile" title="Datei editieren" > - <img src="modules/filemanager/img/edit.gif" width="16" height="16" title="" alt="edit" class="input" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&filename=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=editfile" title="Datei editieren" > + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />edit.gif" width="16" height="16" title="" alt="edit" class="input" /> </a> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"><layout:replace name="chmod" default="0000" /></span> - <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> + <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="00.00.0000 00:00:00" /></span> <span class="filename"><layout:replace name="filename" default="" /></span> </li> @@ -84,13 +163,13 @@ <layout:insert name="fm_file_inactive"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > - <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&filename=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> </a> - <img src="modules/filemanager/img/edit_inactive.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />edit_inactive.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"><layout:replace name="chmod" default="0000" /></span> - <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> + <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="00.00.0000 00:00:00" /></span> <span class="filename"><layout:replace name="filename" default="" /></span> </li> @@ -101,9 +180,9 @@ <layout:insert name="fm_sum"> <![CDATA[ <li class="footer"> - <img src="modules/filemanager/img/arrow.gif" width="16" height="16" title="" alt="" class="input" /> - <input type="image" name="fm-delete-selection" src="modules/filemanager/img/delete.gif" alt="del" title="Lösche ausgwählte Einträge" /> - <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />arrow.gif" width="16" height="16" title="" alt="" class="input" /> + <input type="image" name="fm-delete-selection" src="<layout:replace name="imgpath" default="modules/filemanager/img/" />delete.gif" alt="del" title="Lösche ausgwählte Einträge" /> + <img src="<layout:replace name="imgpath" default="modules/filemanager/img/" />empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod"> </span> <span class="filesize" title=""><layout:replace name="sumsize" default="1 kB" /></span> <span class="filemtime"> </span> @@ -118,7 +197,7 @@ <fieldset> <legend>Datei anlegen</legend> <label title="Im aktuelen Verzeichnis eine neue Datei anlegen">Neuer Dateiname <input type="text" name="fm-new-file-name" value="Neuer Dateiname" /></label> - <label title="Vorlagen für die neue Datei, Leer ist Standard">Template auswählen <select name="fm-new-file-tpl" size="1"><option value="empty">Leer</option><option value="projectfile">phpCMS-Projektdatei</option><option value="menufile">phpCMS-Menüdatei</option></select></label> + <label title="Vorlagen für die neue Datei, Leer ist Standard">Template auswählen <select name="fm-new-file-tpl" size="1"><option value="empty">Leer</option><option value="projectfile">phpCMS-Projektdatei</option><option value="menufile">phpCMS-Menüdatei</option></select></label> </fieldset> <fieldset> @@ -134,7 +213,7 @@ <![CDATA[ <fieldset> <legend>Datei auf den Server laden</legend> - <label title="Datei in das aktuelle Verzeichnis auf dem Server laden">Datei wählen <input type="file" name="fm-upload-file-name" /></label> + <label title="Datei in das aktuelle Verzeichnis auf dem Server laden">Datei wählen <input type="file" name="fm-upload-file-name" /></label> <label title=""><input type="checkbox" name="fm-upload-archiv" value="1" />Archiv entpacken</label> </fieldset> @@ -175,13 +254,13 @@ <legend>Aktion</legend> <label title="Auswahl aus dem Verzeichnis in die Zwischenablage kopieren"><input type="radio" name="fm-clipboard-action" value="copy-select" /> Auswahl in Zwischenablage</label> <label title="Auswahl aus der Zwischenablage in das Verzeichnis kopieren"><input type="radio" name="fm-clipboard-action" value="insert-select" /> Auswahl in Verzeichnis</label> - <label title="Auswahl aus der Zwischenablage löschen"><input type="radio" name="fm-clipboard-action" value="delete-select" /> Auswahl löschen</label> + <label title="Auswahl aus der Zwischenablage löschen"><input type="radio" name="fm-clipboard-action" value="delete-select" /> Auswahl löschen</label> </fieldset> <fieldset> <legend>Inhalt der Zwischenablage</legend> <layout:replace name="content" default="" /> </fieldset> - <button type="submit" name="fm-clipboard-submit" value="1">Aktion ausführen</button> + <button type="submit" name="fm-clipboard-submit" value="1">Aktion ausführen</button> ]]> </layout:insert> Index: class.module_filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.module_filemanager.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class.module_filemanager.php 29 Sep 2004 20:10:46 -0000 1.8 +++ class.module_filemanager.php 7 Dec 2004 06:34:49 -0000 1.9 @@ -28,6 +28,9 @@ /* * $Log$ +* Revision 1.9 2004/12/07 06:34:49 mjahn +* prepration of first Alpha-Preview +* * Revision 1.8 2004/09/29 20:10:46 mjahn * completed phpCMS-config-part * began the statistic part @@ -59,6 +62,7 @@ * Include the file-utility-class **/ include_once (dirname (__FILE__).'/class.file_util.php'); +define ('FM_IMGPATH', MODULE_PATH.'/filemanager/img/'); /** * Filemanager-class for administrative work in the filesystem * @@ -77,10 +81,10 @@ $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); - $actiondata1 = array ('module'=>'filemanager'); + $actiondata1 = array ('module'=>'filemanager', 'format'=>'array'); $this->_callEvent ('CONFIG_GET', $actiondata1); $this->CONF =& $actiondata1 ['config']; - + include_once (dirname (__FILE__).'/config.filemanager.php'); } @@ -108,16 +112,16 @@ $this->basedir = $actiondata['request']['basedir']; } - if ($this->action == 'viewfile' && isset ($actiondata['request']['file'])) { - $this->viewfile = $actiondata['request']['file']; + if ($this->action == 'viewfile' && isset ($actiondata['request']['filename'])) { + $this->viewfile = $actiondata['request']['filename']; } - if ($this->action == 'viewdir' && isset ($actiondata['request']['file'])) { - $this->viewdir = $actiondata['request']['file']; + if ($this->action == 'viewdir' && isset ($actiondata['request']['filename'])) { + $this->viewdir = $actiondata['request']['filename']; } - if ($this->action == 'editfile' && isset ($actiondata['request']['file'])) { - $this->editfile = $actiondata['request']['file']; + if ($this->action == 'editfile' && isset ($actiondata['request']['filename'])) { + $this->editfile = $actiondata['request']['filename']; } if ($this->display && $this->_USER ['isLoggedIn']) { @@ -235,8 +239,12 @@ unset ($files, $dirs); $num = count ($entries); - $actiondata1 = array ('_type'=>'fm_list', '_id'=>'filelist', '_root'=>$root, - 'basedir'=>htmlentities ($this->basedir)); + $actiondata1 = array ('_type'=>'form', '_id'=>'fm_form', '_root'=>$root, + 'action'=>INDEX_FILE.'?moduleid=filemanager', 'imgpath' => FM_IMGPATH, 'method'=>'post'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + $actiondata1 = array ('_type'=>'fm_list', '_id'=>'filelist', '_root'=>'fm_form', + 'basedir'=>htmlentities ($this->basedir), 'imgpath' => FM_IMGPATH); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); $alternate = 1; @@ -305,7 +313,7 @@ $nolink = true; } - $actiondata1 = array ('_root'=>'filelist', '_id'=>'dir-'.$entry, 'basedir'=>$this->basedir, 'filename'=>htmlentities ($entry), 'filesize'=>$file ['filesize'], 'fileatime'=>$file ['fileatime'], 'filectime'=>$file ['filectime'], 'filemtime'=>$file ['filemtime'], 'gid'=>$file ['gid'] ['str'], 'uid'=>$file ['uid'] ['str'], 'chmod'=>$file ['chmod'] ['str'], 'extra'=>'class="line'.$alternate++.'"', 'filetype'=>$type); + $actiondata1 = array ('_root'=>'filelist', 'imgpath' => FM_IMGPATH, '_id'=>'dir-'.$entry, 'basedir'=>$this->basedir, 'filename'=>htmlentities ($entry), 'filesize'=>$file ['filesize'], 'fileatime'=>$file ['fileatime'], 'filectime'=>$file ['filectime'], 'filemtime'=>$file ['filemtime'], 'gid'=>$file ['gid'] ['str'], 'uid'=>$file ['uid'] ['str'], 'chmod'=>$file ['chmod'] ['str'], 'extra'=>'class="line'.$alternate++.'"', 'filetype'=>$type); if ($nolink) { // set no link for open directory $actiondata1 ['_type'] = 'fm_dir_inactive'; @@ -334,7 +342,7 @@ $type = 'symlink.gif'; } - $actiondata1 = array ('_root'=>'filelist', '_id'=>'file-'.$entry, 'filename'=>$entry, 'basedir'=>$this->basedir, 'filename'=>htmlentities ($entry), 'filesize'=>$file ['filesize'], 'fileatime'=>$file ['fileatime'], 'filectime'=>$file ['filectime'], 'filemtime'=>$file ['filemtime'], 'gid'=>$file ['gid'] ['str'], 'uid'=>$file ['uid'] ['str'], 'chmod'=>$file ['chmod'] ['str'], 'extra'=>'class="line'.$alternate++.'"', 'filetype'=>$type); + $actiondata1 = array ('_root'=>'filelist', 'imgpath' => FM_IMGPATH, '_id'=>'file-'.$entry, 'filename'=>$entry, 'basedir'=>$this->basedir, 'filename'=>htmlentities ($entry), 'filesize'=>$file ['filesize'], 'fileatime'=>$file ['fileatime'], 'filectime'=>$file ['filectime'], 'filemtime'=>$file ['filemtime'], 'gid'=>$file ['gid'] ['str'], 'uid'=>$file ['uid'] ['str'], 'chmod'=>$file ['chmod'] ['str'], 'extra'=>'class="line'.$alternate++.'"', 'filetype'=>$type); // check if file is writeable if (!is_writeable ($dir.'/'.$entry)) { @@ -347,19 +355,19 @@ $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } } - $actiondata1 = array ('_root'=>'filelist', '_id'=>'filelist-summary', '_type'=>'fm_sum', 'dirs'=>$num_dirs, 'files'=>$num_files, 'sumsize'=>file_util::filesize ($sum_size)); + $actiondata1 = array ('_root'=>'filelist', 'imgpath' => FM_IMGPATH, '_id'=>'filelist-summary', '_type'=>'fm_sum', 'dirs'=>$num_dirs, 'files'=>$num_files, 'sumsize'=>file_util::filesize ($sum_size)); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set options-box - $actiondata1 = array ('_root'=>$root, '_id'=>'fm-options', '_type'=>'block', 'extra'=>'id="fm-options"'); + $actiondata1 = array ('_root'=>'fm_form', 'imgpath' => FM_IMGPATH, '_id'=>'fm-options', '_type'=>'block', 'extra'=>'id="fm-options"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set tablist - $actiondata1 = array ('_root'=>'fm-options', '_id'=>'tablist', '_type'=>'ulist', 'extra'=>'class="tabbed"'); + $actiondata1 = array ('_root'=>'fm-options', 'imgpath' => FM_IMGPATH, '_id'=>'tablist', '_type'=>'ulist', 'extra'=>'class="tabbed"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set tabbox - $actiondata1 = array ('_root'=>'fm-options', '_id'=>'tabbox', '_type'=>'block', 'extra'=>'class="tabbox"'); + $actiondata1 = array ('_root'=>'fm-options', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox', '_type'=>'block', 'extra'=>'class="tabbox"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); $tabs = array ( @@ -373,41 +381,49 @@ for ($i = 0; $i < $num; $i++) { // set tab-list - $actiondata1 = array ('_root'=>'tablist', '_id'=>'tablistitem-'.$tabs [$i] ['id'], '_type'=>'list_entry'); + $actiondata1 = array ('_root'=>'tablist', 'imgpath' => FM_IMGPATH, '_id'=>'tablistitem-'.$tabs [$i] ['id'], '_type'=>'list_entry'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set tab-script - $actiondata1 = array ('_root'=>'tablist', '_id'=>'tablistscript-'.$tabs [$i] ['id'], '_type'=>'script', 'content'=>'registerTab (\'tabbox-'.$tabs [$i] ['id'].'\');'); + $actiondata1 = array ('_root'=>'tablist', 'imgpath' => FM_IMGPATH, '_id'=>'tablistscript-'.$tabs [$i] ['id'], '_type'=>'script', 'content'=>'registerTab (\'tabbox-'.$tabs [$i] ['id'].'\');'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set the tab-link - $actiondata1 = array ('_root'=>'tablistitem-'.$tabs [$i] ['id'], '_id'=>'tablink-'.$tabs [$i] ['id'], '_type'=>'link', 'href'=>'#tabbox-'.$tabs [$i] ['id'], 'content'=>$tabs [$i] ['name'], 'extra'=>'class="" id="tabbox-'.$tabs [$i] ['id'].'-nav" onclick="displayTab (\'tabbox-'.$tabs [$i] ['id'].'\')" onkeypress="displayTab (\'tabbox-'.$tabs [$i] ['id'].'\')"'); + $actiondata1 = array ('_root'=>'tablistitem-'.$tabs [$i] ['id'], 'imgpath' => FM_IMGPATH, '_id'=>'tablink-'.$tabs [$i] ['id'], '_type'=>'link', 'href'=>'#tabbox-'.$tabs [$i] ['id'], 'content'=>$tabs [$i] ['name'], 'extra'=>'class="" id="tabbox-'.$tabs [$i] ['id'].'-nav" onclick="displayTab (\'tabbox-'.$tabs [$i] ['id'].'\')" onkeypress="displayTab (\'tabbox-'.$tabs [$i] ['id'].'\')"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set the tab-box container - $actiondata1 = array ('_root'=>'tabbox', '_id'=>'tabbox-'.$tabs [$i] ['id'], '_type'=>'block', 'extra'=>'id="tabbox-'.$tabs [$i] ['id'].'"'); + $actiondata1 = array ('_root'=>'tabbox', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox-'.$tabs [$i] ['id'], '_type'=>'block', 'extra'=>'id="tabbox-'.$tabs [$i] ['id'].'"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } // set the tab-box (new) - $actiondata1 = array ('_root'=>'tabbox-new', '_id'=>'tabbox-new-content', '_type'=>'fm_new'); + $actiondata1 = array ('_root'=>'tabbox-new', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox-new-content', '_type'=>'fm_new'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set the tab-box (upload) - $actiondata1 = array ('_root'=>'tabbox-upload', '_id'=>'tabbox-upload-content', '_type'=>'fm_upload'); + $actiondata1 = array ('_root'=>'tabbox-upload', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox-upload-content', '_type'=>'fm_upload'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set the tab-box (backup) - $actiondata1 = array ('_root'=>'tabbox-backup', '_id'=>'tabbox-backup-content', '_type'=>'fm_backup'); + $actiondata1 = array ('_root'=>'tabbox-backup', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox-backup-content', '_type'=>'fm_backup'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); // set the tab-box (clipboard) - $actiondata1 = array ('_root'=>'tabbox-clipboard', '_id'=>'tabbox-clipboard-content', '_type'=>'fm_clipboard'); + $actiondata1 = array ('_root'=>'tabbox-clipboard', 'imgpath' => FM_IMGPATH, '_id'=>'tabbox-clipboard-content', '_type'=>'fm_clipboard'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } + /** + * Let the user et the chmod of a file + * + * @param array $actiondata + **/ + function getContentChmod (&$actiondata) { + } + function _userSort (&$dirs, &$files) { sort ($dirs); sort ($files); |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:07
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/phpcms Modified Files: layout.phpcms.xml class.module_phpcms.php Log Message: prepration of first Alpha-Preview Index: class.module_phpcms.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.module_phpcms.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.module_phpcms.php 1 Oct 2004 07:08:51 -0000 1.5 +++ class.module_phpcms.php 7 Dec 2004 06:34:49 -0000 1.6 @@ -28,12 +28,12 @@ /* * $Log$ -* Revision 1.5 2004/10/01 07:08:51 mjahn -* basic code for tagfile-editor +* Revision 1.6 2004/12/07 06:34:49 mjahn +* prepration of first Alpha-Preview * */ /** -* Class for managing the phpCMS-parser and the phpcms-related website-setting +* Class for managing the phpCMS-configuration and the phpCMS-related website-setting * * <p> * This class provides functionality for manipulating menufiles, projectfiles @@ -95,6 +95,7 @@ $actiondata = array ('filename' => dirname(__FILE__).'/layout.phpcms.xml'); $this->_callEvent('LAYOUT_ADD_TEMPLATE', $actiondata); + return true; } @@ -103,36 +104,45 @@ * * @param array $actiondata $actiondata contains the URI-param-arrays **/ - function parseParam(& $actiondata) { - $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'phpcms'); + function parseParam(&$actiondata) { + $this->display = (isset ($actiondata['request']['moduleid']) &&$actiondata['request']['moduleid'] == 'phpcms'); $this->action = ''; if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } - $this->configaction = ''; - if (isset ($actiondata['request']['configform-submit'])) { - $this->configaction = $actiondata['request']['configform-submit']; - $this->_formdata = $actiondata['post']; - } - - $this->_tagfile = ''; - if (isset ($actiondata['post']['submit-tagfile'])) { - $this->_tagfile = $actiondata['post']['select-tagfile']; - } - switch ($this->action) { case 'cache' : $this->_registerAction('doProcess', 'processCache'); + $this->_cacheaction = ''; + if (isset ($actiondata['request']['cacheform-submit'])) { + $this->_cacheaction = $actiondata['request']['cacheform-submit']; + $this->_formdata = $actiondata['post']; + } break; case 'config' : + $this->_configaction = ''; + if (isset ($actiondata['request']['configform-submit'])) { + $this->_configaction = $actiondata['request']['configform-submit']; + $this->_formdata = $actiondata['post']; + } $this->_registerAction('doProcess', 'processConfig'); break; case 'menu' : + $this->_menufile = ''; + if (isset ($actiondata['post']['submit-tagfile'])) { + $this->_tagfile = $actiondata['post']['select-tagfile']; + $this->_formdata = $actiondata['post']; + } $this->_registerAction('doProcess', 'processMenu'); break; case 'tags' : + $this->_tagfile = ''; + if (isset ($actiondata['post']['submit-tagfile'])) { + $this->_tagfile = $actiondata['post']['select-tagfile']; + $this->_formdata = $actiondata['post']; + } $this->_registerAction('doProcess', 'processTags'); break; default : @@ -155,27 +165,16 @@ * * @param array $actiondata **/ - function process(& $actiondata) { + function process(&$actiondata) { $this->_registerAction('doParseContent', 'getContent'); return true; } // function process () - function processTags() { - $this->_registerAction('doParseContent', 'getContentTags'); - - // parse all projectfiles in projectdir - // collect all tagfile-entries - // check for writeability of the tagfiles - // check for formdata and save it if tagfile is writeable else create error-notice - // check if we have to load any tagfile - - } - /** * **/ - function processCache(& $actiondata) { + function processCache(&$actiondata) { $cachedir = $this->docroot.'/cms/parser/cache/'; if (!file_exists($cachedir)) { @@ -192,9 +191,7 @@ $dh = dir($cachedir); while ($file = $dh->read()) { - if ($file { - 0 } - == '.') { + if ($file {0} == '.') { continue; } @@ -219,13 +216,9 @@ } } - function processMenu(& $actiondata) { - $this->_registerAction('doParseContent', 'getContentMenu'); - } - - function processConfig(& $actiondata) { + function processConfig(&$actiondata) { - if ($this->configaction == 'save') { + if ($this->_configaction == 'save') { $this->_parseConfigFormdata(); } @@ -238,12 +231,96 @@ $this->_loadDefault(); } + function processMenu(&$actiondata) { + $this->_registerAction('doParseContent', 'getContentMenu'); + + // check the projectdir for any projectfiles + $_dh = dir($this->docroot.$this->_CONF['projectdir']); + $entries = array (); + $this->_menufiles = array (); + while (false !== ($file = $_dh->read())) { + + if (strrchr($file, '.') != '.'.$this->_CONF['projectfileext']) { + continue; + } + + // parse all projectfiles in projectdir + $data = $this->_parseProjectFile (file ($this->docroot.$this->_CONF['projectdir'].'/'.$file)); + + if (isset ($entries [$data ['MENU']])) { + continue; + } + + // collect all tagfile-entries + $data ['MENU'] = str_replace ('$home', $data ['HOME'], $data ['MENU']); + $data ['MENU'] = str_replace ('//', '/', $data ['MENU']); + + // check for writeability of the tagfiles + if (!is_writeable ($this->docroot.$data ['MENU'])) { + continue; + } + + $this->_menufiles [] = $data ['MENU']; + $entries [$data ['MENU']] = 1; + } + + // check if we have to load any tagfile + if (count ($this->_menufiles) == 1) { + $this->_menufile = $this->_menufiles [0]; + } + + // check if we have to load a menufile and parse it into an array + if ($this->_menufile != '') { + } + } + + function processTags() { + $this->_registerAction('doParseContent', 'getContentTags'); + + // check the projectdir for any projectfiles + $_dh = dir($this->docroot.$this->_CONF['projectdir']); + $entries = array (); + $this->_tagfiles = array (); + while (false !== ($file = $_dh->read())) { + + if (strrchr($file, '.') != '.'.$this->_CONF['projectfileext']) { + continue; + } + + // parse all projectfiles in projectdir + $data = $this->_parseProjectFile (file ($this->docroot.$this->_CONF['projectdir'].'/'.$file)); + + if (isset ($entries [$data ['TAGS']])) { + continue; + } + + // collect all tagfile-entries + $data ['TAGS'] = str_replace ('$home', $data ['HOME'], $data ['TAGS']); + $data ['TAGS'] = str_replace ('//', '/', $data ['TAGS']); + + // check for writeability of the tagfiles + if (!is_writeable ($this->docroot.$data ['TAGS'])) { + continue; + } + + $this->_tagfiles [] = $data ['TAGS']; + $entries [$data ['TAGS']] = 1; + } + + // check for formdata and save it if tagfile is writeable else create error-notice + + // check if we have to load any tagfile + if (count ($this->_tagfiles) == 1) { + $this->_tagfile = $this->_tagfiles [0]; + } + } + /** * Get content for mainmenu * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getMenuMain(& $actiondata) { + function getMenuMain(&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -263,7 +340,7 @@ * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getMenuSub(& $actiondata) { + function getMenuSub(&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -306,7 +383,7 @@ * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getContent(& $actiondata) { + function getContent(&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -338,7 +415,7 @@ * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getContentCache(& $actiondata) { + function getContentCache(&$actiondata) { // check if user-status if (!$this->_USER['isLoggedIn']) { @@ -354,7 +431,7 @@ $root = $actiondata['_root']; // initial list for the cache-view - $actiondata1 = array ('_root' => $root, '_type' => 'cachelist', '_id' => 'cachedir-'); + $actiondata1 = array ('_root' => $root, '_type' => 'cachelist', '_id' => 'cachelist'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); // ids of elements that were even created in the layout-module @@ -363,55 +440,26 @@ // reset the array with the cache-filenames reset($this->_CACHE); + + //print_r ($this->_CACHE); // walk through the array with the cache-filenames foreach ($this->_CACHE as $url => $cachefile) { - // get path elements - $data = explode('/', $url); - - // set the root-id - $rootid = 'cachedir-'; - - // walk through the path-elements, that are subdirectories - $num = count($data) - 1; - for ($i = 0; $i < $num; $i ++) { - - // empty path-element (i.e. between a double slash in the path) - if ($data[$i] == '') { - continue; - } - - if (isset ($_ids[$rootid.$data[$i].'-'])) { - $rootid = $rootid.$data[$i].'-'; - continue; - } - - // set output for subdirectory - $actiondata1 = array ('_root' => $rootid, '_type' => 'cachedir', '_id' => $rootid.$data[$i].'-', 'cachedir' => $rootid, 'dirname' => $data[$i], 'extra' => 'class="subdir"'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - - $_ids[$rootid] = '1'; - $rootid = $rootid.$data[$i].'-'; - - } $ext = substr($cachefile, strrpos($cachefile, '.') + 1); switch ($ext) { case 'htm' : - $cs = 'statisch'; + $cs = 'HTM'; break; case 'gz' : - $cs = 'gzip'; + $cs = 'GZ'; break; case 'dyn' : - $cs = 'dynamisch'; + $cs = 'DYN'; break; } - // now we can display the file-entry - $selfid = $rootid.$data[$num]; - - $actiondata1 = array ('_root' => $rootid, '_type' => 'cachefile', '_id' => $selfid, 'cachefile' => $cachefile, 'filename' => $data[$num], 'cachetype' => $cs, 'cachetime' => '24.07.2004 11:58:59'); + $actiondata1 = array ('_root' => 'cachelist', '_type' => 'cachefile', '_id' => 'cachefile-'.$cachefile, 'cachefile' => $cachefile, 'cachetype' => $cs, 'cachetime' => '24.07.2004 11:58:59', 'filename'=>$url); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); } // foreach } @@ -421,7 +469,7 @@ * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getContentConfig(& $actiondata) { + function getContentConfig(&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; @@ -447,7 +495,7 @@ $actiondata1 = array ('_root' => 'configform', '_id' => 'tabbox', '_type' => 'block', 'extra' => 'class="tabbox"'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $tabs = array ('common' => 'Allgemein', 'pax' => 'PAX & Mail2Crypt', 'cache' => 'Caching', 'server' => 'Servereinstellungen', 'stat' => 'Statistik', 'other' => 'Sonstiges'); + $tabs = array ('common' => 'Allgemein', 'pax' => 'PAX & Mail2Crypt', 'cache' => 'Caching', 'server' => 'Servereinstellungen', 'i18n'=>'I18N', 'stat' => 'Statistik', 'other' => 'Sonstiges'); foreach ($tabs as $id => $label) { @@ -486,7 +534,7 @@ * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getContentMenu(& $actiondata) { + function getContentMenu(&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -495,14 +543,48 @@ return true; } - include_once (dirname(__FILE__).'/class.phpcms_menu.php'); - $this->_MENU = & new phpcms_menu(); - $this->_MENU->load(); - - $content = '<p>Durch Auswahl einer Projectdatei ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '.'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '.'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. </p>'; + $_root = $actiondata['_root']; - $actiondata1 = array ('_root' => $actiondata['_root'], '_id' => 'user1content', '_type' => 'paragraph', 'content' => $content); + $actiondata1 = array ('_root' => $_root, '_id' => 'form_menufile', '_type' => 'form', 'action' => '#'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + + if (count ($this->_menufiles) > 1) { + + reset ($this->_menufiles); + + $actiondata1 = array ('_root' => 'form_menufile', '_id' => 'select-menufile', '_type' => 'form_select', 'name' => 'select-menufile'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + + foreach ($this->_menufiles as $menufile) { + $actiondata1 = array ('_root' => 'select-menufile', '_id' => 'select-'.$file, '_type' => 'form_select_option', 'value' => $menufile, 'label' => $menufile); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + } + + $actiondata1 = array ('_root' => 'form_menufile', '_id' => 'submit-menufile', '_type' => 'form_submit', 'name' => 'submit-menufile', 'value' => '1', 'content' => 'Menüdatei editieren'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + } + + if ($this->_menufile != '') { + + // + $actiondata1 = array ('_root' => 'form_menufile', '_id' => 'menulist', '_type' => 'list'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + +/* // get the tag-array + //$_data = $this->_parseTagFile(file($this->docroot.$this->_tagfile)); + + // sort the tag-array + //ksort ($_data); + + reset ($_data); + + // walk through tag-array + foreach ($_data as $id => $value) { + $actiondata1 = array ('_root' => 'taglist', '_id' => 'tags_status_'.$id, '_type' => 'tagentry', 'tag' => htmlentities ($id), 'value'=>htmlentities ($value)); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + + }*/ + } return true; } // function getMenuContent () @@ -523,49 +605,44 @@ $_root = $actiondata['_root']; - $actiondata1 = array ('_root' => $_root, '_id' => 'form_projectfile', '_type' => 'form', 'action' => '#'); + $actiondata1 = array ('_root' => $_root, '_id' => 'form_tagfile', '_type' => 'form', 'action' => '#xyz'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $actiondata1 = array ('_root' => 'form_projectfile', '_id' => 'select-projectfile', '_type' => 'form_select', 'name' => 'select-projectfile'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + if (count ($this->_tagfiles) > 1) { - $_dh = dir($this->docroot.$this->_CONF['projectdir']); - $_projectfiles = array (); - $content = ''; - $entries = array (); - while (false !== ($file = $_dh->read())) { + reset ($this->_tagfiles); - if (strrchr($file, '.') != '.'.$this->_CONF['projectfileext']) { - continue; - } + $actiondata1 = array ('_root' => 'form_tagfile', '_id' => 'select-tagfile', '_type' => 'form_select', 'name' => 'select-tagfile'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $data = $this->_parseProjectFile (file ($this->docroot.$this->_CONF['projectdir'].'/'.$file)); - - if (isset ($entries [$data ['TAGS']])) { - continue; + foreach ($this->_tagfiles as $tagfile) { + $actiondata1 = array ('_root' => 'select-tagfile', '_id' => 'select-'.$file, '_type' => 'form_select_option', 'value' => $tagfile, 'label' => $tagfile); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); } - - $data ['TAGS'] = str_replace ('$home', $data ['HOME'], $data ['TAGS']); - $data ['TAGS'] = str_replace ('//', '/', $data ['TAGS']); - $actiondata1 = array ('_root' => 'select-tagfile', '_id' => 'select-'.$file, '_type' => 'form_select_option', 'value' => $data ['TAGS'], 'label' => $data ['TAGS']); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $entries [$data ['TAGS']] = 1; + $actiondata1 = array ('_root' => 'form_tagfile', '_id' => 'submit-tagfile', '_type' => 'form_submit', 'name' => 'submit-tagfile', 'value' => '1', 'content' => 'Tagdatei editieren'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } - $actiondata1 = array ('_root' => 'form_tagfile', '_id' => 'submit-tagfile', '_type' => 'form_submit', 'name' => 'submit-tagfile', 'value' => '1', 'content' => 'Tagdatei editieren'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - - $actiondata1 = array ('_root' => $_root, '_id' => 'form_tags', '_type' => 'form', 'action' => '#'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - if ($this->_tagfile != '') { - $_data = $this->_parseTagFile(file($this->docroot.$this->_tagfile)); + + // + $actiondata1 = array ('_root' => 'form_tagfile', '_id' => 'taglist', '_type' => 'taglist'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + // get the tag-array + $_data = $this->_parseTagFile(file($this->docroot.$this->_tagfile)); + + // sort the tag-array + //ksort ($_data); + + reset ($_data); + + // walk through tag-array foreach ($_data as $id => $value) { - - $actiondata1 = array ('_root' => 'form_tags', '_id' => 'tags_status_'.$id, '_type' => 'paragraph', 'content' => $id.' = '.$value); + $actiondata1 = array ('_root' => 'taglist', '_id' => 'tags_status_'.$id, '_type' => 'tagentry', 'tag' => htmlentities ($id), 'value'=>htmlentities ($value)); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + } } return true; @@ -696,7 +773,7 @@ /** * get a value from the phpCMS-configfile **/ - function _getDefaultValue(& $actiondata) { + function _getDefaultValue(&$actiondata) { if (!is_array($this->_DEFAULTS) || count($this->_DEFAULTS) == 0) { $this->_loadDefault(); } @@ -716,7 +793,7 @@ /** * set a value in the phpCMS-configfile **/ - function _setDefaultValue(& $actiondata) { + function _setDefaultValue(&$actiondata) { if (!is_array($this->_DEFAULTS) || count($this->_DEFAULTS) == 0) { $this->_loadDefault(); } @@ -764,8 +841,13 @@ $current = 0; for ($i = 0; $i < $num; $i++) { - $line = trim ($data [$i]); - if ($line {0} == ';') { + $line = trim ($data [$i]); + + if ($line == '') { + continue; + } + + if ($line{0} == ';') { continue; } @@ -784,6 +866,12 @@ } /** + * + **/ + function _parseMenuFile ($data) { + } + + /** * Callback function for sorting the array with the cache-entries **/ function _sortCacheList($a, $b) { Index: layout.phpcms.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/layout.phpcms.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- layout.phpcms.xml 29 Sep 2004 20:10:45 -0000 1.2 +++ layout.phpcms.xml 7 Dec 2004 06:34:49 -0000 1.3 @@ -22,20 +22,44 @@ <![CDATA[ <fieldset> <legend>PAX-Erweiterung</legend> - <label class="horizontal"><input type="radio" name="config-PAX" value="1"<layout:replace name="PAX_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-PAX" value="0"<layout:replace name="PAX_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-PAX" value="1"<layout:replace name="PAX_ON" /> /> + </label> + <label class="switch"> + <span>Aus<span> + <input type="radio" name="config-PAX" value="0"<layout:replace name="PAX_OFF" /> /> + </label> </fieldset> <fieldset> <legend>PAX-Tags</legend> - <label class="horizontal"><input type="radio" name="config-PAXTAGS" value="1"<layout:replace name="PAXTAGS_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-PAXTAGS" value="0"<layout:replace name="PAXTAGS_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-PAXTAGS" value="1"<layout:replace name="PAXTAGS_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-PAXTAGS" value="0"<layout:replace name="PAXTAGS_OFF" /> /> + </label> </fieldset> <fieldset> <legend>Mail2Crypt</legend> - <label class="horizontal"><input type="radio" name="config-MAIL2CRYPT" value="1"<layout:replace name="MAIL2CRYPT_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-MAIL2CRYPT" value="0"<layout:replace name="MAIL2CRYPT_OFF" /> /> Aus</label> - <label><input type="text" name="config-MAIL2CRYPT_JS" value="<layout:replace name="MAIL2CRYPT_JS" />" />Mail2Crypt JS-Pfad </label> - <label><input type="text" name="config-MAIL2CRYPT_IMG" value="<layout:replace name="MAIL2CRYPT_IMG" />" />Mail2Crypt Img-Pfad </label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-MAIL2CRYPT" value="1"<layout:replace name="MAIL2CRYPT_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-MAIL2CRYPT" value="0"<layout:replace name="MAIL2CRYPT_OFF" /> /> + </label> + <label> + <span>Mail2Crypt JS Pfad</span> + <input type="text" name="config-MAIL2CRYPT_JS" value="<layout:replace name="MAIL2CRYPT_JS" />" /> + </label> + <label> + <span>Mail2Crypt Imagepfad</span> + <input type="text" name="config-MAIL2CRYPT_IMG" value="<layout:replace name="MAIL2CRYPT_IMG" />" /> + </label> ]]> </layout:insert> @@ -44,18 +68,36 @@ <![CDATA[ <fieldset> <legend>Serverseitiger Cache</legend> - <label class="horizontal"><input type="radio" name="config-CACHE_STATE" value="1"<layout:replace name="CACHE_STATE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-CACHE_STATE" value="0"<layout:replace name="CACHE_STATE_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-CACHE_STATE" value="1"<layout:replace name="CACHE_STATE_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-CACHE_STATE" value="0"<layout:replace name="CACHE_STATE_OFF" /> /> + </label> <div id="pc_config_cache_1"> - <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> + <label> + <span>Pfad zum Cacheverzeichnis </span> + <input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" /> + </label> </div> </fieldset> <fieldset> <legend>Clientseitiger Cache</legend> - <label class="horizontal"><input type="radio" name="config-CACHE_CLIENT" value="1"<layout:replace name="CACHE_CLIENT_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-CACHE_CLIENT" value="0"<layout:replace name="CACHE_CLIENT_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-CACHE_CLIENT" value="1"<layout:replace name="CACHE_CLIENT_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-CACHE_CLIENT" value="0"<layout:replace name="CACHE_CLIENT_OFF" /> /> + </label> <div id="pc_config_cache_2"> - <label><input type="text" name="config-PROXY_CACHE_TIME" value="<layout:replace name="PROXY_CACHE_TIME" />" />Pfad zum Cacheverzeichnis </label> + <label> + <span>Pfad zum Cacheverzeichnis</span> + <input type="text" name="config-PROXY_CACHE_TIME" value="<layout:replace name="PROXY_CACHE_TIME" />" /> + </label> </div> </fieldset> ]]> @@ -66,29 +108,84 @@ <![CDATA[ <fieldset> <legend>gzip-Komprimierung</legend> - <label class="horizontal"><input type="radio" name="config-GZIP" value="1"<layout:replace name="GZIP_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-GZIP" value="0"<layout:replace name="GZIP_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-GZIP" value="1"<layout:replace name="GZIP_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-GZIP" value="0"<layout:replace name="GZIP_OFF" /> /> + </label> </fieldset> <fieldset> <legend title="Klau dem Apachen sein Gemachen ;)">Stealth-Mode</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH" value="1"<layout:replace name="STEALTH_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH" value="0"<layout:replace name="STEALTH_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-STEALTH" value="1"<layout:replace name="STEALTH_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-STEALTH" value="0"<layout:replace name="STEALTH_OFF" /> /> + </label> <div id="pc_config_server_1"> - <label><input type="text" name="config-NOLINKCHANGE" value="<layout:replace name="NOLINKCHANGE" />" />Links mit folgenden Endungen nicht behandeln</label> + <label> + <span>Links mit folgenden Endungen nicht behandeln</span> + <input type="text" name="config-NOLINKCHANGE" value="<layout:replace name="NOLINKCHANGE" />" /> + </label> </div> <fieldset id="secure-stealth-mode"> <legend>Secure Stealth Mode</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="1"<layout:replace name="STEALTH_SECURE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="0"<layout:replace name="STEALTH_SECURE_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-STEALTH_SECURE" value="1"<layout:replace name="STEALTH_SECURE_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-STEALTH_SECURE" value="0"<layout:replace name="STEALTH_SECURE_OFF" /> /> + </label> </fieldset> </fieldset> <fieldset> <legend title="Fehlerbehandlung">Debug-Modus</legend> - <label class="horizontal"><input type="radio" name="config-DEBUG" value="1"<layout:replace name="DEBUG_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-DEBUG" value="0"<layout:replace name="DEBUG_OFF" /> /> Aus</label> + <label class="switch"> + <span>An</span> + <input type="radio" name="config-DEBUG" value="1"<layout:replace name="DEBUG_ON" /> /> + </label> + <label class="switch"> + <span>Aus</span> + <input type="radio" name="config-DEBUG" value="0"<layout:replace name="DEBUG_OFF" /> /> + </label> <div id="pc_config_server_2"> - <label><input type="text" name="config-ERROR_PAGE" value="<layout:replace name="ERROR_PAGE" />" />Datei für allgemeine Fehler</label> - <label><input type="text" name="config-ERROR_PAGE_404" value="<layout:replace name="ERROR_PAGE_404" />" />Datei für Fehler 404 </label> + <label> + <span>Datei für allgemeine Fehler</span> + <input type="text" name="config-ERROR_PAGE" value="<layout:replace name="ERROR_PAGE" />" /> + </label> + <label> + <span>Datei für Fehler 404</span> + <input type="text" name="config-ERROR_PAGE_404" value="<layout:replace name="ERROR_PAGE_404" />" /> + </label> + </div> + </fieldset> + ]]> + </layout:insert> + + + <layout:insert name="pc_config_i18n"> + <![CDATA[ + <fieldset> + <legend>I18N</legend> + <label class="switch"><input type="radio" name="config-CACHE_STATE" value="1"<layout:replace name="CACHE_STATE_ON" /> /> An</label> + <label class="switch"><input type="radio" name="config-CACHE_STATE" value="0"<layout:replace name="CACHE_STATE_OFF" /> /> Aus</label> + <div id="pc_config_cache_1"> + <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> + </div> + </fieldset> + <fieldset> + <legend>Clientseitiger Cache</legend> + <label class="switch"><input type="radio" name="config-CACHE_CLIENT" value="1"<layout:replace name="CACHE_CLIENT_ON" /> /> An</label> + <label class="switch"><input type="radio" name="config-CACHE_CLIENT" value="0"<layout:replace name="CACHE_CLIENT_OFF" /> /> Aus</label> + <div id="pc_config_cache_2"> + <label><input type="text" name="config-PROXY_CACHE_TIME" value="<layout:replace name="PROXY_CACHE_TIME" />" />Pfad zum Cacheverzeichnis </label> </div> </fieldset> ]]> @@ -99,8 +196,8 @@ <![CDATA[ <fieldset> <legend>Allgemeine Statistik</legend> - <label class="horizontal"><input type="radio" name="config-STATS" value="1"<layout:replace name="STATS_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STATS" value="0"<layout:replace name="STATS_OFF" /> /> Aus</label> + <label class="switch"><input type="radio" name="config-STATS" value="1"<layout:replace name="STATS_ON" /> /> An</label> + <label class="switch"><input type="radio" name="config-STATS" value="0"<layout:replace name="STATS_OFF" /> /> Aus</label> <div id="pc_config_stat_1"> <label><input type="text" name="config-STATS_DIR" value="<layout:replace name="STATS_DIR" />" />Verzeichnis der Statistik </label> <label><input type="text" name="config-STATS_CURRENT" value="<layout:replace name="STATS_CURRENT" />" />aktuelles Verzeichnis der Statistik </label> @@ -109,8 +206,8 @@ </fieldset> <fieldset> <legend>Referrer</legend> - <label class="horizontal"><input type="radio" name="config-REFERRER" value="1"<layout:replace name="REFERRER_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-REFERRER" value="0"<layout:replace name="REFERRER_OFF" /> /> Aus</label> + <label class="switch"><input type="radio" name="config-REFERRER" value="1"<layout:replace name="REFERRER_ON" /> /> An</label> + <label class="switch"><input type="radio" name="config-REFERRER" value="0"<layout:replace name="REFERRER_OFF" /> /> Aus</label> <label><input type="text" name="config-REFERRER_DIR" value="<layout:replace name="REFERRER_DIR" />" />Verzeichnis für Referrer-Datei </label> <label><input type="text" name="config-REFERRER_FILE" value="<layout:replace name="REFERRER_FILE" />" />Dateiname für Referrer-Datei </label> <label><input type="text" name="config-REF_RELOAD_LOCK" value="<layout:replace name="REF_RELOAD_LOCK" />" />Reloadsperre </label> @@ -130,28 +227,153 @@ </fieldset> <fieldset> <legend>Erkennung von $DOCUMENT_ROOT</legend> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="AUTO_DOCUMENT_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="AUTO_DOCUMENT_ROOT_OFF" /> /> Manuell eingeben</label> + <label class="switch"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="AUTO_DOCUMENT_ON" /> /> Automatisch</label> + <label class="switch"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="AUTO_DOCUMENT_ROOT_OFF" /> /> Manuell eingeben</label> <label><input type="text" name="config-DOCUMENT_ROOT" value="<layout:replace name="DOCUMENT_ROOT" />" />Document_Root </label> </fieldset> <fieldset> <legend>Erkennung von $DOMAIN_NAME</legend> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="1"<layout:replace name="AUTO_DOMAIN_NAME_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="0"<layout:replace name="AUTO_DOMAIN_NAME_OFF" /> /> Manuell eingeben</label> + <label class="switch"><input type="radio" name="autoconfig-DOMAIN_NAME" value="1"<layout:replace name="AUTO_DOMAIN_NAME_ON" /> /> Automatisch</label> + <label class="switch"><input type="radio" name="autoconfig-DOMAIN_NAME" value="0"<layout:replace name="AUTO_DOMAIN_NAME_OFF" /> /> Manuell eingeben</label> <label><input type="text" name="config-DOMAIN_NAME" value="<layout:replace name="DOMAIN_NAME" />" />Domainname </label> </fieldset> <fieldset> <legend>Erkennung von $SCRIPT_PATH</legend> - <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="1"<layout:replace name="AUTO_SCRIPT_PATH_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="0"<layout:replace name="AUTO_SCRIPT_PATH_OFF" /> /> Manuell eingeben</label> + <label class="switch"><input type="radio" name="autoconfig-SCRIPT_PATH" value="1"<layout:replace name="AUTO_SCRIPT_PATH_ON" /> /> Automatisch</label> + <label class="switch"><input type="radio" name="autoconfig-SCRIPT_PATH" value="0"<layout:replace name="AUTO_SCRIPT_PATH_OFF" /> /> Manuell eingeben</label> <label><input type="text" name="config-SCRIPT_PATH" value="<layout:replace name="SCRIPT_PATH" />" />Document_Root </label> </fieldset> <fieldset> <legend>Erkennung von $SCRIPT_NAME</legend> - <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="1"<layout:replace name="AUTO_SCRIPT_NAME_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="0"<layout:replace name="AUTO_SCRIPT_NAME_OFF" /> /> Manuell eingeben</label> + <label class="switch"><input type="radio" name="autoconfig-SCRIPT_NAME" value="1"<layout:replace name="AUTO_SCRIPT_NAME_ON" /> /> Automatisch</label> + <label class="switch"><input type="radio" name="autoconfig-SCRIPT_NAME" value="0"<layout:replace name="AUTO_SCRIPT_NAME_OFF" /> /> Manuell eingeben</label> <label><input type="text" name="config-SCRIPT_NAME" value="<layout:replace name="SCRIPT_NAME" />" />Document_Root </label> </fieldset> ]]> </layout:insert> + + + <layout:insert name="taglist"> + <![CDATA[ + <style> + <!-- + #taglist { + list-item-type:none; + } + #taglist dt { + padding:0.2em; + color:#029544; + border-top:1px solid; + } + #taglist dd { + padding:0 0.2em; + margin-left:3em; + } + --> + </style> + <dl id="taglist"> + <layout:replace name="content" /> + </dl> + ]]> + </layout:insert> + + + <layout:insert name="tagentry"> + <![CDATA[ + <dt><layout:replace name="tag" /></dt> + <dd><layout:replace name="value" /></dd> + ]]> + </layout:insert> + + + <layout:insert name="cachelist"> + <![CDATA[ + <style> + <!-- + #cacheview li { + list-style-type:none; + margin-left:0em; + padding-left:0; + } + #cacheview ul { + margin-left:1.5em; + padding-left:0; + } + #cacheview li { + font-weight:normal; + } + #cacheview li.subdir { + } + #cacheview li.subdir { + font-weight:bold; + } + #cacheview span.gzip { + color:#0f0; + font-weight:bold; + } + #cacheview span.statisch { + color:#f80; + font-weight:bold; + } + #cacheview span.dynamisch { + color:#f00; + font-weight:bold; + } + --> + </style> + <div class="symbolleiste"> + <img src="modules/phpcms/img/cache/del-all.gif" width="16" height="16" alt="" title="Alle Dateien im Cache löschen" /> + <img src="modules/phpcms/img/cache/del-sel.gif" width="16" height="16" alt="" title="Ausgewählte Dateien im Cache löschen" /> + </div> + <ul id="cacheview"> + <layout:replace name="content" default="" /> + </ul> + ]]> + </layout:insert> + + + <layout:insert name="cachedir"> + <![CDATA[ + <li class="subdir"> + <input type="checkbox" name="deletedir[<layout:replace name="cachedir" />]" value="1" /> + <layout:replace name="dirname" /> + <ul> + <layout:replace name="content" default="" /> + </ul> + </li> + ]]> + </layout:insert> + + <layout:insert name="cachefile"> + <![CDATA[ + <li> + <input type="checkbox" name="delete[<layout:replace name="cachefile" />]" value="1" class="input" /> + <span class="<layout:replace name="cachetype" />"><layout:replace name="cachetype" /></span> + <a href="http://<layout:replace name="filename" />" title="<layout:replace name="cachefile" /> gecached am <layout:replace name="cachetime" />">http://<layout:replace name="filename" /></a> + </li> + ]]> + </layout:insert> + + + <layout:insert name="menufolder"> + <![CDATA[ + <li class="subdir"> + <input type="checkbox" name="select[<layout:replace name="CLASS" />]" value="1" /> + <layout:replace name="MNAME" /> <a href="<layout:replace name="LINK" />" Goto </a> + <ul> + <layout:replace name="content" default="" /> + </ul> + </li> + ]]> + </layout:insert> + + <layout:insert name="menuentry"> + <![CDATA[ + <li> + <input type="checkbox" name="select[<layout:replace name="CLASS" />]" value="1" /> + <layout:replace name="MNAME" /> <a href="<layout:replace name="LINK" />" Goto </a> + </li> + ]]> + </layout:insert> + </layout> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:06
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/debug Modified Files: class.module_debug.php Log Message: prepration of first Alpha-Preview Index: class.module_debug.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug/class.module_debug.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_debug.php 29 Sep 2004 20:10:45 -0000 1.4 +++ class.module_debug.php 7 Dec 2004 06:34:48 -0000 1.5 @@ -28,6 +28,9 @@ /* * $Log$ +* Revision 1.5 2004/12/07 06:34:48 mjahn +* prepration of first Alpha-Preview +* * Revision 1.4 2004/09/29 20:10:45 mjahn * completed phpCMS-config-part * began the statistic part @@ -70,11 +73,11 @@ $_root = $actiondata['_root']; - $actiondata1 = array ('_id'=>'debugger', '_type'=>'framebox', 'width'=>'50em', 'height'=>'10em', '_root'=>$_root); + $actiondata1 = array ('_id'=>'debugger', '_type'=>'framebox', 'width'=>'50em', 'height'=>'10em', 'extra'=>' id="debugger"', '_root'=>$_root); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $this->uri['events'] =& $this->_event->_events; - $this->uri['actions'] =& $this->_event->_actionHandler->_actions; +// $this->uri['events'] =& $this->_event->_events; +// $this->uri['actions'] =& $this->_event->_actionHandler->_actions; foreach ($this->uri as $type=>$data) { if (!is_array ($data)) { |
From: Martin J. <mj...@us...> - 2004-12-07 06:35:01
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210 Modified Files: .cvsignore Changelog index.php Log Message: prepration of first Alpha-Preview Index: .cvsignore =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 25 Aug 2004 21:21:02 -0000 1.2 +++ .cvsignore 7 Dec 2004 06:34:48 -0000 1.3 @@ -1,4 +1 @@ pear -efc_xfss-2003-08-22.tar.gz -md5.php -phpplugin-2004-06-13.tar.gz Index: Changelog =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/Changelog,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Changelog 25 Aug 2004 21:16:47 -0000 1.8 +++ Changelog 7 Dec 2004 06:34:48 -0000 1.9 @@ -1,3 +1,8 @@ +December 06 2004 (mjahn) + * created simplier configuration and more flexibility to the framework and some modules + * changed the index.php for better integration into a phpCMS-contentfile + * better documented with phpDOC-comments + August 25 2004 (mjahn) * created structure of the filemanager-gui, includeing up-/download, archiving and clipboarding of files and directories @@ -8,8 +13,6 @@ * created structure of the phpcms-config-gui * created phpinfo in the help-module - - Juli 31 2004 (mjahn) * it seems to be simple to install this software, - simply copy it into the destination dir Index: index.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- index.php 25 Aug 2004 21:16:47 -0000 1.8 +++ index.php 7 Dec 2004 06:34:48 -0000 1.9 @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.9 2004/12/07 06:34:48 mjahn +* prepration of first Alpha-Preview +* * Revision 1.8 2004/08/25 21:16:47 mjahn * step 1 is taken * @@ -58,45 +61,65 @@ */ /** -* Defines wether the debug-module shows its data or not -**/ -define ('DEBUG', false); -error_reporting (E_ALL); +* load only _one_ instance of Admin4phpCMS in the global namespace and only call +* it from there, if there is already an instance of it. This saves memory, +* because only one instance is needed for one single page, regardless of the +* times you call bb_script in your contentfile. +*/ +if (!isset ($GLOBALS ['admin4phpCMS'])) { -/** -* Set the path for including the pear-packages -**/ -define ('PEAR_DIR', dirname (__FILE__).'/pear/'); + define ('MODULE_PATH', '/cms/admin/modules/'); -if (!function_exists ('ini_set')) { - define ('PATH_TO_PEAR', PEAR_DIR); -} else { - $check = ini_set ('include_path', dirname(__FILE__).'/pear/'.PATH_SEPARATOR.ini_get ('include_path')); - if (empty ($check) || $check === false) { + define ('ADMIN4PHPCMS_VERSION', '$version v 1.8 2004/08/25 21:16:47'); + + /** + * Defines wether the debug-module shows its data or not + **/ + define ('DEBUG', false); + error_reporting (E_ALL); + + /** + * Set the path for including the pear-packages + **/ + define ('PEAR_DIR', dirname (__FILE__).'/pear/'); + + /** + * set the index-file-constant for action-parameter in forms and the + * href-parameter in the links + */ + if (isset ($_REQUEST ['file'])) { + define ('INDEX_FILE', $_GET ['file']); + } else { + define ('INDEX_FILE', basename (__FILE__)); + } + + /** + * set the path to the pear-directory + */ + if (!function_exists ('ini_set')) { define ('PATH_TO_PEAR', PEAR_DIR); } else { - define ('PATH_TO_PEAR', ''); + $check = ini_set ('include_path', dirname(__FILE__).'/pear/'.PATH_SEPARATOR.ini_get ('include_path')); + if (empty ($check) || $check === false) { + define ('PATH_TO_PEAR', PEAR_DIR); + } else { + define ('PATH_TO_PEAR', ''); + } } + + /** + * Include the framework-class + */ + include_once (dirname(__FILE__).'/include/class.framework.php'); + + /** + * Initialize a new framework + **/ + $GLOBALS ['admin4phpCMS'] = new framework(); } -/** -* Include the framework-class -**/ -include_once (dirname(__FILE__).'/include/class.framework.php'); - -/** -* Initialize a new framework -**/ -$a = new framework(); /** * Run the framework **/ -$a->run(); - -//print_r ($a); - -/** -* Clear the variable-scope -**/ -unset ($a); +$GLOBALS ['admin4phpCMS']->run (); ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-12-07 06:34:59
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/include Modified Files: class.framework.php Log Message: prepration of first Alpha-Preview Index: class.framework.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.framework.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- class.framework.php 18 Jun 2004 15:16:59 -0000 1.7 +++ class.framework.php 7 Dec 2004 06:34:48 -0000 1.8 @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.8 2004/12/07 06:34:48 mjahn +* prepration of first Alpha-Preview +* * Revision 1.7 2004/06/18 15:16:59 mjahn * module filemanager and editor included * @@ -61,6 +64,25 @@ class framework { function run () { + + // let the modules parse the URI-params + $actiondata = array ('get'=>$_GET, 'post'=>$_POST, 'request'=>$_REQUEST, 'cookie'=>$_COOKIE); + $this->eventhandler->event ('PARSE_PARAM', $actiondata); + + // let the modules do their work + $actiondata = array (); + $this->eventhandler->event ('PROCESS', $actiondata); + + // let the modules print their output + $actiondata = array (); + $this->eventhandler->event ('DISPLAY', $actiondata); + } + + function framework () { + $this->__construct (); + } + + function __construct () { global $ACTION; $this->eventhandler =& new eventHandler (); @@ -110,19 +132,7 @@ $actiondata = array ('filename'=>$includefile, 'class'=>$module->attributes['class']); $this->eventhandler->event ('LOAD_MODULE', $actiondata); } - - // let the modules parse the URI-params - $actiondata = array ('get'=>$_GET, 'post'=>$_POST, 'request'=>$_REQUEST, 'cookie'=>$_COOKIE); - $this->eventhandler->event ('PARSE_PARAM', $actiondata); - - // let the modules do their work - $actiondata = array (); - $this->eventhandler->event ('PROCESS', $actiondata); - - // let the modules print their output - $actiondata = array (); - $this->eventhandler->event ('DISPLAY', $actiondata); - } + } } ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-12-07 06:34:57
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/config Modified Files: config.xml class.module_config.php Log Message: prepration of first Alpha-Preview Index: config.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/config.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config.xml 29 Sep 2004 20:10:46 -0000 1.7 +++ config.xml 7 Dec 2004 06:34:46 -0000 1.8 @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="iso-8859-15"?> <!DOCTYPE framework SYSTEM "config.dtd"> <framework> + <module id="user" name="user-service" include="class.module_user.php" class="module_user"> + <config name="userfile" value="user.db" /> + <config name="permfile" value="perm.db" /> + </module> <module id="mail" name="email-service" include="class.module_mail.php" class="module_mail"> <config name="admin-email" value="ma...@mj..." /> <config name="from-email" value="fra...@ma..." /> @@ -12,15 +16,12 @@ <config name="chmod" value="0606" /> </module> <module id="error" name="error-service" include="class.module_error.php" class="module_error" /> - <module id="user" name="user-service" include="class.module_user.php" class="module_user"> - <config name="userfile" value="Auth_XML.xml" /> - <config name="permfile" value="Perm_XML.xml" /> - </module> <module id="debug" name="debug-service" include="class.module_debug.php" class="module_debug" /> <module id="layout" name="layout-service" include="class.module_layout.php" class="module_layout" /> <module id="editor" name="editor-service" include="class.module_editor.php" class="module_editor" /> <module id="filemanager" name="filemanager" include="class.module_filemanager.php" class="module_filemanager"> <config name="startupdir" value="/" /> + <config name="imagepath" value="filemanager/img/" /> <config name="editor_image" value="jpg,jpeg,png,bmp,gif" /> <config name="editor_xml" value="xml,dtd" /> <config name="editor_phpcms_content" value="phpcms" /> Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- class.module_config.php 25 Aug 2004 21:16:46 -0000 1.7 +++ class.module_config.php 7 Dec 2004 06:34:47 -0000 1.8 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.8 2004/12/07 06:34:47 mjahn +* prepration of first Alpha-Preview +* * Revision 1.7 2004/08/25 21:16:46 mjahn * step 1 is taken * @@ -95,9 +98,6 @@ $this->_registerAction ('doSaveConfig', 'saveConfig'); $this->_registerEvent ('CONFIG_SET_FILE', 'doSetConfigFile'); $this->_registerAction ('doSetConfigFile', 'setConfigFile'); - - $this->_registerAction ('doParseParam', 'parseParam'); - $this->_registerAction ('doParseMenuMain', 'getMenuMain'); } /** |
From: Martin J. <mj...@us...> - 2004-12-07 06:34:57
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/webdav In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13210/modules/webdav Added Files: class.module_webdav.php Log Message: prepration of first Alpha-Preview --- NEW FILE: class.module_webdav.php --- <?php /** * DAV access to phpCMS driven website * * This module is based on the package PEAR::HTTP_WebDAV_Server * * <b>License</b> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.module_webdav.php,v 1.1 2004/12/07 06:34:47 mjahn Exp $ * @package admin4phpCMS * @subpackage module_user **/ /* * $Log: class.module_webdav.php,v $ * Revision 1.1 2004/12/07 06:34:47 mjahn * prepration of first Alpha-Preview * */ /** * include the webdav-class **/ //include_once (dirname (__FILE__).'/class.webdav.php'); /** * * @package admin4phpCMS * @subpackage module_webdav * @todo Get the class work completly **/ class module_webdav extends module { /** * Initialization of the module * * The module registers its own events and connects his methods to some actions **/ function init () { // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); return true; } /** * Parse the URI-params * * @param array $actiondata $actiondata contains the URI-param-arrays **/ function parseParam (&$actiondata) { return true; } } ?> |
From: Martin J. <mj...@us...> - 2004-12-07 06:34:12
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/webdav In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13160/modules/webdav Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/webdav added to the repository |
From: Martin J. <mj...@us...> - 2004-10-01 07:09:11
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30538/modules/phpcms Modified Files: class.module_phpcms.php Log Message: basic code for tagfile-editor Index: class.module_phpcms.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.module_phpcms.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_phpcms.php 29 Sep 2004 20:10:45 -0000 1.4 +++ class.module_phpcms.php 1 Oct 2004 07:08:51 -0000 1.5 @@ -1,4 +1,4 @@ -<?php +<?php /** * Managment of the phpCMS-related administration part * @@ -28,9 +28,8 @@ /* * $Log$ -* Revision 1.4 2004/09/29 20:10:45 mjahn -* completed phpCMS-config-part [...1057 lines suppressed...] + /** * Callback function for sorting the array with the cache-entries **/ - function _sortCacheList ($a, $b) { - $dira = strpos ($a, '/') !== false; - $dirb = strpos ($b, '/') !== false; + function _sortCacheList($a, $b) { + $dira = strpos($a, '/') !== false; + $dirb = strpos($b, '/') !== false; if ($dira && !$dirb) { return -1; } if (!$dira && $dirb) { return 1; } - return strcmp ($a, $b); + return strcmp($a, $b); } // function sortCacheList } |
From: Martin J. <mj...@us...> - 2004-09-29 20:11:23
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/user Modified Files: layout.user.xml class.module_user.php Added Files: user.db class.auth.php Removed Files: Perm_XML.xml Auth_XML.xml Log Message: completed phpCMS-config-part began the statistic part Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class.module_user.php 25 Aug 2004 21:16:46 -0000 1.8 +++ class.module_user.php 29 Sep 2004 20:10:43 -0000 1.9 @@ -30,6 +30,10 @@ /* * $Log$ +* Revision 1.9 2004/09/29 20:10:43 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.8 2004/08/25 21:16:46 mjahn * step 1 is taken * @@ -53,9 +57,15 @@ * */ /** -* include necessary files +* include the authentication-class **/ -include_once (PATH_TO_PEAR.'LiveUser/LiveUser.php'); +//include_once ('Auth.php'); +include_once (dirname (__FILE__).'/class.auth.php'); + +/** +* set the filename of the user-db +**/ +define ('PASSWD_FILE', dirname (__FILE__).'/user.db'); /** * Class for user- and permission-managment @@ -87,6 +97,7 @@ * @access private **/ var $_USER; + var $adminAction = ''; /** * Initialization of the module @@ -94,25 +105,9 @@ * The module registers its own events and connects his methods to some actions **/ function init () { - $liveuserConfig = array( - 'session' => array('name' => 'PHPSESSID','varname' => 'loginInfo'), - 'login' => array('username' => 'handle', 'password' => 'passwd'), - 'cookie' => array('name' => 'loginInfo', 'path' => '/', 'domain' => 'localhost', 'lifetime' => 60), - 'autoInit' => true, - 'authContainers' => array(0 => array('type' => 'XML', - 'file' => dirname(__FILE__).'/Auth_XML.xml', - 'loginTimeout' => 60*30, - 'expireTime' => 60*60*2, - 'idleTime' => 60*30, - 'allowDuplicateHandles' => 0, - 'passwordEncryptionMode' => 'MD5' - ) - ), - 'permContainer' => array('type' => 'XML_Simple', - 'file' => dirname(__FILE__).'/Perm_XML.xml' - ) - ); - $this->_USER = LiveUser::factory($liveuserConfig); + $this->_USER = new SaferAuth('File', PASSWD_FILE); + $this->_USER->setShowLogin (false); + // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doParseMenuMain', 'getMenuMain'); @@ -137,35 +132,61 @@ **/ function parseParam (&$actiondata) { + // start the user-managaer + $this->_USER->start (); + //echo ($this->_USER->getAuth() ? 'true' : 'false'); + // load our own extra template $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.user.xml'); $this->_callEvent ('LAYOUT_ADD_TEMPLATE', $actiondata1); - // check if the user submitted the login-form - $logout = false; - $username = ''; - $passwd = ''; - $password = ''; - if (isset ($actiondata['post']['logout'])) { - $logout = true; - unset ($_POST['logout']); - } elseif (isset ($actiondata['get']['logout'])) { - unset ($_GET['logout']); - $logout = true; - } - if (isset ($actiondata['post']['passwd'])) { - $passwd = $actiondata['post']['passwd']; - $logout = false; - } - $username = ''; - if (isset ($actiondata['post']['handle'])) { - $username = $actiondata['post']['handle']; - $logout = false; + // check for logout + if (isset ($actiondata ['post'] ['logout'])) { + if (!isset ($actiondata ['post'] ['submit-login'])) { + $this->_USER->logout (); + $this->_USER->start (); + } + } elseif (isset ($actiondata ['get'] ['logout'])) { + if (!isset ($actiondata ['post'] ['submit-login'])) { + $this->_USER->logout (); + $this->_USER->start (); + } } + + //check for admin-data + if (isset ($actiondata ['post'] ['submit-deluser'])) { - // start the user-managaer - $this->_USER->init($username, $password, $logout); + if (true || $this->_USER->getUsername () == 'Martin Jahn') { + + $this->_selectedUser = array (); + + if ($actiondata ['post'] ['submit-deluser'] == -1) { + // delete multiple user + $this->adminAction = 'delete-user'; + foreach ($actiondata ['post'] as $id=>$value) { + if (substr ($id, 0, 12) != 'select-user-') { + continue; + } + $this->_selectedUser [] = substr ($id, 12); + } + } else { + // delete one user + $this->adminAction = 'delete-user'; + $this->_selectedUser = array ($actiondata ['post'] ['submit-deluser']); + } + } + } + if (isset ($actiondata ['post'] ['submit-newuser'])) { + $this->_newUser = array ($actiondata ['post'] ['newuser-handle'] => $actiondata ['post'] ['newuser-password']); + $this->adminAction = 'new-user'; + } + + if (isset ($actiondata ['post'] ['submit-edituser'])) { + $this->_selectedUser = array ($actiondata ['post'] ['submit-edituser']); + $this->adminAction = 'edit-user'; + } + // check if we have to display something $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'user'); @@ -176,7 +197,7 @@ } // if the user is not yet logged in - if (!$this->_USER->isLoggedIn ()) { + if (!$this->_USER->getAuth ()) { $this->action = 'login'; } // react onto the action @@ -187,6 +208,9 @@ case 'admin': $this->_registerAction ('doProcess', 'processAdmin'); break; + case 'profile': + $this->_registerAction ('doProcess', 'processProfile'); + break; default: // $this->_registerAction ('doProcess', 'processLogin'); } @@ -209,10 +233,35 @@ } function processAdmin (&$actiondata) { + +// $this->_USER->setMode('sha'); + //check for the correct action we have to do + switch ($this->adminAction) { + case 'delete-user': + foreach ($this->_selectedUser as $id) { + $this->_USER->removeUser ($id); + } + break; + case 'save-user':break; + case 'new-user':; + foreach ($this->_newUser as $id=>$pass) { + $this->_USER->addUser ($id, $pass); + } + case 'edit-user': + //$this->_USER->chgUser ($this->_newUser ['login'], $this->_newUser ['password']); + break; + default:; + } + + // register the correct function $this->_registerAction ('doParseContent', 'getAdminContent'); return true; } + function processProfile (&$actiondata) { + $this->_registerAction ('doParseContent', 'getProfileContent'); + return true; + } /** * Get content for mainmenu @@ -223,7 +272,7 @@ $root = $actiondata['_root']; - if (!$this->_USER->isLoggedIn ()) { + if (!$this->_USER->getAuth ()) { $actiondata1 = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Anmeldung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'extra'=>'class="active"'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); return true; @@ -244,7 +293,7 @@ * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getMenuSub (&$actiondata) { - if (!$this->_USER->isLoggedIn ()) { + if (!$this->_USER->getAuth ()) { return true; } @@ -254,6 +303,12 @@ $root = $actiondata['_root']; + $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Benutzer-Profil', 'module'=>'user', '_id'=>'userprofile', 'action'=>'profile'); + if ($this->action == 'profile') { + $actiondata1 ['extra'] = 'id="current"'; + } + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); + $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Verwaltung', 'module'=>'user', '_id'=>'useroverview', 'action'=>'admin'); if ($this->action == 'admin') { $actiondata1 ['extra'] = 'id="current"'; @@ -271,11 +326,22 @@ function getLoginContent (&$actiondata) { $root = $actiondata['_root']; + + if (isset ($this->_USER) && $this->_USER->getStatus () != 0) { + $actiondata1 = array ('errortext'=>$this->_USER->getStatus ()); + $this->_callEvent ('ERROR_NOTICE', $actiondata1); + } $actiondata1 = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'action'=>'index.php'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - $actiondata1 = array ('_id'=>'loginform-content', '_root'=>'loginform', '_type'=>'us_loginform', 'method'=>'post'); + $users =$this->_USER->listUsers (); + $list = ''; + foreach ($users as $id=>$user) { + $list .= '<option value="'.$user['username'].'">'.$user ['username'].'</option>'; + } + + $actiondata1 = array ('_id'=>'loginform-content', '_root'=>'loginform', '_type'=>'us_loginform', 'method'=>'post', 'userlist'=>$list); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); if (isset ($_GET) && is_array ($_GET)) { @@ -296,31 +362,75 @@ * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getStatusContent (&$actiondata) { - if ($this->_USER->isLoggedIn ()) { + if ($this->_USER->getAuth () == 1) { $root = $actiondata['_root']; - $actiondata = array ('_id'=>'1', '_root'=>$root, '_type'=>'paragraph', 'content'=>$this->_USER->getProperty ('handle').' (<a href="?logout=logout">abmelden</a>)'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + $actiondata1 = array ('_id'=>'1', '_root'=>$root, '_type'=>'paragraph', 'content'=>$this->_USER->session['username'].' (<a href="?logout=logout">abmelden</a>)'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); } return true; } /** - * Get content for statusbar + * Get content for admin content * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getAdminContent (&$actiondata) { - $this->actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'us_list', '_type'=>'us_userlist'); + + $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'container', '_type'=>'block', 'extra'=>'id="container"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - $this->actiondata1 = array ('_root'=>'us_list', '_id'=>'us_list_entry-1', '_type'=>'us_listentry', 'id'=>'1', 'username'=>'Martin Jahn'); + $actiondata1 = array ('_root'=>'container', '_id'=>'us_admin_form', '_type'=>'form'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - $this->actiondata1 = array ('_root'=>'us_list', '_id'=>'us_list_entry-2', '_type'=>'us_listentry', 'id'=>'2', 'username'=>'demo'); + $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_form1', '_type'=>'form_input_hidden', 'value'=>'admin', 'name'=>'action'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_form2', '_type'=>'form_input_hidden', 'value'=>'user', 'name'=>'moduleid'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'us_list', '_type'=>'us_userlist'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + @$user =& $this->_USER->listUsers (); + + if (PEAR::isError ($user)) { + return true; + } + + foreach ($user as $id=>$user) { + + $actiondata1 = array ('_root'=>'us_list', '_id'=>'user-'.$id, '_type'=>'us_listentry', 'id'=>$id, 'username'=>$user ['username']); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + } + + $actiondata1 = array ('_root'=>'us_admin_form', '_id'=>'new-user', '_type'=>'us_newuser'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + return true; + } + + /** + * Get content for user profile + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ + function getProfileContent (&$actiondata) { + $items = get_object_vars ($this->_USER); + + $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'profile-list', '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + $num = count ($this->_USER); + foreach ($this->_USER as $id => $value) { + + $actiondata1 = array ('_root'=>'profile-list', '_id'=>'profile-list-'.$id, '_type'=>'list_entry', 'content'=>$id.' = '.$value); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + + } + return true; } @@ -335,7 +445,7 @@ * @param array $actiondata **/ function getUserStatus (&$actiondata) { - $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); + $actiondata ['isLoggedIn'] = $this->_USER->getAuth (); return true; } @@ -361,21 +471,15 @@ function setUserData (&$actiondata) { return true; } - + /** - * + * Get a list of all available users + * + * @param array $actiondata **/ - function displayUserList ($list, $template) { - if (!is_array ($list)) { - return true; - } - - $num = count ($list); - for ($i = 0; $i < num; $i++ ) { - - } - } - + function getUserList (&$actiondata) { + return true; + } } --- NEW FILE: class.auth.php --- <?php /** * User- and permissionmanagment * * authentication class * * <b>License</b> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.auth.php,v 1.1 2004/09/29 20:10:43 mjahn Exp $ * @package admin4phpCMS * @subpackage module_user **/ /* * $Log: class.auth.php,v $ * Revision 1.1 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part * */ /** * include necessary PEAR-packages **/ include_once ('Auth.php'); /** * @author Martin Jahn <mj...@us...> * @package admin4phpCMS */ class SaferAuth extends Auth { /** * Assign data from login form to internal values * * This function takes the values for username and password * from $HTTP_POST_VARS/$_POST and assigns them to internal variables. * If you wish to use another source apart from $HTTP_POST_VARS/$_POST, * you have to derive this function. * * @global $HTTP_POST_VARS, $_POST * @see Auth * @return void * @access private */ function assignData() { if (isset($this->post[$this->_postUsername]) && $this->post[$this->_postUsername] != '') { $this->username = (get_magic_quotes_gpc() == 1 ? stripslashes($this->post[$this->_postUsername]) : $this->post[$this->_postUsername]); } if (isset($this->post[$this->_postPassword]) && $this->post[$this->_postPassword] != '') { $this->password = (get_magic_quotes_gpc() == 1 ? stripslashes($this->post[$this->_postPassword]) : $this->post[$this->_postPassword] ); } } /** * Has the user been authenticated? * * @access public * @return bool True if the user is logged in, otherwise false. */ function getAuth() { if ( isset($this->session['registered']) ) { return true; } return false; } /** * Add user to the storage container * * @access public * @param string Username * @param string Password * @param mixed Additional parameters * @return mixed True on success, PEAR error object on error * and AUTH_METHOD_NOT_SUPPORTED otherwise. */ function addUser($username, $password, $additional = '') { $this->_loadStorage(); return $this->storage->addUser($username, $password, $additional); } /** * Change password for user in the storage container * * @access public * @param string Username * @param string The new password * @return mixed True on success, PEAR error object on error * and AUTH_METHOD_NOT_SUPPORTED otherwise. */ function changePassword($username, $password) { $this->_loadStorage(); return $this->storage->changePassword($username, $password); } } ?> --- Perm_XML.xml DELETED --- --- Auth_XML.xml DELETED --- Index: layout.user.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/layout.user.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.user.xml 25 Aug 2004 21:16:45 -0000 1.1 +++ layout.user.xml 29 Sep 2004 20:10:43 -0000 1.2 @@ -3,10 +3,16 @@ <layout:insert name="us_userlist"> <![CDATA[ - <h2>Benutzerübersicht</h2> - <ul id="userlist"> - <layout:replace name="username" /> - </ul> + <fieldset> + <legend>Benutzerübersicht</legend> + <ul id="userlist"> + <layout:replace name="content" /> + <li class="header"> + <span class="input"><img src="modules/filemanager/img/arrow.gif" width="16" height="16" alt="" class="input" /></span> + <span class="input"><button type="submit" name="submit-deluser" value="-1" title="ausgewählte Benutzereinträge entfernen">ausgewählte Benutzer entfernen</button></span> + </li> + </ul> + </fieldset> ]]> </layout:insert> @@ -14,8 +20,9 @@ <layout:insert name="us_listentry"> <![CDATA[ <li> - <input type="submit" name="deluser-<layout:replace name="id" />" value="D" /> - <input type="submit" name="edituser-<layout:replace name="id" />" value="E" /> + <span class="input"><input type="checkbox" name="select-user-<layout:replace name="id" />" value="1" title="Benutzereintrag auswählen" /></span> + <span class="input"><button type="submit" name="submit-deluser" value="<layout:replace name="username" />" title="Benutzereintrag entfernen"><img src="modules/filemanager/img/delete.gif" width="16" height="16" alt="del" /></button></span> + <span class="input"><button type="submit" name="submit-edituser" value="<layout:replace name="username" />" title="Benutzereintrag editieren" ><img src="modules/filemanager/img/edit.gif" width="16" height="16" alt="edit" /></button></span> <layout:replace name="username" /> </li> ]]> @@ -39,9 +46,9 @@ <![CDATA[ <fieldset> <legend>Neuen Benutzer anlegen</legend> - <label><input type="text" name="new-handle" value="Neues Login" />Loginname </label> - <label><input type="password" name="new-password" value="Neues Passwort" />Passwort </label> - <label><input type="checkbox" name="new-isActive" />Aktiviert </label> + <label><input type="text" name="newuser-handle" value="Neues Login" />Loginname </label> + <label><input type="password" name="newuser-password" value="Neues Passwort" />Passwort </label> + <button type="submit" name="submit-newuser" value="1">Neuen Benutzer anlegen</button> </fieldset> ]]> </layout:insert> @@ -51,13 +58,40 @@ <![CDATA[ <fieldset class="loginform"> <legend>Am System anmelden</legend> - <input type="hidden" name="method" value="<layout:replace name="method" default="post" />" /> + <script type="text/javascript"> + <![CDATA[ + window.onload = document.getElementById ("username").focus(); + ]]> + </script> <layout:replace name="content" /> - <label><input type="text" name="handle" />Benutzer </label> - <label><input type="password" name="passwd" value="" />Passwort </label> + <label><select name="username"><layout:replace name="userlist" /></select>Benutzer </label> + <label><input type="password" name="password" value="" />Passwort </label> <button type="submit" name="login-submit" value="1">Anmelden</button> </fieldset> ]]> </layout:insert> + <layout:insert name="us_loginform_safer"> + <![CDATA[ + <fieldset class="loginform"> + <legend>Am System anmelden</legend> + <script src="modules/user/js/HMAC.js" type="text/javacript"></script> + <script src="modules/user/js/HMAC_<layout:replace name="crypt" default="md5" />.js" type="text/javacript"></script> + <script type="text/javascript"> + <![CDATA[ + window.onload = document.getElementById ("username").focus(); + ]]> + </script> + <layout:replace name="content" /> +<!-- <label><input type="text" id="username" name="username" />Benutzer </label> --> + <label><input type="password" name="password" value="" />Passwort </label> + <input type="hidden" name="HMAC_use_js" id="HMAC_use_js" value="false" /> + <input type="hidden" name="HMAC_key" id="HMAC_key" value="<layout:replace name="hmac_key" default="" />" /> + <input type="hidden" name="HMAC_hash" id="HMAC_hash" /> + <button type="submit" name="login-submit" value="1">Anmelden</button> + </fieldset> + ]]> + </layout:insert> + + </layout> \ No newline at end of file --- NEW FILE: user.db --- Martin Jahn:{SHA}vC5jpRXo+O4Vao3czy09N0pHSFc= demo:{SHA}ieSV55Qc+eQOaYDRSha/AjzNTJE= |
From: Martin J. <mj...@us...> - 2004-09-29 20:11:23
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/layout Modified Files: layout.css layout.xml class.module_layout.php Log Message: completed phpCMS-config-part began the statistic part Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- layout.xml 25 Aug 2004 21:16:44 -0000 1.7 +++ layout.xml 29 Sep 2004 20:10:42 -0000 1.8 @@ -19,7 +19,9 @@ </head> <body> <div id="menu"> - <img src="modules/layout/img/phpcms.png" width="181" height="60" alt="" title="phpCMS-Logo" /> + <a href="http://phpcms.de/" title="Website des phpCMS-Projekts"> + <img src="modules/layout/img/phpcms.png" width="181" height="60" alt="" title="phpCMS-Logo" /> + </a> <ul id="mainmenu"> <layout:replace name="mainmenu" /> </ul> Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- class.module_layout.php 25 Aug 2004 21:16:44 -0000 1.11 +++ class.module_layout.php 29 Sep 2004 20:10:43 -0000 1.12 @@ -30,6 +30,10 @@ /* * $Log$ +* Revision 1.12 2004/09/29 20:10:43 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.11 2004/08/25 21:16:44 mjahn * step 1 is taken * @@ -156,11 +160,13 @@ $id = ''; if (!isset ($actiondata['_id'])) { $actiondata ['_success'] = false; +// echo '1';print_r ($actiondata); return false; } if (isset ($this->_ids [$actiondata ['_id']])) { $actiondata ['_success'] = false; +// echo '2';print_r ($actiondata); return false; } Index: layout.css =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.css,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- layout.css 25 Aug 2004 21:16:44 -0000 1.5 +++ layout.css 29 Sep 2004 20:10:42 -0000 1.6 @@ -32,6 +32,10 @@ background:#eee; } +#menu img { + margin-left:-10px; +} + #menu p { padding:0.2em; border:1px inset #029544; @@ -90,59 +94,54 @@ height:10em; } - #submenu -{ + #submenu { background:#eee; display:block; -padding: 3px 0; -margin: 0 0 1em 0; -border-bottom: 1px solid #029544; -font: bold Verdana, sans-serif; -position:fixed; -top:0; -left:192px; -width:80%; - + padding: 3px 0; + margin: 0 0 1em 0; + border-bottom: 1px solid #029544; + font: bold Verdana, sans-serif; + position:fixed; + top:0; + left:192px; + width:99%; } -#submenu li -{ -list-style: none; -margin: 0; -display: inline; +#submenu li { + list-style: none; + margin: 0; + display: inline; } -#submenu li a -{ -padding: 3px 0.5em; -margin-left: 3px; -border: 1px solid #029544; -font-weight:bold; -border-bottom: none; -background: #ddd; -text-decoration: none; +#submenu li a { + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #029544; + font-weight:bold; + border-bottom: none; + background: #ddd; + text-decoration: none; } -#submenu li a:link { color: #029544; } -#submenu li a:visited { color: #029544; } - -#submenu li a:hover -{ -color: #029544; -font-weight:bold; -background: #fff; -border-color: #029544; +#submenu li a:link { + color: #029544; } -#submenu li#current a -{ -background: white; -border-bottom: 1px solid white; +#submenu li a:visited { + color: #029544; } +#submenu li a:hover { + color: #029544; + font-weight:bold; + background: #fff; + border-color: #029544; +} - - +#submenu li#current a { + background: white; + border-bottom: 1px solid white; +} #filelist { list-style-type:none; @@ -210,10 +209,6 @@ text-align:right; } -#filelist .icon { - margin-right:0.5em; -} - a img { border:0; } @@ -377,6 +372,7 @@ background:#fff; margin:0.5em 0; border-style:dashed; + padding:0.3em; } label { @@ -385,6 +381,7 @@ clear:both; } +label select, label input { float:right; } @@ -398,3 +395,7 @@ float:none; } +li, +li * { + vertical-align:middle; +} |
From: Martin J. <mj...@us...> - 2004-09-29 20:11:23
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/statistik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/statistik Modified Files: class.module_statistik.php .cvsignore Added Files: config.statistic.xml class.statistic_common.php class.statistic_phpcms.php Log Message: completed phpCMS-config-part began the statistic part --- NEW FILE: class.statistic_common.php --- <?php /** * statistic-module - analysis of phpCMS-logfile * * <b>License</b> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.statistic_common.php,v 1.1 2004/09/29 20:10:43 mjahn Exp $ * @package admin4phpCMS * @subpackage module_statistic **/ /* * $Log: class.statistic_common.php,v $ * Revision 1.1 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part * */ include_once (PATH_TO_PEAR.'Cache.php'); /** * Class for statistic analysis * * Interface for parsing the phpcms-logfile and divide into monthly sections * saved in separated files. * Create the data-arrays and save them as serialized files, they can be used * for presenting the data to the user. * * A basic class creates the interface and implements the analytical part and * the extended classes define the specific parsing function. * * The basic class also takes care of the caching of the parsed data. * * <b>What is interesting?</b> * * <ul> * <li>which IPs, browsers, referrer, files appear how much times?</li> * <li>time-based view of amount of called sites (monthly, weekly, daily, hourly)</li> * <li></li> * </ul> * * This class also renders the tables. For diagramm rendering use another file, * that is called as image-generator. It creates a diagramm according to the parameters * it got. It uses PEAR::Cache for saving server-load. * * @package admin4phpCMS * @subpackage module_statistic * @todo Get the class work completly **/ class statistic_common { /** * flag, if the data is parsed **/ var $parsed = false; var $_parsed = array (); var $_parser_time = array (); function statistic_common () { return $this->__construct (); } function __construct () { return true; } function getCountedFiles ($start, $end) { } } ?> Index: .cvsignore =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/statistik/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 25 Aug 2004 21:21:00 -0000 1.2 +++ .cvsignore 29 Sep 2004 20:10:43 -0000 1.3 @@ -1,3 +1,10 @@ jpgraph* fonts stat.txt +logs* +input* +class.apache.logs.reader.php +class.stat_phpcms.php +class.statistic_apache.php +pie3d_csimex1.php +test.png --- NEW FILE: config.statistic.xml --- <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <config> <source id="apache"> </source> </config> --- NEW FILE: class.statistic_phpcms.php --- <?php /** * statistic-module - analysis of phpCMS-logfile * * <b>License</b> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.statistic_phpcms.php,v 1.1 2004/09/29 20:10:43 mjahn Exp $ * @package admin4phpCMS * @subpackage module_statistic **/ /* * $Log: class.statistic_phpcms.php,v $ * Revision 1.1 2004/09/29 20:10:43 mjahn * completed phpCMS-config-part * began the statistic part * */ /** * include file with parental class **/ include_once (dirname (__FILE__).'/class.statistic_common.php'); define ('LOGDIR', dirname (__FILE__).'/logs/'); /** * Class for statistic analysis * * @package admin4phpCMS * @subpackage module_statistic * @todo Get the class work completly **/ class statistic_phpcms extends statistic_common { /** * set the path to the phpCMS-logdir **/ function load ($path = '/home/martin/devel/admin4phpCMS/modules/statistik/stat.txt') { $this->_logfile = $path; } /** * parse the logfile and sclice it into daily files (to reduce the single filesize) **/ function import () { $fh = fopen ($this->_logfile, 'rb'); if (function_exists ('flock')) { flock ($fh, LOCK_EX); } $date = ''; // get start time // while (!feof ($fh)) { // && $time - $starttime < 10 sec) { $entry = trim (fgets ($fh)); // empty entry -> go if ($entry == '') { continue; } // extract timestamp from entry $time = substr ($entry, 0, strpos ($entry, ';')); $act_date = strftime ('%Y-%m-%d', $time); // check for new date entry if ($act_date != $date) { // close the last statfile, wether it was opened or not @fclose ($temp); // check if the statfile for the actual date exists if (file_exists (LOGDIR.$act_date)) { $temp = fopen (LOGDIR.$act_date.'.log', 'ab'); } else { $temp = fopen (LOGDIR.$act_date.'.log', 'wb'); } } fwrite ($temp, $entry."\n"); } fclose ($temp); if (function_exists ('flock')) { flock ($fh, LOCK_UN); } fclose ($fh); @unlink ($this->_logfile); } /** * parse the splited stat-files **/ function parse ($from_time, $to_time) { $min = strftime ('%Y-%m-%d', $from_time); $max = strftime ('%Y-%m-%d', $to_time); $dh = opendir (LOGDIR); $this->_parsed = array(); while (false !== ($filename = readdir ($dh))) { if (!preg_match ('%\d\d\d\d-\d\d-\d\d\.log%', $filename)) { continue; } $filetime = substr ($filename, 0, 10); if ($filetime < $min || $filetime > $max) { continue; } $this->_parsed [$filetime] = array (); $data = file (LOGDIR.$filename); foreach ($data as $entry) { $entry = explode (';', trim ($entry)); $entry = array ( 'time'=>$entry [0], 'ip'=>$entry [1], 'ref'=>$entry [4], 'ua'=>$entry [5], 'file'=>$entry [6]); $this->_parsed [$filetime] [] = $entry; } } closedir ($dh); $this->parsed = true; } } ?> Index: class.module_statistik.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/statistik/class.module_statistik.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_statistik.php 25 Aug 2004 21:16:44 -0000 1.2 +++ class.module_statistik.php 29 Sep 2004 20:10:43 -0000 1.3 @@ -28,16 +28,23 @@ /* * $Log$ -* Revision 1.2 2004/08/25 21:16:44 mjahn -* step 1 is taken +* Revision 1.3 2004/09/29 20:10:43 mjahn +* completed phpCMS-config-part +* began the statistic part * */ -include_once (PATH_TO_PEAR.'Cache.php'); +include_once (dirname (__FILE__).'/class.statistic_phpcms.php'); + +define ('JPGRAPH', '/home/martin/devel/jpgraph/'); /** * Class for statistic interface * +* You can define several data-sources in this class. They will be displayed +* via a selection to the user and he can choice, which datasource he wants +* to see. +* * @package admin4phpCMS * @subpackage module_statistic * @todo Get the class work completly @@ -63,7 +70,6 @@ * @param array $actiondata $actiondata contains the URI-param-arrays **/ function parseParam (&$actiondata) { -// print_r ($actiondata); $this->display = (isset ($actiondata ['request'] ['moduleid']) && $actiondata ['request'] ['moduleid'] == 'statistik'); $this->action = ''; @@ -74,11 +80,25 @@ $actiondata1 = array (); $this->_callEvent ('USER_GET_STATUS', $actiondata1); $this->_USER = $actiondata1; + $this->_STAT = new statistic_phpcms (); + + if ($this->display) { + $this->_registerAction ('doParseContent', 'getStatContent'); + } return true; } // function parseParam () + + + /** + * process the import process + **/ + function processImport (&$actiondata) { + $this->_STAT->load(); + $this->_STAT->import(); + } /** * Get content for mainmenu @@ -124,15 +144,55 @@ } // function getMenuSub () + + /** + * presentation of the statistic data + **/ + function getStatContent (&$actiondata) { + if (!$this->_USER['isLoggedIn']) { + return true; + } + + if (!$this->display) { + return true; + } + + include_once (JPGRAPH.'jpgraph.php'); + include_once (JPGRAPH.'jpgraph_bar.php'); + + $this->_STAT->parse (mktime(0, 0, 0, strftime ('%m', time ()), 1, strftime ('%Y', time())), time ()); - function parseStatFile () { - // open statfile + $keys = array_keys ($this->_STAT->_parsed); + $num = count ($keys); - // walk through statfile + for ($i = 0; $i < $num; $i++) { + $data [$i] = count ($this->_STAT->_parsed [$keys [$i]]); + } + + // Create the Pie Graph. + $graph = new Graph(600,200,'auto'); + $graph->img->SetImgFormat ('png'); + $graph->SetShadow(); + + // Set A title for the plot + $graph->title->Set("Gesamtübersicht"); + $graph->title->SetFont(FF_FONT1,FS_BOLD); + $graph->SetScale ('textlin'); + //$graph->xaxis->SetTickLabels ($labels); + + // Create + $p1 = new BarPlot($data); + $p1->SetColor ('black'); + $p1->SetFillColor ('orange'); + + $graph->Add($p1); + + $graph->Stroke(dirname (__FILE__).'/test.png'); + + $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'test_diagramm', '_type'=>'image', 'src'=>'/test/modules/statistik/test.png', 'width'=>'600', 'height'=>'200'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - // create stat-arrays - // } } ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:57
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/phpcms Modified Files: class.phpcms_menu.php layout.phpcms.xml class.module_phpcms.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_phpcms.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.module_phpcms.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_phpcms.php 25 Aug 2004 21:16:48 -0000 1.3 +++ class.module_phpcms.php 29 Sep 2004 20:10:45 -0000 1.4 @@ -28,8 +28,9 @@ /* * $Log$ -* Revision 1.3 2004/08/25 21:16:48 mjahn -* step 1 is taken +* Revision 1.4 2004/09/29 20:10:45 mjahn +* completed phpCMS-config-part +* began the statistic part * */ /** @@ -59,12 +60,18 @@ class module_phpcms extends module { /** - * @var array $DEFAULTS contains the information of the default.php-file + * @var array $_DEFAULTS contains the information of the default.php-file * @access private **/ var $_DEFAULTS = array (); /** + * @var array $_config contains the information of the default.php-file + * @access private + **/ + var $_config = array (); + + /** * @var array $_CONF contains the information of the config * @access private **/ @@ -108,7 +115,7 @@ $this->configaction = ''; if (isset ($actiondata['request']['configform-submit'])) { $this->configaction = $actiondata['request']['configform-submit']; - $this->_formdata = $actiondata ['request']; + $this->_formdata = $actiondata ['post']; } $this->projectfile = ''; @@ -130,7 +137,7 @@ $this->_registerAction ('doProcess', 'processTags'); break; default: - $this->_registerAction ('doProcess', 'Process'); + $this->_registerAction ('doProcess', 'process'); } $this->_callEvent ('USER_GET_STATUS', $actiondata1); $this->_USER = $actiondata1; @@ -155,6 +162,78 @@ } // function process () + function processTags () { + $this->_registerAction ('doParseContent', 'getContentTags'); + } + + /** + * + **/ + function processCache (&$actiondata) { + $cachedir = $this->docroot.'/cms/phpcms2412/cache/'; + + if (!file_exists ($cachedir)) { + return false; + } + + if (!is_dir ($cachedir)) { + return false; + } + + $this->_registerAction ('doParseContent', 'getContentCache'); + $this->_CACHE = array(); + + $dh = dir ($cachedir); + while ($file = $dh->read ()) { + + if ($file{0} == '.') { + continue; + } + + // get the URL of the contentfile + $fh = fopen ($cachedir.$file, 'rb'); + $temp = fgets ($fh, 1024); + $temp .= fgets ($fh, 1024); + fclose ($fh); + preg_match('/<!--\sPHPCMS\sFILENAME\s(.*?)\s-->\s*/', $temp, $result); + if(isset($result[1])){ + $url = $result[1]; + } else { + $url = basename($file); + } + + // insert entry + $this->_CACHE [$url] = $file; + } + + if (!uksort ($this->_CACHE, array (&$this, '_sortCacheList'))) { + return false; + } + } + + + + function processMenu (&$actiondata) { + $this->_registerAction ('doParseContent', 'getContentMenu'); + } + + function processConfig (&$actiondata) { + + if ($this->configaction == 'save') { + $this->_parseConfigFormdata (); + } + + + + $this->_registerAction ('doParseContent', 'getContentConfig'); + + // load template from file + $_template = new XML_Tree (dirname (__FILE__).'/config.phpcms.xml'); + $this->_TPL = & $_template->getTreeFromFile (); + // load the values in the default.php + $this->_loadDefault (); + } + /** * Get content for mainmenu * @@ -233,7 +312,6 @@ } ob_start (); - print_r($this->_CONF); $content = ob_get_contents (); ob_end_clean (); @@ -255,74 +333,11 @@ // function getContent () /** - * - **/ - function sortCacheList ($a, $b) { - $dira = strpos ($a, '/') !== false; - $dirb = strpos ($b, '/') !== false; - if ($dira && !$dirb) { - return -1; - } - if (!$dira && $dirb) { - return 1; - } - return strcmp ($a, $b); - - } - // function sortCacheList - - /** - * - **/ - function processCache (&$actiondata) { - $cachedir = $this->docroot.'/cms/phpcms2412/cache/'; - - if (!file_exists ($cachedir)) { - return false; - } - - if (!is_dir ($cachedir)) { - return false; - } - - $this->_registerAction ('doParseContent', 'getCacheContent'); - $this->_CACHE = array(); - - $dh = dir ($cachedir); - while ($file = $dh->read ()) { - - if ($file{0} == '.') { - continue; - } - - // get the URL of the contentfile - $fh = fopen ($cachedir.$file, 'rb'); - $temp = fgets ($fh, 1024); - $temp .= fgets ($fh, 1024); - fclose ($fh); - preg_match('/<!--\sPHPCMS\sFILENAME\s(.*?)\s-->\s*/', $temp, $result); - if(isset($result[1])){ - $url = $result[1]; - } else { - $url = basename($file); - } - - // insert entry - $this->_CACHE [$url] = $file; - } - - if (!uksort ($this->_CACHE, array (&$this, 'sortCacheList'))) { - return false; - } - } - - - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getCacheContent (&$actiondata) { + function getContentCache (&$actiondata) { // check if user-status if (!$this->_USER['isLoggedIn']) { @@ -394,25 +409,12 @@ } // foreach } - function processConfig (&$actiondata) { - if ($this->configaction == 'save') { - $this->checkConfigForm (); - } - $this->_registerAction ('doParseContent', 'getConfigContent'); - - // load template from file - $_template = new XML_Tree (dirname (__FILE__).'/config.phpcms.xml'); - $this->_TPL = & $_template->getTreeFromFile (); - // load the values in the default.php - $this->_loadDefault (); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getConfigContent (&$actiondata) { + function getContentConfig (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; @@ -445,7 +447,6 @@ $actiondata1 = array ('_root'=>'configform', '_id'=>'tabbox', '_type'=>'block', 'extra'=>'class="tabbox"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - //print_r ($this->_DEFAULTS); $tabs = array ('common'=>'Allgemein', 'pax'=>'PAX & Mail2Crypt', 'cache'=>'Caching', 'server'=>'Servereinstellungen', 'stat'=>'Statistik', 'other'=>'Sonstiges'); foreach ($tabs as $id=>$label) { @@ -467,7 +468,7 @@ $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - $actiondata1 = $this->_DEFAULTS; + $actiondata1 = $this->_config; $actiondata1 ['_root'] = 'tabbox-'.$id; $actiondata1 ['_id'] = 'config-'.$id; $actiondata1 ['_type'] = 'pc_config_'.$id; @@ -481,17 +482,12 @@ return true; } // function getConfigContent () - - function processMenu (&$actiondata) { - $this->_registerAction ('doParseContent', 'getMenuContent'); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getMenuContent (&$actiondata) { + function getContentMenu (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -503,12 +499,10 @@ include_once (dirname (__FILE__).'/class.phpcms_menu.php'); $this->_MENU =& new phpcms_menu (); $this->_MENU->load (); - print_r($this->_CONF); - $projectdir = - $content = 'Durch Auswahl einer Projectdatei ist es m�glich, die Men�datei, das Seitentemplate und die Tagdatei zu bearbeiten. '. - 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung f�r eine Projectdatei vorgibt. '. - 'Damit w�re es m�glich alle Men�dateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. '; + $content = '<p>Durch Auswahl einer Projectdatei ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '. + 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '. + 'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. </p>'; $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'user1content', '_type'=>'paragraph', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); @@ -516,16 +510,12 @@ } // function getMenuContent () - function processTags () { - $this->_registerAction ('doParseContent', 'getTagsContent'); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getTagsContent (&$actiondata) { + function getContentTags (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -572,42 +562,30 @@ $actiondata1 = array ('_root'=>'form_tags', '_id'=>'tags_status_'.$id, '_type'=>'paragraph', 'content'=>$id.' = '.$value); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } - } - - - - return true; } // function getTagsContent () - function checkConfigForm () { + function _parseConfigFormdata () { + + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + $this->_loadDefault (); + } + $o = ''; foreach ($this->_formdata as $id=>$value) { if (substr ($id, 0, 7) != 'config-') { continue; } - //echo '<p>'.$id.' = '.$value.'</p>'; - } - } - // function checkConfigForm () - - function _getDefaultValue (&$actiondata) { - if (is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { - $this->_loadDefault (); - } - - if (!isset ($actiondata ['id'])) { - return false; - } - - if (isset ($this->_DEFAULTS [$actiondata ['id']])) { - $actiondata ['value'] = $this->_DEFAULTS [$actiondata ['id']]; - return true; + + $id = strstr ($id, '-'); + $id{0} = ' '; + $id = trim ($id); + $this->_DEFAULTS [$id] ['value'] = $this->_formdata ['config-'.$id]; } - return false; - + $this->_saveDefault ($actiondata1); } + // function _parseConfigFormdata () function _loadDefault () { $_datafile = $this->docroot.$this->_CONF ['configfile']; @@ -620,7 +598,7 @@ } function _parseDefault ($data = '') { - if (!preg_match_all ('/\$this->(\S*)\s*=\s*([^;]*)/im', $data, $erg)) { + if (!preg_match_all ('/\$this->(\S*)\s*=\s*(.*);\s*$/im', $data, $erg)) { return false; } @@ -628,33 +606,91 @@ for ($i = 0; $i < $num; $i++) { switch (strtoupper ($erg [2] [$i])) { case '\'OFF\'': - $this->_DEFAULTS [$erg [1] [$i]] = (int) 0; - $this->_DEFAULTS [$erg [1] [$i].'_ON'] = ''; - $this->_DEFAULTS [$erg [1] [$i].'_OFF'] = ' checked="checked"'; + $this->_config [$erg [1] [$i]] = (int) 0; + $this->_config [$erg [1] [$i].'_ON'] = ''; + $this->_config [$erg [1] [$i].'_OFF'] = ' checked="checked"'; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'onoff', 'value'=> 0); break; case '\'ON\'': - $this->_DEFAULTS [$erg [1] [$i]] = (int) 1; - $this->_DEFAULTS [$erg [1] [$i].'_OFF'] = ''; - $this->_DEFAULTS [$erg [1] [$i].'_ON'] = ' checked="checked"'; + $this->_config [$erg [1] [$i]] = (int) 1; + $this->_config [$erg [1] [$i].'_OFF'] = ''; + $this->_config [$erg [1] [$i].'_ON'] = ' checked="checked"'; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'onoff', 'value'=> 0); break; default: if (substr ($erg [2] [$i], 0, 1) == '\'' && substr ($erg [2] [$i], -1) == '\'') { - $this->_DEFAULTS [$erg [1] [$i]] = (string) substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2); - } else { - $this->_DEFAULTS [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_config [$erg [1] [$i]] = (string) substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2); + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'string', 'value'=> substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2)); + break; } + + if (substr (trim ($erg [2] [$i]), 0, 1) == '$') { + $this->_config [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'func', 'value'=> $erg [2] [$i]); + break; + } + + $this->_config [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'string', 'value'=> $erg [2] [$i]); } - } return true; } function _saveDefault (&$actiondata) { + + $search = array (); + $replace = array (); + foreach ($this->_DEFAULTS as $id=>$entry) { + switch ($entry ['type']) { + case 'string': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1\''.$entry ['value'].'\'$3'; + break; + case 'num': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1'.$entry ['value'].'$3'; + break; + case 'func': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1'.$entry ['value'].'$3'; + break; + } + } + + $_datafile = $this->docroot.$this->_CONF ['configfile']; + if (function_exists ('file_get_contents')) { + $_data = file_get_contents ($_datafile); + } else { + $_data = join ('', file ($_datafile)); + } + $_data = preg_replace ($search, $replace, $_data); + + $fh = fopen ($_datafile, 'wb'); + fwrite ($fh, $_data); + fclose ($fh); } + + function _getDefaultValue (&$actiondata) { + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + $this->_loadDefault (); + } + + if (!isset ($actiondata ['id'])) { + return false; + } + + if (isset ($this->_DEFAULTS [$actiondata ['id']])) { + $actiondata ['value'] = $this->_DEFAULTS [$actiondata ['id']] ['value']; + return true; + } + return false; + + } function _setDefaultValue (&$actiondata) { - if (is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { $this->_loadDefault (); } @@ -666,7 +702,7 @@ return false; } - $this->_DEFAULTS [$this->_DEFAULTS [$actiondata ['id']]] = $actiondata ['value']; + $this->_DEFAULTS [$this->_DEFAULTS [$actiondata ['id']]] ['value'] = $actiondata ['value']; return true; } @@ -674,6 +710,11 @@ // dfdsfas } + /** + * parse a projectfile of phpCMS + * + * @param array $data the data of the projectfile (like from a call of file) + **/ function _parseProjectFile ($data) { $_ret = array (); foreach ($data as $line) { @@ -687,5 +728,21 @@ } return $_ret; } + + /** + * Callback function for sorting the array with the cache-entries + **/ + function _sortCacheList ($a, $b) { + $dira = strpos ($a, '/') !== false; + $dirb = strpos ($b, '/') !== false; + if ($dira && !$dirb) { + return -1; + } + if (!$dira && $dirb) { + return 1; + } + return strcmp ($a, $b); + } + // function sortCacheList } ?> \ No newline at end of file Index: class.phpcms_menu.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.phpcms_menu.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.phpcms_menu.php 24 Jul 2004 08:58:25 -0000 1.1 +++ class.phpcms_menu.php 29 Sep 2004 20:10:45 -0000 1.2 @@ -27,8 +27,9 @@ **/ /* * $Log$ -* Revision 1.1 2004/07/24 08:58:25 mjahn -* changed some things +* Revision 1.2 2004/09/29 20:10:45 mjahn +* completed phpCMS-config-part +* began the statistic part * */ /** @@ -57,40 +58,40 @@ return false; } $parentclass = substr($class, 0, strrpos ($class, '.')); - if ($parentclass == $this->root) { - $menu =& $this->menu; - } else { - $menu =& $this->quicklink[$parentclass]['_sub_']; - } - for ($i = 0; $i < count ($menu); $i++) { - if ($menu[$i]['CLASS'] != $class) { - continue; - } - break; - } + if ($parentclass == $this->root) { + $menu =& $this->menu; + } else { + $menu =& $this->quicklink[$parentclass]['_sub_']; + } + for ($i = 0; $i < count ($menu); $i++) { + if ($menu[$i]['CLASS'] != $class) { + continue; + } + break; + } - if (isset($this->quicklink[$menuEntry['CLASS']])) { - for ($j = 0; isset($this->quicklink[$menuEntry['CLASS'].$j]); $j++); - $menuEntry['CLASS'] = $menuEntry['CLASS'].$j; - } - if ($after) { - $i = ($i == count($menu)) ? count($menu) : $i + 2; - array_splice($menu, $i, 0, array($menuEntry)); - } else { - $i = ($i == 0) ? 0 : $i; - array_splice($menu, $i, 0, array($menuEntry)); - } - $this->quicklink[$menuEntry['CLASS']] = $menu[$i]; - + if (isset($this->quicklink[$menuEntry['CLASS']])) { + for ($j = 0; isset($this->quicklink[$menuEntry['CLASS'].$j]); $j++); + $menuEntry['CLASS'] = $menuEntry['CLASS'].$j; + } + if ($after) { + $i = ($i == count($menu)) ? count($menu) : $i + 2; + array_splice($menu, $i, 0, array($menuEntry)); + } else { + $i = ($i == 0) ? 0 : $i; + array_splice($menu, $i, 0, array($menuEntry)); + } + $this->quicklink[$menuEntry['CLASS']] = $menu[$i]; + } function delete ($class) { - if (isset($this->quicklink[$class])) { - return false; - } - $parentclass = substr($class, 0, strrpos ($class, '.')); - $menu =& $this->quicklink[$parentclass]; - for ($i = 0; $i < count ($menu); $i++) { + if (isset($this->quicklink[$class])) { + return false; + } + $parentclass = substr($class, 0, strrpos ($class, '.')); + $menu =& $this->quicklink[$parentclass]; + for ($i = 0; $i < count ($menu); $i++) { if ($menu[$i]['CLASS'] != $class) { continue; } @@ -121,7 +122,7 @@ case 'xml': $o = $this->__saveAsXML(); break; - default; + default:; } $fh = fopen ($tofile, 'wb'); fwrite ($fh, $o); @@ -141,103 +142,103 @@ } function __parse () { - // check if the menufile exists - if (!file_exists($this->menufile) || !is_file($this->menufile)) { - return false; - } + // check if the menufile exists + if (!file_exists($this->menufile) || !is_file($this->menufile)) { + return false; + } - // get content from menufile + // get content from menufile $data = file ($this->menufile); + // initialize some variables - $this->menu = array(); + $this->menu = array(); $new = false; $menufields = array(); $menucounter = -1; $entrycounter = 0; - // walk through the lines of the menufile - for ($i = 0; $i < count($data); $i++) { - - // remove trailing and leading whitespace - $line = trim($data[$i]); + // walk through the lines of the menufile + for ($i = 0; $i < count($data); $i++) { + // remove trailing and leading whitespace + $line = trim($data[$i]); + // check for empty line - if (trim($line) == '') { + if (trim($line) == '') { continue; } - - // check for comment-line + + // check for comment-line if ($line[0] == ';') { - countinue; + continue; } - + // check for menu-definition if (substr($line, 0, 5) == 'MENU:') { - - if (substr($line, -1) == ';') { - $line = trim(substr($line, 0, strrpos($line, ';'))); - } - - $menulevel = trim (substr($line, 5)); - - // increase the counter for the menublocks - $menucounter++; - - // initialize the new element in the menuarray - $this->menu[$menucounter] = array(); - $entrycounter = 0; - - // save actual menuposition in pointer - $actual =& $this->menu[$menucounter]; - + + if (substr($line, -1) == ';') { + $line = trim(substr($line, 0, strrpos($line, ';'))); + } + $menulevel = trim (substr($line, 5)); + + // increase the counter for the menublocks + $menucounter++; + + // initialize the new element in the menuarray + $this->menu[$menucounter] = array(); + $entrycounter = 0; + + // save actual menuposition in pointer + $actual =& $this->menu[$menucounter]; + continue; } - + // check for field-definition line if (substr($line, 0, 6) == 'CLASS;') { if (substr($line, -1) == ';') { $line = trim(substr($line, 0, strrpos($line, ';'))); } + // get field definitions - $menufielddata = explode(';',$line); - - // initialize some variables + $menufielddata = explode(';',$line); + + // initialize some variables $k = 0; $menufields = array(); - - // walk throught the array of field definitions + + // walk throught the array of field definitions for ($j = 0; $j < count($menufielddata); $j++) { $l = trim($menufielddata[$j]); - - // save name of field definition + + // save name of field definition $menufields[$k++] = $l; } continue; } - + // now we have a menu entry, explode into field elements $entry = explode(';', $line); for ($j = 0; $j < count($menufields); $j++) { + // put data of menu-entry into menu-structure - $actual[$entrycounter][$menufields[$j]] = trim($entry[$j]); + $actual[$entrycounter][$menufields[$j]] = trim($entry[$j]); } - $actual[$entrycounter]['_level_'] = $menulevel; - - // increase menucounter - $entrycounter++; + $actual[$entrycounter]['_level_'] = $menulevel; + + // increase menucounter + $entrycounter++; $this->menuclasses[$menucounter] = substr($actual[0]['CLASS'], 0, strrpos($actual[0]['CLASS'], '.')); } // sort the array with the menu-classes - $temp = $this->menuclasses; + $temp = $this->menuclasses; sort ($temp); $this->root = $temp[0]; - echo '<!--'; - print_r($this->menu); - echo '-->'; - // complete building of menu-structure - $this->menu = $this->__recurseMenu($this->root); + + // complete building of menu-structure + $this->menu = $this->__recurseMenu($this->root); } /** @@ -247,7 +248,7 @@ if (!in_array ($menuclass, $this->menuclasses)) { return false; } - $rootmenu = $this->__getKeyByValue ($this->menuclasses, $menuclass); + $rootmenu = $this->__getKeyByValue ($this->menuclasses, $menuclass); $menu = array(); $actual = 0; @@ -272,32 +273,32 @@ } function __saveAsPhpCMS () { - $i = 0; - $o = ''; - $menu = array($this->menu); - while (isset($menu[$i])) { - $o .= 'MENU:'.$menu[$i][0]['_level_']."\n"; - $menuline = $menu[$i][0]; - unset ($menuline['_level_']); - if (isset($menuline['_sub_'])) { - unset ($menuline['_sub_']); - } - $o .= join(';', array_keys($menuline))."\n"; - for ($j = 0; $j < count ($menu[$i]); $j++) { - $menuEntry = $menu[$i][$j]; - if (isset($menuEntry['_sub_'])) { - unset($menuEntry['_sub_']); - $menu[] = $menu[$i][$j]['_sub_']; - } - if (isset($menuEntry['_level_'])) { - unset($menuEntry['_level_']); - } - $o .= join (";\t", $menuEntry)."\n"; - } - $o .= "\n"; - $i++; - } - return $o; - } + $i = 0; + $o = ''; + $menu = array($this->menu); + while (isset($menu[$i])) { + $o .= 'MENU:'.$menu[$i][0]['_level_']."\n"; + $menuline = $menu[$i][0]; + unset ($menuline['_level_']); + if (isset($menuline['_sub_'])) { + unset ($menuline['_sub_']); + } + $o .= join(';', array_keys($menuline))."\n"; + for ($j = 0; $j < count ($menu[$i]); $j++) { + $menuEntry = $menu[$i][$j]; + if (isset($menuEntry['_sub_'])) { + unset($menuEntry['_sub_']); + $menu[] = $menu[$i][$j]['_sub_']; + } + if (isset($menuEntry['_level_'])) { + unset($menuEntry['_level_']); + } + $o .= join (";\t", $menuEntry)."\n"; + } + $o .= "\n"; + $i++; + } + return $o; + } } ?> \ No newline at end of file Index: layout.phpcms.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/layout.phpcms.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.phpcms.xml 25 Aug 2004 21:16:48 -0000 1.1 +++ layout.phpcms.xml 29 Sep 2004 20:10:45 -0000 1.2 @@ -11,16 +11,8 @@ <label><input type="text" name="config-GLOBAL_PROJECT_FILE" value="<layout:replace name="GLOBAL_PROJECT_FILE" />" />Standard Projektdatei </label> </fieldset> <fieldset> - <legend>Erkennung des Document-Root</legend> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="PAX_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="PAX_OFF" /> /> Manuell eingeben</label> - <label><input type="text" name="config-DOCUMENT_ROOT" value="<layout:replace name="DOCUMENT_ROOT" />" />Document_Root </label> - </fieldset> - <fieldset> - <legend>Erkennung des Domainnamens</legend> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN" value="1"<layout:replace name="AUTO_DOMAIN_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN" value="0"<layout:replace name="AUTO_DOMAIN_OFF" /> /> Manuell eingeben</label> - <label><input type="text" name="config-DOMAIN_NAME" value="<layout:replace name="DOMAIN_NAME" />" />Document_Root </label> + <legend>Sonstiges</legend> + <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> </fieldset> ]]> </layout:insert> @@ -79,12 +71,16 @@ </fieldset> <fieldset> <legend title="Klau dem Apachen sein Gemachen ;)">Stealth-Mode</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="1"<layout:replace name="STEALTH_MODE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="0"<layout:replace name="STEALTH_MODE_OFF" /> /> Aus</label> + <label class="horizontal"><input type="radio" name="config-STEALTH" value="1"<layout:replace name="STEALTH_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STEALTH" value="0"<layout:replace name="STEALTH_OFF" /> /> Aus</label> <div id="pc_config_server_1"> - <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> - <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> + <label><input type="text" name="config-NOLINKCHANGE" value="<layout:replace name="NOLINKCHANGE" />" />Links mit folgenden Endungen nicht behandeln</label> </div> + <fieldset id="secure-stealth-mode"> + <legend>Secure Stealth Mode</legend> + <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="1"<layout:replace name="STEALTH_SECURE_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="0"<layout:replace name="STEALTH_SECURE_OFF" /> /> Aus</label> + </fieldset> </fieldset> <fieldset> <legend title="Fehlerbehandlung">Debug-Modus</legend> @@ -103,8 +99,8 @@ <![CDATA[ <fieldset> <legend>Allgemeine Statistik</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="1"<layout:replace name="STEALTH_MODE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="0"<layout:replace name="STEALTH_MODE_OFF" /> /> Aus</label> + <label class="horizontal"><input type="radio" name="config-STATS" value="1"<layout:replace name="STATS_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STATS" value="0"<layout:replace name="STATS_OFF" /> /> Aus</label> <div id="pc_config_stat_1"> <label><input type="text" name="config-STATS_DIR" value="<layout:replace name="STATS_DIR" />" />Verzeichnis der Statistik </label> <label><input type="text" name="config-STATS_CURRENT" value="<layout:replace name="STATS_CURRENT" />" />aktuelles Verzeichnis der Statistik </label> @@ -133,9 +129,28 @@ <label><input type="text" name="config-TAG_DELIMITER" value="<layout:replace name="TAG_DELIMITER" />" />Tag-Trennzeichen </label> </fieldset> <fieldset> - <legend>Sonstiges</legend> - <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> - <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> + <legend>Erkennung von $DOCUMENT_ROOT</legend> + <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="AUTO_DOCUMENT_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="AUTO_DOCUMENT_ROOT_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-DOCUMENT_ROOT" value="<layout:replace name="DOCUMENT_ROOT" />" />Document_Root </label> + </fieldset> + <fieldset> + <legend>Erkennung von $DOMAIN_NAME</legend> + <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="1"<layout:replace name="AUTO_DOMAIN_NAME_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="0"<layout:replace name="AUTO_DOMAIN_NAME_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-DOMAIN_NAME" value="<layout:replace name="DOMAIN_NAME" />" />Domainname </label> + </fieldset> + <fieldset> + <legend>Erkennung von $SCRIPT_PATH</legend> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="1"<layout:replace name="AUTO_SCRIPT_PATH_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="0"<layout:replace name="AUTO_SCRIPT_PATH_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-SCRIPT_PATH" value="<layout:replace name="SCRIPT_PATH" />" />Document_Root </label> + </fieldset> + <fieldset> + <legend>Erkennung von $SCRIPT_NAME</legend> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="1"<layout:replace name="AUTO_SCRIPT_NAME_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="0"<layout:replace name="AUTO_SCRIPT_NAME_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-SCRIPT_NAME" value="<layout:replace name="SCRIPT_NAME" />" />Document_Root </label> </fieldset> ]]> </layout:insert> |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:57
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/filemanager Modified Files: class.module_filemanager.php class.file_util.php layout.filemanager.xml Log Message: completed phpCMS-config-part began the statistic part Index: layout.filemanager.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/layout.filemanager.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.filemanager.xml 25 Aug 2004 21:21:01 -0000 1.1 +++ layout.filemanager.xml 29 Sep 2004 20:10:46 -0000 1.2 @@ -14,9 +14,9 @@ <ul id="filelist"> <li class="header"> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="icon" /> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="icon" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: UID\nGruppe: GID">Rechte</span> <span class="filesize" title="Dateigröße">Größe</span> <span class="filemtime" title="Last modified">Letzte Änderung</span> @@ -31,11 +31,11 @@ <layout:insert name="fm_dir"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" /> + <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" class="input" /> <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="filename" default="" />&action=viewdir" title="Verzeichnis öffnen" > - <img src="modules/layout/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="open" class="icon" /> + <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="open" class="input" /> </a> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"> <layout:replace name="chmod" default="0000" /></span> <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="" /></span> @@ -50,9 +50,9 @@ <layout:insert name="fm_dir_inactive"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <img src="modules/layout/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="" class="icon" /> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"> <layout:replace name="chmod" default="0000" /></span> <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="" /></span> @@ -65,12 +65,12 @@ <layout:insert name="fm_file"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" /> - <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > - <img src="modules/layout/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="icon" /> + <input type="checkbox" name="select[<layout:replace name="filename" default="" />]" value="selected" id="select[<layout:replace name="filename" default="" />]" class="input" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > + <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> </a> - <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=editfile" title="Datei editieren" > - <img src="modules/layout/img/edit.gif" width="16" height="16" title="" alt="edit" class="icon" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=editfile" title="Datei editieren" > + <img src="modules/filemanager/img/edit.gif" width="16" height="16" title="" alt="edit" class="input" /> </a> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"><layout:replace name="chmod" default="0000" /></span> <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> @@ -84,11 +84,11 @@ <layout:insert name="fm_file_inactive"> <![CDATA[ <li <layout:replace name="extra" default="" />> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> - <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > - <img src="modules/layout/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="icon" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <a href="?moduleid=editor&basedir=<layout:replace name="basedir" default="/" />&file=<layout:replace name="basedir" default="/" /><layout:replace name="filename" default="" />&action=viewfile" title="Datei anzeigen" > + <img src="modules/filemanager/img/filetypes/<layout:replace name="filetype" default="" />" width="16" height="16" title="" alt="view" class="input" /> </a> - <img src="modules/layout/img/edit_inactive.gif" width="16" height="16" title="" alt="" class="icon" /> + <img src="modules/filemanager/img/edit_inactive.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod" title="Besitzer: <layout:replace name="uid" default="" /> <> Gruppe: <layout:replace name="gid" default="" />"><layout:replace name="chmod" default="0000" /></span> <span class="filesize" title="Dateigröße"><layout:replace name="filesize" default="1 kB" /></span> <span class="filemtime" title="Last modified"><layout:replace name="filemtime" default="00.00.0000 00:00:00" /></span> @@ -101,9 +101,9 @@ <layout:insert name="fm_sum"> <![CDATA[ <li class="footer"> - <img src="modules/layout/img/arrow.gif" width="16" height="16" title="" alt="" class="input" /> - <input type="image" name="fm-delete-selection" src="modules/layout/img/delete.gif" alt="del" title="Lösche ausgwählte Einträge" /> - <img src="modules/layout/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> + <img src="modules/filemanager/img/arrow.gif" width="16" height="16" title="" alt="" class="input" /> + <input type="image" name="fm-delete-selection" src="modules/filemanager/img/delete.gif" alt="del" title="Lösche ausgwählte Einträge" /> + <img src="modules/filemanager/img/empty.gif" width="16" height="16" title="" alt="" class="input" /> <span class="chmod"> </span> <span class="filesize" title=""><layout:replace name="sumsize" default="1 kB" /></span> <span class="filemtime"> </span> Index: class.module_filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.module_filemanager.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- class.module_filemanager.php 25 Aug 2004 21:21:01 -0000 1.7 +++ class.module_filemanager.php 29 Sep 2004 20:10:46 -0000 1.8 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.8 2004/09/29 20:10:46 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.7 2004/08/25 21:21:01 mjahn * step 1 is taken * @@ -69,11 +73,14 @@ function init () { // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); - $this->_registerAction ('doProcess', 'process'); + $this->_registerAction ('doParseMenuMain', 'getMenuMain'); + $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); + $actiondata1 = array ('module'=>'filemanager'); $this->_callEvent ('CONFIG_GET', $actiondata1); $this->CONF =& $actiondata1 ['config']; + include_once (dirname (__FILE__).'/config.filemanager.php'); } @@ -85,6 +92,10 @@ $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.filemanager.xml'); $this->_callEvent ('LAYOUT_ADD_TEMPLATE', $actiondata1); + $actiondata1 = array(); + $this->_callEvent ('USER_GET_STATUS', $actiondata1); + $this->_USER = $actiondata1; + $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'filemanager'); $this->viewdir = $this->viewfile = $this->editfile = $this->action = ''; @@ -108,56 +119,51 @@ if ($this->action == 'editfile' && isset ($actiondata['request']['file'])) { $this->editfile = $actiondata['request']['file']; } + + if ($this->display && $this->_USER ['isLoggedIn']) { + $this->_registerAction ('doProcess', 'processFiletree'); + } - if (is_dir ($this->docroot.'/'.$this->basedir.'/'.$this->viewdir)) { - $this->basedir = realpath ($this->docroot.'/'.$this->basedir.'/'.$this->viewdir).'/'; - if (strpos ($this->basedir, $this->docroot) === false) { - $this->basedir = '/'; - $actiondata1 = array ('errortext'=>'Das Verzeichnis liegt außerhalb des zugelassenen Bereiches!'); - $this->_callEvent ('ERROR_NOTICE', $actiondata1); - } else { - $this->basedir = str_replace ($this->docroot, '', $this->basedir); - } - $this->viewdir = ''; - } } - /** - * @param array $actiondata - **/ - function process (&$actiondata) { - $actiondata1 = array(); - $this->_callEvent ('USER_GET_STATUS', $actiondata1); - $this->_USER = $actiondata1; + function processFiletree (&$actiondata) { - if (!$this->_USER['isLoggedIn']) { + if (!$this->display) { return true; } - $this->_registerAction ('doParseMenuMain', 'getMenuMain'); - - if (!$this->display) { + $this->_registerAction ('doParseContent', 'getContentFiletree'); + + if (!$this->_USER['isLoggedIn']) { return true; } - - $this->_registerAction ('doParseStatusbar', 'getContentBar'); - $this->_registerAction ('doParseMenuSub', 'getMenuSub'); - switch ($this->action) { - case 'viewfile': - case 'editfile': - break; - default: - $this->_registerAction ('doParseContent', 'getFileList'); - break; + if (is_dir ($this->docroot.'/'.$this->basedir.'/'.$this->viewdir)) { + $this->basedir = realpath ($this->docroot.'/'.$this->basedir.'/'.$this->viewdir).'/'; + if (strpos ($this->basedir, $this->docroot) === false) { + $this->basedir = '/'; + $actiondata1 = array ('errortext'=>'Das angeforderte Verzeichnis liegt außerhalb des zugelassenen Bereiches!'); + $this->_callEvent ('ERROR_NOTICE', $actiondata1); + } else { + $this->basedir = str_replace ($this->docroot, '', $this->basedir); + } + $this->viewdir = ''; + } else { + $this->basedir = '/'; + $actiondata1 = array ('errortext'=>'Das angeforderte Verzeichnis existiert nicht!'); + $this->_callEvent ('ERROR_NOTICE', $actiondata1); } - + } - + /** * @param array $actiondata **/ function getMenuMain (&$actiondata) { + if (!$this->_USER['isLoggedIn']) { + return true; + } + $root = $actiondata['_root']; $actiondata1 = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu'); if ($this->display) { @@ -167,62 +173,37 @@ } /** - * @param array $actiondata - **/ - function getMenuSub (&$actiondata) { - return true; - - $root = $actiondata['_root']; - - $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'files'); - if ($this->action == '') { - $actiondata1['id'] = 'current'; - } - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - - $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Hochladen', 'module'=>'filemanager', '_id'=>'uploads', 'action'=>'upload'); - if ($this->action == 'upload') { - $actiondata1['id'] = 'current'; - } - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - - $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Backups', 'module'=>'filemanager', '_id'=>'backups', 'action'=>'backup'); - if ($this->action == 'backup') { - $actiondata1['id'] = 'current'; - } - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - - $actiondata1 = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Editor', 'module'=>'filemanager', '_id'=>'editor', 'action'=>'editor'); - if ($this->action == 'editor') { - $actiondata1['id'] = 'current'; - } - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - + * Generates the output for the fileviewer + * + * @param array $actiondata + **/ + function getContentViewer (&$actiondata) { + $actiondata1 = array (); + $this->_callEvent ('EDITOR_VIEW_FILE', $actiondata1); } - + /** - * @param array $actiondata - **/ - function getContentBar (&$actiondata) { + * Generates the ouput for the editor + * + * @param array $actiondata + **/ + function getContentEditor (&$actiondata) { + $actiondata1 = array (); + $this->_callEvent ('EDITOR_EDIT_FILE', $actiondata1); } - + /** * Generates the list of folders and files in the current directory. * - * * @param array $actiondata * @todo The buttons in the beginning of the line (select, edit, view) are sub-elements * of filelist_entry. This enables the function to provide different buttons dependent * to the file-entry. **/ - function getFileList (&$actiondata) { + function getContentFiletree (&$actiondata) { $root = $actiondata ['_root']; $dir = $this->docroot.'/'.$this->basedir; - if (!file_exists ($dir) || !is_dir ($dir)) { - return false; - } - $files = $dirs = array(); $dh = opendir ($dir); while (false !== ($entry = readdir ($dh))) { Index: class.file_util.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.file_util.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.file_util.php 25 Aug 2004 21:16:48 -0000 1.3 +++ class.file_util.php 29 Sep 2004 20:10:46 -0000 1.4 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.4 2004/09/29 20:10:46 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.3 2004/08/25 21:16:48 mjahn * step 1 is taken * @@ -63,36 +67,46 @@ else // UNKNOWN $sP = 'u'; */ - // owner - $sP .= (($in_Perms & 0x0100) ? 'r' : '−') . - (($in_Perms & 0x0080) ? 'w' : '−') . - (($in_Perms & 0x0040) ? (($in_Perms & 0x0800) ? 's' : 'x' ) : - (($in_Perms & 0x0800) ? 'S' : '−')); - - // group - $sP .= (($in_Perms & 0x0020) ? 'r' : '−') . - (($in_Perms & 0x0010) ? 'w' : '−') . + // owner + $sP .= (($in_Perms & 0x0100) ? 'r' : '-').(($in_Perms & 0x0080) ? 'w' : '-'). + (($in_Perms & 0x0040) ? (($in_Perms & 0x0800) ? 's' : 'x' ):(($in_Perms & 0x0800) ? 'S' : '-')); + // group + $sP .= (($in_Perms & 0x0020) ? 'r' : '-') . + (($in_Perms & 0x0010) ? 'w' : '-') . (($in_Perms & 0x0008) ? (($in_Perms & 0x0400) ? 's' : 'x' ) : - (($in_Perms & 0x0400) ? 'S' : '−')); - + (($in_Perms & 0x0400) ? 'S' : '-')); // world - $sP .= '<em>'; - $sP .= (($in_Perms & 0x0004) ? 'r' : '−') . - (($in_Perms & 0x0002) ? 'w' : '−') . + $sP .= (($in_Perms & 0x0004) ? 'r' : '-') . + (($in_Perms & 0x0002) ? 'w' : '-') . (($in_Perms & 0x0001) ? (($in_Perms & 0x0200) ? 't' : 'x' ) : - (($in_Perms & 0x0200) ? 'T' : '−')); - $sP .= '</em>'; + (($in_Perms & 0x0200) ? 'T' : '-')); return $sP; } function fileperms($filepath, $rwx = false) { $decperms = fileperms($filepath); + + list (,,,,$fileuid,$filegid,,,,,,,) = stat ($filepath); $octalperms = sprintf("%o",$decperms); if ($rwx) { - return file_util::chmodstr ($decperms); + $ret = file_util::chmodstr ($decperms); + if ($fileuid == posix_getuid ()) { + return '<em>'.substr ($ret, 0, 3).'</em>'.substr ($ret, 3, 6); + } + if ($filegid == posix_getgid ()) { + return substr ($ret, 0, 3).'<em>'.substr ($ret, 3, 6).'</em>'.substr ($ret, 6, 3); + } + return substr ($ret, 0, 6).'<em>'.substr ($ret, 6, 3).'</em>'; + } else { + $ret = substr($octalperms,-4); + if ($fileuid == posix_getuid ()) { + return '<em>'.substr ($ret, 0, 1).'</em>'.substr ($ret, 1, 2); + } + if ($filegid == posix_getgid ()) { + return substr ($ret, 0, 1).'<em>'.substr ($ret, 1, 1).'</em>'.substr ($ret, 2, 1); + } + return substr ($ret, 0, 2).'<em>'.substr ($ret, 2, 1).'</em>'; } - // -4 value should include ugo and strange bits for files and folders - return substr($octalperms,-4); } function checkpath ($ref, $check) { |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:56
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/config Modified Files: config.xml Log Message: completed phpCMS-config-part began the statistic part Index: config.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/config.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- config.xml 25 Aug 2004 21:16:46 -0000 1.6 +++ config.xml 29 Sep 2004 20:10:46 -0000 1.7 @@ -27,10 +27,12 @@ <config name="editor_phpcms_menu" value="mnu" /> </module> <module id="phpcms" name="phpcms" include="class.module_phpcms.php" class="module_phpcms"> - <config name="configfile" value="/cms/phpcms2412/include/default.php" /> + <config name="configfile" value="/cms/parser/include/default.php" /> <config name="projectdir" value="/cms/templates/" /> <config name="projectfileext" value="ini" /> </module> +<!-- <module id="statistik" name="statistik" include="class.module_statistik.php" class="module_statistik" /> +--> <module id="hilfe" name="help" include="class.module_hilfe.php" class="module_hilfe" /> </framework> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:56
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/debug Modified Files: class.module_debug.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_debug.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug/class.module_debug.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_debug.php 25 Aug 2004 21:16:49 -0000 1.3 +++ class.module_debug.php 29 Sep 2004 20:10:45 -0000 1.4 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.4 2004/09/29 20:10:45 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.3 2004/08/25 21:16:49 mjahn * step 1 is taken * @@ -102,6 +106,7 @@ $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); } } + } function getUserData (&$actiondata) { |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:54
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/editor Modified Files: layout.editor.xml class.module_image_editor.php class.module_text_editor.php class.module_editor.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_text_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_text_editor.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_text_editor.php 25 Aug 2004 21:16:43 -0000 1.2 +++ class.module_text_editor.php 29 Sep 2004 20:10:44 -0000 1.3 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.3 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.2 2004/08/25 21:16:43 mjahn * step 1 is taken * @@ -111,7 +115,7 @@ $this->filename = $actiondata ['_filename']; if (strrchr ($this->filename, '.') == '.gz') { - $data = file ($this->filename); + $data = gzfile ($this->filename); } else { $data = file ($this->filename); } Index: layout.editor.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/layout.editor.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.editor.xml 25 Aug 2004 21:21:00 -0000 1.1 +++ layout.editor.xml 29 Sep 2004 20:10:43 -0000 1.2 @@ -28,8 +28,8 @@ <h2>Dateieditorr für <em><layout:replace name="filename" /></em></h2> <div class="iconbar"> <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&action=viewdir" title="Dateibetrachter schließen" >Zurück</a> - <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=copyfile" title="Dateiinhalt in die Zwischenablage kopieren" >Kopieren</a> - <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=pastefile" title="Inhalt aus der Zwischenablage einfügen" >Einfügen</a> + <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=savefile" title="Dateiinhalt in die Zwischenablage kopieren" >Speichern</a> + <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=savefileas" title="Inhalt aus der Zwischenablage einfügen" >Speichern als ...</a> </div> <div id="fileeditor"> <layout:replace name="content" default="" /> Index: class.module_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_editor.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_editor.php 25 Aug 2004 21:16:43 -0000 1.3 +++ class.module_editor.php 29 Sep 2004 20:10:44 -0000 1.4 @@ -30,6 +30,10 @@ /* * $Log$ +* Revision 1.4 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.3 2004/08/25 21:16:43 mjahn * step 1 is taken * @@ -53,18 +57,13 @@ function init () { // connect to actions - $this->_registerEvent ('EDITOR_EDIT_FILE', 'doEditFile'); - $this->_registerAction ('doEditFile', 'editFile'); - $this->_registerAction ('EDITOR_VIEW_FILE', 'doViewFile'); - $this->_registerAction ('doViewFile', 'viewFile'); $this->_registerAction ('doParseParam', 'parseParam'); - $this->_registerAction ('doProcess', 'process'); $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); $actiondata1 = array ('module'=>'editor'); $this->_callEvent ('CONFIG_GET', $actiondata1); $this->CONF =& $actiondata1 ['config']; - $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.xml'); + $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.editor.xml'); $this->_callEvent ('LAYOUT_ADD_TEMPLATE', $actiondata1); } @@ -108,6 +107,11 @@ $actiondata1 = array ('errortext'=>'Die Datei befindet sich außerhalb des erlaubten Bereiches!'); $this->_callEvent ('ERROR_NOTICE', $actiondata1); } + + if ($this->display) { + $this->_registerAction ('doProcess', 'process'); + } + } /** @@ -144,7 +148,8 @@ $this->webname = str_replace ($this->docroot, '', $this->filename); // extract the extension from filename - $this->ext = strtolower (substr (strrchr ('.', $this->filename), 1)); + $this->ext = strtolower (substr (strrchr ($this->filename, '.'), 1)); + // load correct editor-module into framework switch ($this->ext) { // imagetypes @@ -174,7 +179,7 @@ $actiondata1 = array ('filename'=>dirname(__FILE__).'/class.module_'.$this->filetype.'_editor.php', 'class'=>'module_'.$this->filetype.'_editor'); $this->_callEvent ('LOAD_MODULE', $actiondata1); - $actiondata1 = array ('filename'=>$this->filename); + $actiondata1 = array ('_filename'=>$this->filename); $this->_callEvent ('EDITOR_SAVE_FILE', $actiondata1); switch ($this->action) { Index: class.module_image_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_image_editor.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_image_editor.php 25 Aug 2004 21:16:43 -0000 1.2 +++ class.module_image_editor.php 29 Sep 2004 20:10:44 -0000 1.3 @@ -28,8 +28,9 @@ /* * $Log$ -* Revision 1.2 2004/08/25 21:16:43 mjahn -* step 1 is taken +* Revision 1.3 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part * * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included @@ -154,6 +155,7 @@ } function saveFile (&$actiondata) { + $filename = $actiondata ['_filename']; } function viewFile (&$actiondata) { @@ -176,5 +178,21 @@ } function editFile (&$actiondata) { + $filename = $actiondata ['_filename']; + $webname = $actiondata ['_webname']; + $root = $actiondata ['_root']; + $size = getimagesize ($filename); + $actiondata1 = array ('_root'=>$root, '_id'=>'view-image-block', '_type'=>'empty'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + // set image-viewer + $actiondata1 = array ('_root'=>'view-image-block', '_id'=>'view-image', '_type'=>'image', 'src'=>$webname, + 'width'=>$size[0], 'height'=>$size[1], 'alt'=>'', 'title'=>''); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + // set image-data + $content = 'Dateigröße: '.file_util::filesize ($filename).'<br />'. + 'Breite: '.$size[0].'px<br />'. + 'Höhe: '.$size[1].'px<br />'; + $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'fileinfo', '_type'=>'block', 'id'=>'', 'class'=>'', 'content'=>$content); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } } \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-09-29 20:10:54
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/error In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/error Modified Files: class.module_error.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_error.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/error/class.module_error.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_error.php 18 Jun 2004 15:17:00 -0000 1.4 +++ class.module_error.php 29 Sep 2004 20:10:44 -0000 1.5 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.5 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.4 2004/06/18 15:17:00 mjahn * module filemanager and editor included * @@ -55,10 +59,12 @@ function errorAbort (&$actiondata) { $this->_error [] = $actiondata; + return true; } function errorNotice (&$actiondata) { $this->_error [] = $actiondata; + return true; } function displayError (&$actiondata) { @@ -75,8 +81,8 @@ $content .= $this->_error[$i]['errortext'].'<br />'; } - $errordata = array ('_root'=>$root, '_id'=>'errormessage', '_type'=>'paragraph', 'id'=>'', 'class'=>'error', 'content'=>$content); - $this->_callEvent ('LAYOUT_ADD_ELEMENT', $errordata); + $errordata1 = array ('_root'=>$root, '_id'=>'errormessage', '_type'=>'paragraph', 'content'=>$content); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $errordata1); } } |