From 92d2be2b289a4d7dd2f529017967b2e7f1e7ebcc Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Tue, 4 Jun 2013 22:54:11 +0200 Subject: [PATCH] Add suspension list to ACP [WIP] --- acptemplate/suspensionList.tpl | 47 ++++++++++++++++ .../lib/acp/page/SuspensionListPage.class.php | 56 +++++++++++++++++++ .../data/suspension/SuspensionList.class.php | 9 +++ 3 files changed, 112 insertions(+) create mode 100644 acptemplate/suspensionList.tpl create mode 100644 file/lib/acp/page/SuspensionListPage.class.php create mode 100644 file/lib/data/suspension/SuspensionList.class.php diff --git a/acptemplate/suspensionList.tpl b/acptemplate/suspensionList.tpl new file mode 100644 index 0000000..8eaace1 --- /dev/null +++ b/acptemplate/suspensionList.tpl @@ -0,0 +1,47 @@ +{include file='header' pageTitle='chat.acp.suspension.list'} + +
+

{lang}chat.acp.suspension.list{/lang}

+
+ +{if $objects|count} +
+
+

{lang}wcf.acp.suspension.list{/lang} {#$items}

+
+ + + + + + + + + + + + + + + + + {foreach from=$objects item=$suspension} + + + + + + + + + {/foreach} + +
{lang}wcf.global.objectID{/lang}{lang}wcf.acp.chat.userID{/lang}{lang}wcf.acp.chat.username{/lang}{lang}wcf.acp.chat.roomID{/lang}{lang}wcf.acp.chat.type{/lang}{lang}wcf.acp.chat.expires{/lang}
{@$suspension->suspensionID}{@$suspension->userID}{@$suspension->username}{@$suspension->roomID}{@$suspension->type}{@$suspension->expires|date}
+ +
+{/if} + + +{include file='footer'} diff --git a/file/lib/acp/page/SuspensionListPage.class.php b/file/lib/acp/page/SuspensionListPage.class.php new file mode 100644 index 0000000..8e1f64b --- /dev/null +++ b/file/lib/acp/page/SuspensionListPage.class.php @@ -0,0 +1,56 @@ + + * @package be.bastelstu.chat + * @subpackage acp.page + */ +class SuspensionListPage extends \wcf\page\SortablePage { + /** + * @see \wcf\page\AbstractPage::$activeMenuItem + */ + public $activeMenuItem = 'chat.acp.menu.link.suspension.list'; + + /** + * @see \wcf\page\AbstractPage::$neededPermissions + */ + public $neededPermissions = array(); + + /** + * @see wcf\page\SortablePage::$defaultSortField + */ + public $defaultSortField = 'username'; + + /** + * @see wcf\page\MultipleLinkPage::$itemsPerPage + */ + public $itemsPerPage = 50; + + /** + * @see wcf\page\SortablePage::$validSortFields + */ + public $validSortFields = array('suspensionID', 'userID', 'username', 'roomID', 'type', 'expires'); + + /** + * @see wcf\page\MultipleLinkPage::$objectListClassName + */ + public $objectListClassName = 'chat\data\suspension\SuspensionList'; + + /** + * @see wcf\page\MultipleLinkPage::readObjects() + */ + protected function initObjectList() { + parent::initObjectList(); + + $this->objectList->sqlSelects .= "user.username"; + $this->objectList->sqlJoins .= "LEFT JOIN + wcf".WCF_N."_user AS user + ON suspension.userID = user.userID"; + } +} diff --git a/file/lib/data/suspension/SuspensionList.class.php b/file/lib/data/suspension/SuspensionList.class.php new file mode 100644 index 0000000..9a87032 --- /dev/null +++ b/file/lib/data/suspension/SuspensionList.class.php @@ -0,0 +1,9 @@ +