[Phpcms-plugins-cvs] admin4phpCMS/modules/editor layout.editor.xml,1.1,1.2 class.module_image_editor
Brought to you by:
mjahn
From: Martin J. <mj...@us...> - 2004-09-29 20:10:54
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/editor Modified Files: layout.editor.xml class.module_image_editor.php class.module_text_editor.php class.module_editor.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_text_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_text_editor.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_text_editor.php 25 Aug 2004 21:16:43 -0000 1.2 +++ class.module_text_editor.php 29 Sep 2004 20:10:44 -0000 1.3 @@ -28,6 +28,10 @@ /* * $Log$ +* Revision 1.3 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.2 2004/08/25 21:16:43 mjahn * step 1 is taken * @@ -111,7 +115,7 @@ $this->filename = $actiondata ['_filename']; if (strrchr ($this->filename, '.') == '.gz') { - $data = file ($this->filename); + $data = gzfile ($this->filename); } else { $data = file ($this->filename); } Index: layout.editor.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/layout.editor.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.editor.xml 25 Aug 2004 21:21:00 -0000 1.1 +++ layout.editor.xml 29 Sep 2004 20:10:43 -0000 1.2 @@ -28,8 +28,8 @@ <h2>Dateieditorr für <em><layout:replace name="filename" /></em></h2> <div class="iconbar"> <a href="?moduleid=filemanager&basedir=<layout:replace name="basedir" default="/" />&action=viewdir" title="Dateibetrachter schließen" >Zurück</a> - <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=copyfile" title="Dateiinhalt in die Zwischenablage kopieren" >Kopieren</a> - <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=pastefile" title="Inhalt aus der Zwischenablage einfügen" >Einfügen</a> + <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=savefile" title="Dateiinhalt in die Zwischenablage kopieren" >Speichern</a> + <a href="?moduleid=editor&file=<layout:replace name="filename" default="/" />&action=savefileas" title="Inhalt aus der Zwischenablage einfügen" >Speichern als ...</a> </div> <div id="fileeditor"> <layout:replace name="content" default="" /> Index: class.module_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_editor.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_editor.php 25 Aug 2004 21:16:43 -0000 1.3 +++ class.module_editor.php 29 Sep 2004 20:10:44 -0000 1.4 @@ -30,6 +30,10 @@ /* * $Log$ +* Revision 1.4 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part +* * Revision 1.3 2004/08/25 21:16:43 mjahn * step 1 is taken * @@ -53,18 +57,13 @@ function init () { // connect to actions - $this->_registerEvent ('EDITOR_EDIT_FILE', 'doEditFile'); - $this->_registerAction ('doEditFile', 'editFile'); - $this->_registerAction ('EDITOR_VIEW_FILE', 'doViewFile'); - $this->_registerAction ('doViewFile', 'viewFile'); $this->_registerAction ('doParseParam', 'parseParam'); - $this->_registerAction ('doProcess', 'process'); $this->docroot = realpath ($_SERVER['DOCUMENT_ROOT']); $actiondata1 = array ('module'=>'editor'); $this->_callEvent ('CONFIG_GET', $actiondata1); $this->CONF =& $actiondata1 ['config']; - $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.xml'); + $actiondata1 = array ('filename'=>dirname (__FILE__).'/layout.editor.xml'); $this->_callEvent ('LAYOUT_ADD_TEMPLATE', $actiondata1); } @@ -108,6 +107,11 @@ $actiondata1 = array ('errortext'=>'Die Datei befindet sich außerhalb des erlaubten Bereiches!'); $this->_callEvent ('ERROR_NOTICE', $actiondata1); } + + if ($this->display) { + $this->_registerAction ('doProcess', 'process'); + } + } /** @@ -144,7 +148,8 @@ $this->webname = str_replace ($this->docroot, '', $this->filename); // extract the extension from filename - $this->ext = strtolower (substr (strrchr ('.', $this->filename), 1)); + $this->ext = strtolower (substr (strrchr ($this->filename, '.'), 1)); + // load correct editor-module into framework switch ($this->ext) { // imagetypes @@ -174,7 +179,7 @@ $actiondata1 = array ('filename'=>dirname(__FILE__).'/class.module_'.$this->filetype.'_editor.php', 'class'=>'module_'.$this->filetype.'_editor'); $this->_callEvent ('LOAD_MODULE', $actiondata1); - $actiondata1 = array ('filename'=>$this->filename); + $actiondata1 = array ('_filename'=>$this->filename); $this->_callEvent ('EDITOR_SAVE_FILE', $actiondata1); switch ($this->action) { Index: class.module_image_editor.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/editor/class.module_image_editor.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_image_editor.php 25 Aug 2004 21:16:43 -0000 1.2 +++ class.module_image_editor.php 29 Sep 2004 20:10:44 -0000 1.3 @@ -28,8 +28,9 @@ /* * $Log$ -* Revision 1.2 2004/08/25 21:16:43 mjahn -* step 1 is taken +* Revision 1.3 2004/09/29 20:10:44 mjahn +* completed phpCMS-config-part +* began the statistic part * * Revision 1.1 2004/06/18 15:17:00 mjahn * module filemanager and editor included @@ -154,6 +155,7 @@ } function saveFile (&$actiondata) { + $filename = $actiondata ['_filename']; } function viewFile (&$actiondata) { @@ -176,5 +178,21 @@ } function editFile (&$actiondata) { + $filename = $actiondata ['_filename']; + $webname = $actiondata ['_webname']; + $root = $actiondata ['_root']; + $size = getimagesize ($filename); + $actiondata1 = array ('_root'=>$root, '_id'=>'view-image-block', '_type'=>'empty'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + // set image-viewer + $actiondata1 = array ('_root'=>'view-image-block', '_id'=>'view-image', '_type'=>'image', 'src'=>$webname, + 'width'=>$size[0], 'height'=>$size[1], 'alt'=>'', 'title'=>''); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); + // set image-data + $content = 'Dateigröße: '.file_util::filesize ($filename).'<br />'. + 'Breite: '.$size[0].'px<br />'. + 'Höhe: '.$size[1].'px<br />'; + $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'fileinfo', '_type'=>'block', 'id'=>'', 'class'=>'', 'content'=>$content); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } } \ No newline at end of file |