<nav>
<ul>
{if !$queue->isDone()}
- <li class="jsOnly"><a id="enableContent" class="button"><span class="icon icon16 icon-check"></span> <span>{lang}wcf.moderation.activation.enableContent{/lang}</span></a></li>
+ {if $queueManager->canRemoveContent($queue->getDecoratedObject())}<li class="jsOnly"><a id="enableContent" class="button"><span class="icon icon16 icon-check"></span> <span>{lang}wcf.moderation.activation.enableContent{/lang}</span></a></li>{/if}
<li class="jsOnly"><a id="removeContent" class="button"><span class="icon icon16 icon-remove"></span> <span>{lang}wcf.moderation.activation.removeContent{/lang}</span></a></li>
{/if}
<li><a href="{link controller='ModerationList'}{/link}" class="button"><span class="icon icon16 icon-list"></span> <span>{lang}wcf.moderation.moderation{/lang}</span></a></li>
<nav>
<ul>
{if !$queue->isDone()}
- <li class="jsOnly"><a id="removeContent" class="button"><span class="icon icon16 icon-remove"></span> <span>{lang}wcf.moderation.report.removeContent{/lang}</span></a></li>
+ {if $queueManager->canRemoveContent($queue->getDecoratedObject())}<li class="jsOnly"><a id="removeContent" class="button"><span class="icon icon16 icon-remove"></span> <span>{lang}wcf.moderation.report.removeContent{/lang}</span></a></li>{/if}
<li class="jsOnly"><a id="removeReport" class="button"><span class="icon icon16 icon-remove"></span> <span>{lang}wcf.moderation.report.removeReport{/lang}</span></a></li>
{/if}
<li><a href="{link controller='ModerationList'}{/link}" class="button"><span class="icon icon16 icon-list"></span> <span>{lang}wcf.moderation.moderation{/lang}</span></a></li>
{include file='userListItem'}
</ol>
</div>
-
-<script data-relocate="true">
- //<![CDATA[
- $(function() {
- $('#removeContent').hide();
- });
- //]]>
-</script>
parent::assignVariables();
WCF::getTPL()->assign(array(
- 'disabledContent' => ModerationQueueActivationManager::getInstance()->getDisabledContent($this->queue)
+ 'disabledContent' => ModerationQueueActivationManager::getInstance()->getDisabledContent($this->queue),
+ 'queueManager' => ModerationQueueActivationManager::getInstance()
));
}
}
parent::assignVariables();
WCF::getTPL()->assign(array(
- 'reportedContent' => ModerationQueueReportManager::getInstance()->getReportedContent($this->queue)
+ 'reportedContent' => ModerationQueueReportManager::getInstance()->getReportedContent($this->queue),
+ 'queueManager' => ModerationQueueReportManager::getInstance()
));
}
}
<?php
namespace wcf\system\moderation\queue;
+use wcf\data\moderation\queue\ModerationQueue;
use wcf\data\moderation\queue\ModerationQueueAction;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
$queueAction->executeAction();
}
}
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::canRemoveContent()
+ */
+ public function canRemoveContent(ModerationQueue $queue) {
+ return true;
+ }
}
ModerationQueueManager::getInstance()->getProcessor($this->definitionName, null, $objectTypeID)->populate($objects);
}
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueManager::canRemoveContent()
+ */
+ public function canRemoveContent(ModerationQueue $queue) {
+ return $this->getProcessor(null, $queue->objectTypeID)->canRemoveContent($queue);
+ }
+
/**
* @see \wcf\system\moderation\queue\IModerationQueueManager::removeContent()
*/
*/
public function removeContent(ModerationQueue $queue, $message);
+ /**
+ * Returns true if the affected content may be removed.
+ *
+ * @return boolean
+ */
+ public function canRemoveContent(ModerationQueue $queue);
+
/**
* Removes queses from database, should only be called if the referenced
* object is permanently deleted.
*/
public function populate($objectTypeID, array $objects);
+ /**
+ * Returns whether the afftected content may be removed.
+ *
+ * @param \wcf\data\moderation\queue\ModerationQueue $queue
+ * @return boolean
+ */
+ public function canRemoveContent(ModerationQueue $queue);
+
/**
* Removes affected content. It is up to the processing object to use a
* soft-delete or remove the content permanently.
}
}
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::canRemoveContent()
+ */
+ public function canRemoveContent(ModerationQueue $queue) {
+ return false;
+ }
+
/**
* @see \wcf\system\moderation\queue\IModerationQueueHandler::removeContent()
*/