From 340866e3995659a88f99b392ca020223c86580eb Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 25 Dec 2015 09:45:37 +0100 Subject: [PATCH] Add clipboard for media page --- com.woltlab.wcf/clipboardAction.xml | 1 + .../install/files/acp/templates/mediaList.tpl | 47 +++++++++++++++++-- .../lib/acp/page/MediaListPage.class.php | 25 +++++++--- 3 files changed, 63 insertions(+), 10 deletions(-) diff --git a/com.woltlab.wcf/clipboardAction.xml b/com.woltlab.wcf/clipboardAction.xml index cbe7ec5302..8e0eea694a 100644 --- a/com.woltlab.wcf/clipboardAction.xml +++ b/com.woltlab.wcf/clipboardAction.xml @@ -100,6 +100,7 @@ 2 + diff --git a/wcfsetup/install/files/acp/templates/mediaList.tpl b/wcfsetup/install/files/acp/templates/mediaList.tpl index f1ef8a9a9e..75d296d323 100644 --- a/wcfsetup/install/files/acp/templates/mediaList.tpl +++ b/wcfsetup/install/files/acp/templates/mediaList.tpl @@ -1,5 +1,42 @@ {include file='header' pageTitle='wcf.acp.media.list'} + +

{lang}wcf.acp.media.list{/lang}

{lang}wcf.acp.media.stats{/lang}

@@ -72,9 +109,10 @@ TODO: add file search

{lang}wcf.acp.media.list{/lang} {#$items}

- +
+ @@ -86,9 +124,10 @@ TODO: add file search {foreach from=$objects item=media} - + + @@ -123,6 +162,8 @@ TODO: add file search {event name='contentNavigationButtonsBottom'} + + {else}

{lang}wcf.global.noItems{/lang}

diff --git a/wcfsetup/install/files/lib/acp/page/MediaListPage.class.php b/wcfsetup/install/files/lib/acp/page/MediaListPage.class.php index 3e62846610..6bd7668433 100644 --- a/wcfsetup/install/files/lib/acp/page/MediaListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/MediaListPage.class.php @@ -2,6 +2,8 @@ namespace wcf\acp\page; use wcf\data\media\ViewableMediaList; use wcf\page\SortablePage; +use wcf\system\clipboard\ClipboardHandler; +use wcf\system\WCF; /** * Shows the list of media entries. @@ -16,32 +18,32 @@ use wcf\page\SortablePage; */ class MediaListPage extends SortablePage { /** - * @inheritdoc + * @inheritDoc */ public $activeMenuItem = 'wcf.acp.menu.link.media.list'; /** - * @inheritdoc + * @inheritDoc */ public $defaultSortField = 'uploadTime'; /** - * @inheritdoc + * @inheritDoc */ public $defaultSortOrder = 'DESC'; /** - * @inheritdoc + * @inheritDoc */ public $neededPermissions = ['admin.content.cms.canManageMedia']; /** - * @inheritdoc + * @inheritDoc */ public $objectListClassName = ViewableMediaList::class; /** - * @inheritdoc + * @inheritDoc */ public $validSortFields = [ 'filename', @@ -52,7 +54,16 @@ class MediaListPage extends SortablePage { ]; /** - * @inheritdoc + * @inheritDoc + */ + public function assignVariables() { + parent::assignVariables(); + + WCF::getTPL()->assign('hasMarkedItems', ClipboardHandler::getInstance()->hasMarkedItems(ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.media'))); + } + + /** + * @inheritDoc */ protected function readObjects() { if ($this->sqlOrderBy && $this->sortField == 'mediaID') { -- 2.20.1
{lang}wcf.global.objectID{/lang} {lang}wcf.media.filename{/lang} {lang}wcf.media.uploadTime{/lang}
- + {event name='rowButtons'}