From 22d3795aecf0c1ae14bd589cc0d9b05a62e3701a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 4 Feb 2012 20:50:18 +0100 Subject: [PATCH] Adding ChatRoomListPage --- acpMenu.xml | 22 +++++ acptemplate/chatRoomList.tpl | 96 ++++++++++++++++++++ build.php | 13 ++- file/lib/acp/page/ChatRoomListPage.class.php | 47 ++++++++++ package.xml | 8 +- userGroupOption.xml | 31 +++++++ 6 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 acpMenu.xml create mode 100644 acptemplate/chatRoomList.tpl create mode 100644 file/lib/acp/page/ChatRoomListPage.class.php create mode 100644 userGroupOption.xml diff --git a/acpMenu.xml b/acpMenu.xml new file mode 100644 index 0000000..6d9b743 --- /dev/null +++ b/acpMenu.xml @@ -0,0 +1,22 @@ + + + + + wcf.acp.menu.link.content + + + + index.php/ChatRoomList/ + wcf.acp.menu.link.chat + admin.content.chat.canEditRoom,admin.content.chat.canDeleteRoom + 1 + + + + index.php/ChatRoomAdd/ + wcf.acp.menu.link.chat + admin.content.chat.canAddRoom + 2 + + + diff --git a/acptemplate/chatRoomList.tpl b/acptemplate/chatRoomList.tpl new file mode 100644 index 0000000..e4b7140 --- /dev/null +++ b/acptemplate/chatRoomList.tpl @@ -0,0 +1,96 @@ +{include file='header'} + +
+ +
+

{lang}wcf.acp.chat.room.list{/lang}

+
+ + +
+ +
+ {pages print=true assign=pagesLinks controller="ChatRoomList" link="pageNo=%d"} + + {if $__wcf->session->getPermission('admin.content.chat.canAddRoom')} + + {/if} +
+ +{hascontent} +
+
+

{lang}wcf.acp.chat.room.list{/lang} {#$items}

+
+ + + + + + + + {event name='headColumns'} + + + + + {content} + {foreach from=$objects item=chatRoom} + + + + + + {event name='columns'} + + {/foreach} + {/content} + +
{lang}wcf.global.objectID{/lang}{lang}wcf.acp.chat.room.title{/lang}
+ {if $__wcf->session->getPermission('admin.content.chat.canEditRoom')} + + {else} + + {/if} + {if $__wcf->session->getPermission('admin.content.chat.canDeleteRoom')} + + {else} + + {/if} + + {event name='buttons'} +

{@$chatRoom->roomID}

{if $__wcf->session->getPermission('admin.content.chat.canEditRoom')}{$chatRoom->title|language}{else}{$chatRoom->title|language}{/if}

+ +
+ +
+ {@$pagesLinks} + + {if $__wcf->session->getPermission('admin.content.chat.canAddRoom')} + + {/if} +
+{hascontentelse} +
+
+

{lang}wcf.acp.chat.room.noneAvailable{/lang}

+
+
+{/hascontent} + +{include file='footer'} \ No newline at end of file diff --git a/build.php b/build.php index f10da56..5b96816 100755 --- a/build.php +++ b/build.php @@ -15,6 +15,7 @@ EOT; if (file_exists('file.tar')) unlink('file.tar'); if (file_exists('template.tar')) unlink('template.tar'); + if (file_exists('acptemplate.tar')) unlink('acptemplate.tar'); foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile); foreach (glob('file/style/*.css') as $cssFile) unlink($cssFile); if (file_exists('timwolla.wcf.chat.tar')) unlink('timwolla.wcf.chat.tar'); @@ -60,15 +61,25 @@ if ($code != 0) exit($code); echo << + * @package com.woltlab.wcf.bbcode + * @subpackage acp.page + * @category Community Framework + */ +class ChatRoomListPage extends \wcf\page\MultipleLinkPage { + /** + * @see wcf\page\AbstractPage::$neededPermissions + */ + public $neededPermissions = array( + 'admin.content.chat.canEditRoom', + 'admin.content.chat.canDeleteRoom' + ); + + /** + * @see wcf\page\MultipleLinkPage::$objectListClassName + */ + public $objectListClassName = '\wcf\data\chat\room\ChatRoomList'; + + /** + * @see wcf\page\MultipleLinkPage::$sortField + */ + public $sortField = 'position'; + + /** + * @see wcf\page\MultipleLinkPage::$sortOrder + */ + public $sortOrder = 'ASC'; + + /** + * @see wcf\page\IPage::show() + */ + public function show() { + // set active menu item. + \wcf\system\menu\acp\ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.chat.list'); + + parent::show(); + } +} diff --git a/package.xml b/package.xml index 7c3bf7b..1424b36 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@ 0 1 - 3.0.0 Alpha 3 + 3.0.0 Alpha 4 2011-11-26 com.woltlab.wcf.bbcode @@ -25,6 +25,7 @@ language/*.xml file.tar template.tar + acptemplate.tar install.sql objectType.xml option.xml @@ -32,17 +33,22 @@ eventListener.xml templatelistener.xml acloptions.xml + acpMenu.xml + userGroupOption.xml language/*.xml file.tar template.tar + acptemplate.tar objectType.xml option.xml pagemenu.xml eventListener.xml templatelistener.xml acloptions.xml + acpMenu.xml + userGroupOption.xml diff --git a/userGroupOption.xml b/userGroupOption.xml new file mode 100644 index 0000000..aad3e80 --- /dev/null +++ b/userGroupOption.xml @@ -0,0 +1,31 @@ + + + + + + admin.content + + + + + + + + + + \ No newline at end of file