hide condition field, if the user can't select any group (#2179)
authorJoshua Rüsweg <josh@wcflabs.de>
Tue, 11 Apr 2017 15:31:54 +0000 (17:31 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Apr 2017 15:31:54 +0000 (17:31 +0200)
wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php

index 8a52ab6fadf52cae2a2cb82638621e54a5fd0e33..144caa73b30063f663a8bd63c144f1a2b73a1451 100644 (file)
@@ -111,7 +111,8 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements ICon
         * @inheritDoc
         */
        public function getHTML() {
-               return <<<HTML
+               if (!empty($this->getUserGroups())) {
+                       return <<<HTML
 <dl{$this->getErrorClass('groupIDs')}>
        <dt>{$this->getLabel('groupIDs')}</dt>
        <dd>
@@ -129,6 +130,9 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements ICon
        </dd>
 </dl>
 HTML;
+               } 
+               
+               return '';
        }
        
        /**