File modules/cms/action/folder/FolderEditAction.class.php
Last commit: Fri Mar 11 20:14:46 2022 +0100 dankert Fix: Do not output objects.
1 <?php 2 namespace cms\action\folder; 3 use cms\action\FolderAction; 4 use cms\action\Method; 5 use cms\model\Permission; 6 use cms\model\BaseObject; 7 use cms\model\File; 8 use util\Html; 9 10 11 class FolderEditAction extends FolderAction implements Method { 12 public function view() { 13 if ( ! $this->folder->isRoot() ) 14 $this->setTemplateVar('parentid',$this->folder->parentid); 15 16 $list = array(); 17 18 // Schleife ueber alle Objekte in diesem Ordner 19 foreach( $this->folder->getObjects() as $o ) 20 { 21 /* @var $o BaseObject */ 22 23 $id = $o->objectid; 24 25 if ( $o->hasRight(Permission::ACL_READ) ) 26 { 27 $list[$id]['name'] = $o->getDefaultName()->name; 28 $list[$id]['filename'] = $o->filename; 29 $list[$id]['desc'] = $o->getDefaultName()->description; 30 if ( $list[$id]['desc'] == '' ) 31 $list[$id]['desc'] = \cms\base\Language::lang('NO_DESCRIPTION_AVAILABLE'); 32 $list[$id]['desc'] = $list[$id]['desc'].' - '.\cms\base\Language::lang('IMAGE').' '.$id; 33 34 $list[$id]['type'] = $o->getType(); 35 $list[$id]['id' ] = $id; 36 37 $list[$id]['icon' ] = $o->getType(); 38 $list[$id]['class'] = $o->getType(); 39 $list[$id]['url' ] = Html::url($o->getType(),'',$id); 40 41 if ( $o->getType() == 'file' ) 42 { 43 $file = new File( $id ); 44 $file->load(); 45 $list[$id]['desc'] .= ' - '.intval($file->size/1000).'kB'; 46 } 47 48 $list[$id]['date'] = $o->lastchangeDate; 49 $list[$id]['user'] = $o->lastchangeUser->getProperties(); 50 } 51 } 52 53 $this->setTemplateVar('object' ,$list ); 54 55 $this->setTemplateVar('add',parent::hasPermissionToAddAnyObject() ); 56 } 57 58 59 public function post() { 60 } 61 }
Downloadmodules/cms/action/folder/FolderEditAction.class.php
History Fri, 11 Mar 2022 20:14:46 +0100 dankert Fix: Do not output objects. Sun, 5 Dec 2021 20:33:24 +0100 dankert Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'. Fri, 3 Dec 2021 23:27:44 +0100 dankert New: Only allowed methods are shown in the dropdown menu; Some security enhancements. Thu, 4 Mar 2021 03:39:25 +0100 Jan Dankert New: Separate edit action for images and texts. Mon, 4 Jan 2021 19:03:18 +0100 Jan Dankert Refactoring: ACL class is renamed to Permission, because most RBAC/DMAC concepts are calling it a permission. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.