phpcms-plugins-cvs Mailing List for phpCMS-plugins (Page 14)
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-07-24 08:58:34
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/modules/config Modified Files: config.xml class.module_config.php Log Message: changed some things Index: config.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/config.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config.xml 18 Jun 2004 15:16:59 -0000 1.3 +++ config.xml 24 Jul 2004 08:58:25 -0000 1.4 @@ -1,30 +1,34 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE framework SYSTEM "config.dtd"> -<framework> - <module id="user" name="user-service" include="class.module_user.php" class="module_user"> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE framework SYSTEM "config.dtd"> +<framework> + <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="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="debug" name="debug-service" include="class.module_debug.php" class="module_debug" /> - <module id="filemanager" name="filemanager" include="class.module_filemanager.php" class="module_filemanager"> - <config name="startupdir" value="/" /> - <config name="editor_image" value="jpg,jpeg,png,bmp,gif" /> - <config name="editor_xml" value="xml,dtd" /> - <config name="editor_phpcms_content" value="phpcms" /> - <config name="editor_phpcms_menu" value="mnu" /> - </module> - + <config name="permfile" value="Perm_XML.xml" /> + </module> + <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="debug" name="debug-service" include="class.module_debug.php" class="module_debug" /> + <module id="filemanager" name="filemanager" include="class.module_filemanager.php" class="module_filemanager"> + <config name="startupdir" value="/" /> + <config name="editor_image" value="jpg,jpeg,png,bmp,gif" /> + <config name="editor_xml" value="xml,dtd" /> + <config name="editor_phpcms_content" value="phpcms" /> + <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="projectdir" value="/cms/templates/" /> + <config name="projectfileext" value="ini" /> + </module> <module id="error" name="error-service" include="class.module_error.php" class="module_error" /> - <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..." /> - </module> - <module id="log" name="log-service" include="class.module_log.php" class="module_log"> - <config name="logfile" value="log/framework.log" /> - <config name="logrotate" /> - <config name="logrotate-days" value="2" /> - <config name="chmod" value="0606" /> - </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..." /> + </module> + <module id="log" name="log-service" include="class.module_log.php" class="module_log"> + <config name="logfile" value="log/framework.log" /> + <config name="logrotate" /> + <config name="logrotate-days" value="2" /> + <config name="chmod" value="0606" /> + </module> </framework> \ No newline at end of file Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.module_config.php 4 Jun 2004 11:32:08 -0000 1.5 +++ class.module_config.php 24 Jul 2004 08:58:25 -0000 1.6 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.6 2004/07/24 08:58:25 mjahn +* changed some things +* * Revision 1.5 2004/06/04 11:32:08 mjahn * several changes * @@ -138,7 +141,15 @@ if (!isset($actiondata['module']) || !isset ($this->_config[$actiondata['module']])) { $actiondata['config'] =& $this->_config; } else { - $actiondata['config'] =& $this->_config[$actiondata['module']]; + if (!isset ($actiondata ['format']) || $actiondata ['format']=='object') { + $actiondata['config'] =& $this->_config[$actiondata['module']]; + } + if (isset ($actiondata ['format']) && $actiondata ['format']=='array') { + $num = count ($this->_config[$actiondata['module']]->children); + for ($i = 0; $i < $num; $i++) { + $actiondata['config'][$this->_config[$actiondata['module']]->children[$i]->attributes['name']] = & $this->_config[$actiondata['module']]->children[$i]->attributes['value']; + } + } } return true; } |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:34
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/modules/layout Modified Files: layout.tpl layout.css layout.xml class.module_layout.php Added Files: gui.js gui.css Log Message: changed some things --- NEW FILE: gui.css --- ul.horizontal { } ul.tabbed { padding: 3px 0; margin-left: 0; border-bottom: 1px solid #778; font: bold 12px Verdana, sans-serif; } ul.tabbed li { list-style: none; margin: 0; display: inline; } ul.tabbed li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; border-bottom: none; background: #DDE; text-decoration: none; } ul.tabbed li a:link { color: #448; } ul.tabbed li a:visited { color: #667; } ul.tabbed li a:hover { color: #000; background: #AAE; border-color: #227; } ul.tabbed li a#current { background: white; border-bottom: 1px solid white; } /** * CSS-Anweisungen für die Konfigurationscontainer **/ div.config { width:40em; margin-top:1em; } div.config ul { margin:0; padding:0; } div.config ul li a { background:#eee; color:black; } div.config ul li a.current { background:#ccc; color:black; } div.config ul li a:hover { background:#ccc; color:black; } div.config div { padding:0.3em; } Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class.module_layout.php 18 Jun 2004 15:17:01 -0000 1.8 +++ class.module_layout.php 24 Jul 2004 08:58:24 -0000 1.9 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.9 2004/07/24 08:58:24 mjahn +* changed some things +* * Revision 1.8 2004/06/18 15:17:01 mjahn * module filemanager and editor included * @@ -199,7 +202,7 @@ case 'submenu': // set the submenu block - $actiondata = array ('_type'=>'ulist', '_id'=>'submenu', 'id'=>'submenu'); + $actiondata = array ('_type'=>'ulist', '_id'=>'submenu', 'extra'=>'id="submenu""'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); // get the error-messages $actiondata = array ('_root'=>'submenu'); @@ -253,8 +256,10 @@ // check if there is a layout-template for the type of this element if (!isset ($element['_type']) || !isset ($this->_layout[$element['_type']])) { + //echo '<p>Undefined layout type: '.$element['_type'].'</p>'."\n"; return ''; } + //echo '<p>Defined layout type: '.$element['_type'].'</p>'."\n"; if (!isset($element['content'])) { $element['content'] = ''; @@ -310,6 +315,10 @@ return $o; } + function _setTags () { + $this->_defaultTags = array (); + } + /** * Parse the template-file * Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- layout.xml 18 Jun 2004 15:17:01 -0000 1.4 +++ layout.xml 24 Jul 2004 08:58:24 -0000 1.5 @@ -4,155 +4,141 @@ <layout:insert name="empty"> <![CDATA[ - <layout:replace name="content" /> +<layout:replace name="content" /> ]]> </layout:insert> <layout:insert name="block"> <![CDATA[ - <div <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </div> +<div <layout:replace name="extra" default="" />> + <layout:replace name="content" /> +</div> ]]> </layout:insert> <layout:insert name="column_block"> <![CDATA[ - <div <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - <br style="clear:both;" /> - </div> + <div <layout:replace name="extra" default="" />> +<layout:replace name="content" /> + <br style="clear:both;" /> +</div> ]]> </layout:insert> <layout:insert name="column"> <![CDATA[ - <div <layout:replace name="extra" default="" /> style="float:left;"> - <layout:replace name="content" /> - </div> +<div <layout:replace name="extra" default="" /> style="float:left;"> + <layout:replace name="content" /> +</div> ]]> </layout:insert> <layout:insert name="inline"> <![CDATA[ - <span <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </span> +<span <layout:replace name="extra" default="" />> + <layout:replace name="content" /> +</span> ]]> </layout:insert> <layout:insert name="paragraph"> <![CDATA[ - <p <layout:replace name="extra" default="" />><layout:replace name="content" /></p> +<p <layout:replace name="extra" default="" />><layout:replace name="content" /></p> ]]> </layout:insert> <layout:insert name="hr"> <![CDATA[ - <hr <layout:replace name="extra" default="" /> /> +<hr <layout:replace name="extra" default="" /> /> ]]> </layout:insert> <layout:insert name="headline"> <![CDATA[ - <h2 <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </h2> +<h2 <layout:replace name="extra" default="" />><layout:replace name="content" /></h2> ]]> </layout:insert> <layout:insert name="image"> <![CDATA[ - <img src="<layout:replace name="src" />" width="<layout:replace name="width" />" height="<layout:replace name="height" />" title="<layout:replace name="title" />" alt="<layout:replace name="alt" />" <layout:replace name="extra" default="" /> /> +<img src="<layout:replace name="src" />" width="<layout:replace name="width" />" height="<layout:replace name="height" />" title="<layout:replace name="title" />" alt="<layout:replace name="alt" />" <layout:replace name="extra" default="" /> /> ]]> </layout:insert> <layout:insert name="link"> <![CDATA[ - <a href="<layout:replace name="href" />" title="<layout:replace name="title" />"> - <layout:replace name="content" /> - </a> +<a href="<layout:replace name="href" />" title="<layout:replace name="title" />" <layout:replace name="extra" default="" />><layout:replace name="content" /></a> ]]> </layout:insert> <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"> - <layout:replace name="content" /> - </form> +<form action="<layout:replace name="action" default="" />" <layout:replace name="extra" default="" /> method="<layout:replace name="method" default="post" />" enctype="x-form/multipart"> + <layout:replace name="content" /> +</form> ]]> </layout:insert> <layout:insert name="form_fieldset"> <![CDATA[ - <fieldset> - <legend><layout:replace name="title" /></legend> - <layout:replace name="content" /> - </fieldset> +<fieldset> + <legend><layout:replace name="title" /></legend> + <layout:replace name="content" /> +</fieldset> ]]> </layout:insert> <layout:insert name="form_input_hidden"> <![CDATA[ - <input type="hidden" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> +<input type="hidden" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> ]]> </layout:insert> <layout:insert name="form_input_text"> <![CDATA[ - <label> - <span> - <layout:replace name="label" /> - </span> - <input type="text" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> - </label> +<label> + <span> + <layout:replace name="label" /> + </span> + <input type="text" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> +</label> ]]> </layout:insert> <layout:insert name="form_input_password"> <![CDATA[ - <label> - <span> - <layout:replace name="label" default="" /> - </span> - <input type="password" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> - </label> +<label><span><layout:replace name="label" default="" /></span><input type="password" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /></label> ]]> </layout:insert> <layout:insert name="form_radio"> <![CDATA[ - <label><input type="radio" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /><label /></label> +<label><input type="radio" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /><label /></label> ]]> </layout:insert> <layout:insert name="form_checkbox"> <![CDATA[ - <label> - <span> - <layout:replace name="label" default="" /> - </span> - <input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> - </label> +<label><span><layout:replace name="label" default="" /></span><input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /></label> ]]> </layout:insert> <layout:insert name="form_checkbox_simple"> <![CDATA[ - <input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> +<input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> ]]> </layout:insert> @@ -160,84 +146,90 @@ <layout:insert name="form_textarea"> <![CDATA[ - <label> - <span> - <layout:replace name="label" default="" /> - </span> - <textarea name="<layout:replace name="name" />" <layout:replace name="extra" default="" />><layout:replace name="value" /></textarea> - </label> +<label><span><layout:replace name="label" default="" /></span><textarea name="<layout:replace name="name" />" <layout:replace name="extra" default="" />><layout:replace name="value" /></textarea></label> ]]> </layout:insert> <layout:insert name="form_button"> <![CDATA[ - <button type="<layout:replace name="type" />" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" />> - <layout:replace name="text" /> - </button> +<button type="<layout:replace name="type" />" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" />><layout:replace name="text" /></button> ]]> </layout:insert> <layout:insert name="menu_main_entry"> <![CDATA[ - <li <layout:replace name="extra" default="" />> - <a href="?moduleid=<layout:replace name="module" />&<layout:replace name="params" />"> - <layout:replace name="name" /> - </a> - </li> +<li <layout:replace name="extra" default="" />><a href="?moduleid=<layout:replace name="module" />&<layout:replace name="params" />"><layout:replace name="name" /> </a></li> ]]> </layout:insert> <layout:insert name="ulist"> <![CDATA[ - <ul <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </ul> +<ul <layout:replace name="extra" default="" />> + <layout:replace name="content" /> +</ul> ]]> </layout:insert> <layout:insert name="olist"> <![CDATA[ - <ol <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </ol> +<ol <layout:replace name="extra" default="" />> + <layout:replace name="content" /> +</ol> ]]> </layout:insert> <layout:insert name="menu_sub_entry"> <![CDATA[ - <li <layout:replace name="extra" default="" />> - <a href="?moduleid=<layout:replace name="module" />&action=<layout:replace name="action" />&<layout:replace name="param" />"> - <layout:replace name="name" /> - </a> - </li> + <li <layout:replace name="extra" default="" />><a href="?moduleid=<layout:replace name="module" />&action=<layout:replace name="action" />&<layout:replace name="param" />"><layout:replace name="name" /> </a></li> ]]> </layout:insert> <layout:insert name="list_entry"> <![CDATA[ - <li <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - </li> +<li <layout:replace name="extra" default="" />><layout:replace name="content" /></li> ]]> </layout:insert> <layout:insert name="filelist_entry"> <![CDATA[ - <li <layout:replace name="extra" default="" />> - <layout:replace name="content" /> - <span class="filemtime" title="Last modified"><layout:replace name="filemtime" /></span> - <span class="filesize" title="Dateigröße"><layout:replace name="filesize" /></span> - <span class="chmod" title="Besitzer: <layout:replace name="uid" />\nGruppe: <layout:replace name="gid" />"><layout:replace name="chmod" /></span> - </li> +<li <layout:replace name="extra" default="" />><layout:replace name="content" /><span class="filemtime" title="Last modified"><layout:replace name="filemtime" /></span><span class="filesize" title="Dateigröße"><layout:replace name="filesize" /></span><span class="chmod" title="Besitzer: <layout:replace name="uid" />\nGruppe: <layout:replace name="gid" />"><layout:replace name="chmod" /></span></li> ]]> </layout:insert> + + + <layout:insert name="tabbed_box"> + <![CDATA[ +<div class="tabbedBox"><layout:replace name="content" default="" /></div> + ]]> + </layout:insert> + + + <layout:insert name="box"> + <![CDATA[ +<div class="box"><layout:replace name="content" default="" /></div> + ]]> + </layout:insert> + + + <layout:insert name="tab"> + <![CDATA[ +<div class="tab"><layout:replace name="content" default="" /></div> + ]]> + </layout:insert> + + + <layout:insert name="script"> + <![CDATA[ +<script <layout:replace name="extra" default="" /> type="text/javascript"><layout:replace name="content" default="" /></script> + ]]> + </layout:insert> </layout> \ No newline at end of file Index: layout.tpl =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.tpl 18 Jun 2004 15:17:01 -0000 1.1 +++ layout.tpl 24 Jul 2004 08:58:24 -0000 1.2 @@ -9,6 +9,8 @@ <meta name="language" content="de" /> <meta http-equiv="imagetoolbar" content="no" /> <link rel="stylesheet" href="modules/layout/layout.css" type="text/css" /> + <link rel="stylesheet" href="modules/layout/gui.css" type="text/css" /> + <script type="text/javascript" src="modules/layout/gui.js"></script> </head> <body> <div id="menu"> @@ -20,7 +22,13 @@ </p> </div> <div id="content"> - <phpcms-admin:replace name="submenu" /> + <div class="status"> + <phpcms:admin:replace name="username" /><phpcms:admin:replace name="userstatus" /> + <phpcms:admin:replace name="datum" /> + + + <phpcms-admin:replace name="submenu" /> + </div> <div class="content"> <phpcms-admin:replace name="error" /> <phpcms-admin:replace name="content" /> --- NEW FILE: gui.js --- var tabs = new Array (); /** * display a tab and hide all other tabs **/ function displayTab (id) { var i = 0; num = tabs.length; for (i = 0; i < num; i++) { if (tabs [i] != id) { hideTab (tabs [i]); /* alert ('hideTab (' + tabs [i] + ')');*/ continue; } showTab (tabs [i]); /* alert ('showTab (' + tabs [i] + ')');*/ } } /** * helper-function to hide a tab **/ function hideTab (id) { document.getElementById (id).style.display = 'none'; } /** * helper-function to display a tab **/ function showTab (id) { document.getElementById (id).style.display = 'block'; } /** * register a tabbox **/ function registerTab (id) { tabs.push (id); } window.onload = function onloadHide () { displayTab (tabs [0]); } Index: layout.css =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- layout.css 18 Jun 2004 15:17:01 -0000 1.2 +++ layout.css 24 Jul 2004 08:58:24 -0000 1.3 @@ -9,7 +9,7 @@ } #content { - margin-left:190px; + margin-left:192px; padding:0; background:#fff; } @@ -25,25 +25,46 @@ top:0; left:0; height:100%; - width:190px; + width:170px; margin:0; - padding:0; - border-right:0.1em solid #000; - border-bottom:0.1em solid #000; - background:#fff; + padding:0 10px; + border-right:2px outset #eee; + border-bottom:2px outset #eee; + background:#eee; +} + +#menu p { + padding:0.2em; + border:2px inset #eee; } #menu ul { list-style-type:none; padding:0; margin:0; + background:#eee; } #menu ul li { - padding:0.2em; - margin:0.1em; + padding:0; + margin:0; } +#menu ul li a { + padding:0.2em 0.5em; + margin:0.5em 0.1em; + display:block; + background:#ddd; + border:2px outset #ddd; + text-decoration:none; +} + +#menu ul li.active a, +#menu ul li a:hover { + background:#ddd; + border:2px inset #ddd; +} + #menu ul li ul { margin-left:1em; } @@ -71,7 +92,7 @@ font: bold Verdana, sans-serif; position:fixed; top:0; -left:191px; +left:192px; width:80%; } |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:34
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/include Modified Files: class.eventhandler.php class.actionhandler.php class.module.php Log Message: changed some things Index: class.module.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.module.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.module.php 4 Jun 2004 11:32:07 -0000 1.5 +++ class.module.php 24 Jul 2004 08:58:24 -0000 1.6 @@ -27,6 +27,9 @@ **/ /* * $Log$ +* Revision 1.6 2004/07/24 08:58:24 mjahn +* changed some things +* * Revision 1.5 2004/06/04 11:32:07 mjahn * several changes * @@ -51,6 +54,7 @@ function __construct (&$eventhandler) { $this->_event =& $eventhandler; + $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); } function _registerEvent ($eventname, $eventaction) { Index: class.actionhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.actionhandler.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.actionhandler.php 4 Jun 2004 11:32:07 -0000 1.5 +++ class.actionhandler.php 24 Jul 2004 08:58:24 -0000 1.6 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.6 2004/07/24 08:58:24 mjahn +* changed some things +* * Revision 1.5 2004/06/04 11:32:07 mjahn * several changes * @@ -103,9 +106,12 @@ if (!isset($this->_actions[$actionname])) { return false; } - + reset ($this->_actions[$actionname]); foreach ($this->_actions[$actionname] as $actionclass => $actionmethod ) { + if (DEBUG) { + echo '<p>Action: '.$actionclass.'::'.$actionmethod.'</p>'; + } $object =& $this->__getInstance($actionclass); $object->{$actionmethod}($actiondata); } Index: class.eventhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.eventhandler.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- class.eventhandler.php 18 Jun 2004 15:16:59 -0000 1.6 +++ class.eventhandler.php 24 Jul 2004 08:58:24 -0000 1.7 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.7 2004/07/24 08:58:24 mjahn +* changed some things +* * Revision 1.6 2004/06/18 15:16:59 mjahn * module filemanager and editor included * @@ -102,7 +105,9 @@ } $action = $this->_events[$eventname]; - //echo '<p>Event: '.$eventname.'-> '.$action.'</p>'; + if (DEBUG) { + echo '<p>Event: '.$eventname.'-> '.$action.'</p>'; + } return $this->_actionHandler->action($action, $actiondata); } |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:34
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/docs Modified Files: Benutzerhandbuch.lyx Added Files: .cvsignore Log Message: changed some things --- NEW FILE: .cvsignore --- html pdf Index: Benutzerhandbuch.lyx =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/docs/Benutzerhandbuch.lyx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Benutzerhandbuch.lyx 5 Jun 2004 12:44:22 -0000 1.5 +++ Benutzerhandbuch.lyx 24 Jul 2004 08:58:24 -0000 1.6 @@ -112,54 +112,54 @@ Einleitung \layout Standard -Admin4phpCMS ist eine eigenständiges Framework, daß mit Hilfe eines Benutzer-/Be -rechtigungssystems ermöglicht, eine komfortable Administration für die Website - zu erstellen. +Admin4phpCMS ist eine eigenständiges Framework, das mit Hilfe eines Benutzer-/Be +rechtigungssystems eine komfortable Administration für phpCMS-Websites darstellt. Über einzelne Module kann die Funktionalität flexibel und beliebig erweitert werden. -\layout Section - -Die Module + Die Unabhängigkeit vom phpCMS-Parser ist wichtig, damit die Website auch + administriert werden kann, wenn der Parser falsch konfiguriert wurde. \layout Standard -Folgende Module werden als Grundausstattung mitgeliefert werden. +Folgende Module stelle ich mir als Grundausstattung vor: \layout Itemize -Dateimanager-Modul +phpCMS-Konfiguration-Modul \layout Itemize -Modulmanager (automatisches Update, Installation und Löschen von Modulen - ähnlich dem PEAR-Installer) +phpCMS-Statistik-Modul \layout Itemize -Konfigurations-Modul für phpCMS und das Framework, sowie andere administrative - Aufgaben +phpCMS-Cache-Modul \layout Itemize -Benutzer- und Rechteverwaltung -\layout Standard +Dateimanager-Modul +\layout Itemize -Zusätzlich werden folgende Module zur Nachinstallation über den Modulmanager - angeboten +Editor-Modul (Bearbeiten von Texten, XML-Daten und Bildern) \layout Itemize -ein Pluginmanager-Modul (abzustimmen mit obw wegen PluginToolkit) +Modulverwaltung \layout Itemize -ein umfangreiches Statistik-Modul (phpCMS-Statistikdaten graphisch aufbereitet) +Pluginmanager-Modul \layout Itemize -ein WebDAV-Modul (für die komfortable Pflege der Internetpräsenz) +HTTP-Indexer-Modul \layout Itemize -Newsletter-Modul +Backup-Modul \layout Itemize -u. - a. +(vielleicht) Email-Modul (Webmail-Client?) +\layout Itemize + +Log-Modul +\layout Itemize + +WebDAV-Schnittstellen-Modul \layout Chapter -Benutzerhandbuch +Benutzer-Dokumentation \layout Chapter Entwickler-Dokumentation @@ -357,21 +357,6 @@ Funktion übergeben wurden. \layout Chapter -Die Module -\layout Section - -Filemanager-Modul -\layout Subsection - -Virtuelles Dateisystem -\layout Subsection - -Der Dateimanager -\layout Subsection - -Der Dateieditor -\layout Chapter - Anhang \layout Section |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:33
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990 Modified Files: index.php Added Files: .cvsignore INSTALL Log Message: changed some things --- NEW FILE: .cvsignore --- pear --- NEW FILE: INSTALL --- Index: index.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 18 Jun 2004 15:16:58 -0000 1.5 +++ index.php 24 Jul 2004 08:58:25 -0000 1.6 @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.6 2004/07/24 08:58:25 mjahn +* changed some things +* * Revision 1.5 2004/06/18 15:16:58 mjahn * module filemanager and editor included * @@ -56,7 +59,7 @@ /** * Set the path for including the pear-packages **/ -ini_set ('include_path', realpath(dirname(__FILE__).'/../pear/').'/:'.ini_get('include_path')); +ini_set ('include_path', realpath(dirname(__FILE__).'/pear/').'/:'.ini_get('include_path')); /** * Include the framework-class |
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24205/modules/editor Modified Files: class.module_xml_editor.php class.module_editor.php Added Files: class.module_phpcms_editor.php editor.css editor.js class.module_image_editor.php Log Message: updated editor-module Index: class.module_xml_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_xml_editor.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.module_xml_editor.php 18 Jun 2004 15:17:00 -0000 1.1 +++ class.module_xml_editor.php 24 Jul 2004 08:50:34 -0000 1.2 @@ -28,6 +28,9 @@ /* * $Log$ +* Revision 1.2 2004/07/24 08:50:34 mjahn +* updated editor-module +* * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * @@ -123,26 +126,30 @@ $this->filename = $actiondata ['_filename']; // set container for fileviewer - $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'columns', '_type'=>'column_block', 'id'=>'spalten', 'class'=>''); + $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'columns', '_type'=>'column_block', 'extra'=>'id="spalten"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for XML-Tree - $actiondata = array ('_root'=>'columns', '_id'=>'file-edit-tree-column', '_type'=>'column', 'id'=>'', 'class'=>''); + $actiondata = array ('_root'=>'columns', '_id'=>'tree-column', '_type'=>'column'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set list-container for XML-Tree - $actiondata = array ('_root'=>'file-edit-tree-column', '_id'=>'file-edit-tree', '_type'=>'ulist', 'id'=>'', 'class'=>''); + $actiondata = array ('_root'=>'tree-column', '_id'=>'file-edit-tree', '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for input-fields - $actiondata = array ('_root'=>'columns', '_id'=>'file-edit-input', '_type'=>'column', 'id'=>'', 'class'=>''); + $actiondata = array ('_root'=>'columns', '_id'=>'edit-column', '_type'=>'column'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $XML =& new XML_Tree ($this->filename); $this->_file =& $XML->getTreeFromFile (); //print_r ($this->_file); - $this->displayNode ($this->_file, 'file-edit-tree', 'file-edit-tree-0', 'file-edit-input'); + $this->displayNode ($this->_file, 'file-edit-tree', 'file-edit-tree-0', 'edit-column'); + + $actiondata = array ('_id'=>'file-edit-form-submit', '_root'=>'file-edit-form', '_type'=>'form_button', 'text'=>'Absenden', 'name'=>'xml-save-file', 'value'=>'save'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } /** @@ -155,31 +162,34 @@ **/ function displayNode (&$node, $root, $node_id, $input_id) { if (isset ($node->name) && $node->name != '') { - $actiondata = array ('_id'=>$node_id, '_root'=>$root, '_type'=>'list_entry', 'class'=>'', 'id'=>''); + $actiondata = array ('_id'=>$node_id, '_root'=>$root, '_type'=>'list_entry'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>$node_id.'-link', '_root'=>$node_id, '_type'=>'link', 'class'=>'', 'id'=>'', 'content'=>$node->name, 'href'=>'#'.$node_id); + $actiondata = array ('_id'=>$node_id.'-script', '_root'=>$root, '_type'=>'script', 'content'=>'registerTab (\''.$node_id.'\')'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>$node_id.'-link', '_root'=>$node_id, '_type'=>'link', 'content'=>$node->name, 'href'=>'#'.$node_id, 'extra'=>'onclick="displayTab (\''.$node_id.'\' )" onkeypress="displayTab (\''.$node_id.'\')"'); if (isset ($node->attributes['name'])) { $actiondata ['title'] = $node->attributes['name']; } $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>$node_id.'-name', '_root'=>$node_id.'-link', '_type'=>'empty', 'class'=>'', 'id'=>'', 'content'=>$node->name); + $actiondata = array ('_id'=>$node_id.'-name', '_root'=>$node_id.'-link', '_type'=>'empty', 'content'=>$node->name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>$node_id.'-block', '_root'=>$input_id, '_type'=>'block', 'class'=>'', 'id'=>$node_id); + $actiondata = array ('_id'=>$node_id.'-block', '_root'=>$input_id, '_type'=>'block', 'extra'=>'id="'.$node_id.'"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>$node_id.'-set', '_root'=>$node_id.'-block', '_type'=>'form_fieldset', 'class'=>'', 'id'=>'', 'title'=>$node->name); + $actiondata = array ('_id'=>$node_id.'-set', '_root'=>$node_id.'-block', '_type'=>'form_fieldset','title'=>$node->name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); foreach ($node->attributes as $name=>$value) { - $actiondata = array ('_id'=>$node_id.'-'.$name, '_root'=>$node_id.'-set', '_type'=>'form_input_text', 'extra'=>'id="'.$node_id.'-'.$name.'" ', 'name'=>$node_id.'-'.$name, 'value'=>htmlentities ($value), 'label'=>$name); + $actiondata = array ('_id'=>$node_id.'-'.$name, '_root'=>$node_id.'-set', '_type'=>'form_input_text', 'extra'=>'id="xml-'.$node_id.'-attr-'.$name.'" ', 'name'=>'xml-'.$node_id.'-attr-'.$name, 'value'=>htmlentities ($value), 'label'=>$name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } - $actiondata = array ('_id'=>$node_id.'-content', '_root'=>$node_id.'-set', '_type'=>'form_textarea', 'name'=>$node_id.'-content', 'extra'=>'id="'.$node_id.'-content" ', 'value'=>htmlentities ($node->content), 'label'=>'content'); + $actiondata = array ('_id'=>$node_id.'-content', '_root'=>$node_id.'-set', '_type'=>'form_textarea', 'name'=>'xml-'.$node_id.'-content', 'extra'=>'id="xml-'.$node_id.'-content" ', 'value'=>htmlentities ($node->content), 'label'=>'content'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); @@ -187,7 +197,7 @@ if (isset ($node->children) && is_array ($node->children) && count ($node->children) > 0) { - $actiondata = array ('_id'=>$node_id.'-sub', '_root'=>$node_id, '_type'=>'ulist', 'class'=>'', 'id'=>''); + $actiondata = array ('_id'=>$node_id.'-sub', '_root'=>$node_id, '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $num = count ($node->children); @@ -196,14 +206,6 @@ $this->displayNode ($node->children[$i], $node_id.'-sub', $node_id.'-'.$i, $input_id); } } - - - } } -/* -12 ma -12 deu -8 bio -*/ ?> \ No newline at end of file --- NEW FILE: editor.js --- /** * @package editor * @author Martin Jahn <mj...@us...> * @copyright (c) Copyright by Martin Jahn * @license GPL * @version $Id: editor.js,v 1.3 2004/07/02 17:41:24 mjahn Exp $ **/ /** * changed some things: * - body onload-eventhandler is no more needed * - comfortable choice of contentfield for image insertion **/ var imgtag_pre = '<img src="'; var imgtag_post = '" />'; // Author: James Craig // a few browser sniffs to account for known bugs var sUserAgent = navigator.userAgent.toLowerCase(); var isIE = document.all?true:false; var isOp = (sUserAgent.indexOf('opera')!=-1)?true:false; // make new popup window function pop(oAnchor,sProps,sWindow){ var sUrl = ''; // get URL from calling link oAnchor if(oAnchor.getAttribute) sUrl = oAnchor.getAttribute('href'); if(sUrl=='') sUrl = oAnchor.href; // if still no URL, return true and let the regular link take over if(sUrl=='') return true; // set window name ('_blank' for new window each time) var sWindowName = sWindow?sWindow:'reusedWindow'; // sets default properties if none are defined in the function call optional variable 'sProps' if(!sProps) sProps = 'width=640,height=480,scrollbars,resizable,toolbar,status,menubar,location'; // assign the popup to this variable so we can verify it exists if(sUrl) var oPopup = window.open(sUrl,sWindowName,sProps); // An Opera bug returns too early if you focus the window, so we don't focus it in that browser. // Only a noticable defect if a window is already open and hidden. if(oPopup && !isOp) oPopup.focus(); // If popup was created successfully, cancel link in calling window. // Acts as regular link in browser that has popup blocking enabled or JavaScript turned off. return (oPopup)?false:true; } // With onkeypress event, this verifies 'Enter' key // needed for popup function verifyKey(oElement,oEvent){ if(oEvent.keyCode==13 && oElement.onclick) oElement.onclick(); } // Moz only - wraps selected text with lft and rgt function wrapMoz(txtarea, lft, rgt) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; if (selEnd==1 || selEnd==2) selEnd=selLength; var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd); var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + lft + s2 + rgt + s3; } // IE only - Insert text at caret position or at start of selected text function insertIE (txtarea, text) { if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text+caretPos.text + ' ' : text+caretPos.text; } else { txtarea.value = txtarea.value + text; } return; } // Switch function based on browser - Insert text at caret position or at start of selected text function insertTag(txtarea , lft) { if (document.all) { insertIE(txtarea, lft); } else if (document.getElementById) { wrapMoz(txtarea, unescape(lft), ''); } } function insertImg() { var index, link, desc, title, copy, lft, txtarea; if (document.getElementById('input-preview-select') == null) { return false; } if (document.getElementById ('input-preview-select').selectedIndex >= 0) { index = document.getElementById ('input-preview-select').selectedIndex; link = document.getElementById ('input-preview-select').options[index].value; if (link == null) { return false; } lft=imgtag_pre + link + imgtag_post; // get id of the selected contentfield where to insert the image-tag if (document.getElementsByName('input-preview-target') == null) { return false; } cs = document.getElementsByName('input-preview-target'); i=0; if (cs.length > 1) { while (true) { if (!cs[i]) { break; } if (cs[i].checked == false) { i++; continue; } break; } } insertTag(document.getElementById ('input-content-'+cs[i].value), lft); } return false; } // End Processing code. function selectImage() { var index; var link; if (document.getElementById ('input-preview-select').selectedIndex >= 0) { index = document.getElementById ('input-preview-select').selectedIndex; link = document.getElementById ('input-preview-select').options[index].value; link = document.getElementById ('input-preview-thumbpath').value + '/' + link; document.getElementById ('input-preview-image').src = link; title = document.getElementById ('input-preview-select').options[index].title; a1 = title.indexOf ('x'); a2 = title.indexOf ('='); a3 = title.indexOf ('('); a4 = title.indexOf (')'); width = title.substr (0, a1); height = title.substr (a1 + 1, a2 - a1 - 1); fsize = title.substr (a2 + 1, a3 - a2 - 1); ftime = title.substr (a3 + 1, a4 - a3 - 1); if (document.getElementById ('input-preview-info')) { document.getElementById ('input-preview-info').value = width + ' x ' + height + ' = ' + fsize + '(letzte Änderung am ' + ftime + ')'; } if (document.getElementById ('input-preview-size')) { document.getElementById ('input-preview-size').value = width+' x '+height; } if (document.getElementById ('input-preview-filesize')) { document.getElementById ('input-preview-filesize').value = fsize; } if (document.getElementById ('input-preview-filectime')) { document.getElementById ('input-preview-filectime').value = ftime; } } } var tabs = new Array (); /** * display a tab and hide all other tabs **/ function displayTab (id) { var i = 0; num = tabs.length; for (i = 0; i < num; i++) { if (tabs [i] != id) { hideTab (tabs [i]); /* alert ('hideTab (' + tabs [i] + ')');*/ continue; } showTab (tabs [i]); /* alert ('showTab (' + tabs [i] + ')');*/ } } /** * helper-function to hide a tab **/ function hideTab (id) { document.getElementById (id).style.display = 'none'; } /** * helper-function to display a tab **/ function showTab (id) { document.getElementById (id).style.display = 'block'; } /** * register a tabbox **/ function registerTab (id) { tabs.push (id); } window.onload = function onloadHide () { registerTab ('new'); registerTab ('open'); registerTab ('delete'); registerTab ('upload'); registerTab ('image'); displayTab ('xyz'); } --- NEW FILE: class.module_image_editor.php --- <?php /** * Editor for XML-files * * <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_xml_editor.php,v 1.1 2004/06/18 15:17:00 mjahn Exp $ * @package admin4phpCMS * @subpackage module_editor **/ /* * $Log: class.module_xml_editor.php,v $ * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * */ /** * Image editor class * * This class provides an interface for editing image-files. * * @package admin4phpCMS * @subpackage module_editor * @inheriteddoc **/ class module_image_editor extends module { function init () { $this->_registerEvent ('DISPLAY_VIEWER', 'doDisplayViewer'); $this->_registerAction ('doDisplayViewer', 'viewFile'); $this->_registerEvent ('DISPLAY_EDITOR', 'doDisplayEditor'); $this->_registerAction ('doDisplayEditor', 'editFile'); $this->_registerEvent ('EDITOR_SAVE_FILE', 'doEditorSaveFile'); $this->_registerAction ('doEditorSaveFile', 'saveFile'); } function histogram($image, $output, $rating = '0', $type_fill = 1) { //header ("Content-type: image/jpeg"); //print $image;die(); $this->image=$image; $this->type_fill=$type_fill; $this->input_format=$input_format; $this->output_format=$output_format; $this->rating=$rating; $this->outputHistogramm (); } function analize_to_array() { switch ($this->input_format) { case "jpeg": $im=imagecreatefromjpeg($this->image); break; case "png": $im=imagecreatefrompng($this->image); } $xx=imagesx($im); $yy=imagesy($im); $this->size=$xx*$yy; $this->index=0; for($i=0;$i<$xx;$i+=$this->rating) { for($j=0;$j<$yy;$j+=$this->rating) { $rgb = imagecolorat($im, $i, $j); $rrggbb=imagecolorsforindex ($im, $rgb); $this->r[$this->index] = $rrggbb['red']; $this->g[$this->index] = $rrggbb['green']; $this->b[$this->index] = $rrggbb['blue']; $this->index++; } } } function outputHistogramm() { $this->analize_to_array(); $coef=(int)($this->index/800); if($coef<1) { $coef=1; } $image = imagecreatetruecolor (800, 400); $background_color = imagecolorallocate ($image, 0, 0, 0); $axis_color=imagecolorallocate ($image, 255, 255, 255); $red=imagecolorallocate ($image, 255, 0, 0); $green=imagecolorallocate ($image, 0, 255, 0); $blue=imagecolorallocate ($image, 0, 0, 255); //---- imageline($image, 10, 0, 10, 400, $axis_color); imageline($image, 0, 100, 800, 100, $axis_color); imageline($image, 0, 200, 800, 200, $axis_color); imageline($image, 0, 300, 800, 300, $axis_color); $pos=0; for($i=0;$i<$this->index;$i+=$coef) { if($this->type_fill==0) { imagesetpixel($image, $pos+10, 100-($this->r[$i]/3), $red); imagesetpixel($image, $pos+10, 200-($this->g[$i]/3) , $green); imagesetpixel($image, $pos+10, 300-($this->b[$i]/3) , $green); } else if($this->type_fill==1) { imageline($image, $pos+10, 100, $pos+10, 100-($this->r[$i]/3), $red); imageline($image, $pos+10, 200, $pos+10, 200-($this->g[$i]/3), $green); imageline($image, $pos+10, 300, $pos+10, 300-($this->b[$i]/3), $blue); } $pos++; } //---- imagestring($image, 2, 30, 310, "Sample No. : 1 ----------------------------------------------------------------------------------------------> Sample No. : $this->index",$axis_color); imagestring($image, 3, 20, 340, "Image Histogram for Red, Green, Blue elements . ",$axis_color); imagestring($image, 2, 20, 360, "Image Name : test.jpg --- Number Of Pixels : $this->size --- Sampling Rate : 1 Sample for each $this->rating * $this->rating Pixels .",$axis_color); imagestring($image, 2, 20, 380, "For Scientific versions contact : za...@ya... -- Image Processing ",$axis_color); switch($this->output_format) { case "jpeg": imagejpeg($image); break; case "png": imagepng($image); } } function saveFile (&$actiondata) { } function viewFile (&$actiondata) { $filename = $actiondata ['_filename']; $webname = $actiondata ['_webname']; $root = $actiondata ['_root']; $size = getimagesize ($filename); $actiondata = array ('_root'=>$root, '_id'=>'view-image-block', '_type'=>'empty'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set image-viewer $actiondata = 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', $actiondata); // set image-data $content = 'Dateigröße: '.file_util::filesize ($filename).'<br />'. 'Breite: '.$size[0].'px<br />'. 'Höhe: '.$size[1].'px<br />'; $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'fileinfo', '_type'=>'block', 'id'=>'', 'class'=>'', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } function editFile (&$actiondata) { } } --- NEW FILE: editor.css --- /** * @package editor * @author Martin Jahn <mj...@us...> * @copyright (c) Copyright by Martin Jahn * @license GPL * @version $Id: editor.css,v 1.9 2004/05/21 21:12:55 mjahn Exp $ **/ #editor fieldset { width: 90%; margin-bottom: 2em; padding: 1em; border: 2px ridge #060; display: block; } #editor legend { font-size: 140%; font-weight: bold; color: #060; background-color: transparent; } #editor form { margin: 0; } #editor h3 { margin: 25px 0 0 0; padding: 5px 10px; width: 98%; font-size: 120%; font-weight: normal; border-bottom: 2px solid #FFF; color: #060; background-color: #EEE; } #editor div.label { padding: 5px 10px; width: 98%; font-size: 90%; font-weight: bold; border-bottom: 2px solid #FFF; color: #060; background-color: #EEE; } #editor label { padding: 5px 10px; width: 98%; font-size: 90%; font-weight: bold; border-bottom: 2px solid #FFF; color: #060; background-color: #EEE; display: block; } #editor label span { padding-left: 10px; } #editor label span span { padding: 0; color: #000; } #editor a { color: #060; text-decoration: none; cursor: help; } #editor div.htmlarea, #editor input[type=text], #editor textarea { padding: 3px; width: 95%; border: 1px inset #060; background-color: #FAFAFA; display: block; } #editor input[type=text]:focus, #editor textarea:focus { border-color: #090; background-color: #FFF; } #editor select { position: relative; width: 95%; color: #000; border: 1px inset #060; background-color: #FAFAFA; display: block; } #editor select:focus { background-color: #FFF; } #editor input.editor-newfile { background: url(/img/editor/editor_new.png) no-repeat; background-position: 2px; } #editor input.editor-openfile { background: url(/img/editor/editor_edit.png) no-repeat; background-position: 2px; } #editor input.editor-savefile { background: url(/img/editor/editor_save.png) no-repeat; background-position: 2px; } #editor input.editor-delfile { background: url(/img/editor/editor_delete.png) no-repeat; background-position: 2px; } #editor input.editor-exit { background: url(/img/editor/editor_exit.png) no-repeat; background-position: 2px; } #editor input.editor-reset { background: url(/img/editor/editor_undo.png) no-repeat; background-position: 2px; } #editor input.editor-insertimage { background: url(/img/editor/editor_insertimage.png) no-repeat; background-position: 2px; } #editor input.editor-upload { background: url(/img/editor/editor_upload.png) no-repeat; background-position: 2px; } #editor input[type=submit], #editor input[type=reset], #editor input[type=button] { margin: 0 2px; padding: 2px 2px 2px 20px; border: 2px solid #F6F6F6; font-weight: normal; background-color: #EEE; } #editor input[type=submit]:hover, #editor input[type=reset]:hover, #editor input[type=button]:hover { border: 2px outset #EEE; background-color: #EFEFEF; } #editor input[type=submit]:active, #editor input[type=reset]:active, #editor input[type=button]:active { border: 2px inset #EEE; background-color: #EAEAEA; } #editor #preview { padding: 5px 10px; width: 98%; font-size: 90%; font-weight: bold; border-bottom: 2px solid #FFF; color: #060; background-color: #EEE; display: block; } #editor img.input-preview-image { padding: 1px; background: #EAEAEA; border: 1px inset #EEE; float:left; display:inline; } #editor label input.short { width: 18em; } Index: class.module_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_editor.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.module_editor.php 18 Jun 2004 15:17:00 -0000 1.1 +++ class.module_editor.php 24 Jul 2004 08:50:34 -0000 1.2 @@ -30,12 +30,13 @@ /* * $Log$ +* Revision 1.2 2004/07/24 08:50:34 mjahn +* updated editor-module +* * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * */ -require('classes/CropImage.php'); - /** * Editor-class * @@ -145,6 +146,9 @@ case 'xml': $this->filetype = 'xml'; break; + case 'htm': + $this->filetype = 'phpcms'; + break; default: $this->filetype = 'text'; break; @@ -172,27 +176,27 @@ function getViewContent (&$actiondata) { - $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->filename); + $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->webname); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for fileviewer $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'fileviewer', '_type'=>'block', 'extra'=>'id="fileviewer"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_root'=>'fileviewer', '_filename'=>$this->filename); + $actiondata = array ('_root'=>'fileviewer', '_filename'=>$this->filename, '_webname'=>$this->webname); $this->_callEvent ('DISPLAY_VIEWER', $actiondata); } function getEditContent (&$actiondata) { - $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->filename); + $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->webname); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set formular for fileviewer $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'file-edit-form', '_type'=>'form', 'action'=>'', 'method'=>'post'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_root'=>'file-edit-form', '_filename'=>$this->filename); + $actiondata = array ('_root'=>'file-edit-form', '_filename'=>$this->filename, '_webname'=>$this->webname); $this->_callEvent ('DISPLAY_EDITOR', $actiondata); } --- NEW FILE: class.module_phpcms_editor.php --- <?php /** * Editor for phpCMS-files * * <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$ * @package admin4phpCMS * @subpackage module_editor **/ /* * $Log$ * */ /** * phpCMS editor class * * This class provides an interface for editing phpCMS-files. * * @package admin4phpCMS * @subpackage module_editor * @inheriteddoc **/ class module_phpcms_editor extends module { function init () { $this->_registerEvent ('DISPLAY_VIEWER', 'doDisplayViewer'); $this->_registerAction ('doDisplayViewer', 'viewFile'); $this->_registerEvent ('DISPLAY_EDITOR', 'doDisplayEditor'); $this->_registerAction ('doDisplayEditor', 'editFile'); } function viewFile (&$actiondata) { } function editFile (&$actiondata) { global $GLOBALS; $GLOBALS['DEFAULTS']->PROJECTFILENAME = $_SERVER['DOCUMENT_ROOT'].'/cms/templates/home.ini'; // import online-editor class include_once (realpath (dirname(__FILE__).'/../../../onlineEditor4phpCMS/include/class.ext_editor.php')); if (isset ($_GET ['file'])) { $_GET ['editfile'] = $_GET ['file']; } // initialize editor $EDITOR = new cExtEditor(); // set path to the XML-style configfile $EDITOR->configfile = 'editor.conf.xml'; // connect the user-permission-control to the editor-object $this->_callEvent ('USER_GET_STATUS', $actiondata); $this->EDITOR->USER = $actiondata; // call display-method of editor object $actiondata = array ('_id'=>'edit-file', '_root'=>$actiondata ['_root'], '_type'=>'empty', 'content'=>$EDITOR->start ()); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } } ?> |
From: Martin J. <mj...@us...> - 2004-07-24 08:47:35
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23820/modules/phpcms Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms added to the repository |
From: Martin J. <mj...@us...> - 2004-07-24 08:46:44
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23704 Added Files: .project Log Message: fixed some bugs --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>admin4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-02 17:41:36
|
Update of /cvsroot/phpcms-plugins/onlineEditor4phpCMS/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26107/docs Added Files: fdl.txt gpl.txt Log Message: general update --- NEW FILE: gpl.txt --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: fdl.txt --- GNU Free Documentation License Version 1.2, November 2002 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. |
From: Martin J. <mj...@us...> - 2004-07-02 17:41:35
|
Update of /cvsroot/phpcms-plugins/onlineEditor4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26107/include Modified Files: class.ext_editor.php class.image.php class.phpcmsMenu.php Log Message: general update Index: class.ext_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/include/class.ext_editor.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- class.ext_editor.php 21 May 2004 21:13:02 -0000 1.13 +++ class.ext_editor.php 2 Jul 2004 17:41:25 -0000 1.14 @@ -36,7 +36,7 @@ include_once (dirname(__FILE__).'/class.utilities.php'); include_once (dirname(__FILE__).'/pclzip/pclzip-trace.lib.php'); include_once (dirname(__FILE__).'/htmlcleaner.php'); -include_once ('XML/Unserializer.php'); +include_once ('XML/Tree.php'); include_once ('HTTP/Upload.php'); // causes PHP to report all errors @@ -81,13 +81,14 @@ * this function combines the different mehtods of this class into a the application **/ function start () { - $this->__parseFormData (); - // check and parse configfile if (!$this->__parseConfigfile()) { $this->savefile = false; $this->showeditor = false; } + + $this->__parseFormData (); + $metadata = false;; if ($this->__parseProjectFile() && $this->__parseMenufile()) { $metadata = true; @@ -96,15 +97,13 @@ $this->__processEditor (); if ($this->showeditor) { - // load the editor templatefile into $this->EDITOR - $tpl = $this->CONF['editor']['templatefile']; + $tpl = $this->CONF['config']['templatefile']; if (substr($tpl, 0, 1) == '/') { $tpl = realpath($this->docroot.$tpl); } else { $tpl = realpath($this->basedir.'/'.$tpl); } - // parse the editor-template-file $this->EDITOR = new cTemplate(); $this->EDITOR->load($tpl); @@ -114,12 +113,10 @@ if ($metadata) { echo $this->__displayEditor(); } else { - //Header ('Location: '.$EDITOR->editfile); - echo 'Eigentlich Abbruch<br />'; + Header ('Location: '.$this->editfile); } } else { - //Header ('Location: '.$EDITOR->editfile); - echo 'Keine Anzeige<br />'; + Header ('Location: '.$this->editfile); } } @@ -131,6 +128,7 @@ util::magicQuotesRemove($_COOKIE); // consider which action i have to do + if (DEBUG) echo '<p>$EDITOR->action[type] = '.$this->action['type'].'</p>'; switch ($this->action['type']) { // delete the chosen contentfile case 'del': @@ -185,7 +183,7 @@ if (!file_exists($newfilename)) { return false; } - @chmod ($newfilename, decoct($this->CONF['editor']['chmod'])); + @chmod ($newfilename, decoct($this->CONF['config']['chmod'])); // check for menudata of new contentfile if (isset($_POST['input-newmenu']) && isset($_POST['input-newmenu-position'])) { @@ -251,11 +249,16 @@ // default action default: // check for URI-paramters - if (isset($_GET['editfile'])) { - $this->__load($_GET['editfile']); - $this->showeditor = true; - $this->savefile = false; + if (isset ($_GET ['editfile'])) { + $openfile = $_GET ['editfile']; + } elseif (isset ($_POST ['editfile'])) { + $openfile = $_POST['editfile']; + } else { + $this->showeditor = true; + break; } + $this->__load($openfile); + $this->showeditor = true; break; } } @@ -266,7 +269,7 @@ **/ function __displayEditor() { // set common output data and predefine some fields - $this->EDITOR->setFieldValue ('USER.NAME', $this->USER->getProperty('handle')); + $this->EDITOR->setFieldValue ('USER.NAME', '');//$this->USER->getProperty('handle')); $this->EDITOR->setFieldValue ('FILE.NAME', 'keine Datei offen'); $this->EDITOR->setFieldValue ('FILE.SIZE', ''); $this->EDITOR->setFieldValue ('FILE.CTIME', ''); @@ -370,7 +373,7 @@ $this->EDITOR->setFieldValue ('INPUT.ID', $fieldname); $this->EDITOR->setFieldValue ('INPUT.VALUE', $buffer); $o = ''; - foreach ($this->CONF['script'] as $script) { + foreach ($this->CONF['scriptlist'] as $script) { $this->EDITOR->setFieldValue ('SCRIPT.NAME', $script['name']); $this->EDITOR->setFieldValue ('SCRIPT.TITLE', $script['title']); $this->EDITOR->setFieldValue ('SCRIPT.PATH', $script['path']); @@ -436,9 +439,9 @@ $contentselector = $this->EDITOR->getFieldValue ('EDITOR.CONTENTSELECTOR'); $contentselector .= $this->EDITOR->process('EDITOR.CONTENTSELECTOR.TPL'); $this->EDITOR->setFieldValue ('EDITOR.CONTENTSELECTOR', $contentselector); - $this->EDITOR->setFieldValue ('WYSIWYG.PATH', $this->CONF['wysiwyg']['path']); - $this->EDITOR->setFieldValue ('EDITOR.WYSIWYG.PRE', $this->EDITOR->getFieldValue('WYSIWYG.PRE.'.$this->CONF['wysiwyg']['tpl'])); - $this->EDITOR->setFieldValue ('WYSIWYG.INPUT', $this->EDITOR->getFieldValue('WYSIWYG.INPUT.'.$this->CONF['wysiwyg']['tpl'])); + $this->EDITOR->setFieldValue ('WYSIWYG.PATH', $this->CONF['editor']['path']); + $this->EDITOR->setFieldValue ('EDITOR.WYSIWYG.PRE', $this->EDITOR->getFieldValue('WYSIWYG.PRE.'.$this->CONF['editor']['tpl'])); + $this->EDITOR->setFieldValue ('WYSIWYG.INPUT', $this->EDITOR->getFieldValue('WYSIWYG.INPUT.'.$this->CONF['editor']['tpl'])); return $this->EDITOR->process('EDITOR.INPUTWYSIWYG'); break; @@ -454,7 +457,7 @@ **/ function __processFile($x) { // get temporary name for contentfile - $tempname = tempnam ($this->docroot.$this->CONF['editor']['tempdir'], 'editor'); + $tempname = tempnam ($this->docroot.$this->CONF['config']['tempdir'], 'editor'); // save content in temporary file $this->__saveFile($x, $tempname); $this->__backupFile ($this->editfile) ; @@ -493,25 +496,27 @@ } // not a file - if (!is_file($this->docroot.$this->CONF['imagebox']['imgpath'].'/'.$file)) { + if (!is_file($this->docroot.$this->CONF ['imagebox']['imgpath'].'/'.$file)) { continue; } // not a supported imagetype - if (!in_array (strtolower (substr ($file, strrpos ($file, '.') + 1)), $this->CONF['imagebox']['filter']['ext'])) { + if (!in_array (strtolower (substr ($file, strrpos ($file, '.') + 1)), $this->CONF ['imagebox']['filter'])) { + echo '1'; continue; } // check for thumbnail file - if (!file_exists($this->docroot.$this->CONF['imagebox']['thumbpath'].'/'.$file)) { - $IMG = new cImage($this->docroot.$this->CONF['imagebox']['imgpath'].'/'.$file); + if (!file_exists($this->docroot.$this->CONF ['imagebox']['thumbpath'].'/'.$file)) { + $IMG = new cImage($this->docroot.$this->CONF ['imagebox']['imgpath'].'/'.$file); if ($IMG->ok == false) { unset ($IMG); + echo '2'; continue; } $IMG->__resizeMaxLength($this->CONF['imagebox']['preview']['width'] > $this->CONF['imagebox']['preview']['height'] ? $this->CONF['imagebox']['preview']['width'] : $this->CONF['imagebox']['preview']['height']); $IMG->fileImage($this->docroot.$this->CONF['imagebox']['thumbpath'].'/'.$file); - @chmod ($this->docroot.$this->CONF['imagebox']['thumbpath'].'/'.$file, octdec($this->CONF['editor']['chmod'])); + @chmod ($this->docroot.$this->CONF['imagebox']['thumbpath'].'/'.$file, octdec($this->CONF['config']['chmod'])); unset ($IMG); } @@ -646,9 +651,44 @@ } // parse configfile into array - $conf = &new XML_Unserializer(); - $conf->unserialize($this->configfile, true); - $this->CONF = $conf->getUnserializedData(); + $conf = new XML_Tree ($this->configfile, true); + $data =& $conf->getTreeFromFile (); + + foreach ($data->children as $element) { + switch ($element->name) { + case 'imagebox': + $this->CONF ['imagebox'] = $element->attributes; + foreach ($element->children as $imgboxdata) { + if ($imgboxdata->name == 'preview') { + $this->CONF ['imagebox']['preview'] = $imgboxdata->attributes; + } + + if ($imgboxdata->name == 'filter') { + $this->CONF ['imagebox']['filter'] = array (); + foreach ($imgboxdata->children as $filter) { + $this->CONF ['imagebox']['filter'][] = $filter->content; + } + } + + } + break; + case 'script': + $this->CONF['scriptlist'][] = $element->attributes; + break; + case 'config': + $this->CONF['config'][$element->attributes ['id']] = $element->attributes ['value']; + break; + default: + $this->CONF[$element->name][$element->attributes ['id']] = $element->attributes; + break; + + } + } + if (DEBUG) { + echo '<!--'; + print_r($this->CONF); + echo '-->'; + } return true; } @@ -656,15 +696,12 @@ * check for uploaded files **/ function __parseUploadFile () { - global - $HTTP_POST_FILES, - $HTTP_SERVER_VARS; // initialize upload-object $upload = new HTTP_Upload('de'); // get upload-data - $file = $upload->getFiles('editform'); + $file = $upload->getFiles('input-upload'); // save error-message if (PEAR::isError($file)) { Index: class.image.php =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/include/class.image.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.image.php 21 May 2004 21:13:02 -0000 1.5 +++ class.image.php 2 Jul 2004 17:41:25 -0000 1.6 @@ -338,6 +338,7 @@ function __getSupportedImageTypes() { $types = array ('jpeg', 'png', 'gif', 'wbmp', 'swf'); + $support = array (); foreach ($types as $type) { if (function_exists('image'.$type)) { $support[] = $type; Index: class.phpcmsMenu.php =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/include/class.phpcmsMenu.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class.phpcmsMenu.php 21 May 2004 21:13:02 -0000 1.8 +++ class.phpcmsMenu.php 2 Jul 2004 17:41:25 -0000 1.9 @@ -200,9 +200,6 @@ $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); } |
From: Martin J. <mj...@us...> - 2004-07-02 17:41:34
|
Update of /cvsroot/phpcms-plugins/onlineEditor4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26107 Modified Files: Changelog editor.conf.xml editor.js editor.php editor.tpl.xml Log Message: general update Index: editor.conf.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/editor.conf.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- editor.conf.xml 21 May 2004 21:12:55 -0000 1.2 +++ editor.conf.xml 2 Jul 2004 17:41:24 -0000 1.3 @@ -1,81 +1,17 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- @version: $Id$ --> +<?xml version="1.0" encoding="iso-8859-1"?> <onlineeditor> - <contentfield> - <id>PROJECT</id> - <type>project</type> - <displayever>1</displayever> - </contentfield> - <contentfield> - <id>MENU</id> - <type>menu</type> - <displayever>1</displayever> - </contentfield> - <contentfield> - <id>TITEL</id> - <type>text</type> - <displayever>1</displayever> - </contentfield> - <contentfield> - <id>KOLUMNE</id> - <type>textarea</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>CONTENT1</id> - <type>wysiwyg</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>SCRIPT1</id> - <type>script</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>CONTENT2</id> - <type>wysiwyg</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>SCRIPT2</id> - <type>script</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>CONTENT</id> - <type>wysiwyg</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>SCRIPT</id> - <type>script</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>FOOTER</id> - <type>textarea</type> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>BILD</id> - <type>image</type> - <imgpath>/photos/big/</imgpath> - <thumbpath>/photos/thumb/</thumbpath> - <preview> - <width>200</width> - <height>200</height> - </preview> - <displayever>0</displayever> - </contentfield> - <contentfield> - <id>BILDDATUM</id> - <type>date</type> - <format>%DD.%MM.%YYYY</format> - <displayever>0</displayever> - </contentfield> - <imagebox> - <thumbpath>/photos/thumb/</thumbpath> - <imgpath>/photos/big/</imgpath> + <contentfield id="PROJECT" type="project" displayever="1" /> + <contentfield id="MENU" type="menu" displayever="1" /> + <contentfield id="TITEL" type="text" displayever="1" /> + <contentfield id="KOLUMNE" type="textarea" displayever="0" /> + <contentfield id="CONTENT1" type="wysiwyg2" displayever="0" /> + <contentfield id="SCRIPT1" type="script" displayever="0" /> + <contentfield id="CONTENT2" type="wysiwyg2" displayever="0" /> + <contentfield id="SCRIPT2" type="script" displayever="0" /> + <contentfield id="CONTENT" type="wysiwyg2" displayever="0" /> + <contentfield id="SCRIPT" type="script" displayever="0" /> + <contentfield id="FOOTER" type="textarea" displayever="0" /> + <imagebox thumbpath="/photos/thumb/" imgpath="/photos/big/"> <filter> <ext>jpeg</ext> <ext>jpg</ext> @@ -83,44 +19,16 @@ <ext>gif</ext> <ext>bmp</ext> </filter> - <preview> - <width>200</width> - <height>200</height> - </preview> - </imagebox> - <script> - <name>Fehlerseiten Skript</name> - <path>$plugindir/error4phpCMS/error4phpcms.php</path> - <title>Komfortable Fehleranzeige</title> - </script> - <script> - <name>FormMailer</name> - <path>$plugindir/formular4phpCMS/formular.php</path> - <title>Formmailer</title> - </script> - <script> - <name>Gaestebuch Ausgabe</name> - <path>$plugindir/guestbook4phpCMS/view.php</path> - <title>XML-basiertes Gaestebuchskript</title> - </script> - <script> - <name>Gaestebuch Eingabe</name> - <path>$plugindir/guestbook4phpCMS/new.php</path> - <title>XML-basiertes Gaestebuchskript</title> - </script> - <wysiwyg> - <id>htmlarea</id> - <tpl>HTMLAREA</tpl> - <path>/cms/plugins/htmlarea/</path> - </wysiwyg> - <wysiwyg1> - <id>htmlarea</id> - <tpl>WYSIWYM</tpl> - <path>/cms/plugins/wysiwym-editor/</path> - </wysiwyg1> - <editor> - <chmod>0606</chmod> - <tempdir>/cms/phpcms2412/temp/</tempdir> - <templatefile>editor.tpl.xml</templatefile> - </editor> + <preview width="200" height="200" /> + </imagebox> + <script name="Fehlerseiten Skript" path="$plugindir/error4phpCMS/error4phpcms.php" title="Komfortable Fehleranzeige" /> + <script name="FormMailer" path="$plugindir/formular4phpCMS/formular.php" title="Formmailer" /> + <script name="Gästebuch Ausgabe" path="$plugindir/guestbook4phpCMS/view.php" title="XML-basiertes Gästebuchskript" /> + <script name="Gästebuch Eingabe" path="$plugindir/guestbook4phpCMS/new.php" title="XML-basiertes Gästebuchskript" /> + <editor type="wysiwyg" id="htmlarea" tpl="HTMLAREA" path="/cms/plugins/htmlarea/" /> + <editor type="wysiwym" id="wysiwym" tpl="WYSIWYM" path="/cms/plugins/wysiwym-editor/" /> + <editor type="wysiwyg1" id="fckeditor" tpl="FCKEDITOR" path="/cms/plugins/fckeditor/" /> + <config id="chmod" value="0606" /> + <config id="tempdir" value="/cms/phpcms2412/temp/" /> + <config id="templatefile" value="editor.tpl.xml" /> </onlineeditor> \ No newline at end of file Index: Changelog =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/Changelog,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Changelog 16 May 2004 22:35:57 -0000 1.2 +++ Changelog 2 Jul 2004 17:41:24 -0000 1.3 @@ -1,3 +1,7 @@ +Juli 2 2004 (mjahn) + * make the editor independent from PEAR::XML_Unserializer + * disabled the user-checking due to function-probs + May 16 2004 (mjahn) * refactoring of class.ext_editor.php * renamed oe_config.xml into editor.conf.xml Index: editor.js =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/editor.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- editor.js 21 May 2004 21:12:55 -0000 1.2 +++ editor.js 2 Jul 2004 17:41:24 -0000 1.3 @@ -158,20 +158,53 @@ } } -function toggle_area(divid) { - if (document.getElementById(divid)) { - if (document.getElementById(divid).style.display == "block") { - document.getElementById(divid).style.display = "none"; - } else { - document.getElementById(divid).style.display = "block"; +var tabs = new Array (); + +/** +* display a tab and hide all other tabs +**/ +function displayTab (id) { + var i = 0; + num = tabs.length; + for (i = 0; i < num; i++) { + if (tabs [i] != id) { + hideTab (tabs [i]); +/* alert ('hideTab (' + tabs [i] + ')');*/ + continue; } + showTab (tabs [i]); +/* alert ('showTab (' + tabs [i] + ')');*/ } } -window.onload = function onload_toggle() { - toggle_area("new"); - toggle_area("open"); - toggle_area("delete"); - toggle_area("image"); - toggle_area("upload"); +/** +* helper-function to hide a tab +**/ +function hideTab (id) { + document.getElementById (id).style.display = 'none'; +} + +/** +* helper-function to display a tab +**/ +function showTab (id) { + document.getElementById (id).style.display = 'block'; +} + +/** +* register a tabbox +**/ +function registerTab (id) { + tabs.push (id); +} + +window.onload = function onloadHide () { + registerTab ('new'); + registerTab ('open'); + registerTab ('delete'); + registerTab ('upload'); + registerTab ('image'); + + displayTab ('xyz'); } + Index: editor.tpl.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/editor.tpl.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- editor.tpl.xml 21 May 2004 21:12:55 -0000 1.2 +++ editor.tpl.xml 2 Jul 2004 17:41:24 -0000 1.3 @@ -1,7 +1,7 @@ /** * @package editor * @author Martin Jahn <mj...@us...> -* @author Jan Tank (zeek) <> +* @author Jan Tank (zeek) <ze...@us...> * @copyright (c) Copyright by Martin Jahn * @license GPL * @version $Id$ @@ -17,11 +17,11 @@ <span>User: <span>{USER.NAME}</span> (<a href="{SELF}?logout=logout">Abmelden</a>) | aktuelle Datei: <span>{FILE.NAME}</span> <span>{FILE.CTIME}</span></span> </label> <div class="label"> - <input type="button" name="editor-newfile" class="editor-newfile" onclick="toggle_area('new')" value="Neue Datei anlegen" /> - <input type="button" name="editor-openfile" class="editor-openfile" onclick="toggle_area('open')" value="Datei zum Editieren öffnen" /> + <input type="button" name="editor-newfile" class="editor-newfile" onclick="displayTab('new')" value="Neue Datei anlegen" /> + <input type="button" name="editor-openfile" class="editor-openfile" onclick="displayTab('open')" value="Datei zum Editieren öffnen" /> <input type="submit" name="editor-savefile" class="editor-savefile" value="Datei speichern" /> - <input type="button" name="editor-delfile" class="editor-delfile" onclick="toggle_area('delete')" value="Datei löschen" /> - <input type="submit" name="editor-saveexit" class="editor-exit" value="Speichern und Datei schließen" /> + <input type="button" name="editor-delfile" class="editor-delfile" onclick="displayTab('delete')" value="Datei löschen" /> + <input type="submit" name="editor-saveexit" class="editor-exit" value="Speichern und Datei schließen" /> </div> {EDITOR.ERROR} <div id="new" style="display:block;"> @@ -31,22 +31,22 @@ <input type="text" name="input-newfile" id="input-newfile" /> </label> <label for="input-template"> - <span><a href="{HELP}#selectstyle" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Vorlage wählen</a></span> + <span><a href="{HELP}#selectstyle" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Vorlage wählen</a></span> <select name="input-template" id="input-template"> {EDITOR.TPLSELECT} </select> </label> <label for="input-newmenu"> - <span><a href="{HELP}#selectdoc" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Menüpunkt auswählen</a></span> + <span><a href="{HELP}#selectdoc" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Menüpunkt auswählen</a></span> <select name="input-newmenu" id="input-newmenu"> {MENUS} </select> </label> <div class="label"> - <input type="radio" name="input-newmenu-position" id="input-newmenu-position" value="before" /><span>davor einfügen</span> + <input type="radio" name="input-newmenu-position" id="input-newmenu-position" value="before" /><span>davor einfügen</span> </div> <div class="label"> - <input type="radio" name="input-newmenu-position" id="input-newmenu-position" value="after" selected="selected" /><span>dahinter einfügen</span> + <input type="radio" name="input-newmenu-position" id="input-newmenu-position" value="after" selected="selected" /><span>dahinter einfügen</span> </div> <label for="input-newfile-submit"> <input type="submit" name="input-newfile-submit" id="input-newfile-submit" class="editor-newfile" value="Datei anlegen" /> @@ -56,7 +56,7 @@ <div id="open" style="display:block;"> <h3>Dokument öffnen und editieren</h3> <label for="input-openfile"> - <span><a href="{HELP}#selectdoc" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Dokument auswählen</a></span> + <span><a href="{HELP}#selectdoc" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Dokument auswählen</a></span> <select name="input-openfile" id="input-openfile"> {MENUS1} </select> @@ -69,7 +69,7 @@ <div id="delete" style="display:block;"> <h3>Dokument löschen</h3> <label for="input-delfile"> - <span><a href="{HELP}#del" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Dokument auswählen</a></span> + <span><a href="{HELP}#del" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Dokument auswählen</a></span> <select name="input-delfile" id="input-delfile"> {MENUS} </select> @@ -94,20 +94,20 @@ {EDITOR.EDIT.TPL} <!--// Fehlermeldungen und Hinweise: Template ist unter EDITOR.ERROR.TPL //--> {EDITOR.MESSAGE} - <!--// Project- und Menüauswahl: Template ist unter EDITOR.FILELIST.TPL //--> + <!--// Project- und Men�auswahl: Template ist unter EDITOR.FILELIST.TPL //--> <fieldset> <legend>Contentfelder ändern</legend> {EDITOR.FILEEDIT} - <!--// Menü-Eingabefelder: Template ist unter EDITOR.EDITMENU.TPL //--> + <!--// Men�-Eingabefelder: Template ist unter EDITOR.EDITMENU.TPL //--> {EDITOR.MENUEDIT} <!--// Content-Eingabefelder: Template ist unter EDITOR.CONTENTEDIT.TPL //--> {EDITOR.CONTENTEDIT} <div class="label"> <input type="submit" name="editor-savefile" class="editor-savefile" value="Datei speichern" /> <input type="reset" name="editor-reset" class="editor-reset" value="Änderungen rückgängig" /> - <input type="button" name="editor-image" class="editor-insertimage" onclick="toggle_area('image')" value="Bild einfügen" /> - <input type="button" name="editor-upload" class="editor-upload" onclick="toggle_area('upload')" value="Bild hochladen" /> - <input type="submit" name="editor-saveexit" class="editor-exit" value="Speichern und Datei schließen" /> + <input type="button" name="editor-image" class="editor-insertimage" onclick="displayTab('image')" value="Bild einfügen" /> + <input type="button" name="editor-upload" class="editor-upload" onclick="displayTab('upload')" value="Bild hochladen" /> + <input type="submit" name="editor-saveexit" class="editor-exit" value="Speichern und Datei schließen" /> </div> <!-- Bildauswahl-Abteilung: Template ist unter EDITOR.IMAGEEDIT.TPL --> {EDITOR.IMAGEEDIT} @@ -130,28 +130,28 @@ <label for="input-content-PROJECT"> <span><a href="{HELP}#projektfile" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Projektdatei</a></span> <select name="input-content-PROJECT" id="input-content-PROJECT"> - <option value="">Projektdatei wählen...</option> + <option value="">Projektdatei wählen...</option> {PROJECTS} </select> </label> <label for="input-content-MENU"> <span><a href="{HELP}#menufile" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">Menüeintrag</a></span> <select name="input-content-MENU" id="input-content-MENU"> - <option value="">Menüpunkt wählen...</option> + <option value="">Menüpunkt wählen...</option> {MENUS} </select> </label> {EDITOR.MENUEDIT.TPL} - <h3>Menüeintrag ändern</h3> + <h3>Menüeintrag ändern</h3> <input type="hidden" name="input-menu-CLASS" id="input-menu-CLASS" value="{MENU.ACTUAL.CLASS}" /> {EDITOR.MENUENTRIES} {EDITOR.CONTENTEDIT.TPL} <h3>Contentfelder</h3> - <!-- Template für <input type="text"> unter EDITOR.INPUTTEXT: Template für <textarea> unter EDITOR.INPUTAREA --> + <!-- Template für <input type="text"> unter EDITOR.INPUTTEXT: Template f�r <textarea> unter EDITOR.INPUTAREA --> {EDITOR.INPUT} @@ -163,7 +163,7 @@ <label for="input-preview-select"> <span>Bild auswählen</span> <select size="10" name="input-preview-select" id="input-preview-select" onchange="selectImage()"> - <!-- Template für <option> unter EDITOR.IMAGELIST.TPL --> + <!-- Template f�r <option> unter EDITOR.IMAGELIST.TPL --> {EDITOR.IMAGELIST} </select> </label> @@ -171,18 +171,18 @@ <img src="/img/preview.png" width="200" width="200" id="input-preview-image" name="input-preview-image" alt="Vorschau" /> </div> <label for="input-preview-size"> - <span>Bildgröße</span> + <span>Bildgröße</span> <input type="text" id="input-preview-size" name="input-preview-size" class="short" value="" readonly="readonly" /> </label> <label for="input-preview-filesize"> - <span>Dateigröße</span> + <span>Dateigröße</span> <input type="text" id="input-preview-filesize" name="input-preview-filesize" class="short" value="" readonly="readonly" /> </label> <label for="input-preview-filectime"> - <span>letzte Änderung</span> + <span>letzte Änderung</span> <input type="text" id="input-preview-filectime" name="input-preview-filectime" class="short" value="" readonly="readonly" /> </label> - <!-- Template für <input type="radio"> unter EDITOR.CONTENTSELECTOR.TPL --> + <!-- Template für <input type="radio"> unter EDITOR.CONTENTSELECTOR.TPL --> {EDITOR.CONTENTSELECTOR} <label for="input-preview-select-submit"> <input type="button" name="input-preview-select-submit" id="input-preview-select-submit" class="editor-insertimage" onclick="return insertImg();" value="Bild einfügen" /> @@ -210,7 +210,7 @@ <span><a href="{HELP}#inputtext" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">{INPUT.ID}</a></span> <input type="text" name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}" value="{INPUT.VALUE}" /> </label> -{EDITOR.INPUTSCRIPT} <label for="input-content-{INPUT.ID}"><span>{INPUT.ID}</span><select name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}"><option>Skript wählen...</option>{SCRIPTS}</select></label> +{EDITOR.INPUTSCRIPT} <label for="input-content-{INPUT.ID}"><span>{INPUT.ID}</span><select name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}"><option>Skript wählen...</option>{SCRIPTS}</select></label> {EDITOR.INPUTAREA} <label for="input-content-{INPUT.ID}"> <span><a href="{HELP}#inputtextarea" onclick="return pop(this,'width=350,height=500,scrollbars,resizable','Hilfe');" onkeypress="verifyKey(this,event);">{INPUT.ID}</a></span> <textarea name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}" rows="20" cols="40">{INPUT.VALUE}</textarea> @@ -238,10 +238,10 @@ </label> {EDITOR.ERROR.TPL} <div class="label">{ERROR}</label> -{EDITOR.ERROR.OPEN}<span class="error">Datei <q>{ERROR.FILE}</q> konnte nicht geöffnet werden.</span> +{EDITOR.ERROR.OPEN}<span class="error">Datei <q>{ERROR.FILE}</q> konnte nicht geöffnet werden.</span> {EDITOR.ERROR.SAVE}<span class="error">Datei <q>{ERROR.FILE}</q> konnte nicht gespeichert werden.</span> -{EDITOR.ERROR.DEL}<span class="error">Datei <q>{ERROR.FILE}</q> konnte nicht gelöscht werden.</span> -{EDITOR.ERROR.NONE}<span class="error">Es ist ein Fehler aufgetreten. Die gewünschte Aktion konnte nicht durchgeführt werden.</span> +{EDITOR.ERROR.DEL}<span class="error">Datei <q>{ERROR.FILE}</q> konnte nicht gelöscht werden.</span> +{EDITOR.ERROR.NONE}<span class="error">Es ist ein Fehler aufgetreten. Die gewünschte Aktion konnte nicht durchgeführt werden.</span> {WYSIWYG.PRE.HTMLAREA} <!-- Editorfunktionen --> @@ -259,6 +259,16 @@ {WYSIWYG.INPUT.HTMLAREA} <textarea name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}" rows="20" cols="40">{INPUT.VALUE}</textarea> <script language='javascript1.2'>HTMLArea.replace('input-content-{FIELD}')</script> +{WYSIWYG.PRE.FCKEDITOR} +<!-- load the main FCKEditor files --> +<script type="text/javascript" src="{WYSIWYG.PATH}/fckeditor.js"></script> + +{WYSIWYG.INPUT.FCKEDITOR} <textarea name="input-content-{INPUT.ID}" id="input-content-{INPUT.ID}" rows="20" cols="40">{INPUT.VALUE}</textarea> +<script type="text/javascript"> + var oFCKEditor = new FCKEditor ('input-content-{FIELD}'); + oFCKEditor.ReplaceTextarea (); +</script> + {WYSIWYG.PRE.WYSIWYM} <script type="text/javascript" src="{WYSIWYG.PATH}/online-editor.js"></script> Index: editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/onlineEditor4phpCMS/editor.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- editor.php 21 May 2004 21:12:55 -0000 1.11 +++ editor.php 2 Jul 2004 17:41:24 -0000 1.12 @@ -1,6 +1,6 @@ <?php /** -* Editor - Erweiterter Online-Editor für phpCMS +* Editor - Erweiterter Online-Editor für phpCMS * * Dieses Plugin/Skript veroeffentliche ich so wie es ist und gebe deshalb auch keinerlei Garantie, * dass es richtig funktioniert. Ausserdem uebernehme ich keinerlei Haftung fuer eventuelle durch @@ -9,16 +9,16 @@ * Falls du Verbesserungsvorschlaege oder Wuensche bezueglich des Skriptes hast melde dich bei * Martin Jahn <mj...@us...> * -* Dieses Script ist kostenlos für private und kommerzielle Nuzung. +* Dieses Script ist kostenlos für private und kommerzielle Nuzung. * Es wird unter den Bedingungen der GNU General Public License, wie von der Free * Software Foundation herausgegeben, verteilt. Eine Kopie der GPL sollte im Zip-File * enthalten sein. Das Script darf (im Rahmen der GPL) nach belieben genutzt, weiter- * gegeben und modifiziert werden. Dieser Copyright-Hinweis muss jedoch in jedem Fall -* unverändert im Script belassen werden. +* unverändert im Script belassen werden. * -* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses -* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit -* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, +* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses +* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit +* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, * Verbesserungsvorschläge oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. * * @package editor @@ -31,11 +31,16 @@ if (!defined('DEBUG')) { define ('DEBUG', false); } +if (DEBUG) { + error_reporting (E_ALL); +} + $is_phpcms = isset($GLOBALS['PHPCMS']); +ini_set ('include_path', dirname (__FILE__).'/pear/:'.ini_get ('include_path')); // import the user-permission-managment from global namespace -global $a; +//global $a; setlocale (LC_TIME, 'de'); // only for non-phpcms call if (!$is_phpcms) { @@ -48,15 +53,27 @@ </head> <body> <?php - include_once (dirname(__FILE__).'/../user4phpCMS/auth_script.php'); + //include_once (dirname(__FILE__).'/auth_script.php'); $GLOBALS['DEFAULTS']->PROJECTFILENAME = $_SERVER['DOCUMENT_ROOT'].'/cms/templates/home.ini'; } // check if user is logged in -if (!$a->isLoggedIn()) { - return false; +//if (!$a->isLoggedIn()) { + //return false; +//} + +if (DEBUG) { + echo '<!--'."\n"; + echo 'POST'."\n"; + print_r($_POST); + echo 'POST'."\n"; + print_r ($_GET); + echo 'FILES'."\n"; + print_r ($_FILES); + echo '-->'; + } // import online-editor class |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:40
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/user Modified Files: class.module_user.php Log Message: module filemanager and editor included Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_user.php 5 Jun 2004 12:44:23 -0000 1.4 +++ class.module_user.php 18 Jun 2004 15:17:01 -0000 1.5 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.5 2004/06/18 15:17:01 mjahn +* module filemanager and editor included +* * Revision 1.4 2004/06/05 12:44:23 mjahn * separated layout-files * @@ -48,6 +51,22 @@ /** * Class for user- and permission-managment * +* <p> +* The class module_user uses {@link http://pear.php.net/packages/LiveUser PEAR::LiveUser} +* for managing the user-accounts and the permissions. LiveUser can use several sources +* for user- and permission-data. See {@link http://pear.php.net/packages/LiveUser/docs LiveUser-Manual} +* for details. +* </p> +* <p> +* This module <b>provides</b> some events for use in the other modules: +* </p> +* <ul> +* <li><b>USER_GET_DATA</b> provides the user-data (see {@link getUserData() getUserData} for details)</li> +* <li><b>USER_GET_STATUS</b> provides status-information about the user logged in +* (see {@link getUserData() getUserData} for details)</li> +* <li><b>USER_SET_DATA</b> set the user-data in the db (see {@link setUserData() setUserData} for details)</li> +* </ul> +* * @package admin4phpCMS * @subpackage module_user * @todo Get the class work completly @@ -60,6 +79,11 @@ **/ var $_USER; + /** + * Initialization of the module + * + * The module registers its own events and connects his methods to some actions + **/ function init () { $liveuserConfig = array( 'session' => array('name' => 'PHPSESSID','varname' => 'loginInfo'), @@ -95,15 +119,24 @@ $this->_registerAction ('doSetUserData', 'setUserData'); $this->_registerEvent ('USER_GET_STATUS', 'doGetUserStatus'); $this->_registerAction ('doGetUserStatus', 'getUserStatus'); + + return true; } + /** + * Parse the URI-params + * + * @param array $actiondata $actiondata contains the URI-param-arrays + **/ function parseParam (&$actiondata) { $logout = false; $username = ''; $password = ''; if (isset ($actiondata['post']['logout'])) { $logout = true; + unset ($_POST['logout']); } elseif (isset ($actiondata['get']['logout'])) { + unset ($_GET['logout']); $logout = true; } $passwd = ''; @@ -125,16 +158,25 @@ if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } + return true; } + /** + * Process-methode of the module + * + * @param array $actiondata + **/ function process (&$actiondata) { + return true; } - function getUserStatus (&$actiondata) { - $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); - } + /** + * Get content for mainmenu + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getMenuMain (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { return true; @@ -142,8 +184,15 @@ $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Benutzerverwaltung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + return true; } + + /** + * Get submenu of module + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getMenuSub (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { return true; @@ -166,8 +215,14 @@ $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + return true; } + /** + * Get content of the module + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getContent (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { @@ -176,7 +231,7 @@ $actiondata = array ('_id'=>'benutzerlogin', '_root'=>$root, '_type'=>'headline', 'content'=>'Benutzerlogin', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>'', 'action'=>'index.php'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>'method', '_type'=>'form_input_hidden', 'value'=>'post', 'name'=>'method','_root'=>'loginform', 'id'=>'', 'class'=>''); @@ -190,14 +245,19 @@ $actiondata = array ('_id'=>'submit', '_type'=>'form_button', 'value'=>'Absenden', 'name'=>'submit','text'=>'Absenden', '_root'=>'loginform', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - return; + return true; } if (!$this->display) { return true; } - + return true; } + /** + * Get content for statusbar + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getContentBar (&$actiondata) { if ($this->_USER->isLoggedIn ()) { @@ -206,12 +266,59 @@ $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); } - + return true; + } + + /** + * Get content for statusbar + * + * This function provides the following information about the user-status + * <ul> + * <li><b>$actiondata['isLoggedIn']</b> is the user logged in</li> + * </ul> + * + * @param array $actiondata + **/ + function getUserStatus (&$actiondata) { + $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); + return true; } + + /** + * Get userdata from the user-array + * + * This function provides the following information about the user + * <ul> + * <li><b>$actiondata['']</b> contains</li> + * </ul> + * + * @param array $actiondata + **/ function getUserData (&$actiondata) { + return true; } + /** + * Set userdata in the user-array + * + * @param array $actiondata + **/ function setUserData (&$actiondata) { + return true; + } + + /** + * + **/ + function displayUserList ($list, $template) { + if (!is_array ($list)) { + return true; + } + + $num = count ($list); + for ($i = 0; $i < num; $i++ ) { + + } } } |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:39
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/include Modified Files: class.eventhandler.php class.framework.php Log Message: module filemanager and editor included Index: class.framework.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.framework.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- class.framework.php 4 Jun 2004 11:32:07 -0000 1.6 +++ class.framework.php 18 Jun 2004 15:16:59 -0000 1.7 @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.7 2004/06/18 15:16:59 mjahn +* module filemanager and editor included +* * Revision 1.6 2004/06/04 11:32:07 mjahn * several changes * @@ -49,7 +52,6 @@ /** * include the necessary files **/ -include_once (dirname(__FILE__).'/class.actionhandler.php'); include_once (dirname(__FILE__).'/class.eventhandler.php'); include_once (dirname(__FILE__).'/class.module.php'); @@ -60,7 +62,7 @@ function run () { global $ACTION; - $this->eventhandler =& new eventHandler (new actionHandler ()); + $this->eventhandler =& new eventHandler (); // register some necessary events and actions $actiondata = array ('actionname'=>'doLoadModule', 'class'=>'actionHandler', 'method'=>'loadModule'); Index: class.eventhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.eventhandler.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.eventhandler.php 4 Jun 2004 11:32:07 -0000 1.5 +++ class.eventhandler.php 18 Jun 2004 15:16:59 -0000 1.6 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.6 2004/06/18 15:16:59 mjahn +* module filemanager and editor included +* * Revision 1.5 2004/06/04 11:32:07 mjahn * several changes * @@ -41,6 +44,10 @@ * */ /** +* include the actionhandler-class +**/ +include_once (dirname(__FILE__).'/class.actionhandler.php'); +/** * eventhandler-class * * The eventhandler-class hides the managment of the events and correspondending action from the framework @@ -63,8 +70,8 @@ * @param actionhandler $actionhandler saves the reference to the actionhandler-object * @ignore **/ - function eventHandler (&$actionhandler) { - return $this->__construct ($actionhandler); + function eventHandler () { + return $this->__construct (); } /** @@ -73,8 +80,8 @@ * @param actionhandler $actionhandler referenze to the actionhandler-object * @ignore **/ - function __construct (&$actionhandler) { - $this->_actionHandler =& $actionhandler; + function __construct () { + $this->_actionHandler =& new actionHandler (); $this->_events['REGISTER_ACTION'] = 'doRegisterAction'; $this->_events['REGISTER_EVENT'] = 'doRegisterEvent'; $this->_actionHandler->_objects['eventHandler'] =& $this; |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:38
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241 Modified Files: Changelog index.php Log Message: module filemanager and editor included Index: Changelog =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/Changelog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Changelog 5 Jun 2004 12:44:22 -0000 1.5 +++ Changelog 18 Jun 2004 15:16:58 -0000 1.6 @@ -1,3 +1,8 @@ +June 18 2004 (mjahn) + * integrated filemanager (simple variant) + * integrated editor for XML and for text + * enhanced functionality of module layout + June 6 2004 (mjahn) * separated layout for framework and layout-elements for the modules into layout.tpl and layout.xml for better handling of module_layout Index: index.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.php 4 Jun 2004 11:32:07 -0000 1.4 +++ index.php 18 Jun 2004 15:16:58 -0000 1.5 @@ -1,6 +1,6 @@ <?php /** -* Admin4phpCMS - modulare administration-gui +* Admin4phpCMS - a modular administration-gui * * This script contains a modulare framework for several module. * This software was written to make the administration of a website as easy @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.5 2004/06/18 15:16:58 mjahn +* module filemanager and editor included +* * Revision 1.4 2004/06/04 11:32:07 mjahn * several changes * @@ -48,20 +51,30 @@ /** * Defines wether the debug-module shows its data or not **/ -define ('DEBUG', true); +define ('DEBUG', false); /** -* PEAR-Pakete einbinden +* Set the path for including the pear-packages **/ ini_set ('include_path', realpath(dirname(__FILE__).'/../pear/').'/:'.ini_get('include_path')); /** -* Einbindung der Framwork-Klasse +* Include the framework-class **/ include_once (dirname(__FILE__).'/include/class.framework.php'); +/** +* Initialize a new framework +**/ $a = new framework(); + +/** +* Run the framework +**/ $a->run(); +/** +* Clear the variable-scope +**/ unset ($a); ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:27
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/filemanager Modified Files: class.module_filemanager.php Added Files: class.file_util.php config.filemanager.php Log Message: module filemanager and editor included Index: class.module_filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.module_filemanager.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_filemanager.php 5 Jun 2004 12:44:22 -0000 1.2 +++ class.module_filemanager.php 18 Jun 2004 15:17:00 -0000 1.3 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.3 2004/06/18 15:17:00 mjahn +* module filemanager and editor included +* * Revision 1.2 2004/06/05 12:44:22 mjahn * separated layout-files * @@ -37,12 +40,17 @@ * several changes * */ + +/** +* Include the file-utility-class +**/ +include_once (dirname (__FILE__).'/class.file_util.php'); /** * Filemanager-class for administrative work in the filesystem * * @package admin4phpCMS * @subpackage module_filemanager -* @todo Get the class working correctly +* @uses file_editor **/ class module_filemanager extends module { @@ -51,66 +59,123 @@ // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doProcess', 'process'); - $this->_registerAction ('doParseMenuMain', 'getMenuMain'); - $this->_registerAction ('doParseStatusbar', 'getContentBar'); - $this->_registerAction ('doParseMenuSub', 'getMenuSub'); - $this->_registerAction ('doParseContent', 'getContent'); + $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); + $actiondata = array ('module'=>'filemanager'); + $this->_callEvent ('CONFIG_GET', $actiondata); + $this->CONF =& $actiondata ['config']; + include_once (dirname (__FILE__).'/config.filemanager.php'); } + + /** + * @param array $actiondata + **/ function parseParam (&$actiondata) { $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'filemanager'); - $this->action = ''; + $this->viewdir = $this->viewfile = $this->editfile = $this->action = ''; if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } + + $this->basedir = '/'; + if (isset ($actiondata['request']['basedir'])) { + $this->basedir = $actiondata['request']['basedir']; + } + + if ($this->action == 'viewfile' && isset ($actiondata['request']['file'])) { + $this->viewfile = $actiondata['request']['file']; + } + + if ($this->action == 'viewdir' && isset ($actiondata['request']['file'])) { + $this->viewdir = $actiondata['request']['file']; + } + + if ($this->action == 'editfile' && isset ($actiondata['request']['file'])) { + $this->editfile = $actiondata['request']['file']; + } + + 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 = '/'; + $actiondata = array ('errortext'=>'Das Verzeichnis liegt außerhalb des zugelassenen Bereiches!'); + $this->_callEvent ('ERROR_NOTICE', $actiondata); + } else { + $this->basedir = str_replace ($this->docroot, '', $this->basedir); + } + $this->viewdir = ''; + } } + /** + * @param array $actiondata + **/ function process (&$actiondata) { $actiondata = array(); $this->_callEvent ('USER_GET_STATUS', $actiondata); $this->_USER = $actiondata; - } - - function getMenuMain (&$actiondata) { + if (!$this->_USER['isLoggedIn']) { return true; } + + $this->_registerAction ('doParseMenuMain', 'getMenuMain'); + + if (!$this->display) { + return true; + } + + + $this->_registerAction ('doParseStatusbar', 'getContentBar'); + $this->_registerAction ('doParseMenuSub', 'getMenuSub'); + switch ($this->action) { + case 'viewfile': + case 'editfile': + break; + default: + $this->_registerAction ('doParseContent', 'getFileList'); + break; + } + + } + + /** + * @param array $actiondata + **/ + function getMenuMain (&$actiondata) { $root = $actiondata['_root']; - $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu', 'id'=>'', 'class'=>'', 'params'=>''); + $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } + /** + * @param array $actiondata + **/ function getMenuSub (&$actiondata) { - if (!$this->_USER['isLoggedIn']) { - return true; - } + return true; - if (!$this->display) { - return true; - } - $root = $actiondata['_root']; - $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'files', 'id'=>'', 'class'=>'', 'param'=>'', 'action'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'files'); if ($this->action == '') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Hochladen', 'module'=>'filemanager', '_id'=>'uploads', 'action'=>'upload', 'id'=>'', 'class'=>'', 'params'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Hochladen', 'module'=>'filemanager', '_id'=>'uploads', 'action'=>'upload'); if ($this->action == 'upload') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Backups', 'module'=>'filemanager', '_id'=>'backups', 'action'=>'backup', 'id'=>'', 'class'=>'', 'params'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Backups', 'module'=>'filemanager', '_id'=>'backups', 'action'=>'backup'); if ($this->action == 'backup') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Editor', 'module'=>'filemanager', '_id'=>'editor', 'action'=>'editor', 'id'=>'', 'class'=>'', 'params'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Editor', 'module'=>'filemanager', '_id'=>'editor', 'action'=>'editor'); if ($this->action == 'editor') { $actiondata['id'] = 'current'; } @@ -118,10 +183,254 @@ } - function getContent (&$actiondata) { + /** + * @param array $actiondata + **/ + function getContentBar (&$actiondata) { } - function getContentBar (&$actiondata) { + /** + * 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) { + $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))) { + // skip selflink + if ($entry == '.') { + continue; + } + + // skip hidden files + if ($entry{0} == '.' && $entry{1} != '.') { + continue; + } + + // entry is file + if (is_file ($dir.'/'.$entry)) { + $files[] = $entry; + } + + // entry is directory + if (is_dir ($dir.'/'.$entry)) { + $dirs[] = $entry; + } + } + closedir ($dh); + sort ($dirs); + sort ($files); + $entries = array_merge ($dirs, $files); + unset ($files, $dirs); + $num = count ($entries); + + $actiondata = array ('_type'=>'headline', '_id'=>'headline', '_root'=>$root, + 'content'=>'Verzeichnis: '.htmlentities ($this->basedir)); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_type'=>'ulist', '_id'=>'filelist', '_root'=>$root, 'extra'=>'id="filelist"',); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_type'=>'filelist_entry', '_id'=>'list-0', '_root'=>'filelist', + 'extra'=>'class="header"', 'filesize'=>'Größe', 'filemtime'=>'Letzte Änderung', + 'chmod'=>'CHMOD', 'gid'=>'GID', 'uid'=>'UID'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-0', '_type'=>'image', + 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', + 'extra'=>'class="input""'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-1', '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input""'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-2', '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // set filename + $actiondata = array ('_root'=>'list-0', '_id'=>'file0', '_type'=>'inline', 'extra'=>'class="filename""', 'content'=>'Name'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $alternate = 1; + $sum_size = 0; + $num_files = 0; + $num_dirs = 0; + + for ($i = 0; $i < $num; $i++) { + $entry = $entries[$i]; + + // alternate the class of the list-items + if ($alternate == 3) { + $alternate = 1; + } + + // get stat of the entry + $data = stat ($dir.'/'.$entry); + + $file['uid'] = file_util::uid ($data[4]); + $file['gid'] = file_util::gid ($data[5]); + $file['filename'] = $entry; + $file['filemtime'] = strftime ('%d.%m.%Y %H:%M:%S', $data[9]); + $file['filectime'] = strftime ('%d.%m.%Y %H:%M:%S', $data[8]); + $file['fileatime'] = strftime ('%d.%m.%Y %H:%M:%S', $data[10]); + $file['filesize'] = file_util::filesize ($dir.'/'.$entry); + $file['chmod'] = array ('oct'=>file_util::fileperms($dir.'/'.$entry)); + // set file-list-item + $actiondata = array ( + '_type'=>'filelist_entry', '_id'=>'list-'.$entry, '_root'=>'filelist', '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']['oct'], + 'extra'=>'class="line'.$alternate++.'"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // entry is directory + if (is_dir ($dir.'/'.$entry)) { + + $nolink = false; + + // entry is parent directory + if ($entry == '..') { + $type = 'parent'; + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'img-empty-'.$entry, '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'alt'=>'', 'title'=>'', 'extra'=>'class="input" id="input""'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } else { + $num_dirs++; + $type = 'folder'; + + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'select-'.$entry, '_type'=>'form_checkbox_simple', 'id'=>'select['.$entry.']', 'name'=>'select['.$entry.']', 'value'=>'selected', 'title'=>'Auswählen', 'extra'=>'class="input"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + if (!is_executable ($dir.'/'.$entry)) { + $type = 'folder_inactive'; + $nolink = true; + } + + if (!is_readable ($dir.'/'.$entry)) { + $type = 'folder_inactive'; + $nolink = true; + } + + if (is_link ($dir.'/'.$entry)) { + $type = 'symlink'; + } + + + } + + if ($nolink) { + // set no link for open directory + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'view-'.$entry, '_type'=>'empty', 'href'=>'?moduleid=filemanager&basedir='.$this->basedir.'&file='.$entry.'&action=viewdir'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } else { + // set link for open directory + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'view-'.$entry, '_type'=>'link', 'href'=>'?moduleid=filemanager&basedir='.$this->basedir.'&file='.$entry.'&action=viewdir', 'title'=>'Verzeichnis öffnen'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } + // set image for link + $actiondata = array ('_root'=>'view-'.$entry, '_id'=>'img-view-'.$entry, '_type'=>'image', 'src'=>'modules/layout/img/filetypes/'.$type.'.gif', 'width'=>'16', 'height'=>'16', 'alt'=>'edit', 'extra'=>'class="icon"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // set distance image + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'img-empty-'.$entry, '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'alt'=>'', 'title'=>'', 'extra'=>'class="icon"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // set filename + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'file-'.$entry, '_type'=>'inline', 'extra'=>'class="filename"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + if ($nolink) { + // set no link to filename + $actiondata = array ('_root'=>'file-'.$entry, '_id'=>'file-link-'.$entry, '_type'=>'empty', 'content'=>$entry); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } else { + // set link to filename + $actiondata = array ('_root'=>'file-'.$entry, '_id'=>'file-link-'.$entry, '_type'=>'link', 'href'=>'?moduleid=filemanager&basedir='.$this->basedir.'&file='.$entry.'&action=viewdir', 'title'=>'Verzeichnis öffnen', 'content'=>$entry); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } + } + + if (is_file ($dir.'/'.$entry)) { + + $num_files++; + $sum_size += $data[7]; + + $type = 'text.gif'; + foreach ($this->FILETYPES as $filetype) { + if (eregi ($filetype[0], $entry)) { + $type = $filetype[1]; + break; + } + } + if (is_link ($dir.'/'.$entry)) { + $type = 'symlink'; + } + + $editor = 'edit'; + + // insert checkbox for selecting files + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'select-'.$entry, '_type'=>'form_checkbox_simple', 'extra'=>'id="select['.$entry.']"', 'class'=>'input', 'name'=>'select['.$entry.']', 'value'=>'selected', 'title'=>'Auswählen'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // insert view-link + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'view-'.$entry, '_type'=>'link', 'href'=>'?moduleid=filemanager&file='.$this->basedir.$entry.'&action=viewfile', 'title'=>'Datei anzeigen'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // insert image for view-link + $actiondata = array ('_root'=>'view-'.$entry, '_id'=>'img-view-'.$entry, '_type'=>'image', 'src'=>'modules/layout/img/filetypes/'.$type, 'width'=>'16', 'height'=>'16', 'alt'=>'view', 'title'=>'', 'extra'=>'class="icon"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // insert edit-link + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'edit-'.$entry, '_type'=>'link', 'href'=>'?moduleid=filemanager&file='.$this->basedir.$entry.'&action=editfile', 'title'=>'Datei editieren'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // insert image for edit-link + $actiondata = array ('_root'=>'edit-'.$entry, '_id'=>'img-edit-'.$entry, '_type'=>'image', 'src'=>'modules/layout/img/'.$editor.'.gif', 'width'=>'16', 'height'=>'16', 'alt'=>'edit', 'title'=>'', 'extra'=>'class="icon"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // set filename + $actiondata = array ('_root'=>'list-'.$entry, '_id'=>'file-'.$entry, '_type'=>'inline', 'extra'=>'class="filename"', 'content'=>$entry); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } + } + $actiondata = array ('_type'=>'filelist_entry', '_id'=>'list1', '_root'=>'filelist', + 'extra'=>'class="header"', 'filename'=>$num_dirs.' Verzeichnisse', 'filesize'=>$sum_size, 'filemtime'=>$num_files.' Dateien', + 'chmod'=>'', 'gid'=>'', ''=>'UID'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list1', '_id'=>'list-img0', '_type'=>'image', + 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', + 'extra'=>'class="input"'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list1', '_id'=>'list-img1', '_type'=>'image', + 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>''); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_root'=>'list1', '_id'=>'list-img2', '_type'=>'image', + 'src'=>'modules/layout/img/empty.gif', + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>''); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + // set filename + $actiondata = array ('_root'=>'list1', '_id'=>'file1', '_type'=>'inline', 'extra'=>'class="filename""', 'content'=>$num_dirs.' Verzeichnisse'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } } ?> \ No newline at end of file --- NEW FILE: class.file_util.php --- <?php class file_util { function fileperms($filepath) { $decperms = fileperms($filepath); $octalperms = sprintf("%o",$decperms); // -4 value should include ugo and strange bits for files and folders return substr($octalperms,-4); } function filesize($file) { if (!file_exists($file)) { return ''; } $size = filesize($file); $factor = 0; while ($size > 1024) { $factor++; $size /= 1024; } switch ($factor) { case 3: return round($size).' GB'; case 2: return round($size).' MB'; case 1: return round($size).' kB'; default:return $size.' B'; } return round ($size / $factor); } function gid ($gid) { $data = posix_getgrgid ($gid); return array ('int'=>$gid, 'str'=>$data['name']); } function uid ($uid) { $data = posix_getpwuid ($uid); return array ('int'=>$uid, 'str'=>$data['name']); } } ?> --- NEW FILE: config.filemanager.php --- <?php /* $Id: config.filemanager.php,v 1.1 2004/06/18 15:17:01 mjahn Exp $ */ /* +----------------------------------------------------------------------+ | phpCMS Content Management System - Version 1.2.0 Beta +----------------------------------------------------------------------+ | phpCMS is Copyright (c) 2001-2003 by Michael Brauchl | and Contributing phpCMS Team Members | Filemanager Copyright (c) 2003 Markus Richert +----------------------------------------------------------------------+ | 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. +----------------------------------------------------------------------+ | Original Author: Markus Richert (e157m369) | Contributors: | Beate Paland (beate76) +----------------------------------------------------------------------+ */ /////////////////////////////////////////////////////////////////////////////// // This is the filetypes registration. // // Note: The pattern "\.htm" will match on ".htm" as well as ".html"-files // IMPORTANT: Dots must be escaped, so use "\." instead of ".". // First match in the array will break further search // // These are the arrays values: // - regexp pattern on the filename, used with eregi() // - iconfile in /parser/gif/filemanager/filetypes/ // - param for the 'show' & 'edit'-action // ('image': file has to be shown as source of an <img>-tag, // 'text': it is raw-text, so display it with PHP's Code-Highlighting, // and make it editable // false: Don't show the file and even the link to show it, but only the icon) // - browsing allowed, show the link for it (true or false) $this->FILETYPES = array( // phpCMS Files // phpCMS ProjectFile array("\.ini$", 'phpcms.project.gif', 'text', false, ), // phpCMS Template array("\.tpl$", 'phpcms.template.gif', 'text', false, ), // phpCMS MenuFile array("\.mnu$", 'phpcms.menu.gif', 'text', false, ), // phpCMS MenuTemplate array("\.mtpl$", 'phpcms.menutemplate.gif', 'text', false, ), // phpCMS MenuFile array("\.tag$", 'phpcms.tag.gif', 'text', false, ), // Web- and Script-Files // Apache Webserver security settings array("\.(htaccess|htusers|htpasswd)$", 'security.gif', 'text', false, ), // Webscripts (serverside) array("\.(phps|php|php[2-5]?|asp|asa|cgi|pl|shtml|phtml)$", 'serverscript.gif', 'text', true, ), // Webscripts (clientside) array("\.js$", 'clientscript.gif', 'text', true, ), // Webpages array("\.(htm|html)$", 'webpage.gif', 'text', true, ), // XML Files array("\.(xml|xsl|xslt)$", 'xml.gif', 'text', true, ), // Wap Files array("\.(wml|wsl(c|s|sc))$", 'wap.gif', 'text', true, ), // StyleSheet array("\.css$", 'css.gif', 'text', true, ), // Images // WebImages array("\.(gif|png|jp(g|e|eg)|ico)$", 'webimage.gif', 'image', true, ), // Bitmaps array("\.(bmp|wbmp)$", 'bitmap.gif', 'image', true, ), // Targa Images array("\.(tif|tiff)$", 'targa.gif', 'image', true, ), // Audio and Video // Flash Movies array("\.(swf|cab)$", 'flash.gif', false, true, ), // Audiofiles (Waveform) array("\.(wav|mp(2|3|4|a)|vqf|ai(f|ff|fc)|au|snd)$", 'audio.gif', false, true, ), // Audiofiles (Midi) array("\.(mid|midi)$", 'midi.gif', false, true, ), // WindowsMedia Videofiles array("\.(asf|wma|wmv|avi)$", 'winmedia.gif', false, true, ), // QuickTime File array("\.(qt|mov)$", 'quicktime.gif', false, true, ), // RealAudio/RealVideo Files array("\.(rm|ra|ram)$", 'realmedia.gif', false, true, ), // MPEG Movies array("\.(mp(e|g|eg)|m1v|mpv2)$", 'movie.gif', false, true, ), // Specials // Archives array("\.(zip|rar|sit|gz|tar|tar.gz|gtar|gzip|ace|lha|arj|arc)$", 'archive.gif', false, true, ), // Adobe Acrobat-Files array("\.(pdf|fdf)$", 'acrobat.gif', false, true, ), // Adobe Photoshop File array("\.(psd)$", 'photoshop.gif', false, true, ), // Microsoft Excel-Files array("\.xl(s|a)$", 'excel.gif', false, true, ), // Microsoft Word-Files array("\.do(c|t)$", 'word.gif', false, true, ), // Microsoft Powerpoint-Files array("\.pp(t|s|z)$", 'powerpoint.gif', false, true, ), // Microsoft Access-Files array("\.(md(b|a|e)|db)$", 'access.gif', false, true, ), // Helpfiles array("\.(hlp|chm)$", 'help.gif', false, true, ), // Executables array("\.(exe|com|bat|hqx|bin|dll|class)$", 'executable.gif', false, true, ), // Textfiles // Comma/Tab-separated Files array("\.(c|t)sv$", 'csv.gif', 'text', true, ), // RichText Files array("\.rt(f|x)$", 'richtext.gif', 'text', true, ), // PlainText File array("\.txt$", 'text.gif', 'text', true, ), // Link on a file, M$ only array("\.lnk$", 'symlink.gif', false, false, ), ); // set the defaults, used if nothing above matched $this->DEF_FILETYPE['icon'] = 'text.gif'; $this->DEF_FILETYPE['show'] = 'text'; $this->DEF_FILETYPE['browse'] = false; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // This is the templates registration. // First value is the part of the filename between 'template.' and '.txt' // Second value is the description shown in the selector-field of the FileManager $this->TEMPLATES = array( array( 'html', 'HTML' ), array( 'phpcms', 'phpCMS ContentFile' ), ); ?> |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:26
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/layout Modified Files: class.module_layout.php layout.css layout.xml Added Files: layout.tpl Log Message: module filemanager and editor included Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- layout.xml 5 Jun 2004 12:44:23 -0000 1.3 +++ layout.xml 18 Jun 2004 15:17:01 -0000 1.4 @@ -1,184 +1,243 @@ <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <!DOCTYPE layout SYSTEM "layout.dtd"> -<layout> +<layout name="standard"> - <empty> + <layout:insert name="empty"> <![CDATA[ - <content /> + <layout:replace name="content" /> ]]> - </empty> + </layout:insert> - <block> + <layout:insert name="block"> <![CDATA[ - <div id="<id />" class="<class />"> - <content /> + <div <layout:replace name="extra" default="" />> + <layout:replace name="content" /> </div> ]]> - </block> + </layout:insert> - <paragraph> + <layout:insert name="column_block"> <![CDATA[ - <p id="<id />" class="<class />"> - <content /> - </p> + <div <layout:replace name="extra" default="" />> + <layout:replace name="content" /> + <br style="clear:both;" /> + </div> ]]> - </paragraph> + </layout:insert> - <hr> + <layout:insert name="column"> <![CDATA[ - <hr id="<id />" class="<class />" /> + <div <layout:replace name="extra" default="" /> style="float:left;"> + <layout:replace name="content" /> + </div> + ]]> + </layout:insert> + + + <layout:insert name="inline"> + <![CDATA[ + <span <layout:replace name="extra" default="" />> + <layout:replace name="content" /> + </span> + ]]> + </layout:insert> + + + <layout:insert name="paragraph"> + <![CDATA[ + <p <layout:replace name="extra" default="" />><layout:replace name="content" /></p> + ]]> + </layout:insert> + + + <layout:insert name="hr"> + <![CDATA[ + <hr <layout:replace name="extra" default="" /> /> ]]> - </hr> + </layout:insert> - <headline> + <layout:insert name="headline"> <![CDATA[ - <h2 id="<id />" class="<class />"> - <content /> + <h2 <layout:replace name="extra" default="" />> + <layout:replace name="content" /> </h2> ]]> - </headline> + </layout:insert> - <image> + <layout:insert name="image"> <![CDATA[ - <img src="<src />" width="<width />" height="<height />" title="<title />" alt="<alt />"> + <img src="<layout:replace name="src" />" width="<layout:replace name="width" />" height="<layout:replace name="height" />" title="<layout:replace name="title" />" alt="<layout:replace name="alt" />" <layout:replace name="extra" default="" /> /> ]]> - </image> + </layout:insert> + <layout:insert name="link"> + <![CDATA[ + <a href="<layout:replace name="href" />" title="<layout:replace name="title" />"> + <layout:replace name="content" /> + </a> + ]]> + </layout:insert> - <form> + <layout:insert name="form"> <![CDATA[ - <form id="<id />" name="<name />" method="<method />" enctype="x-form/multipart"> - <content /> + <form action="<layout:replace name="action" default="" />" <layout:replace name="extra" default="" /> method="<layout:replace name="method" default="post" />" enctype="x-form/multipart"> + <layout:replace name="content" /> </form> ]]> - </form> + </layout:insert> - <form_input_hidden> + <layout:insert name="form_fieldset"> <![CDATA[ - <input type="hidden" name="<name />" id="<id />" value="<value />" /> + <fieldset> + <legend><layout:replace name="title" /></legend> + <layout:replace name="content" /> + </fieldset> ]]> - </form_input_hidden> + </layout:insert> - <form_input_text> + <layout:insert name="form_input_hidden"> + <![CDATA[ + <input type="hidden" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> + ]]> + </layout:insert> + + + <layout:insert name="form_input_text"> <![CDATA[ <label> <span> - <label /> + <layout:replace name="label" /> </span> - <input type="text" name="<name />" id="<id />" value="<value />" /> + <input type="text" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> </label> ]]> - </form_input_text> + </layout:insert> - <form_input_password> + <layout:insert name="form_input_password"> <![CDATA[ <label> <span> - <label /> + <layout:replace name="label" default="" /> </span> - <input type="password" name="<name />" id="<id />" value="<value />" /> + <input type="password" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> </label> ]]> - </form_input_password> + </layout:insert> - <form_radio> + <layout:insert name="form_radio"> <![CDATA[ - <label><input type="radio" name="<name />" id="<id />" value="<value />" /><label /></label> + <label><input type="radio" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /><label /></label> ]]> - </form_radio> + </layout:insert> - <form_checkbox> + <layout:insert name="form_checkbox"> <![CDATA[ <label> <span> - <label /> + <layout:replace name="label" default="" /> </span> - <input type="checkbox" name="<name />" id="<id />" value="<value />" /> + <input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> </label> ]]> - - </form_checkbox> + </layout:insert> - <form_textarea> + <layout:insert name="form_checkbox_simple"> + <![CDATA[ + <input type="checkbox" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" /> /> + ]]> + + </layout:insert> + + + <layout:insert name="form_textarea"> <![CDATA[ <label> <span> - <label /> + <layout:replace name="label" default="" /> </span> - <textarea name="<name />" id="<id />"> - <value /> - </textarea> + <textarea name="<layout:replace name="name" />" <layout:replace name="extra" default="" />><layout:replace name="value" /></textarea> </label> ]]> - - </form_textarea> + </layout:insert> - <form_button> + <layout:insert name="form_button"> <![CDATA[ - <button type="<type />" name="<name />" id="<id />" value="<value />"> - <text /> + <button type="<layout:replace name="type" />" name="<layout:replace name="name" />" value="<layout:replace name="value" />" <layout:replace name="extra" default="" />> + <layout:replace name="text" /> </button> ]]> - - </form_button> + </layout:insert> - <menu_main_entry> + <layout:insert name="menu_main_entry"> <![CDATA[ - <li class="<class />" id="<id />"> - <a href="?moduleid=<module />&<params />"> - <name /> + <li <layout:replace name="extra" default="" />> + <a href="?moduleid=<layout:replace name="module" />&<layout:replace name="params" />"> + <layout:replace name="name" /> </a> </li> ]]> - </menu_main_entry> + </layout:insert> - <ulist> + <layout:insert name="ulist"> <![CDATA[ - <ul id="<id />" class="<class />"> - <content /> + <ul <layout:replace name="extra" default="" />> + <layout:replace name="content" /> </ul> ]]> - </ulist> + </layout:insert> - <menu_sub_entry> + <layout:insert name="olist"> <![CDATA[ - <li class="<class />" id="<id />"> - <a href="?moduleid=<module />&action=<action />&<param />"> - <name /> + <ol <layout:replace name="extra" default="" />> + <layout:replace name="content" /> + </ol> + ]]> + </layout:insert> + + + <layout:insert name="menu_sub_entry"> + <![CDATA[ + <li <layout:replace name="extra" default="" />> + <a href="?moduleid=<layout:replace name="module" />&action=<layout:replace name="action" />&<layout:replace name="param" />"> + <layout:replace name="name" /> </a> </li> ]]> - </menu_sub_entry> + </layout:insert> - <list_entry> + <layout:insert name="list_entry"> <![CDATA[ - <li class="<class />"> - <content /> + <li <layout:replace name="extra" default="" />> + <layout:replace name="content" /> </li> ]]> - </list_entry> + </layout:insert> - <fm_file_entry> + <layout:insert name="filelist_entry"> <![CDATA[ - + <li <layout:replace name="extra" default="" />> + <layout:replace name="content" /> + <span class="filemtime" title="Last modified"><layout:replace name="filemtime" /></span> + <span class="filesize" title="Dateigröße"><layout:replace name="filesize" /></span> + <span class="chmod" title="Besitzer: <layout:replace name="uid" />\nGruppe: <layout:replace name="gid" />"><layout:replace name="chmod" /></span> + </li> ]]> - </fm_file_entry> - + </layout:insert> </layout> \ No newline at end of file --- NEW FILE: layout.tpl --- (This appears to be a binary file; contents omitted.) Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- class.module_layout.php 5 Jun 2004 12:44:23 -0000 1.7 +++ class.module_layout.php 18 Jun 2004 15:17:01 -0000 1.8 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.8 2004/06/18 15:17:01 mjahn +* module filemanager and editor included +* * Revision 1.7 2004/06/05 12:44:23 mjahn * separated layout-files * @@ -49,7 +52,7 @@ */ /** -* include the PEAR::XML_Tree-class for parsing the layout.xml-file +* Include the PEAR::XML_Tree-class for parsing the layout.xml-file * * There is a little bug in the Node.php in this package. It replaces the entities '<', '>', '"' and '''. * With this the output is not interpretable for clients @@ -87,6 +90,8 @@ var $_ids = array (); /** + * + * * @var array saves the layout-data * @example /home/martin/devel/admin4phpCMS/modules/layout/layout.xml included example-file * @access private @@ -114,7 +119,7 @@ } /** - * adds an object to the elements-list + * Add an element to the elements-list * * <p>$actiondata must provide the following information * <ul> @@ -125,7 +130,6 @@ * @param array $actionhandler data of the element to insert **/ function addElement (&$actiondata) { - // get a reference to the parental element $parent =& $this->_elements[0]; if (isset ($actiondata['_root'])) { @@ -137,6 +141,7 @@ return false; } $this->_ids[$actiondata['_id']] = $actiondata; + //echo '<p>ADD_ELEMENT '.$actiondata ['_id'].'</p>'."\n"; if (isset ($parent['_sub'])) { $parent['_sub'][] =& $this->_ids[$actiondata['_id']]; @@ -159,12 +164,12 @@ $output = join ('', file (dirname (__FILE__).'/layout.tpl')); // get all tags from the framework-layoutfile - $matches = preg_match_all ('°<phpcms-admin:([^(?/>)]*)\s/>°im', $output, $tags); + $matches = preg_match_all ('°<phpcms-admin:replace name="([^"]*)"\s*/>°im', $output, $tags); $tagnames = $tags[1]; $search = $tags[0]; $replace = array(); unset ($tags); - + // walk through the tag-array and generate the output for ($i = 0; $i < $matches; $i++) { $replace[$i] = ''; switch ($tagnames[$i]) { @@ -233,35 +238,11 @@ } } + // send output to browser echo str_replace ($search, $replace, $output); - //print_r($this->_elements); - } /** - * Displays an array of elements - * - * This function walks recursively through the element-structure and parses the output of any element. - * - * @param array $elements array with the element-arrays - **/ - function displayGroup (&$elements) { - $o = ''; - $num = count ($elements); - for ($i = 0; $i < $num; $i++) { - - // if entry does not exists jump over - if (!isset ($elements[$i])) { - continue; - } - - // check if sub-elements exist - $o .= $this->displayElement ($elements[$i]); - } - return $o; - } - - /** * Displays a single element * * $element['_type'] specifies, which template is used for displaying this element @@ -291,22 +272,44 @@ } // create the search- and replace-arrays - $replace = $search = array(); - foreach (array_keys ($element) as $id) { - if (substr ($id, 0, 1) == '_') { - continue; - } - $search[] = '<'.$id.' />'; - $replace[] = $element[$id]; + $matches = preg_match_all ('°<layout:replace\sname="([^"]*)"\s(?:default="([^"]*)"\s)*\s*/>°im', $this->_layout[$element['_type']], $erg); + $search = $erg[0]; + $tags = $erg[1]; + $defaults = $erg[2]; + $replace = array(); + for ($i = 0; $i < $matches; $i++) { + if (!isset ($element[$tags[$i]])) { + $replace [$i] = $defaults[$i]; + } else { + $replace[$i] = $element[$tags[$i]]; + } } - - //print_r ($replace); return str_replace ($search, $replace, $this->_layout[$element['_type']]."\n"); } - - - + /** + * Displays an array of elements + * + * This function walks recursively through the element-structure and parses the output of any element. + * + * @param array $elements array with the element-arrays + **/ + function displayGroup (&$elements) { + $o = ''; + $num = count ($elements); + for ($i = 0; $i < $num; $i++) { + + // if entry does not exists jump over + if (!isset ($elements[$i])) { + continue; + } + + // check if sub-elements exist + $o .= $this->displayElement ($elements[$i]); + } + return $o; + } + /** * Parse the template-file * @@ -330,32 +333,24 @@ $XML =& new XML_Tree ($layoutfile); $this->_layoutdata =& $XML->getTreeFromFile (); $num = count ($this->_layoutdata->children); + //print_r($this->_layoutdata); for ($i = 0; $i < $num; $i++) { if (!isset($this->_layoutdata->children[$i]->name)) { continue; } - $this->_layout[$this->_layoutdata->children[$i]->name] =& $this->_layoutdata->children[$i]->content; - } - } - - /** - * Save the templatedata into the xml-file - * - * @access private - **/ - function _saveLayoutFile () { - $layoutfile = dirname(__FILE__).'/layout.xml'; - - $fh = fopen ($layoutfile, 'wb'); - if ($fh === false) { - $actiondata = array ('errortext'=>'Layoutdatei konnte nicht geöffnet werden!'); - $this->_callEvent ('ERROR_NOTICE', $actiondata); + if ($this->_layoutdata->children[$i]->name != 'layout:insert') { + continue; + } + + if (!isset($this->_layoutdata->children[$i]->attributes['name'])) { + continue; + } + + $this->_layout[$this->_layoutdata->children[$i]->attributes['name']] =& $this->_layoutdata->children[$i]->content; } - fwrite ($fh, $this->_layoutdata->get()); - fclose ($fh); + //print_r($this->_layout); } - } ?> \ No newline at end of file Index: layout.css =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.css,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.css 4 Jun 2004 11:11:58 -0000 1.1 +++ layout.css 18 Jun 2004 15:17:01 -0000 1.2 @@ -11,10 +11,13 @@ #content { margin-left:190px; padding:0; + background:#fff; } .content { padding:0.5em; + padding-top:2em; + overflow:auto; } #menu { @@ -27,6 +30,7 @@ padding:0; border-right:0.1em solid #000; border-bottom:0.1em solid #000; + background:#fff; } #menu ul { @@ -48,10 +52,6 @@ margin-left:1em; } -.content { - background:#fff; -} - label span { display:block; } @@ -63,10 +63,17 @@ #submenu { + background:#fff; + display:block; padding: 3px 0; -margin: 0; +margin: 0 0 1em 0; border-bottom: 1px solid #778; -font: bold 12px Verdana, sans-serif; +font: bold Verdana, sans-serif; +position:fixed; +top:0; +left:191px; +width:80%; + } #submenu li @@ -101,3 +108,89 @@ background: white; border-bottom: 1px solid white; } + +#filelist { + width:50em; +} + +#filelist li { + display:block; +} + +#filelist li, +#filelist li * { + font-family:monospace; +} + +#filelist li input, +#filelist li a, +#filelist li img, +#filelist li label, +#filelist li span { + float:left; + display:block; +} + +#filelist li .input { + margin-right:0.5em; +} + +#filelist li { + clear:left; +} + +li.line1 { + background-color:#fff; +} + +li.line2 { + background-color:#ddd; +} + +.filename { + width:15em; + padding-left:1em; +} + +.filemtime { + width:13em; +} + +.filesize { + width:6em; +} + +.chmod { + width:4em; +} + + +.giduid { + width:5em; +} + +#filelist .icon { + margin-right:0.5em; +} + +a img { + border:0; +} + +#filelist .header { + background-color:#f9e; +} + +#fileviewer { + font-family:monospace; + background:silver; + white-space:pre; + padding-right:1em; +} + +#fileviewer .linenumber { + background-color:#fff; + color:#00f; + padding-right:0.5em; + margin-right:0.5em; +} |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:25
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/error In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/error Modified Files: class.module_error.php Log Message: module filemanager and editor included Index: class.module_error.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/error/class.module_error.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_error.php 4 Jun 2004 11:11:57 -0000 1.3 +++ class.module_error.php 18 Jun 2004 15:17:00 -0000 1.4 @@ -28,6 +28,9 @@ /* * $Log$ +* Revision 1.4 2004/06/18 15:17:00 mjahn +* module filemanager and editor included +* * Revision 1.3 2004/06/04 11:11:57 mjahn * several changes * @@ -47,7 +50,7 @@ $this->_registerAction ('doErrorAbort', 'errorAbort'); $this->_registerEvent ('ERROR_NOTICE', 'doErrorNotice'); $this->_registerAction ('doErrorNotice', 'errorNotice'); - $this->_registerAction ('doGetContents', 'displayError'); + $this->_registerAction ('doParseError', 'displayError'); } function errorAbort (&$actiondata) { @@ -59,6 +62,21 @@ } function displayError (&$actiondata) { + $root = $actiondata ['_root']; + if (!isset ($this->_error) || !is_array ($this->_error)) { + return true; + } + $num = count ($this->_error); + $content = ''; + for ($i = 0; $i < $num; $i++) { + if (!isset ($this->_error[$i]['errortext'])) { + continue; + } + $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); } } |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:25
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/config Modified Files: config.xml Log Message: module filemanager and editor included Index: config.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/config.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- config.xml 4 Jun 2004 11:11:57 -0000 1.2 +++ config.xml 18 Jun 2004 15:16:59 -0000 1.3 @@ -6,9 +6,14 @@ <config name="permfile" value="Perm_XML.xml" /> </module> <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="debug" name="debug-service" include="class.module_debug.php" class="module_debug" /> <module id="filemanager" name="filemanager" include="class.module_filemanager.php" class="module_filemanager"> <config name="startupdir" value="/" /> + <config name="editor_image" value="jpg,jpeg,png,bmp,gif" /> + <config name="editor_xml" value="xml,dtd" /> + <config name="editor_phpcms_content" value="phpcms" /> + <config name="editor_phpcms_menu" value="mnu" /> </module> <module id="error" name="error-service" include="class.module_error.php" class="module_error" /> |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:11
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/layout/img Added Files: arrow.gif browse.gif delete.gif delete_all.gif down.gif down_active.gif edit.gif empty.gif home.gif move.gif newdir.gif newfile.gif reload.gif up.gif up_active.gif upload.gif Log Message: module filemanager and editor included --- NEW FILE: down.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: arrow.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: home.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: move.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: down_active.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_all.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: reload.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up_active.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: browse.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: upload.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: empty.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: newfile.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: newdir.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete.gif --- (This appears to be a binary file; contents omitted.) |
From: Martin J. <mj...@us...> - 2004-06-18 15:17:11
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/editor Added Files: class.module_editor.php class.module_text_editor.php class.module_xml_editor.php Log Message: module filemanager and editor included --- NEW FILE: class.module_xml_editor.php --- <?php /** * Editor for XML-files * * <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_xml_editor.php,v 1.1 2004/06/18 15:17:00 mjahn Exp $ * @package admin4phpCMS * @subpackage module_editor **/ /* * $Log: class.module_xml_editor.php,v $ * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * */ /** * include PEAR:XML_Tree for parsing of XML-files **/ include_once ('XML/Tree.php'); /** * XML editor class * * This class provides an interface for editing XML-files. * * @package admin4phpCMS * @subpackage module_editor * @inheriteddoc **/ class module_xml_editor extends module { function init () { $this->_registerEvent ('DISPLAY_VIEWER', 'doDisplayViewer'); $this->_registerAction ('doDisplayViewer', 'viewFile'); $this->_registerEvent ('DISPLAY_EDITOR', 'doDisplayEditor'); $this->_registerAction ('doDisplayEditor', 'editFile'); $this->_registerEvent ('EDITOR_SAVE_FILE', 'doEditorSaveFile'); $this->_registerAction ('doEditorSaveFile', 'saveFile'); } /** * save the data from the formular into the XML-file * * @param string $actiondata $actiondata['filename'] must provide the filename * @return boolean true if file was saved successful **/ function saveFile (&$actiondata) { $filename = $actiondata ['filename']; if (!isset($filename)) { $actiondata = array ('errortext'=>'Datei '.$filename.' konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } if (!file_exists ($filename)) { $actiondata = array ('errortext'=>'Layoutdatei '.$filename.' konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } $this->filename = $filename; $XML =& new XML_Tree ($this->filename); $this->_file =& $XML->getTreeFromFile (); return true; $fh = @fopen ($filename, 'wb'); if ($fh === false) { fclose ($fh); $actiondata = array ('errortext'=>'Konnte nicht in die Zieldatei '.$this->filename.' schreiben! (fehlende Schreibrechte)'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } fwrite ($fh, $this->_file->get ()); fclose ($fh); return true; } function viewFile (&$actiondata) { $this->filename = $actiondata ['_filename']; $data = file ($this->filename); $i = 0; foreach ($data as $line) { $actiondata = array ('_id'=>'line'.$i, '_root'=>$actiondata ['_root'], '_type'=>'empty', 'class'=>'', 'id'=>'', 'content'=>htmlentities ($line).'<br />'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $i++; } } /** * display the editform for the XML-data * * @param array $actiondata $actiondata ['filename'] must provide the filename **/ function editFile (&$actiondata) { $this->filename = $actiondata ['_filename']; // set container for fileviewer $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'columns', '_type'=>'column_block', 'id'=>'spalten', 'class'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for XML-Tree $actiondata = array ('_root'=>'columns', '_id'=>'file-edit-tree-column', '_type'=>'column', 'id'=>'', 'class'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set list-container for XML-Tree $actiondata = array ('_root'=>'file-edit-tree-column', '_id'=>'file-edit-tree', '_type'=>'ulist', 'id'=>'', 'class'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for input-fields $actiondata = array ('_root'=>'columns', '_id'=>'file-edit-input', '_type'=>'column', 'id'=>'', 'class'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $XML =& new XML_Tree ($this->filename); $this->_file =& $XML->getTreeFromFile (); //print_r ($this->_file); $this->displayNode ($this->_file, 'file-edit-tree', 'file-edit-tree-0', 'file-edit-input'); } /** * walk recursive through the XML-structure and display the XML-data * * @param XML_Tree $node the element of the XML-Tree * @param string $root the id of the parental-element * @param string $node_id the id of the current node * @param string $input_id the id of the input-field-container **/ function displayNode (&$node, $root, $node_id, $input_id) { if (isset ($node->name) && $node->name != '') { $actiondata = array ('_id'=>$node_id, '_root'=>$root, '_type'=>'list_entry', 'class'=>'', 'id'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>$node_id.'-link', '_root'=>$node_id, '_type'=>'link', 'class'=>'', 'id'=>'', 'content'=>$node->name, 'href'=>'#'.$node_id); if (isset ($node->attributes['name'])) { $actiondata ['title'] = $node->attributes['name']; } $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>$node_id.'-name', '_root'=>$node_id.'-link', '_type'=>'empty', 'class'=>'', 'id'=>'', 'content'=>$node->name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>$node_id.'-block', '_root'=>$input_id, '_type'=>'block', 'class'=>'', 'id'=>$node_id); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>$node_id.'-set', '_root'=>$node_id.'-block', '_type'=>'form_fieldset', 'class'=>'', 'id'=>'', 'title'=>$node->name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); foreach ($node->attributes as $name=>$value) { $actiondata = array ('_id'=>$node_id.'-'.$name, '_root'=>$node_id.'-set', '_type'=>'form_input_text', 'extra'=>'id="'.$node_id.'-'.$name.'" ', 'name'=>$node_id.'-'.$name, 'value'=>htmlentities ($value), 'label'=>$name); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } $actiondata = array ('_id'=>$node_id.'-content', '_root'=>$node_id.'-set', '_type'=>'form_textarea', 'name'=>$node_id.'-content', 'extra'=>'id="'.$node_id.'-content" ', 'value'=>htmlentities ($node->content), 'label'=>'content'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } if (isset ($node->children) && is_array ($node->children) && count ($node->children) > 0) { $actiondata = array ('_id'=>$node_id.'-sub', '_root'=>$node_id, '_type'=>'ulist', 'class'=>'', 'id'=>''); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $num = count ($node->children); for ($i = 0; $i < $num; $i++) { $this->displayNode ($node->children[$i], $node_id.'-sub', $node_id.'-'.$i, $input_id); } } } } /* 12 ma 12 deu 8 bio */ ?> --- NEW FILE: class.module_text_editor.php --- <?php /** * Editor for Text-files * * <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_text_editor.php,v 1.1 2004/06/18 15:17:00 mjahn Exp $ * @package admin4phpCMS * @subpackage module_editor **/ /* * $Log: class.module_text_editor.php,v $ * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * */ /** * include PEAR:XML_Tree for parsing of XML-files **/ include_once ('XML/Tree.php'); /** * Text editor class * * This class provides an interface for editing Text-files. * * @package admin4phpCMS * @subpackage module_editor * @inheriteddoc **/ class module_text_editor extends module { function init () { $this->_registerEvent ('DISPLAY_VIEWER', 'doDisplayViewer'); $this->_registerAction ('doDisplayViewer', 'viewFile'); $this->_registerEvent ('DISPLAY_EDITOR', 'doDisplayEditor'); $this->_registerAction ('doDisplayEditor', 'editFile'); } /** * Open a XML-file * * @param string $filename Contains the path of the XML-file to edit * @return boolean true if XML-file was opened successful **/ function openfile ($filename) { if (!isset($filename)) { $actiondata = array ('errortext'=>'Datei '.$filename.' konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } if (!file_exists ($filename)) { $actiondata = array ('errortext'=>'Layoutdatei '.$filename.' konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } $this->filename = $filename; $XML =& new XML_Tree ($this->filename); $this->_file =& $XML->getTreeFromFile (); return true; } /** * save the data from the formular into the XML-file * * @param string $filename Contains the path where to save the XML-file * @return boolean true if file was saved successful **/ function savefile ($filename = '') { if (!isset ($this->_file)) { $actiondata = array ('errortext'=>'Keine XML-Daten zum Speichern vorhanden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } if ($filename != '' && file_exists ($filename) && is_writeable ($filename)) { $this->filename = $filename; } $fh = @fopen ($filename, 'wb'); if ($fh === false) { fclose ($fh); $actiondata = array ('errortext'=>'Konnte nicht in die Zieldatei '.$this->filename.' schreiben! (fehlende Schreibrechte)'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } fwrite ($fh, $this->_file->get ()); fclose ($fh); } function viewFile (&$actiondata) { $this->filename = $actiondata ['_filename']; $data = file ($this->filename); $i = 0; foreach ($data as $line) { $actiondata = array ('_id'=>'line'.$i, '_root'=>$actiondata ['_root'], '_type'=>'empty', 'content'=>htmlentities ($line)); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $i++; } } function editFile (&$actiondata) { $this->filename = $actiondata ['_filename']; $data = file ($this->filename); $actiondata = array ('_id'=>'edit-file', '_root'=>$actiondata ['_root'], '_type'=>'form_textarea', 'value'=>join ('', $data)); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } } ?> --- NEW FILE: class.module_editor.php --- <?php /** * The filemanager-module * * This module is based on the package PEAR::LiveUser. * * <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_editor.php,v 1.1 2004/06/18 15:17:00 mjahn Exp $ * @package admin4phpCMS * @subpackage module_editor **/ /* * $Log: class.module_editor.php,v $ * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included * */ require('classes/CropImage.php'); /** * Editor-class * * @package admin4phpCMS * @subpackage module_editor * @uses file_editor **/ class module_editor extends module { 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']); $actiondata = array ('module'=>'editor'); $this->_callEvent ('CONFIG_GET', $actiondata); $this->CONF =& $actiondata ['config']; } /** * @param array $actiondata **/ function parseParam (&$actiondata) { // check if we have to display our content $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'editor'); // initialize variables $this->viewfile = ''; $this->editfile = ''; $this->action = ''; // get the action if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } // get the filename of the file to view if ($this->action == 'viewfile' && isset ($actiondata['request']['file'])) { $this->filename = realpath ($this->docroot.'/'.$actiondata['request']['file']); } // get the filename of the file to edit if ($this->action == 'editfile' && isset ($actiondata['request']['file'])) { $this->filename = realpath ($this->docroot.'/'.$actiondata['request']['file']); } if (isset ($this->filename) && strpos ($this->filename, $this->docroot) === false) { $this->filename = ''; $this->action = ''; $actiondata = array ('errortext'=>'Die Datei befindet sich außerhalb des erlaubten Bereiches!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); } } /** * @param array $actiondata **/ function process (&$actiondata) { $actiondata = array(); $this->_callEvent ('USER_GET_STATUS', $actiondata); $this->_USER = $actiondata; if (!$this->_USER['isLoggedIn']) { return true; } if (!isset ($this->filename) || $this->filename == '') { return true; } // check if the file exists if (!file_exists ($this->filename)) { $actiondata = array ('errortext'=>'Die Datei '.$this->filename.' existiert nicht!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return true; } // check if the file is readable if (!is_readable ($this->filename)) { $actiondata = array ('errortext'=>'Die Datei '.$filename.' kann nicht geöffnet werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return true; } // get the filesystem path to the file $this->webname = str_replace ($this->docroot, '', $this->filename); // extract the extension from filename $this->ext = strtolower (substr ($this->filename, strrpos ($this->filename, '.')+1)); // load correct editor-module into framework switch ($this->ext) { // imagetypes case 'png': case 'jpg': case 'jpeg': case 'gif': case 'bmp': case 'ico': $this->filetype = 'image'; break; case 'xml': $this->filetype = 'xml'; break; default: $this->filetype = 'text'; break; } $actiondata = array ('filename'=>dirname(__FILE__).'/class.module_'.$this->filetype.'_editor.php', 'class'=>'module_'.$this->filetype.'_editor'); $this->_callEvent ('LOAD_MODULE', $actiondata); $actiondata = array ('filename'=>$this->filename); $this->_callEvent ('EDITOR_SAVE_FILE', $actiondata); switch ($this->action) { case 'viewfile': $this->_registerAction ('doParseContent', 'getViewContent'); break; case 'editfile': $this->_registerAction ('doParseContent', 'getEditContent'); break; default: break; } } function getViewContent (&$actiondata) { $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->filename); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set container for fileviewer $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'fileviewer', '_type'=>'block', 'extra'=>'id="fileviewer"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'fileviewer', '_filename'=>$this->filename); $this->_callEvent ('DISPLAY_VIEWER', $actiondata); } function getEditContent (&$actiondata) { $actiondata = array ('_id'=>'headline1', '_root'=>$actiondata['_root'], '_type'=>'headline', 'content'=>$this->filename); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set formular for fileviewer $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'file-edit-form', '_type'=>'form', 'action'=>'', 'method'=>'post'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'file-edit-form', '_filename'=>$this->filename); $this->_callEvent ('DISPLAY_EDITOR', $actiondata); } } ?> |
From: Martin J. <mj...@us...> - 2004-06-18 15:16:06
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27453/img Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/img added to the repository |
From: Martin J. <mj...@us...> - 2004-06-18 15:14:59
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26456/editor Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor added to the repository |
From: Martin J. <mj...@us...> - 2004-06-18 15:14:37
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/temp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26259/temp Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/temp added to the repository |
From: Martin J. <mj...@us...> - 2004-06-05 12:44:33
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471/modules/user Modified Files: class.module_user.php Log Message: separated layout-files Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_user.php 4 Jun 2004 11:32:09 -0000 1.3 +++ class.module_user.php 5 Jun 2004 12:44:23 -0000 1.4 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.4 2004/06/05 12:44:23 mjahn +* separated layout-files +* * Revision 1.3 2004/06/04 11:32:09 mjahn * several changes * @@ -52,7 +55,7 @@ class module_user extends module { /** - * @var object Benutzer- und Rechtemanagment-Objekt + * @var object $_USER reference to the user- and permission-managment-object * @access private **/ var $_USER; @@ -129,10 +132,13 @@ } function getUserStatus (&$actiondata) { - $actiondata ['loggedin'] = $this->_USER->isLoggedIn (); + $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); } function getMenuMain (&$actiondata) { + if (!$this->_USER->isLoggedIn ()) { + return true; + } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Benutzerverwaltung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); |
From: Martin J. <mj...@us...> - 2004-06-05 12:44:32
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471/modules/filemanager Modified Files: class.module_filemanager.php Log Message: separated layout-files Index: class.module_filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.module_filemanager.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.module_filemanager.php 4 Jun 2004 11:11:57 -0000 1.1 +++ class.module_filemanager.php 5 Jun 2004 12:44:22 -0000 1.2 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.2 2004/06/05 12:44:22 mjahn +* separated layout-files +* * Revision 1.1 2004/06/04 11:11:57 mjahn * several changes * @@ -62,18 +65,27 @@ $this->action = $actiondata['request']['action']; } } - + function process (&$actiondata) { - + $actiondata = array(); + $this->_callEvent ('USER_GET_STATUS', $actiondata); + $this->_USER = $actiondata; } - + function getMenuMain (&$actiondata) { + if (!$this->_USER['isLoggedIn']) { + return true; + } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu', 'id'=>'', 'class'=>'', 'params'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } function getMenuSub (&$actiondata) { + if (!$this->_USER['isLoggedIn']) { + return true; + } + if (!$this->display) { return true; } |