From b6486b71618befbb08e6fb2f8275f60fd0554a81 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 7 May 2013 10:16:49 +0200 Subject: [PATCH] Fixes user option management-related issues in pure WCF installation Closes #1244 Closes #1245 --- .../files/acp/templates/userOptionAdd.tpl | 401 +++++++++--------- .../acp/templates/userOptionSetDefaults.tpl | 70 +-- .../form/UserOptionSetDefaultsForm.class.php | 12 +- wcfsetup/install/lang/de.xml | 2 + wcfsetup/install/lang/en.xml | 2 + 5 files changed, 249 insertions(+), 238 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/userOptionAdd.tpl b/wcfsetup/install/files/acp/templates/userOptionAdd.tpl index 7d90472ae4..6cab6f72b5 100644 --- a/wcfsetup/install/files/acp/templates/userOptionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userOptionAdd.tpl @@ -22,207 +22,210 @@ -
-
-
- {lang}wcf.global.form.data{/lang} - - -
-
- - {if $errorField == 'optionName'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.name.error.{@$errorType}{/lang} - {/if} - - {/if} -
- - {include file='multipleLanguageInputJavascript' elementIdentifier='optionName' forceSelection=true} - - -
-
- - {if $errorField == 'optionDescription'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.description.error.{@$errorType}{/lang} - {/if} - - {/if} -
- - {include file='multipleLanguageInputJavascript' elementIdentifier='optionDescription' forceSelection=true} - - -
-
- +{if !$availableCategories|empty} + +
+
+ {lang}wcf.global.form.data{/lang} + + +
+
+ + {if $errorField == 'optionName'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.name.error.{@$errorType}{/lang} + {/if} + + {/if} +
+ + {include file='multipleLanguageInputJavascript' elementIdentifier='optionName' forceSelection=true} + + +
+
+ + {if $errorField == 'optionDescription'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.description.error.{@$errorType}{/lang} + {/if} + + {/if} +
+ + {include file='multipleLanguageInputJavascript' elementIdentifier='optionDescription' forceSelection=true} + + +
+
+ + + {if $errorField == 'categoryName'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.categoryName.error.{@$errorType}{/lang} + {/if} + + {/if} +
+ + +
+
+
+ +
+
+ + {event name='dataFields'} +
+ +
+ {lang}wcf.acp.user.option.typeData{/lang} + + +
+
+ + {if $errorField == 'optionType'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.optionType.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.user.option.optionType{/lang} +
+ + +
+
+
+ + {lang}wcf.acp.user.option.defaultValue.description{/lang} +
+
+ + +
+
+ + {if $errorField == 'selectOptions'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.selectOptions.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.user.option.selectOptions.description{/lang} +
+ + + +
+
+ + {if $errorField == 'outputClass'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.outputClass.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.user.option.outputClass.description{/lang} +
+ + + {event name='typeDataFields'} +
+ +
+ {lang}wcf.acp.user.option.access{/lang} + +
+
+
+ +
+
+ +
+
+
+ +
+
+ + +
+
+ + {if $errorField == 'validationPattern'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.user.option.validationPattern.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.user.option.validationPattern.description{/lang} +
+ + +
+
+ + + +
+
- {if $errorField == 'categoryName'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.categoryName.error.{@$errorType}{/lang} - {/if} - - {/if} -
- - -
-
-
- -
-
- - {event name='dataFields'} -
- -
- {lang}wcf.acp.user.option.typeData{/lang} - - -
-
- - {if $errorField == 'optionType'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.optionType.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.user.option.optionType{/lang} -
- - -
-
-
- - {lang}wcf.acp.user.option.defaultValue.description{/lang} -
-
- - -
-
- - {if $errorField == 'selectOptions'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.selectOptions.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.user.option.selectOptions.description{/lang} -
- + {event name='accessFields'} +
- -
-
- - {if $errorField == 'outputClass'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.outputClass.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.user.option.outputClass.description{/lang} -
- - - {event name='typeDataFields'} - + {event name='fieldsets'} +
-
- {lang}wcf.acp.user.option.access{/lang} - -
-
-
- -
-
- -
-
-
- -
-
- - -
-
- - {if $errorField == 'validationPattern'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.user.option.validationPattern.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.user.option.validationPattern.description{/lang} -
- - -
-
- - - -
-
- - {event name='accessFields'} -
- - {event name='fieldsets'} - - -
- -
-
- +
+ +
+ +{else} +

{lang}wcf.acp.user.option.add.noCategories{/lang}

+{/if} {include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/userOptionSetDefaults.tpl b/wcfsetup/install/files/acp/templates/userOptionSetDefaults.tpl index 8233776faf..7efd4d7043 100644 --- a/wcfsetup/install/files/acp/templates/userOptionSetDefaults.tpl +++ b/wcfsetup/install/files/acp/templates/userOptionSetDefaults.tpl @@ -12,8 +12,8 @@

{lang}wcf.global.success.edit{/lang}

{/if} -{hascontent} -
+
+ {hascontent} -
-{/hascontent} + {/hascontent} +
-
-
-
-
-
- - {lang}wcf.acp.user.option.setDefaults.applyChangesToExistingUsers.description{/lang} -
-
-
- - {foreach from=$optionTree[0][categories] item=optionCategory} +{if !$optionTree|empty} + +
- {lang}wcf.user.option.category.{@$optionCategory[object]->categoryName}{/lang} - - {include file='optionFieldList' options=$optionCategory[options] langPrefix='wcf.user.option.'} - - {if $optionCategory[categories]|count} - {foreach from=$optionCategory[categories] item=optionCategory2} - {include file='optionFieldList' options=$optionCategory2[options] langPrefix='wcf.user.option.'} - {/foreach} - {/if} +
+
+ + {lang}wcf.acp.user.option.setDefaults.applyChangesToExistingUsers.description{/lang} +
+
- {/foreach} + + {foreach from=$optionTree[0][categories] item=optionCategory} +
+ {lang}wcf.user.option.category.{@$optionCategory[object]->categoryName}{/lang} + + {include file='optionFieldList' options=$optionCategory[options] langPrefix='wcf.user.option.'} + + {if $optionCategory[categories]|count} + {foreach from=$optionCategory[categories] item=optionCategory2} + {include file='optionFieldList' options=$optionCategory2[options] langPrefix='wcf.user.option.'} + {/foreach} + {/if} +
+ {/foreach} + + {event name='fieldsets'} +
- {event name='fieldsets'} -
- -
- -
-
+
+ +
+ +{else} +

{lang}wcf.acp.user.option.noItems{/lang}

+{/if} {include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php index aef6617a2e..f672733e87 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php @@ -43,7 +43,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { */ public function readParameters() { parent::readParameters(); - + $this->optionHandler = new UserOptionHandler(false, '', 'settings'); $this->optionHandler->init(); } @@ -64,7 +64,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { */ public function validate() { parent::validate(); - + $this->optionHandler->validate(); } @@ -73,7 +73,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { */ public function save() { parent::save(); - + // get new values $saveOptions = $this->optionHandler->save(); @@ -115,7 +115,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { // reset cache UserOptionCacheBuilder::getInstance()->reset(); $this->saved(); - + WCF::getTPL()->assign('success', true); } @@ -124,7 +124,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { */ public function readData() { parent::readData(); - + if (empty($_POST)) { $this->optionHandler->readData(); } @@ -135,7 +135,7 @@ class UserOptionSetDefaultsForm extends AbstractForm { */ public function assignVariables() { parent::assignVariables(); - + WCF::getTPL()->assign(array( 'optionTree' => $this->optionHandler->getOptionTree(), 'applyChangesToExistingUsers' => $this->applyChangesToExistingUsers diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index d53a73973a..cf70903fa9 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1109,4 +1109,6 @@ user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]> + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 8dbf656965..4a698e47bf 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1109,4 +1109,6 @@ user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]> + + -- 2.20.1