From 6fc06ba56f0910dfc959aadffe65139c19afa233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 20 Apr 2013 17:19:17 +0200 Subject: [PATCH] Make ACP WCF conform --- acptemplate/roomAdd.tpl | 21 +++++---- acptemplate/roomList.tpl | 57 ++++++++++++++----------- file/lib/acp/form/RoomAddForm.class.php | 6 +-- file/lib/data/room/RoomAction.class.php | 4 +- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/acptemplate/roomAdd.tpl b/acptemplate/roomAdd.tpl index d9e66ec..5d51644 100644 --- a/acptemplate/roomAdd.tpl +++ b/acptemplate/roomAdd.tpl @@ -24,17 +24,22 @@ {/if}
- + {hascontent} + + {/hascontent}
-
-
+ +
- {lang}chat.acp.room.data{/lang} + {lang}wcf.global.form.data{/lang}
diff --git a/acptemplate/roomList.tpl b/acptemplate/roomList.tpl index 82545f5..c7daff3 100644 --- a/acptemplate/roomList.tpl +++ b/acptemplate/roomList.tpl @@ -16,47 +16,52 @@
- {if $__wcf->session->getPermission('admin.chat.canAddRoom')} + {hascontent} - {/if} + {/hascontent}
-{hascontent} -
+{if $objects|count} +
    - {content} - {foreach from=$objects item=chatRoom} -
  1. - + {foreach from=$objects item=chatRoom} +
  2. + + {if $__wcf->session->getPermission('admin.chat.canEditRoom')} + {$chatRoom->title|language} + {else} + {$chatRoom->title|language} + {/if} + + {if $__wcf->session->getPermission('admin.chat.canEditRoom')} - {$chatRoom->title|language} - {else} - {$chatRoom->title|language} + + {/if} + {if $__wcf->session->getPermission('admin.chat.canDeleteRoom')} + {/if} - - {if $__wcf->session->getPermission('admin.chat.canEditRoom')} - - {/if} - {if $__wcf->session->getPermission('admin.chat.canDeleteRoom')} - - {/if} - + {event name='itemButtons'} -
    1. - - {/foreach} - {/content} + +
        + + {/foreach}
      -{hascontentelse} +{else}

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

      -{/hascontent} +{/if} {include file='footer'} diff --git a/file/lib/acp/form/RoomAddForm.class.php b/file/lib/acp/form/RoomAddForm.class.php index bd6f561..51ecc00 100644 --- a/file/lib/acp/form/RoomAddForm.class.php +++ b/file/lib/acp/form/RoomAddForm.class.php @@ -62,9 +62,9 @@ public function readParameters() { */ public function readFormParameters() { parent::readFormParameters(); - + I18nHandler::getInstance()->readValues(); - + if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title'); if (I18nHandler::getInstance()->isPlainValue('topic')) $this->topic = I18nHandler::getInstance()->getValue('topic'); } @@ -86,7 +86,7 @@ public function validate() { */ public function save() { parent::save(); - + // save room $this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array( 'title' => $this->title, diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 47a2ba3..c711fee 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -84,7 +84,7 @@ public function prune() { } /** - * @see wcf\data\ISortableAction + * @see wcf\data\ISortableAction::validateUpdatePosition() */ public function validateUpdatePosition() { // validate permissions @@ -101,7 +101,7 @@ public function validateUpdatePosition() { } /** - * @see wcf\data\ISortableAction + * @see wcf\data\ISortableAction::updatePosition() */ public function updatePosition() { $roomList = new RoomList();