\ 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 @@
-
\ 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 @@
-
-
-