Added missing templates
authorAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 09:25:48 +0000 (10:25 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 09:25:48 +0000 (10:25 +0100)
com.woltlab.wcf/templates/checkboxesOptionType.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/checkboxesSearchableOptionType.tpl [new file with mode: 0644]

diff --git a/com.woltlab.wcf/templates/checkboxesOptionType.tpl b/com.woltlab.wcf/templates/checkboxesOptionType.tpl
new file mode 100644 (file)
index 0000000..62f6c3f
--- /dev/null
@@ -0,0 +1,3 @@
+{foreach from=$selectOptions key=key item=selectOption}
+       <label><input type="checkbox" name="values[{$option->optionName}][]" value="{$key}" {if $key|in_array:$value} checked="checked"{/if} {if $disableOptions[$key]|isset || $enableOptions[$key]|isset}class="jsEnablesOptions" data-disable-options="[ {@$disableOptions[$key]}]" data-enable-options="[ {@$enableOptions[$key]}]"{/if} /> {lang}{@$selectOption}{/lang}</label>
+{/foreach}
diff --git a/com.woltlab.wcf/templates/checkboxesSearchableOptionType.tpl b/com.woltlab.wcf/templates/checkboxesSearchableOptionType.tpl
new file mode 100644 (file)
index 0000000..3c88d94
--- /dev/null
@@ -0,0 +1,19 @@
+<label><input type="checkbox" id="search_{$option->optionName}" name="searchOptions[{$option->optionName}]"{if $searchOption} checked="checked"{/if} /> {lang}wcf.user.option.searchRadioButtonOption{/lang}</label>
+{foreach from=$selectOptions key=key item=selectOption}
+       <label><input type="checkbox" name="values[{$option->optionName}][]" value="{$key}" {if $key|in_array:$value} checked="checked"{/if}{if !$searchOption} disabled="disabled"{/if} /> {lang}{@$selectOption}{/lang}</label>
+{/foreach}
+
+<script data-relocate="true">
+       //<![CDATA[
+       $(function() {
+               $('#search_{$option->optionName}').change(function(event) {
+                       if ($(event.currentTarget).prop('checked')) {
+                               $('input[name="values[{$option->optionName}][]"]').enable();
+                       }
+                       else {
+                               $('input[name="values[{$option->optionName}][]"]').disable();
+                       }
+               });
+       });
+       //]]>
+</script>