openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 0080dd57738f20bd20a0fc0afd35e229a00e5c5b
parent 686c8852858d4e6b3c44546b14a59649dad42bcb
Author: Jan Dankert <develop@jandankert.de>
Date:   Wed, 15 May 2019 22:57:09 +0200

Removed: Alter Filebrowser für fckeditor.

Diffstat:
modules/cms-core/action/FilebrowserAction.class.php | 263-------------------------------------------------------------------------------
modules/cms-ui/themes/default/html/views/filebrowser/browse.php | 0
modules/cms-ui/themes/default/html/views/filebrowser/browse.tpl.src.xml | 49-------------------------------------------------
3 files changed, 0 insertions(+), 312 deletions(-)

diff --git a/modules/cms-core/action/FilebrowserAction.class.php b/modules/cms-core/action/FilebrowserAction.class.php @@ -1,262 +0,0 @@ -<?php - -namespace cms\action; - - -use Http; -use Session; -use \Html; - -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// 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. - - -/** - * Action-Klasse zum Bearbeiten einer Datei - * @author $Author$ - * @version $Revision$ - * @package openrat.actions - * - * @deprecated old ckeditor trash - */ -class FilebrowserAction extends ObjectAction -{ - public $security = Action::SECURITY_USER; - - var $command; - var $resourceType; - - /** - * Ordner - * - * @var String - */ - var $currentFolder; - - /** - * Aktueller Ordner - * - * @var Object - */ - var $folder; - - /** - * Konstruktor - */ - function __construct() - { - if ( $this->getRequestId() != 0 ) - { - $fid = $this->getRequestId(); - } - else - { - $project = Session::getProject(); - $fid = $project->getRootObjectId(); - } - - $this->folder = new Folder( $fid ); - $this->folder->load(); - - - } - - - - /** - * - */ - function show() - { - throw new \SecurityException('no subaction found'); - } - - - /** - * Datei-Upload. - * - */ - public function directuploadPost() - { - $upload = new Upload( $this->getRequestVar('name','abc') ); - - if ( !$upload->isValid() ) - { - echo 'Upload failed, reason: '.$upload->error; - } - else - { - $file = new File(); - $file->parentid = $this->folder->objectid; - $file->name = $upload->filename; - $file->filename = $upload->filename; - $file->extension = $upload->extension; - $file->value = $upload->value; - $file->add(); - - $newId = $file->objectid; - $newUrl = str_replace('&amp;','&',Html::url('file','show',$newId,array('oid'=>'__OID__'.$newId.'__'))); - - echo '<script type="text/javascript">' ; - echo 'window.parent.CKEDITOR.tools.callFunction('.$this->getRequestVar('CKEditorFuncNum',OR_FILTER_NUMBER).",'".$newUrl."','');</script>"; - echo '</script>' ; - echo 'OK' ; - } - - } - - - public function browseView() - { - global $conf_php; - $funcNum = $this->getRequestVar('CKEditorFuncNum',OR_FILTER_NUMBER); - - if ( ! $this->folder->isRoot ) - $this->setTemplateVar('up_url',Html::url('filebrowser','browse',$this->folder->parentid,array('CKEditorFuncNum'=>$funcNum))); - - $user = Session::getUser(); - $this->setTemplateVar('writable',$this->folder->hasRight(ACL_WRITE) ); - $this->setTemplateVar('style',$user->style ); - - $list = array(); - - // Schleife ueber alle Objekte in diesem Ordner - foreach( $this->folder->getObjects() as $o ) - { - $id = $o->objectid; - - if ( $o->hasRight(ACL_READ) ) - { - $list[$id]['name'] = Text::maxLaenge( 30,$o->name ); - $list[$id]['filename'] = Text::maxLaenge( 20,$o->filename ); - $list[$id]['desc'] = Text::maxLaenge( 30,$o->desc ); - if ( $list[$id]['desc'] == '' ) - $list[$id]['desc'] = lang('NO_DESCRIPTION_AVAILABLE'); - $list[$id]['desc'] = $list[$id]['desc'].' - '.lang('IMAGE').' '.$id; - - $list[$id]['type'] = $o->getType(); - - $list[$id]['icon' ] = $o->getType(); - $list[$id]['class'] = $o->getType(); - if ( $o->isFolder ) - $list[$id]['url' ] = Html::url('filebrowser','browse',$id,array('CKEditorFuncNum'=>$funcNum) ); - else - $list[$id]['url' ] = "javascript:window.top.opener.CKEDITOR.tools.callFunction($funcNum,'".Html::url('file','show',$id,array('oid'=>'__OID__'.$id.'__'))."','');window.top.close();window.top.opener.focus();"; - - - - if ( $o->getType() == 'file' ) - { - $file = new File( $id ); - $file->load(); - $list[$id]['desc'] .= ' - '.intval($file->size/1000).'kB'; - - if ( $file->isImage() ) - { - $list[$id]['icon' ] = 'image'; - $list[$id]['class'] = 'image'; - //$list[$id]['url' ] = Html::url('file','show',$id) nur sinnvoll bei Lightbox-Anzeige - } -// if ( substr($file->mimeType(),0,5) == 'text/' ) -// $list[$id]['icon'] = 'text'; - } - - $list[$id]['date'] = $o->lastchangeDate; - $list[$id]['user'] = $o->lastchangeUser; - } - } - - $this->setTemplateVar('object' ,$list ); - $this->setTemplateVar('CKEditorFuncNum',$funcNum ); - $this->setTemplateVar('token',token() ); - $this->setTemplateVar('id',$this->folder->objectid ); - } - - - public function addfolderPost() - { - - $filename = $this->getRequestVar('name'); - - if ( empty($filename) ) - { - $this->addNotice('folder',$this->name,'ADDED',OR_NOTICE_ERROR); - } - elseif( !$this->folder->hasRight(ACL_CREATE_FOLDER) ) - { - $this->addNotice('folder',$this->name,'ERROR',OR_NOTICE_ERROR); - } - elseif( $this->folder->hasFilename( $filename ) ) - { - $this->addNotice('folder',$this->name,'ERROR',OR_NOTICE_ERROR); - - } - else - { - $newFolder = new Folder(); - $newFolder->parentid = $this->folder->objectid; - $newFolder->filename = $filename; - $newFolder->name = $filename; - $newFolder->add(); - - $this->addNotice('folder',$this->folder->name,'ADDED',OR_NOTICE_OK); - } - } - - - - public function uploadPost() - { - if ( $this->hasRequestVar('name') ) - $name = $this->getRequestVar('name','abc'); - else - $name = 'file'; - - $upload = new Upload($name); - - if ( !$upload->isValid() ) - { - $this->addValidationError('file','COMMON_VALIDATION_ERROR',array(),$upload->error); - return; - } - // Pr�fen der maximal erlaubten Dateigr��e. - elseif ( $upload->size < 0 ) - { - // Maximale Dateigr��e ist �berschritten - $this->addValidationError('file','MAX_FILE_SIZE_EXCEEDED'); - return; - } - elseif( $upload->size > 0 ) - { - $file = new File(); - $file->desc = ''; - $file->filename = $upload->filename; - $file->name = $upload->filename; - $file->extension = $upload->extension; - $file->size = $upload->size; - $file->parentid = $this->folder->objectid; - - $file->value = $upload->value; - - $file->add(); // Datei hinzufuegen - $this->folder->setTimestamp(); - $this->addNotice('file',$file->name,'ADDED','ok'); - } - } -} - -?>- \ No newline at end of file diff --git a/modules/cms-ui/themes/default/html/views/filebrowser/browse.php b/modules/cms-ui/themes/default/html/views/filebrowser/browse.php diff --git a/modules/cms-ui/themes/default/html/views/filebrowser/browse.tpl.src.xml b/modules/cms-ui/themes/default/html/views/filebrowser/browse.tpl.src.xml @@ -1,48 +0,0 @@ -<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd"> - <page> - <table> - <row class="headline"> - <column> - <text key="GLOBAL_TYPE"></text> - <text raw="_/_"></text> - <text key="GLOBAL_NAME"></text> - </column> - <column> - <text key="GLOBAL_LASTCHANGE"></text> - </column> - </row> - <if present="up_url"> - <row class="data"> - <column width="50%" colspan="8"> - <link type="html" url="var:up_url"> - <image type="folder"></image> - <text raw="__.._____________________"></text> - </link> - </column> - </row> - </if> - <list list="object" extract="true"> - <row class="data"> - <column class="clickable"> - <link type="html" url="var:url" title="var:desc" class="var:class"> - <image type="var:icon"></image> - <text var="name"></text> - <text raw="_"></text> - </link> - </column> - <column> - <date date="var:date"></date> - </column> - </row> - </list> - <if empty="object"> - <row> - <column colspan="2"> - <text text="GLOBAL_NOT_FOUND"></text> - </column> - </row> - </if> - </table> - </page> -</output>- \ No newline at end of file