Use UserOption::getTitle() where possible
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 12 Apr 2021 09:53:43 +0000 (11:53 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 12 Apr 2021 09:53:43 +0000 (11:53 +0200)
Not all places could be adjusted for compatibility reasons, as the `Option`
super class does not have the `getTitle()` method and as the prefix is given
explicitly.

Helper methods for the description should also be added.

see #4107

com.woltlab.wcf/templates/optionFieldList.tpl
com.woltlab.wcf/templates/userOptionFieldList.tpl
com.woltlab.wcf/templates/userProfileAbout.tpl
com.woltlab.wcf/templates/userProfileOptionFieldList.tpl
wcfsetup/install/files/acp/templates/optionFieldList.tpl
wcfsetup/install/files/acp/templates/userSearch.tpl

index 740eed8e1fd247263a518f82a5bf675c25a0dbb2..e7a4376ab6bc15aaf3c3820f9a10e7537424f105 100644 (file)
@@ -7,7 +7,7 @@
                {assign var=error value=''}
        {/if}
        <dl class="{$option->optionName}Input{if $error} formError{/if}">
-               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>{if $isSearchMode|empty || !$optionData[hideLabelInSearch]}<label for="{$option->optionName}">{if VISITOR_USE_TINY_BUILD && $isGuestGroup && $option->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}{lang}{@$langPrefix}{$option->optionName}{/lang}</label>{/if}</dt>
+               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>{if $isSearchMode|empty || !$optionData[hideLabelInSearch]}<label for="{$option->optionName}">{if VISITOR_USE_TINY_BUILD && $isGuestGroup && $option->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}{$langPrefix|concat:$option->optionName|language}</label>{/if}</dt>
                <dd>{@$optionData[html]}
                        {if $error}
                                <small class="innerError">
@@ -21,4 +21,4 @@
                        <small>{lang __optional=true}{@$langPrefix}{$option->optionName}.description{/lang}</small>
                </dd>
        </dl>
-{/foreach}
\ No newline at end of file
+{/foreach}
index f5581639b200cd4710ccf95a969895ad0fbf0a31..c92bc05a481b3368d7e962e3fe65a8626b9583d8 100644 (file)
@@ -1,7 +1,7 @@
 {foreach from=$options item=optionData}
        {assign var=option value=$optionData[object]}
        <dl class="{$option->optionName}Input{if $errorType|is_array && $errorType[$option->optionName]|isset} formError{/if}">
-               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>{if $isSearchMode|empty || !$optionData[hideLabelInSearch]}<label for="{$option->optionName}">{lang}{@$langPrefix}{$option->optionName}{/lang}</label>{if $inSearchMode|empty && $option->required} <span class="customOptionRequired">*</span>{/if}{/if}</dt>
+               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>{if $isSearchMode|empty || !$optionData[hideLabelInSearch]}<label for="{$option->optionName}">{$langPrefix|concat:$option->optionName|language}</label>{if $inSearchMode|empty && $option->required} <span class="customOptionRequired">*</span>{/if}{/if}</dt>
                <dd>{@$optionData[html]}
                        <small>{lang __optional=true}{@$langPrefix}{$option->optionName}.description{/lang}</small>
                        
index 3603ca6fce7880492b8550d4a83d4e50f83b256b..4437abb33cd112d5bf1b82f8374b9e56b62fdeb0 100644 (file)
@@ -7,7 +7,7 @@
                                        
                                        {foreach from=$optionCategory[options] item=userOption}
                                                <dl>
-                                                       <dt>{lang}wcf.user.option.{@$userOption[object]->optionName}{/lang}</dt>
+                                                       <dt>{$userOption[object]->getTitle()}</dt>
                                                        <dd>{@$userOption[object]->optionValue}</dd>
                                                </dl>
                                        {/foreach}
index 8524d4f063822101de323b77136b6edb03fd9270..c62d02801e5969b22bcfcaf371a4213e2c7b1ac3 100644 (file)
@@ -6,7 +6,7 @@
                {assign var=error value=''}
        {/if}
        <dl class="{$option->optionName}Input{if $error} formError{/if}">
-               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}><label for="{$option->optionName}">{lang}{@$langPrefix}{$option->optionName}{/lang}</label></dt>
+               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}><label for="{$option->optionName}">{$langPrefix|concat:$option->optionName|language}</label></dt>
                <dd>{@$optionData[html]}
                        {if $error}
                                <small class="innerError">
index 4ed68fe6ba2488874e03465db15e6914eba39606..da8d574c0a2f02fff56980da32a390caeeadcf60 100644 (file)
@@ -14,7 +14,7 @@
                                        {if VISITOR_USE_TINY_BUILD && $isGuestGroup && $option->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}
                                        {if $groupIsOwner && $option->optionName|in_array:$ownerGroupPermissions}<span class="icon icon16 fa-shield jsTooltip" title="{lang}wcf.acp.group.ownerGroupPermission{/lang}"></span> {/if}
                                        
-                                       {lang}{@$langPrefix}{$option->optionName}{/lang}
+                                       {$langPrefix|concat:$option->optionName|language}
                                </label>
                        {/if}
                </dt>
index b5c240cdde298903658f75f7c6951f394e920715..68203e0ad965193868da2d534236ebc3097e8a8a 100644 (file)
@@ -95,7 +95,7 @@
                                                        
                                                        {* the 'about me' field does not qualify for display *}
                                                        {if $option->optionName !== 'aboutMe'}
-                                                               <label><input type="checkbox" name="columns[]" value="{$option->optionName}"{if $option->optionName|in_array:$columns} checked{/if}> {lang}wcf.user.option.{$option->optionName}{/lang}</label>
+                                                               <label><input type="checkbox" name="columns[]" value="{$option->optionName}"{if $option->optionName|in_array:$columns} checked{/if}> {$option->getTitle()}</label>
                                                        {/if}
                                                {/foreach}
                                        </dd>