Marked delayed content with a separate label in moderation
authorMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 15:57:09 +0000 (17:57 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 15:57:09 +0000 (17:57 +0200)
com.woltlab.wcf/templates/moderationList.tpl
com.woltlab.wcf/templates/moderationQueueList.tpl
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php
wcfsetup/install/files/lib/page/ModerationListPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index f27cb37eea678f5828c484f8b060d9027747eed6..a083657c0584ae9f78b313536387da7585a97c4b 100644 (file)
@@ -83,7 +83,7 @@
                                                </td>
                                                <td class="columnText columnSubject">
                                                        <h3>
-                                                               <span class="badge label">{lang}wcf.moderation.type.{@$definitionNames[$entry->objectTypeID]}{/lang}</span>
+                                                               <span class="badge label">{$entry->getLabel()}</span>
                                                                <a href="{$entry->getLink()}" class="messageGroupLink">{$entry->getTitle()|tableWordwrap}</a>
                                                        </h3>
                                                        
index 3d4c95f4b39cdfaa06e2cf40a996c9ff08db3a64..ff9081ac9c94c20fbf983dafd8800353d0b9bdc3 100644 (file)
@@ -6,7 +6,7 @@
                        </div>
                        <div>
                                <h3>
-                                       <span class="badge label">{lang}wcf.moderation.type.{@$definitionNames[$queue->objectTypeID]}{/lang}</span>
+                                       <span class="badge label">{$queue->getLabel()}</span>
                                        <a href="{@$queue->getLink()}">{$queue->getAffectedObject()->getTitle()}</a>
                                </h3>
                                <small>{if $queue->getUserProfile()->userID}<a href="{link controller='User' object=$queue->getUserProfile()->getDecoratedObject()}{/link}">{$queue->getAffectedObject()->getUsername()}</a>{else}{$queue->getAffectedObject()->getUsername()}{/if} <span class="separatorLeft">{@$queue->lastChangeTime|time}</span></small>
index 90c9fcc5c431f2af722b0f97540d081d499f295e..6440a0ec1e8ba5771a9e219dc3fbda801a8e5634 100644 (file)
@@ -166,8 +166,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                }
                
                WCF::getTPL()->assign([
-                       'queues' => $queues,
-                       'definitionNames' => ModerationQueueManager::getInstance()->getDefinitionNamesByObjectTypeIDs()
+                       'queues' => $queues
                ]);
                
                return [
index 13403703f463884f0268cdd48ea30e4dc792e949..074908e6478bc65e05f7dd6e1a466e3d69ab63d4 100644 (file)
@@ -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);
+       }
 }
index 37b0ca04bad1a7b8291b94949531c8759446cfe3..d305505f4923b77ca5e6cc283a83e0ce853c4809 100644 (file)
@@ -128,7 +128,6 @@ class ModerationListPage extends SortablePage {
                        'assignedUserID' => $this->assignedUserID,
                        'availableDefinitions' => $this->availableDefinitions,
                        'definitionID' => $this->definitionID,
-                       'definitionNames' => ModerationQueueManager::getInstance()->getDefinitionNamesByObjectTypeIDs(),
                        'status' => $this->status
                ]);
        }
index c6568402341184696974fcedde21e45a74a92f45..39f2f50d21c9c46b73676df19b3c6e51b70c329d 100644 (file)
@@ -2611,6 +2611,7 @@ Fehler sind beispielsweise:
                <item name="wcf.moderation.type"><![CDATA[Typ]]></item>
                <item name="wcf.moderation.type.all"><![CDATA[Alle Einträge]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.moderation.activation"><![CDATA[Freischaltung]]></item>
+               <item name="wcf.moderation.type.com.woltlab.wcf.moderation.activation.delayed"><![CDATA[Zeitgesteuerte Freischaltung]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.moderation.report"><![CDATA[Meldung]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.comment.comment"><![CDATA[Kommentar]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.comment.response"><![CDATA[Antwort auf Kommentar]]></item>
index aeb409af4ccebd162737ae22b94890e1414b4519..682997bd66b5e4b2869558f70dc112965929b2c7 100644 (file)
@@ -2617,6 +2617,7 @@ Errors are:
                <item name="wcf.moderation.type"><![CDATA[Type]]></item>
                <item name="wcf.moderation.type.all"><![CDATA[All Items]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.moderation.activation"><![CDATA[Approval]]></item>
+               <item name="wcf.moderation.type.com.woltlab.wcf.moderation.activation.delayed"><![CDATA[Delayed]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.moderation.report"><![CDATA[Report]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.comment.comment"><![CDATA[Comment]]></item>
                <item name="wcf.moderation.type.com.woltlab.wcf.comment.response"><![CDATA[Comment Reply]]></item>