From: Marcel Werk Date: Tue, 19 Jul 2016 15:57:09 +0000 (+0200) Subject: Marked delayed content with a separate label in moderation X-Git-Tag: 3.0.0_Beta_1~1040 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8983117678c87934ef5ec1e190b1e4166e7fb4ea;p=GitHub%2FWoltLab%2FWCF.git Marked delayed content with a separate label in moderation --- diff --git a/com.woltlab.wcf/templates/moderationList.tpl b/com.woltlab.wcf/templates/moderationList.tpl index f27cb37eea..a083657c05 100644 --- a/com.woltlab.wcf/templates/moderationList.tpl +++ b/com.woltlab.wcf/templates/moderationList.tpl @@ -83,7 +83,7 @@

- {lang}wcf.moderation.type.{@$definitionNames[$entry->objectTypeID]}{/lang} + {$entry->getLabel()} {$entry->getTitle()|tableWordwrap}

diff --git a/com.woltlab.wcf/templates/moderationQueueList.tpl b/com.woltlab.wcf/templates/moderationQueueList.tpl index 3d4c95f4b3..ff9081ac9c 100644 --- a/com.woltlab.wcf/templates/moderationQueueList.tpl +++ b/com.woltlab.wcf/templates/moderationQueueList.tpl @@ -6,7 +6,7 @@

- {lang}wcf.moderation.type.{@$definitionNames[$queue->objectTypeID]}{/lang} + {$queue->getLabel()} {$queue->getAffectedObject()->getTitle()}

{if $queue->getUserProfile()->userID}{$queue->getAffectedObject()->getUsername()}{else}{$queue->getAffectedObject()->getUsername()}{/if} {@$queue->lastChangeTime|time} diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 90c9fcc5c4..6440a0ec1e 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -166,8 +166,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { } WCF::getTPL()->assign([ - 'queues' => $queues, - 'definitionNames' => ModerationQueueManager::getInstance()->getDefinitionNamesByObjectTypeIDs() + 'queues' => $queues ]); return [ diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php index 13403703f4..074908e647 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php @@ -11,6 +11,7 @@ use wcf\system\bbcode\SimpleMessageParser; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\moderation\queue\ModerationQueueManager; use wcf\system\visitTracker\VisitTracker; +use wcf\system\WCF; /** * Represents a viewable moderation queue entry. @@ -177,4 +178,19 @@ class ViewableModerationQueue extends DatabaseObjectDecorator implements ILinkab return false; } + + /** + * Returns the label for this queue entry. + * + * @return string + */ + public function getLabel() { + $definition = ObjectTypeCache::getInstance()->getDefinition(ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->definitionID); + + if ($definition->definitionName == 'com.woltlab.wcf.moderation.activation' && $this->getAffectedObject()->enableTime) { + return WCF::getLanguage()->get('wcf.moderation.type.com.woltlab.wcf.moderation.activation.delayed'); + } + + return WCF::getLanguage()->get('wcf.moderation.type.'.$definition->definitionName); + } } diff --git a/wcfsetup/install/files/lib/page/ModerationListPage.class.php b/wcfsetup/install/files/lib/page/ModerationListPage.class.php index 37b0ca04ba..d305505f49 100644 --- a/wcfsetup/install/files/lib/page/ModerationListPage.class.php +++ b/wcfsetup/install/files/lib/page/ModerationListPage.class.php @@ -128,7 +128,6 @@ class ModerationListPage extends SortablePage { 'assignedUserID' => $this->assignedUserID, 'availableDefinitions' => $this->availableDefinitions, 'definitionID' => $this->definitionID, - 'definitionNames' => ModerationQueueManager::getInstance()->getDefinitionNamesByObjectTypeIDs(), 'status' => $this->status ]); } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c656840234..39f2f50d21 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2611,6 +2611,7 @@ Fehler sind beispielsweise: + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index aeb409af4c..682997bd66 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2617,6 +2617,7 @@ Errors are: +