1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Add suspension list to ACP [WIP]

This commit is contained in:
Maximilian Mader 2013-06-04 22:54:11 +02:00
parent 2c6a5c0c69
commit 92d2be2b28
3 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,47 @@
{include file='header' pageTitle='chat.acp.suspension.list'}
<header class="boxHeadline">
<h1>{lang}chat.acp.suspension.list{/lang}</h1>
</header>
{if $objects|count}
<div class="tabularBox tabularBoxTitle marginTop">
<header>
<h2>{lang}wcf.acp.suspension.list{/lang} <span class="badge badgeInverse">{#$items}</span></h2>
</header>
<!--
'suspensionID', 'userID', 'username', 'roomID', 'type', 'expires'
-->
<table class="table">
<thead>
<tr>
<th class="columnID{if $sortField == 'suspensionID'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=suspensionID&sortOrder={if $sortField == 'suspensionID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
<th class="columnUserID{if $sortField == 'userID'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=userID&sortOrder={if $sortField == 'userID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.chat.userID{/lang}</a></th>
<th class="columnUsername{if $sortField == 'username'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=username&sortOrder={if $sortField == 'username' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.chat.username{/lang}</a></th>
<th class="columnRoomID{if $sortField == 'roomID'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=roomID&sortOrder={if $sortField == 'roomID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.chat.roomID{/lang}</a></th>
<th class="columnType{if $sortField == 'type'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=type&sortOrder={if $sortField == 'type' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.chat.type{/lang}</a></th>
<th class="columnExpires{if $sortField == 'expires'} active {@$sortOrder}{/if}"><a href="{link application='chat' controller='SuspensionList'}pageNo={@$pageNo}&sortField=expires&sortOrder={if $sortField == 'expires' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.chat.expires{/lang}</a></th>
</tr>
</thead>
<tbody>
{foreach from=$objects item=$suspension}
<tr>
<td id="columnID">{@$suspension->suspensionID}</td>
<td id="columnUserID">{@$suspension->userID}</td>
<td id="columnUsername">{@$suspension->username}</td>
<td id="columnRoomID">{@$suspension->roomID}</td>
<td id="columnType">{@$suspension->type}</td>
<td id="columnExpires">{@$suspension->expires|date}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{include file='footer'}

View File

@ -0,0 +1,56 @@
<?php
namespace chat\acp\page;
use \wcf\system\WCF;
/**
* Lists chat suspensions.
*
* @author Maximilian Mader
* @copyright 2010-2013 Tim Düsterhus
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
* @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";
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace chat\data\suspension;
class SuspensionList extends \wcf\data\DatabaseObjectList {
/**
* @see wcf\data\DatabaseObjectList::$className
*/
public $className = 'chat\data\suspension\Suspension';
}