From: Marcel Werk Date: Thu, 13 Jun 2013 23:22:04 +0000 (+0200) Subject: Added list of deleted content X-Git-Tag: 2.0.0_Beta_4~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07d8203e5672cebd20fac538bf35ccf65069aeae;p=GitHub%2FWoltLab%2FWCF.git Added list of deleted content --- diff --git a/com.woltlab.wcf/objectTypeDefinition.xml b/com.woltlab.wcf/objectTypeDefinition.xml index 72c70e4241..b53929cef2 100644 --- a/com.woltlab.wcf/objectTypeDefinition.xml +++ b/com.woltlab.wcf/objectTypeDefinition.xml @@ -115,6 +115,11 @@ + + com.woltlab.wcf.deletedContent + + + com.woltlab.wcf.searchableObjectType diff --git a/com.woltlab.wcf/templates/deletedContentList.tpl b/com.woltlab.wcf/templates/deletedContentList.tpl new file mode 100644 index 0000000000..491cda28a7 --- /dev/null +++ b/com.woltlab.wcf/templates/deletedContentList.tpl @@ -0,0 +1,70 @@ +{include file='documentHeader'} + + + {lang}wcf.moderation.deletedContent.objectType.{@$objectType}{/lang} - {PAGE_TITLE|language} + + {include file='headInclude'} + + + + +{capture assign='sidebar'} +
+ {lang}wcf.moderation.deletedContent.objectTypes{/lang} + + +
+{/capture} + +{include file='header' sidebarOrientation='left'} + +
+

{lang}wcf.moderation.deletedContent.{@$objectType}{/lang}

+
+ +{include file='userNotice'} + +
+ {pages print=true assign=pagesLinks controller='DeletedContentList' link="objectType=$objectType&pageNo=%d"} + + {hascontent} + + {/hascontent} +
+ +{if $items} + {include file=$resultListTemplateName application=$resultListApplication} +{else} +

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

+{/if} + +
+ {@$pagesLinks} + + {hascontent} + + {/hascontent} +
+ +{include file='footer'} + + + \ No newline at end of file diff --git a/com.woltlab.wcf/templates/userPanel.tpl b/com.woltlab.wcf/templates/userPanel.tpl index bb4c687d9b..2e012225db 100644 --- a/com.woltlab.wcf/templates/userPanel.tpl +++ b/com.woltlab.wcf/templates/userPanel.tpl @@ -188,10 +188,11 @@ $(function() { WCF.Language.addObject({ 'wcf.moderation.noMoreItems': '{lang}wcf.moderation.noMoreItems{/lang}', - 'wcf.moderation.showAll': '{lang}wcf.moderation.showAll{/lang}' + 'wcf.moderation.showAll': '{lang}wcf.moderation.showAll{/lang}', + 'wcf.moderation.showDeletedContent': '{lang}wcf.moderation.showDeletedContent{/lang}' }); - new WCF.Moderation.UserPanel('{link controller='ModerationList'}{/link}'); + new WCF.Moderation.UserPanel('{link controller='ModerationList'}{/link}', '{link controller='DeletedContentList'}{/link}'); }); //]]> diff --git a/wcfsetup/install/files/js/WCF.Moderation.js b/wcfsetup/install/files/js/WCF.Moderation.js index 44c6470539..b54c2bf8be 100644 --- a/wcfsetup/install/files/js/WCF.Moderation.js +++ b/wcfsetup/install/files/js/WCF.Moderation.js @@ -353,12 +353,19 @@ WCF.Moderation.UserPanel = WCF.UserPanel.extend({ */ _showAllLink: '', + /** + * link to deleted content list + * @var string + */ + _deletedContentLink: '', + /** * @see WCF.UserPanel.init() */ - init: function(showAllLink) { + init: function(showAllLink, deletedContentLink) { this._noItems = 'wcf.moderation.noMoreItems'; this._showAllLink = showAllLink; + this._deletedContentLink = deletedContentLink; this._super('outstandingModeration'); }, @@ -369,6 +376,8 @@ WCF.Moderation.UserPanel = WCF.UserPanel.extend({ _addDefaultItems: function(dropdownMenu) { this._addDivider(dropdownMenu); $('
  • ' + WCF.Language.get('wcf.moderation.showAll') + '
  • ').appendTo(dropdownMenu); + this._addDivider(dropdownMenu); + $('
  • ' + WCF.Language.get('wcf.moderation.showDeletedContent') + '
  • ').appendTo(dropdownMenu); }, /** diff --git a/wcfsetup/install/files/lib/page/DeletedContentListPage.class.php b/wcfsetup/install/files/lib/page/DeletedContentListPage.class.php new file mode 100644 index 0000000000..fdc755f47a --- /dev/null +++ b/wcfsetup/install/files/lib/page/DeletedContentListPage.class.php @@ -0,0 +1,74 @@ + + * @package com.woltlab.wcf + * @subpackage page + * @category Community Framework + */ +class DeletedContentListPage extends MultipleLinkPage { + /** + * @see wcf\page\AbstractPage::$loginRequired + */ + public $loginRequired = true; + + /** + * @see wcf\page\AbstractPage::$neededPermissions + */ + public $neededPermissions = array('mod.general.canUseModeration'); + + /** + * object type object + * @var wcf\data\object\type\ObjectType + */ + public $objectType = null; + + /** + * @see wcf\page\IPage::readParameters() + */ + public function readParameters() { + parent::readParameters(); + + // get object type + if (isset($_REQUEST['objectType'])) { + $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.deletedContent', $_REQUEST['objectType']); + if ($this->objectType === null) { + throw new IllegalLinkException(); + } + } + else { + // use first object type + $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.deletedContent'); + $this->objectType = reset($objectTypes); + } + } + + /** + * @see wcf\page\MultipleLinkPage::readParameters() + */ + protected function initObjectList() { + $this->objectList = $this->objectType->getProcessor()->getObjectList(); + } + + /** + * @see wcf\page\IPage::assignVariables() + */ + public function assignVariables() { + parent::assignVariables(); + + WCF::getTPL()->assign(array( + 'availableObjectTypes' => ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.deletedContent'), + 'objectType' => $this->objectType->objectType, + 'resultListTemplateName' => $this->objectType->getProcessor()->getTemplateName(), + 'resultListApplication' => $this->objectType->getProcessor()->getApplication() + )); + } +} diff --git a/wcfsetup/install/files/lib/system/moderation/IDeletedContentProvider.class.php b/wcfsetup/install/files/lib/system/moderation/IDeletedContentProvider.class.php new file mode 100644 index 0000000000..6578b8e56d --- /dev/null +++ b/wcfsetup/install/files/lib/system/moderation/IDeletedContentProvider.class.php @@ -0,0 +1,35 @@ + + * @package com.woltlab.wcf + * @subpackage system.moderation + * @category Community Framework + */ +interface IDeletedContentProvider { + /** + * Returns a list of deleted content. + * + * @return wcf\data\DatabaseObjectList + */ + public function getObjectList(); + + /** + * Returns the template name for the result output. + * + * @return string + */ + public function getTemplateName(); + + /** + * Returns the application of the result template. + * + * @return string + */ + public function getApplication(); +} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c22e993cf9..a1cb70bac1 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1699,6 +1699,8 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getAllowedExtensions() + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index e44e7cdad5..fda912091f 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1698,6 +1698,8 @@ Allowed extensions: {', '|implode:$attachmentHandler->getAllowedExtensions()}]]> + +