Filtering labels by group now lifts the limit
authorAlexander Ebert <ebert@woltlab.com>
Mon, 17 Jul 2017 18:06:34 +0000 (20:06 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 17 Jul 2017 18:06:34 +0000 (20:06 +0200)
Closes #2318

wcfsetup/install/files/lib/acp/page/LabelListPage.class.php

index d71c6812482cf4c421105688401bbaf7f6bfb1ff..52b8affc6a744407925a335ecdbc897649087f17 100644 (file)
@@ -70,13 +70,13 @@ class LabelListPage extends SortablePage {
         * label group to which the displayed labels belong
         * @var LabelGroup
         */
-       public $labelGroup = null;
+       public $labelGroup;
        
        /**
         * list with available label groups
         * @var LabelGroupList
         */
-       public $labelGroupList = null;
+       public $labelGroupList;
        
        /**
         * @inheritDoc
@@ -103,6 +103,12 @@ class LabelListPage extends SortablePage {
                $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_label_group label_group ON (label_group.groupID = label.groupID)";
                if ($this->labelGroup) {
                        $this->objectList->getConditionBuilder()->add('label.groupID = ?', [$this->labelGroup->groupID]);
+                       
+                       // Ramp up the limit to display all labels at once for easier
+                       // drag & drop sorting. This isn't exactly infinite, but if
+                       // you have a label group with more than 1k labels, being able
+                       // to sort them is the least of your problems.
+                       $this->itemsPerPage = 1000;
                }
                if ($this->cssClassName) {
                        $this->objectList->getConditionBuilder()->add('label.cssClassName LIKE ?', ['%'.addcslashes($this->cssClassName, '_%').'%']);