Added list of deleted content
authorMarcel Werk <burntime@woltlab.com>
Thu, 13 Jun 2013 23:22:04 +0000 (01:22 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 13 Jun 2013 23:22:04 +0000 (01:22 +0200)
com.woltlab.wcf/objectTypeDefinition.xml
com.woltlab.wcf/templates/deletedContentList.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/userPanel.tpl
wcfsetup/install/files/js/WCF.Moderation.js
wcfsetup/install/files/lib/page/DeletedContentListPage.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/moderation/IDeletedContentProvider.class.php [new file with mode: 0644]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 72c70e4241019c19477901f0ab1816fcfbc87a10..b53929cef2661e86e234a77a1876056e5950b53c 100644 (file)
                        <interfacename><![CDATA[wcf\system\tagging\ITaggable]]></interfacename>
                </definition>
                
+               <definition>
+                       <name>com.woltlab.wcf.deletedContent</name>
+                       <interfacename><![CDATA[wcf\system\moderation\IDeletedContentProvider]]></interfacename>
+               </definition>
+               
                <definition>
                        <name>com.woltlab.wcf.searchableObjectType</name>
                        <interfacename><![CDATA[wcf\system\search\ISearchableObjectType]]></interfacename>
diff --git a/com.woltlab.wcf/templates/deletedContentList.tpl b/com.woltlab.wcf/templates/deletedContentList.tpl
new file mode 100644 (file)
index 0000000..491cda2
--- /dev/null
@@ -0,0 +1,70 @@
+{include file='documentHeader'}
+
+<head>
+       <title>{lang}wcf.moderation.deletedContent.objectType.{@$objectType}{/lang} - {PAGE_TITLE|language}</title>
+       
+       {include file='headInclude'}
+</head>
+
+<body id="tpl{$templateName|ucfirst}">
+
+{capture assign='sidebar'}
+       <fieldset>
+               <legend>{lang}wcf.moderation.deletedContent.objectTypes{/lang}</legend>
+               
+               <nav>
+                       <ul>
+                               {foreach from=$availableObjectTypes item=availableObjectType}
+                                       <li{if $objectType == $availableObjectType->objectType} class="active"{/if}><a href="{link controller='DeletedContentList'}objectType={@$availableObjectType->objectType}{/link}">{lang}wcf.moderation.deletedContent.objectType.{@$availableObjectType->objectType}{/lang}</a></li>
+                               {/foreach}
+                       </ul>
+               </nav>
+       </fieldset>
+{/capture}
+
+{include file='header' sidebarOrientation='left'}
+
+<header class="boxHeadline">
+       <h1>{lang}wcf.moderation.deletedContent.{@$objectType}{/lang}</h1>
+</header>
+
+{include file='userNotice'}
+
+<div class="contentNavigation">
+       {pages print=true assign=pagesLinks controller='DeletedContentList' link="objectType=$objectType&pageNo=%d"}
+       
+       {hascontent}
+               <nav>
+                       <ul>
+                               {content}
+                                       {event name='contentNavigationButtonsTop'}
+                               {/content}
+                       </ul>
+               </nav>
+       {/hascontent}
+</div>
+
+{if $items}
+       {include file=$resultListTemplateName application=$resultListApplication}
+{else}
+       <p class="info">{lang}wcf.global.noItems{/lang}</p>
+{/if}
+
+<div class="contentNavigation">
+       {@$pagesLinks}
+       
+       {hascontent}
+               <nav>
+                       <ul>
+                               {content}
+                                       {event name='contentNavigationButtonsBottom'}
+                               {/content}
+                       </ul>
+               </nav>
+       {/hascontent}
+</div>
+
+{include file='footer'}
+
+</body>
+</html>
\ No newline at end of file
index bb4c687d9bfc58dfff09646ac26e22d4a3854e10..2e012225dbf8feb2c0e433706d12391d036a18f1 100644 (file)
                                $(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}');
                                });
                                //]]>
                        </script>
index 44c64705392ad68db944b2b7dd6850cd8d87133c..b54c2bf8bec897448a4509efcb116a4765b74220 100644 (file)
@@ -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);
                $('<li><a href="' + this._showAllLink + '">' + WCF.Language.get('wcf.moderation.showAll') + '</a></li>').appendTo(dropdownMenu);
+               this._addDivider(dropdownMenu);
+               $('<li><a href="' + this._deletedContentLink + '">' + WCF.Language.get('wcf.moderation.showDeletedContent') + '</a></li>').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 (file)
index 0000000..fdc755f
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+namespace wcf\page;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\exception\IllegalLinkException;
+use wcf\system\WCF;
+
+/**
+ * List of deleted content.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2013 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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 (file)
index 0000000..6578b8e
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+namespace wcf\system\moderation;
+
+/**
+ * Interface for deleted content provider.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2013 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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();
+}
index c22e993cf9f306a1c09394a12559989ca345609c..a1cb70bac10b5fa0743ea9e1fe76e1d63cb0a5b3 100644 (file)
@@ -1699,6 +1699,8 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getAllowedExtensions()
                <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>
                <item name="wcf.moderation.showAll"><![CDATA[Alle Einträge anzeigen]]></item>
+               <item name="wcf.moderation.showDeletedContent"><![CDATA[Gelöschte Inhalte anzeigen]]></item>
+               <item name="wcf.moderation.deletedContent.objectTypes"><![CDATA[Gelöschte Inhalte]]></item>
        </category>
        
        <category name="wcf.moderation.activation">
index e44e7cdad541d7e0310f28d77061d180dbb539fd..fda912091f543b477d57d7d9f6b8c674e7c715fd 100644 (file)
@@ -1698,6 +1698,8 @@ Allowed extensions: {', '|implode:$attachmentHandler->getAllowedExtensions()}]]>
                <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>
                <item name="wcf.moderation.showAll"><![CDATA[Show All Items]]></item>
+               <item name="wcf.moderation.showDeletedContent"><![CDATA[TODO: Gelöschte Inhalte anzeigen]]></item>
+               <item name="wcf.moderation.deletedContent.objectTypes"><![CDATA[TODO: Gelöschte Inhalte]]></item>
        </category>
        
        <category name="wcf.moderation.activation">