From 2a00af177239e6707d39242cbd0673dd7d66a787 Mon Sep 17 00:00:00 2001 From: Tobias Friebel Date: Wed, 8 Jan 2014 18:32:59 +0100 Subject: [PATCH] Changes for WBB 4 --- aclOption.xml | 11 ++++ acptemplates/__boardAddLimitThreadView.tpl | 9 +++ acptemplates/limitThreadView.tpl | 18 ------ de-informal.utf-8.xml | 35 ----------- eventListener.xml | 44 ++++++++++++++ eventlistener.xml | 50 ---------------- .../LimitThreadViewACPListener.class.php | 24 ++++---- .../LimitThreadViewFeedListener.class.php | 20 ++++--- .../LimitThreadViewListener.class.php | 37 ++++++------ install.sql | 10 +--- de.utf-8.xml => language/de.xml | 7 ++- en.utf-8.xml => language/en.xml | 7 ++- options.xml => option.xml | 18 +++--- package.xml | 59 +++++++++++-------- templateListener.xml | 18 ++++++ groupoptions.xml => userGroupOption.xml | 6 +- 16 files changed, 181 insertions(+), 192 deletions(-) create mode 100644 aclOption.xml create mode 100644 acptemplates/__boardAddLimitThreadView.tpl delete mode 100644 acptemplates/limitThreadView.tpl delete mode 100644 de-informal.utf-8.xml create mode 100644 eventListener.xml delete mode 100644 eventlistener.xml rename de.utf-8.xml => language/de.xml (90%) rename en.utf-8.xml => language/en.xml (88%) rename options.xml => option.xml (66%) create mode 100644 templateListener.xml rename groupoptions.xml => userGroupOption.xml (50%) diff --git a/aclOption.xml b/aclOption.xml new file mode 100644 index 0000000..c84b7de --- /dev/null +++ b/aclOption.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/acptemplates/__boardAddLimitThreadView.tpl b/acptemplates/__boardAddLimitThreadView.tpl new file mode 100644 index 0000000..eef8d06 --- /dev/null +++ b/acptemplates/__boardAddLimitThreadView.tpl @@ -0,0 +1,9 @@ +
+
+ +
+
+ + {lang}wbb.acp.board.limitthreadview.description{/lang} +
+
\ No newline at end of file diff --git a/acptemplates/limitThreadView.tpl b/acptemplates/limitThreadView.tpl deleted file mode 100644 index ee320d0..0000000 --- a/acptemplates/limitThreadView.tpl +++ /dev/null @@ -1,18 +0,0 @@ -
- {lang}wbb.acp.board.limitthreadview{/lang} - -
-
- -
-
- -
- -
- -
\ No newline at end of file diff --git a/de-informal.utf-8.xml b/de-informal.utf-8.xml deleted file mode 100644 index 3869978..0000000 --- a/de-informal.utf-8.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - Dein Zugriff auf dieses Thema wurde eingeschränkt. Insgesamt gibt es {#$posts} {if $posts == 1}Beitrag{else}Beiträge{/if} in diesem Thema.
Um sie alle lesen zu können musst Du dich vorher registrieren/freischalten lassen.

]]>
-
- - - - - - - - - - - - - - - - - - - - - -
diff --git a/eventListener.xml b/eventListener.xml new file mode 100644 index 0000000..f1214d4 --- /dev/null +++ b/eventListener.xml @@ -0,0 +1,44 @@ + + + + + + readData + + + + + assignVariables + + + + + + readData + + + + + + admin + assignVariables + + 1 + + + + admin + readFormParameters + + 1 + + + + admin + save + + 1 + + + + \ No newline at end of file diff --git a/eventlistener.xml b/eventlistener.xml deleted file mode 100644 index 0e999ce..0000000 --- a/eventlistener.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - ThreadPage - readData - lib/system/event/listener/LimitThreadViewListener.class.php - - - ThreadPage - assignVariables - lib/system/event/listener/LimitThreadViewListener.class.php - - - - ThreadsFeedPage - readData - lib/system/event/listener/LimitThreadViewFeedListener.class.php - - - PostsFeedPage - readData - lib/system/event/listener/LimitThreadViewFeedListener.class.php - - - - BoardAddForm - assignVariables - lib/system/event/listener/LimitThreadViewACPListener.class.php - admin - 1 - - - BoardAddForm - readFormParameters - lib/system/event/listener/LimitThreadViewACPListener.class.php - admin - 1 - - - BoardAddForm - save - lib/system/event/listener/LimitThreadViewACPListener.class.php - admin - 1 - - - - \ No newline at end of file diff --git a/files/lib/system/event/listener/LimitThreadViewACPListener.class.php b/files/lib/system/event/listener/LimitThreadViewACPListener.class.php index f138b16..10f3667 100644 --- a/files/lib/system/event/listener/LimitThreadViewACPListener.class.php +++ b/files/lib/system/event/listener/LimitThreadViewACPListener.class.php @@ -1,17 +1,21 @@ + * Provides ACP integration * - * Lizenz: CC Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung - * http://creativecommons.org/licenses/by-nc-nd/2.0/de/ + * @author Tobias Friebel + * @copyright 2014 Tobias Friebel + * @license Creative Commons Attribution-NoDerivatives + * @package com.toby.wbb.limitthreadview + * @subpackage system.event.listener + * @category WoltLab Burning Board */ - -require_once(WCF_DIR.'lib/system/event/EventListener.class.php'); - -class LimitThreadViewACPListener implements EventListener +class LimitThreadViewACPListener implements IEventListener { - private $limitThreadView = 0; + public $limitThreadView = 0; private $isSave = false; /** @@ -43,8 +47,6 @@ public function execute($eventObj, $className, $eventName) 'limitThreadView' => $this->limitThreadView, )); } - - WCF::getTPL()->append('additionalFields', WCF::getTPL()->fetch('limitThreadView')); break; } } diff --git a/files/lib/system/event/listener/LimitThreadViewFeedListener.class.php b/files/lib/system/event/listener/LimitThreadViewFeedListener.class.php index 74b9afb..acfa053 100644 --- a/files/lib/system/event/listener/LimitThreadViewFeedListener.class.php +++ b/files/lib/system/event/listener/LimitThreadViewFeedListener.class.php @@ -1,15 +1,19 @@ + * Limits thread feeds to configured length * - * Lizenz: CC Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung - * http://creativecommons.org/licenses/by-nc-nd/2.0/de/ + * @author Tobias Friebel + * @copyright 2014 Tobias Friebel + * @license Creative Commons Attribution-NoDerivatives + * @package com.toby.wbb.limitthreadview + * @subpackage system.event.listener + * @category WoltLab Burning Board */ - -require_once(WCF_DIR.'lib/system/event/EventListener.class.php'); - -class LimitThreadViewFeedListener implements EventListener +class LimitThreadViewFeedListener implements IEventListener { /** * @see EventListener::execute() diff --git a/files/lib/system/event/listener/LimitThreadViewListener.class.php b/files/lib/system/event/listener/LimitThreadViewListener.class.php index d00a143..0d3e9e4 100644 --- a/files/lib/system/event/listener/LimitThreadViewListener.class.php +++ b/files/lib/system/event/listener/LimitThreadViewListener.class.php @@ -1,18 +1,22 @@ + * Limits thread to configured length * - * Lizenz: CC Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung - * http://creativecommons.org/licenses/by-nc-nd/2.0/de/ + * @author Tobias Friebel + * @copyright 2014 Tobias Friebel + * @license Creative Commons Attribution-NoDerivatives + * @package com.toby.wbb.limitthreadview + * @subpackage system.event.listener + * @category WoltLab Burning Board */ - -require_once (WCF_DIR . 'lib/system/event/EventListener.class.php'); - -class LimitThreadViewListener implements EventListener +class LimitThreadViewListener implements IEventListener { /** - * @see EventListener::execute() + * @see \wcf\system\event\IEventListener::execute() */ public function execute($eventObj, $className, $eventName) { @@ -26,9 +30,6 @@ public function execute($eventObj, $className, $eventName) else $limitCount = LIMIT_THREAD_VIEW_DEFAULT_LIMIT; - if ($eventObj->countItems() <= $limitCount) - return; - switch ($eventName) { case 'readData': @@ -49,6 +50,9 @@ public function execute($eventObj, $className, $eventName) break; case 'assignVariables': + if ($eventObj->countItems() <= $limitCount) + return; + if ($limitCount <= $eventObj->itemsPerPage) { $eventObj->pages = 1; @@ -62,10 +66,10 @@ public function execute($eventObj, $className, $eventName) if ($eventObj->pageNo == $pageMaxNo && $count < $eventObj->itemsPerPage) { - foreach ($eventObj->postList->posts as $i => $post) + foreach ($eventObj->objectList as $i => $post) { if ($i >= $count) - unset($eventObj->postList->posts[$i]); + unset($eventObj->objectList[$i]); } } } @@ -75,10 +79,7 @@ public function execute($eventObj, $className, $eventName) $limitBox = WCF::getLanguage()->getDynamicVariable('wbb.thread.limitthreadview', array('posts' => $eventObj->countItems())); - WCF :: getTPL()->append('userMessages', $limitBox); - - if (LIMIT_THREAD_VIEW_SHOW_WARNING_DOWN) - WCF :: getTPL()->append('additionalBoxes', $limitBox); + WCF :: getTPL()->assign('limitMessageBox', $limitBox); } break; } diff --git a/install.sql b/install.sql index fbdf6ea..8469b99 100644 --- a/install.sql +++ b/install.sql @@ -1,8 +1,2 @@ -ALTER TABLE wbb1_1_board ADD - limitThreadView TINYINT( 1 ) NOT NULL DEFAULT -1; - -ALTER TABLE wbb1_1_board_to_group ADD - canViewLimitedContent TINYINT(1) NOT NULL DEFAULT -1; - -ALTER TABLE wbb1_1_board_to_user ADD - canViewLimitedContent TINYINT(1) NOT NULL DEFAULT -1; \ No newline at end of file +ALTER TABLE wbb1_board ADD + limitThreadView TINYINT( 1 ) NOT NULL DEFAULT -1; \ No newline at end of file diff --git a/de.utf-8.xml b/language/de.xml similarity index 90% rename from de.utf-8.xml rename to language/de.xml index 811d195..d17c0dc 100644 --- a/de.utf-8.xml +++ b/language/de.xml @@ -1,6 +1,7 @@ - - + @@ -9,7 +10,7 @@ - Ihr Zugriff auf dieses Thema wurde eingeschränkt. Insgesamt gibt es {#$posts} {if $posts == 1}Beitrag{else}Beiträge{/if} in diesem Thema.
Um sie alle lesen zu können müssen Sie sich vorher registrieren/freischalten lassen.

]]>
+ Ihr Zugriff auf dieses Thema wurde eingeschränkt. Insgesamt gibt es {#$posts} {if $posts == 1}Beitrag{else}Beiträge{/if} in diesem Thema.
Um sie alle lesen zu können müssen Sie sich vorher registrieren oder freischalten lassen.

]]>
diff --git a/en.utf-8.xml b/language/en.xml similarity index 88% rename from en.utf-8.xml rename to language/en.xml index b78efb5..a0a9dc0 100644 --- a/en.utf-8.xml +++ b/language/en.xml @@ -1,6 +1,7 @@ - - +code="en"> @@ -9,7 +10,7 @@ - To read them all you should register or let you unlock.]]> + To read them all you should register or let you unlock.]]> diff --git a/options.xml b/option.xml similarity index 66% rename from options.xml rename to option.xml index 5f183d4..e7450ee 100755 --- a/options.xml +++ b/option.xml @@ -1,6 +1,6 @@ - - - + + + @@ -11,16 +11,16 @@ - - -