mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Fixing ACP
This commit is contained in:
parent
6359d0382e
commit
e07be6695e
@ -1,15 +1,9 @@
|
||||
{include file='header' pageTitle='wcf.acp.chat.room.'|concat:$action}
|
||||
{include file='header' pageTitle='chat.acp.room.'|concat:$action}
|
||||
|
||||
<script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.ACL.js"></script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(function() {
|
||||
WCF.Icon.addObject({
|
||||
'wcf.icon.delete': '{@$__wcf->getPath('wcf')}icon/delete.svg',
|
||||
'wcf.icon.user': '{@$__wcf->getPath('wcf')}icon/user.svg',
|
||||
'wcf.icon.users': '{@$__wcf->getPath('wcf')}icon/users.svg'
|
||||
});
|
||||
|
||||
new WCF.ACL.List($('#groupPermissions'), {@$objectTypeID}, ''{if $roomID|isset}, {@$roomID}{/if});
|
||||
});
|
||||
//]]>
|
||||
@ -17,7 +11,7 @@
|
||||
|
||||
<header class="boxHeadline">
|
||||
<hgroup>
|
||||
<h1>{lang}wcf.acp.chat.room.{$action}{/lang}</h1>
|
||||
<h1>{lang}chat.acp.room.{$action}{/lang}</h1>
|
||||
</hgroup>
|
||||
</header>
|
||||
|
||||
@ -32,18 +26,18 @@
|
||||
<div class="contentNavigation">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="{link application='chat' controller='ChatRoomList'}{/link}" title="{lang}wcf.acp.menu.link.chat.room.list{/lang}" class="button"><img src="{@$__wcf->getPath('wcf')}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.chat.room.list{/lang}</span></a></li>
|
||||
<li><a href="{link application='chat' controller='roomList'}{/link}" title="{lang}chat.acp.menu.link.room.list{/lang}" class="button"><span class="icon icon16 icon-list"></span> <span>{lang}chat.acp.menu.link.room.list{/lang}</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{if $action == 'add'}{link application='chat' controller='ChatRoomAdd'}{/link}{else}{link application='chat' controller='ChatRoomEdit' id=$roomID}{/link}{/if}">
|
||||
<form method="post" action="{if $action == 'add'}{link application='chat' controller='roomAdd'}{/link}{else}{link application='chat' controller='roomEdit' id=$roomID}{/link}{/if}">
|
||||
<div class="container containerPadding sortableListContainer marginTop shadow">
|
||||
<fieldset>
|
||||
<legend>{lang}wcf.acp.chat.room.data{/lang}</legend>
|
||||
<legend>{lang}chat.acp.room.data{/lang}</legend>
|
||||
|
||||
<dl{if $errorField == 'title'} class="formError"{/if}>
|
||||
<dt><label for="title">{lang}wcf.acp.chat.room.title{/lang}</label></dt>
|
||||
<dt><label for="title">{lang}chat.acp.room.title{/lang}</label></dt>
|
||||
<dd>
|
||||
<input type="text" id="title" name="title" value="{$title}" autofocus="autofocus" class="long" />
|
||||
{if $errorField == 'title'}
|
||||
@ -51,17 +45,17 @@
|
||||
{if $errorType == 'empty'}
|
||||
{lang}wcf.global.form.error.empty{/lang}
|
||||
{else}
|
||||
{lang}wcf.acp.chat.room.title.error.{@$errorType}{/lang}
|
||||
{lang}chat.acp.room.title.error.{@$errorType}{/lang}
|
||||
{/if}
|
||||
</small>
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{include file='multipleLanguageInputJavascript' elementIdentifier='title'}
|
||||
{include file='multipleLanguageInputJavascript' elementIdentifier='title' forceSelection='false'}
|
||||
|
||||
<dl{if $errorField == 'topic'} class="formError"{/if}>
|
||||
<dt><label for="topic">{lang}wcf.acp.chat.room.topic{/lang}</label></dt>
|
||||
<dt><label for="topic">{lang}chat.acp.room.topic{/lang}</label></dt>
|
||||
<dd>
|
||||
<input type="text" id="topic" name="topic" value="{$topic}" class="long" />
|
||||
{if $errorField == 'topic'}
|
||||
@ -69,14 +63,14 @@
|
||||
{if $errorType == 'empty'}
|
||||
{lang}wcf.global.form.error.empty{/lang}
|
||||
{else}
|
||||
{lang}wcf.acp.chat.room.topic.error.{@$errorType}{/lang}
|
||||
{lang}chat.acp.room.topic.error.{@$errorType}{/lang}
|
||||
{/if}
|
||||
</small>
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{include file='multipleLanguageInputJavascript' elementIdentifier='topic'}
|
||||
{include file='multipleLanguageInputJavascript' elementIdentifier='topic' forceSelection='false'}
|
||||
|
||||
<dl id="groupPermissions">
|
||||
<dt>{lang}wcf.acp.acl.permissions{/lang}</dt>
|
@ -4,14 +4,14 @@
|
||||
//<![CDATA[
|
||||
$(function() {
|
||||
new WCF.Action.Delete('\\chat\\data\\room\\RoomAction', $('.chatRoomRow'));
|
||||
new WCF.Sortable.List('chatRoomList', '\\chat\\data\\room\\RoomAction', {@$startIndex-1});
|
||||
new WCF.Sortable.List('roomList', '\\chat\\data\\room\\RoomAction', {@$startIndex-1});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<header class="boxHeadline">
|
||||
<hgroup>
|
||||
<h1>{lang}wcf.acp.chat.room.list{/lang}</h1>
|
||||
<h1>{lang}chat.acp.room.list{/lang}</h1>
|
||||
</hgroup>
|
||||
</header>
|
||||
|
||||
@ -19,30 +19,30 @@
|
||||
{if $__wcf->session->getPermission('admin.chat.canAddRoom')}
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="{link application='chat' controller='ChatRoomAdd'}{/link}" title="{lang}chat.acp.room.add{/lang}" class="button"><img src="{@$__wcf->getPath('wcf')}icon/add.svg" alt="" class="icon24" /> <span>{lang}chat.acp.room.add{/lang}</span></a></li>
|
||||
<li><a href="{link application='chat' controller='roomAdd'}{/link}" title="{lang}chat.acp.room.add{/lang}" class="button"><img src="{@$__wcf->getPath('wcf')}icon/add.svg" alt="" class="icon24" /> <span>{lang}chat.acp.room.add{/lang}</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{/if}
|
||||
</div>
|
||||
{hascontent}
|
||||
<section id="chatRoomList" class="container containerPadding sortableListContainer marginTop shadow">
|
||||
<section id="roomList" class="container containerPadding sortableListContainer marginTop shadow">
|
||||
<ol class="sortableList" data-object-id="0" start="{$startIndex}">
|
||||
{content}
|
||||
{foreach from=$objects item=chatRoom}
|
||||
<li class="sortableNode sortableNoNesting chatRoomRow" data-object-id="{@$chatRoom->roomID}">
|
||||
<span class="sortableNodeLabel">
|
||||
{if $__wcf->session->getPermission('admin.chat.canEditRoom')}
|
||||
<a href="{link application='chat'controller='ChatRoomEdit' id=$chatRoom->roomID}{/link}">{$chatRoom->title|language}</a>
|
||||
<a href="{link application='chat' controller='roomEdit' id=$chatRoom->roomID}{/link}">{$chatRoom->title|language}</a>
|
||||
{else}
|
||||
{$chatRoom->title|language}
|
||||
{/if}
|
||||
|
||||
<span class="statusDisplay sortableButtonContainer">
|
||||
{if $__wcf->session->getPermission('admin.content.chat.canEditRoom')}
|
||||
<a href="{link application='chat' controller='ChatRoomEdit' id=$chatRoom->roomID}{/link}"><img src="{@$__wcf->getPath('wcf')}icon/edit.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip icon16" /></a>
|
||||
{if $__wcf->session->getPermission('admin.chat.canEditRoom')}
|
||||
<a href="{link application='chat' controller='roomEdit' id=$chatRoom->roomID}{/link}"><span title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip icon icon16 icon-edit" /></a>
|
||||
{/if}
|
||||
{if $__wcf->session->getPermission('admin.content.chat.canDeleteRoom')}
|
||||
<img src="{@$__wcf->getPath('wcf')}icon/delete.svg" alt="" title="{lang}wcf.global.button.delete{/lang}" class="jsDeleteButton jsTooltip icon16" data-object-id="{@$chatRoom->roomID}" data-confirm-message="{lang}chat.acp.room.delete.sure{/lang}" />
|
||||
{if $__wcf->session->getPermission('admin.chat.canDeleteRoom')}
|
||||
<span title="{lang}wcf.global.button.delete{/lang}" class="jsDeleteButton jsTooltip icon icon16 icon-remove" data-object-id="{@$chatRoom->roomID}" data-confirm-message="{lang}chat.acp.room.delete.sure{/lang}" />
|
||||
{/if}
|
||||
</span>
|
||||
</span>
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\acp\form;
|
||||
namespace chat\acp\form;
|
||||
use \wcf\system\exception\UserInputException;
|
||||
use \wcf\system\language\I18nHandler;
|
||||
use \wcf\system\WCF;
|
||||
@ -88,21 +88,21 @@ public function save() {
|
||||
parent::save();
|
||||
|
||||
// save room
|
||||
$this->objectAction = new \wcf\data\chat\room\ChatRoomAction(array(), 'create', array('data' => array(
|
||||
$this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array(
|
||||
'title' => $this->title,
|
||||
'topic' => $this->topic
|
||||
)));
|
||||
$this->objectAction->executeAction();
|
||||
$returnValues = $this->objectAction->getReturnValues();
|
||||
$chatRoomEditor = new \wcf\data\chat\room\ChatRoomEditor($returnValues['returnValues']);
|
||||
$roomEditor = new \chat\data\room\RoomEditor($returnValues['returnValues']);
|
||||
$roomID = $returnValues['returnValues']->roomID;
|
||||
|
||||
if (!I18nHandler::getInstance()->isPlainValue('title')) {
|
||||
I18nHandler::getInstance()->save('title', 'chat.room.title'.$roomID, 'chat.room', \chat\util\ChatUtil::getPackageID());
|
||||
|
||||
// update title
|
||||
$chatRoomEditor->update(array(
|
||||
'title' => 'wcf.chat.room.title'.$roomID
|
||||
$roomEditor->update(array(
|
||||
'title' => 'chat.room.title'.$roomID
|
||||
));
|
||||
}
|
||||
|
||||
@ -110,13 +110,13 @@ public function save() {
|
||||
I18nHandler::getInstance()->save('topic', 'chat.room.topic'.$roomID, 'chat.room', \chat\util\ChatUtil::getPackageID());
|
||||
|
||||
// update topic
|
||||
$chatRoomEditor->update(array(
|
||||
$roomEditor->update(array(
|
||||
'topic' => 'chat.room.topic'.$roomID
|
||||
));
|
||||
}
|
||||
|
||||
\wcf\system\acl\ACLHandler::getInstance()->save($roomID, $this->objectTypeID);
|
||||
\wcf\system\chat\permission\ChatPermissionHandler::clearCache();
|
||||
\chat\system\permission\permissionHandler::clearCache();
|
||||
|
||||
$this->saved();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\acp\form;
|
||||
namespace chat\acp\form;
|
||||
use \wcf\system\language\I18nHandler;
|
||||
use \wcf\system\WCF;
|
||||
|
||||
@ -21,7 +21,7 @@ class RoomEditForm extends RoomAddForm {
|
||||
/**
|
||||
* @see \wcf\acp\form\ACPForm::$activeMenuItem
|
||||
*/
|
||||
public $activeMenuItem = 'wcf.acp.menu.link.room.list';
|
||||
public $activeMenuItem = 'chat.acp.menu.link.room.list';
|
||||
|
||||
/**
|
||||
* @see \wcf\page\AbstractPage::$neededPermissions
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\acp\page;
|
||||
namespace chat\acp\page;
|
||||
|
||||
/**
|
||||
* Lists available chatrooms.
|
||||
|
Loading…
Reference in New Issue
Block a user