openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2c4a2254b167bd30a462b49a96e95f4373730781
parent d9bc673781f1903b046dc8119f586552482e61bf
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 10 Jan 2019 22:42:42 +0100

Cleanup: Alte Methoden entfernt. Sortierung nach Dateinamen eingebaut.

Diffstat:
modules/cms-core/action/FolderAction.class.php | 107-------------------------------------------------------------------------------
modules/cms-ui/themes/default/html/views/folder/order.php | 22+++++++++++++++++++---
modules/cms-ui/themes/default/html/views/folder/order.tpl.src.xml | 18+++++++++++++++---
3 files changed, 34 insertions(+), 113 deletions(-)

diff --git a/modules/cms-core/action/FolderAction.class.php b/modules/cms-core/action/FolderAction.class.php @@ -429,36 +429,6 @@ class FolderAction extends ObjectAction } - // Reihenfolge von Objekten aendern - public function changesequencePost() - { - $ids = $this->folder->getObjectIds(); - $seq = 0; - foreach( $ids as $id ) - { - $seq++; // Sequenz um 1 erhoehen - - // Die beiden Ordner vertauschen - if ( $id == $this->getRequestVar('objectid1') ) - $id = $this->getRequestVar('objectid2'); - elseif ( $id == $this->getRequestVar('objectid2') ) - $id = $this->getRequestVar('objectid1'); - - $o = new BaseObject( $id ); - $o->setOrderId( $seq ); - - unset( $o ); // Selfmade Garbage Collection :-) - } - - $this->addNotice($this->folder->getType(),$this->folder->name,'SEQUENCE_CHANGED','ok'); - $this->folder->setTimestamp(); - - // Ordner anzeigen - $this->callSubAction('order'); - - } - - private function OLD__________editPost() { $type = $this->getRequestVar('type'); // Typ der Aktion, z.B "copy" oder "move" @@ -820,66 +790,6 @@ class FolderAction extends ObjectAction - public function settopPost() - { - $o = new BaseObject( $this->getRequestVar('objectid1') ); - $o->setOrderId( 1 ); - - $ids = $this->folder->getObjectIds(); - $seq = 1; - - foreach( $ids as $id ) - { - if ( $id != $this->getRequestVar('objectid1') ) - { - $seq++; // Sequenz um 1 erhoehen - - $o = new BaseObject( $id ); - $o->setOrderId( $seq ); - - unset( $o ); // Selfmade Garbage Collection :-) - } - } - - $this->addNotice($this->folder->getType(),$this->folder->name,'SEQUENCE_CHANGED','ok'); - $this->folder->setTimestamp(); - - // Ordner anzeigen - $this->callSubAction('order'); - } - - - public function setbottomPost() - { - $ids = $this->folder->getObjectIds(); - $seq = 0; - - foreach( $ids as $id ) - { - if ( $id != $this->getRequestVar('objectid1') ) - { - $seq++; // Sequenz um 1 erhoehen - - $o = new BaseObject( $id ); - $o->setOrderId( $seq ); - - unset( $o ); // Selfmade Garbage Collection :-) - } - } - - $seq++; // Sequenz um 1 erhoehen - $o = new BaseObject( $this->getRequestVar('objectid1') ); - $o->setOrderId( $seq ); - - $this->addNotice($this->folder->getType(),$this->folder->name,'SEQUENCE_CHANGED','ok'); - $this->folder->setTimestamp(); - - // Ordner anzeigen - $this->callSubAction('order'); - - } - - /** * Alias für Methode 'create'. */ @@ -1337,29 +1247,12 @@ class FolderAction extends ObjectAction $list[$id]['date'] = $o->lastchangeDate; $list[$id]['user'] = $o->lastchangeUser; - if ( $last_objectid != 0 && $o->hasRight(ACL_WRITE) ) - { - $list[$id ]['upurl' ] = Html::url('folder','changesequence',0,array( - 'objectid1'=>$id, - 'objectid2'=>$last_objectid)); - $list[$last_objectid]['downurl' ] = $list[$id]['upurl']; - $list[$last_objectid]['bottomurl'] = Html::url('folder','setbottom',0,array( - 'objectid1'=>$last_objectid)); - $list[$id ]['topurl' ] = Html::url('folder','settop',0,array( - 'objectid1'=>$id)); - } - $last_objectid = $id; } } - $this->setTemplateVar('flip_url' ,Html::url('folder','reorder',0,array('type'=>'flip' )) ); - $this->setTemplateVar('orderbyname_url' ,Html::url('folder','reorder',0,array('type'=>'name' )) ); - $this->setTemplateVar('orderbytype_url' ,Html::url('folder','reorder',0,array('type'=>'type' )) ); - $this->setTemplateVar('orderbylastchange_url',Html::url('folder','reorder',0,array('type'=>'lastchange')) ); $this->setTemplateVar('object' ,$list ); $this->setTemplateVar('act_objectid',$this->folder->id); - $this->setTemplateVar('token',token() ); } diff --git a/modules/cms-ui/themes/default/html/views/folder/order.php b/modules/cms-ui/themes/default/html/views/folder/order.php @@ -3,15 +3,23 @@ <form name="" target="_self" data-target="view" action="./" data-method="order" data-action="folder" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="or-form folder" data-async="" data-autosave=""><input type="hidden" name="<?php echo REQ_PARAM_EMBED ?>" value="1" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="folder" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="order" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" /> <div class="table-wrapper"><div class="table-filter"><input type="search" name="filter" placeholder="<?php echo lang('SEARCH_FILTER') ?>" /></div><table class="or-table--sortable" width="100%"></div> <tr class="headline"> - <td class="help clickable"> + <td class="help"> <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'FOLDER_ORDER'.'')))); ?></span> </td> - <td class="help clickable"> + <td class="help"> + <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'GLOBAL_TYPE'.'')))); ?></span> + + </td> + <td class="help"> <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'GLOBAL_NAME'.'')))); ?></span> </td> - <td class="help clickable"> + <td class="help"> + <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'GLOBAL_FILENAME'.'')))); ?></span> + + </td> + <td class="help"> <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'GLOBAL_LASTCHANGE'.'')))); ?></span> </td> @@ -23,12 +31,20 @@ </td> <td> + <span class="sort-value"><?php echo nl2br(encodeHtml(htmlentities($icon))); ?></span> + <img src="./modules/cms-ui/themes/default/images/icon_<?php echo $icon ?>.png" /> + </td> + <td> <span><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span> </td> <td> + <span><?php echo nl2br(encodeHtml(htmlentities($filename))); ?></span> + + </td> + <td> <?php include_once( 'modules/template-engine/components/html/date/component-date.php') ?><?php component_date($date) ?> </td> diff --git a/modules/cms-ui/themes/default/html/views/folder/order.tpl.src.xml b/modules/cms-ui/themes/default/html/views/folder/order.tpl.src.xml @@ -4,13 +4,19 @@ <table class="or-table--sortable"> <row class="headline"> - <column class="help clickable"> + <column class="help"> <text key="FOLDER_ORDER"></text> </column> - <column class="help clickable"> + <column class="help"> + <text key="GLOBAL_TYPE"></text> + </column> + <column class="help"> <text key="GLOBAL_NAME"></text> </column> - <column class="help clickable"> + <column class="help"> + <text key="GLOBAL_FILENAME"></text> + </column> + <column class="help"> <text key="GLOBAL_LASTCHANGE"></text> </column> </row> @@ -20,10 +26,16 @@ <text raw="_"></text> </column> <column> + <text class="sort-value" value="var:icon" /> <image type="var:icon"></image> + </column> + <column> <text var="name"></text> </column> <column> + <text var="filename"></text> + </column> + <column> <date date="var:date"></date> </column> </row>