Added some labels for better usability
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Aug 2012 15:06:15 +0000 (17:06 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Aug 2012 15:06:15 +0000 (17:06 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/userGroupOption.tpl

index d83d14f3adee926a50f35602cf008162cb8f7168..3256d72c536b142099908a8f81aa590e8efc25b6 100644 (file)
@@ -678,13 +678,17 @@ WCF.ACP.Options.Group = Class.extend({
        init: function(canEditEveryone) {
                // disable 'Everyone' input
                this._canEditEveryone = (canEditEveryone === true) ? true : false;
-               var $defaultValue = $('#defaultValueContainer').find('input, textarea').removeAttr('id').removeAttr('name');
+               var $defaultContainer = $('#defaultValueContainer');
+               var $defaultValue = $defaultContainer.find('input, textarea').attr('id', 'optionValue' + $defaultContainer.children('dl').data('groupID')).removeAttr('name');
                if (!this._canEditEveryone) {
                        $defaultValue.attr('disabled', 'disabled');
                }
                
-               // remove id and name-attribute from input elements
-               $('#otherValueContainer').find('input, textarea').removeAttr('id').removeAttr('name');
+               // fix id and remove name-attribute from input elements
+               $('#otherValueContainer > dl').each(function(index, container) {
+                       var $container = $(container);
+                       $container.find('input, textarea').removeAttr('name').attr('id', 'optionValue' + $container.data('groupID'));
+               });
                
                // bind event listener
                $('#submitButton').click($.proxy(this._click, this));
index 2bc78ec35ec5318941ed663ef70c9c35c60468ca..538ac87271e9fc104686482d58d8100b4c30a87a 100644 (file)
@@ -3,7 +3,7 @@
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
-               new WCF.ACP.Options.Group({@$userGroupOption->optionID}, {if $canEditEveryone}true{else}false{/if});
+               new WCF.ACP.Options.Group({if $canEditEveryone}true{else}false{/if});
        });
        //]]>
 </script>
@@ -23,7 +23,7 @@
                <legend>{lang}wcf.acp.group.option.defaultValue{/lang}</legend>
                
                <dl data-group-id="{@$groupEveryone->groupID}">
-                       <dt>{lang}{$groupEveryone->groupName}{/lang}</dt>
+                       <dt><label for="optionValue{@$groupEveryone->groupID}">{lang}{$groupEveryone->groupName}{/lang}</label></dt>
                        <dd>{@$defaultFormElement}</dd>
                </dl>
        </fieldset>
@@ -33,7 +33,7 @@
                
                {foreach from=$groups item=group}
                        <dl data-group-id="{@$group->groupID}">
-                               <dt>{lang}{$group->groupName}{/lang}</dt>
+                               <dt><label for="optionValue{@$group->groupID}">{lang}{$group->groupName}{/lang}</label></dt>
                                <dd>{@$formElements[$group->groupID]}</dd>
                        </dl>
                {/foreach}