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

Add pagination to chatSuspensionList and rename variables in chatSuspensionList.tpl and ChatSuspensionListPage.class.php

This commit is contained in:
Maximilian Mader 2013-06-21 20:18:33 +02:00
parent 7cf72a0326
commit eb27166c6c
2 changed files with 23 additions and 18 deletions

View File

@ -12,7 +12,7 @@
<header class="boxHeadline"> <header class="boxHeadline">
<h1>{lang}chat.acp.suspension.list{/lang}</h1> <h1>{lang}chat.acp.suspension.list{/lang}</h1>
</header> </header>
{if $objects|count} {if $objects|count}
<form method="post" action="{link controller='ChatSuspensionList' application='chat'}{/link}"> <form method="post" action="{link controller='ChatSuspensionList' application='chat'}{/link}">
<div class="container containerPadding marginTop"> <div class="container containerPadding marginTop">
@ -22,14 +22,14 @@
<dl> <dl>
<dt><label for="username">{lang}wcf.user.username{/lang}</label></dt> <dt><label for="username">{lang}wcf.user.username{/lang}</label></dt>
<dd> <dd>
<input type="text" id="username" name="username" class="medium" value="{$filterUsername}" /> <input type="text" id="username" name="username" class="medium" value="{$username}" />
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="issuerUsername">{lang}chat.acp.suspension.issuer{/lang}</label></dt> <dt><label for="issuerUsername">{lang}chat.acp.suspension.issuer{/lang}</label></dt>
<dd> <dd>
<input type="text" id="issuerUsername" name="issuerUsername" class="medium" value="{$filterIssuerUsername}" /> <input type="text" id="issuerUsername" name="issuerUsername" class="medium" value="{$issuerUsername}" />
</dd> </dd>
</dl> </dl>
@ -37,11 +37,11 @@
<dt><label for="roomID">{lang}chat.general.room{/lang}</label></dt> <dt><label for="roomID">{lang}chat.general.room{/lang}</label></dt>
<dd> <dd>
<select id="roomID" name="roomID"> <select id="roomID" name="roomID">
<option value="-1"{if $filterRoomID == -1} selected="selected"{/if}></option> <option value="-1"{if $roomID == -1} selected="selected"{/if}></option>
<option value="0"{if $filterRoomID == 0} selected="selected"{/if}>{lang}chat.room.global{/lang}</option> <option value="0"{if $roomID == 0} selected="selected"{/if}>{lang}chat.room.global{/lang}</option>
<option value="" disabled="disabled">&mdash;&mdash;&mdash;&mdash;</option> <option value="" disabled="disabled">&mdash;&mdash;&mdash;&mdash;</option>
{foreach from=$availableRooms key=id item=room} {foreach from=$availableRooms key=id item=room}
<option value="{$id}" {if $filterRoomID == $id}selected="selected"{/if}>{$room}</option> <option value="{$id}" {if $roomID == $id}selected="selected"{/if}>{$room}</option>
{/foreach} {/foreach}
</select> </select>
</dd> </dd>
@ -51,9 +51,9 @@
<dt><label for="suspensionType">{lang}chat.acp.suspension.type{/lang}</label></dt> <dt><label for="suspensionType">{lang}chat.acp.suspension.type{/lang}</label></dt>
<dd> <dd>
<select id="suspensionType" name="suspensionType"> <select id="suspensionType" name="suspensionType">
<option value=""{if $filterSuspensionType == null} selected="selected"{/if}></option> <option value=""{if $suspensionType == null} selected="selected"{/if}></option>
<option value="{'\chat\data\suspension\Suspension::TYPE_MUTE'|constant}"{if $filterSuspensionType == '\chat\data\suspension\Suspension::TYPE_MUTE'|constant} selected="selected"{/if}>{lang}chat.suspension.{'\chat\data\suspension\Suspension::TYPE_MUTE'|constant}{/lang}</option> <option value="{'\chat\data\suspension\Suspension::TYPE_MUTE'|constant}"{if $suspensionType == '\chat\data\suspension\Suspension::TYPE_MUTE'|constant} selected="selected"{/if}>{lang}chat.suspension.{'\chat\data\suspension\Suspension::TYPE_MUTE'|constant}{/lang}</option>
<option value="{'\chat\data\suspension\Suspension::TYPE_BAN'|constant}"{if $filterSuspensionType == '\chat\data\suspension\Suspension::TYPE_BAN'|constant} selected="selected"{/if}>{lang}chat.suspension.{'\chat\data\suspension\Suspension::TYPE_BAN'|constant}{/lang}</option> <option value="{'\chat\data\suspension\Suspension::TYPE_BAN'|constant}"{if $suspensionType == '\chat\data\suspension\Suspension::TYPE_BAN'|constant} selected="selected"{/if}>{lang}chat.suspension.{'\chat\data\suspension\Suspension::TYPE_BAN'|constant}{/lang}</option>
</select> </select>
</dd> </dd>
</dl> </dl>
@ -64,6 +64,10 @@
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" /> <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
</div> </div>
</form> </form>
<div class="contentNavigation">
{pages print=true assign=pagesLinks application="chat" controller="ChatSuspensionList" link="pageNo=%d&userID=$userID&issuerUserID=$issuerUserID&roomID=$roomID&suspensionType=$suspensionType"}
</div>
<div class="tabularBox tabularBoxTitle marginTop"> <div class="tabularBox tabularBoxTitle marginTop">
<header> <header>
@ -98,6 +102,10 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="contentNavigation">
{pages print=true assign=pagesLinks application="chat" controller="ChatSuspensionList" link="pageNo=%d&username=$username&issuerUsername=$issuerUsername&roomID=$roomID&suspensionType=$suspensionType"}
</div>
{else} {else}
<p class="info">{lang}wcf.global.noItems{/lang}</p> <p class="info">{lang}wcf.global.noItems{/lang}</p>
{/if} {/if}

View File

@ -28,11 +28,6 @@ class ChatSuspensionListPage extends \wcf\page\SortablePage {
*/ */
public $defaultSortField = 'expires'; public $defaultSortField = 'expires';
/**
* @see \wcf\page\MultipleLinkPage::$itemsPerPage
*/
public $itemsPerPage = 30;
/** /**
* @see \wcf\page\SortablePage::$validSortFields * @see \wcf\page\SortablePage::$validSortFields
*/ */
@ -120,10 +115,12 @@ public function assignVariables() {
WCF::getTPL()->assign(array( WCF::getTPL()->assign(array(
'availableRooms' => \chat\data\room\RoomCache::getInstance()->getRooms(), 'availableRooms' => \chat\data\room\RoomCache::getInstance()->getRooms(),
'filterRoomID' => ($this->filterRoomID !== null) ? $this->filterRoomID : -1, 'roomID' => ($this->filterRoomID !== null) ? $this->filterRoomID : -1,
'filterUsername' => $this->filterUsername, 'username' => $this->filterUsername,
'filterIssuerUsername' => $this->filterIssuerUsername, 'issuerUsername' => $this->filterIssuerUsername,
'filterSuspensionType' => $this->filterSuspensionType 'suspensionType' => $this->filterSuspensionType,
'userID' => $this->filterUserID,
'issuerUserID' => $this->filterIssuerUserID
)); ));
} }