Support disabling all checkboxes created by `{htmlCheckboxes}`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 13 Jan 2019 09:43:57 +0000 (10:43 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 13 Jan 2019 09:43:57 +0000 (10:43 +0100)
wcfsetup/install/files/lib/system/template/plugin/HtmlCheckboxesFunctionTemplatePlugin.class.php

index e60b9c091b99a23c1a148c4c3f407460dc71349f..2a3a8f429d22076f77cb3cd5a9b1735da23b21d1 100644 (file)
@@ -69,7 +69,7 @@ class HtmlCheckboxesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
                $html = '';
                foreach ($tagArgs['options'] as $key => $value) {
                        if (!empty($html)) $html .= $tagArgs['separator'];
-                       $html .= '<label><input type="checkbox" name="'.$this->encodeHTML($tagArgs['name']).'[]" value="'.$this->encodeHTML($key).'"'.(in_array($key, $tagArgs['selected']) ? ' checked' : '').'> '.$this->encodeHTML($value).'</label>';
+                       $html .= '<label><input type="checkbox" name="'.$this->encodeHTML($tagArgs['name']).'[]" value="'.$this->encodeHTML($key).'"'.(in_array($key, $tagArgs['selected']) ? ' checked' : '').(!empty($tagArgs['disabled']) ? ' disabled' : '').'> '.$this->encodeHTML($value).'</label>';
                }
                
                return $html;