Makes form errors more customizable for plugins
authorMatthias Schmidt <gravatronics@live.com>
Wed, 28 Sep 2011 07:25:07 +0000 (09:25 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 28 Sep 2011 07:25:07 +0000 (09:25 +0200)
See http://www.woltlab.com/bugtracker/index.php?page=Bug&bugID=1496

wcfsetup/install/files/acp/templates/cronjobAdd.tpl
wcfsetup/install/files/acp/templates/login.tpl
wcfsetup/install/files/acp/templates/masterPassword.tpl
wcfsetup/install/files/acp/templates/masterPasswordInit.tpl
wcfsetup/install/files/acp/templates/optionImport.tpl
wcfsetup/install/files/acp/templates/packageStartInstall.tpl
wcfsetup/install/files/acp/templates/updateServerAdd.tpl
wcfsetup/install/files/acp/templates/userAdd.tpl
wcfsetup/install/files/acp/templates/userGroupAdd.tpl
wcfsetup/install/files/acp/templates/userMail.tpl

index 20903dc8498f9342d040945caa8f85966b323789..2024f8604333b3285edea57bc32299a28ac6a963 100644 (file)
                                        {if $errorField == 'className'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'doesNotExist'}{lang}wcf.acp.cronjob.error.className.doesNotExist{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.cronjob.error.className.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="classNameHelpMessage">{lang}wcf.acp.cronjob.className.description{/lang}</small>
@@ -67,7 +70,7 @@
                                        {if $errorField == 'startMinute'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.cronjob.error.timing.notValid{/lang}{/if}
+                                                       {lang}wcf.acp.cronjob.error.timing.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="startMinuteHelpMessage">{lang}wcf.acp.cronjob.startMinute.description{/lang}</small>
@@ -81,7 +84,7 @@
                                        {if $errorField == 'startHour'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.cronjob.error.timing.notValid{/lang}{/if}
+                                                       {lang}wcf.acp.cronjob.error.timing.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="startHourHelpMessage">{lang}wcf.acp.cronjob.startHour.description{/lang}</small>
@@ -95,7 +98,7 @@
                                        {if $errorField == 'startDom'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.cronjob.error.timing.notValid{/lang}{/if}
+                                                       {lang}wcf.acp.cronjob.error.timing.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="startDomHelpMessage">{lang}wcf.acp.cronjob.startDom.description{/lang}</small>
                                        {if $errorField == 'startMonth'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.cronjob.error.timing.notValid{/lang}{/if}
+                                                       {lang}wcf.acp.cronjob.error.timing.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="startMonthHelpMessage">{lang}wcf.acp.cronjob.startMonth.description{/lang}</small>
                                        {if $errorField == 'startDow'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.cronjob.error.timing.notValid{/lang}{/if}
+                                                       {lang}wcf.acp.cronjob.error.timing.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="startDowHelpMessage">{lang}wcf.acp.cronjob.startDow.description{/lang}</small>
index 939b4b722a7fd7c76512be1333cbc0e2a133afae..c59782dfc67b9dfa4702ff5625267210a9e2da8a 100644 (file)
@@ -14,7 +14,7 @@
        </hgroup>
 </header>
 
-{if $errorField != ''}
+{if $errorField}
        <p class="error">{lang}wcf.global.form.error{/lang}</p>
 {/if}
 
                        <dd><input type="text" id="username" name="username" value="{$username}" class="medium" />
                                {if $errorField == 'username'}
                                        <small class="innerError">
-                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                               {if $errorType == 'notFound'}{lang}wcf.user.error.username.notFound{/lang}{/if}
+                                               <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.user.error.username.{@$errorType}{/lang}
+                                               {/if}
                                        </small>
                                {/if}
                        </dd>
                        <dd><input type="password" id="password" name="password" value="" class="medium" />
                                {if $errorField == 'password'}
                                        <small class="innerError">
-                                               <img src="{@RELATIVE_WCF_DIR}icon/errorS.png" alt="" />
-                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                               {if $errorType == 'false'}{lang}wcf.user.error.password.false{/lang}{/if}
+                                               <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.user.error.password.{@$errorType}{/lang}
+                                               {/if}
                                        </small>
                                {/if}
                        </dd>
index 0506a35824a5c6943ec149ad76b2198640b933a4..89ddf8fb7c9390c17d3efe697ab8a9eaaf34a003 100644 (file)
                                        {if $errorField == 'masterPassword'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'invalid'}{lang}wcf.acp.masterPassword.error.invalid{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.masterPassword.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="masterPasswordHelpMessage">{lang}wcf.acp.masterPassword.enter.description{/lang}</small>
index 87f2b86122c98cf6048ae4b8eaf4fb2a93d374b3..72599b54c7e4ae5cd279476c87f00c96e2a9b0d9 100644 (file)
                                        {if $errorField == 'masterPassword'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'notSecure'}{lang}wcf.acp.masterPassword.error.notSecure{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.masterPassword.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="masterPasswordHelpMessage">{lang}wcf.acp.masterPassword.init.description{/lang}</small>
                                        {if $errorField == 'confirmMasterPassword'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'notEqual'}{lang}wcf.acp.masterPassword.error.notEqual{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.masterPassword.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                </dd>
index f5c310924403084006169ceb4d5ec564fbf0118a..603e16078cb8d272cc5a1ac60cbb42f7cfdf3bb3 100644 (file)
                                        {if $errorField == 'optionImport'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'importFailed'}{lang}wcf.acp.option.import.error.importFailed{/lang}{/if}
-                                                       {if $errorType == 'uploadFailed'}{lang}wcf.acp.option.import.error.uploadFailed{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.option.import.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="optionImportHelpMessage">{lang}wcf.acp.option.import.upload.description{/lang}</small>
index f6250741148eabf2ba78eb4d09918e9b6442ad2c..86c717e818a025a7dd1fb27b1653fcd2eee19a05 100644 (file)
                                        {if $errorField == 'uploadPackage'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'noValidPackage'}{lang}wcf.acp.package.startInstall.error.noValidPackage{/lang}{/if}
-                                                       {if $errorType == 'noValidUpdate'}{lang}wcf.acp.package.startInstall.error.noValidUpdate{/lang}{/if}
-                                                       {if $errorType == 'noValidInstall'}{lang}wcf.acp.package.startInstall.error.noValidInstall{/lang}{/if}
-                                                       {if $errorType == 'uploadFailed'}{lang}wcf.acp.package.startInstall.error.uploadFailed{/lang}{/if}
-                                                       {if $errorType == 'uniqueAlreadyInstalled'}{lang}wcf.acp.package.startInstall.error.uniqueAlreadyInstalled{/lang}{/if}
-                                                       {if $errorType == 'phpRequirements'}<pre>{$phpRequirements|print_r}</pre>{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {elseif $errorType == 'phpRequirements'}
+                                                               {* todo: use language variable (-> else) *}
+                                                               <pre>{$phpRequirements|print_r}</pre>
+                                                       {else}
+                                                               {lang}wcf.acp.package.startInstall.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="uploadPackageHelpMessage">{lang}wcf.acp.package.startInstall.source.upload.description{/lang}</small>
                                        {if $errorField == 'downloadPackage'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'notFound'}{lang}wcf.acp.package.startInstall.error.notFound{/lang}{/if}
-                                                       {if $errorType == 'noValidPackage'}{lang}wcf.acp.package.startInstall.error.noValidPackage{/lang}{/if}
-                                                       {if $errorType == 'noValidUpdate'}{lang}wcf.acp.package.startInstall.error.noValidUpdate{/lang}{/if}
-                                                       {if $errorType == 'noValidInstall'}{lang}wcf.acp.package.startInstall.error.noValidInstall{/lang}{/if}
-                                                       {if $errorType == 'uniqueAlreadyInstalled'}{lang}wcf.acp.package.startInstall.error.uniqueAlreadyInstalled{/lang}{/if}
+                                                       {lang}wcf.acp.package.startInstall.error.{@$errorType}{/lang}
                                                </small>
                                        {/if}
                                        <small id="downloadPackageHelpMessage">{lang}wcf.acp.package.startInstall.source.download.description{/lang}</small>
index 467720a121b06edbc73c56d036258f8a785e4740..677b0795793070db89a61aa2d441367dea135d6e 100644 (file)
                                        {if $errorField == 'serverURL'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       {if $errorType == 'notValid'}{lang}wcf.acp.updateServer.serverURL.error.notValid{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.updateServer.serverURL.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="serverURLHelpMessage">{lang}wcf.acp.updateServer.serverURL.description{/lang}</small>
index f72eb5f309040ce0db0e8b35e696d423efe57985..c2a22eb116d1617dfac81663b8dfbf68a5fb9b53 100644 (file)
                                {if $errorType.username|isset}
                                        <small class="innerError">
                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                               {if $errorType.username == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                               {if $errorType.username == 'notValid'}{lang}wcf.user.error.username.notValid{/lang}{/if}
-                                               {if $errorType.username == 'notUnique'}{lang}wcf.user.error.username.notUnique{/lang}{/if}
+                                               {if $errorType.username == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.user.error.username.{@$errorType.username}{/lang}
+                                               {/if}
                                        </small>
                                {/if}
                        </dd>
                                                {if $errorType.email|isset}
                                                        <small class="innerError">
                                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                               {if $errorType.email == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                               {if $errorType.email == 'notValid'}{lang}wcf.user.error.email.notValid{/lang}{/if}
-                                                               {if $errorType.email == 'notUnique'}{lang}wcf.user.error.email.notUnique{/lang}{/if}
+                                                               {if $errorType.email == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.user.error.email.{@$errorType.email}{/lang}
+                                                               {/if}
                                                        </small>
                                                {/if}
                                        </dd>
                                                {if $errorType.confirmEmail|isset}
                                                        <small class="innerError">
                                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                               {if $errorType.confirmEmail == 'notEqual'}{lang}wcf.user.error.confirmEmail.notEqual{/lang}{/if}
+                                                               {lang}wcf.user.error.confirmEmail.{@$errorType.confirmEmail}{/lang}
                                                        </small>
                                                {/if}
                                        </dd>
                                                {if $errorType.password|isset}
                                                        <small class="innerError">
                                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                               {if $errorType.password == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               {if $errorType.password == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.user.error.password.{@$errorType.password}{/lang}
+                                                               {/if}
                                                        </small>
                                                {/if}
                                        </dd>
                                                {if $errorType.confirmPassword|isset}
                                                        <small class="innerError">
                                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                               {if $errorType.confirmPassword == 'notEqual'}{lang}wcf.user.error.confirmPassword.notEqual{/lang}{/if}
+                                                               {lang}wcf.user.error.confirmPassword.{@$errorType.confirmPassword}{/lang}
                                                        </small>
                                                {/if}
                                        </dd>
index 6be83ef450e7b33f75a7c620f18562fb59f753e1..800507c1ae068704270bdc84eaceac28413845e4 100644 (file)
                                        {if $errorType.groupName|isset}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType.groupName == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                       {if $errorType.groupName == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.group.groupName.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="groupNameHelpMessage">{lang}wcf.acp.group.groupName.description{/lang}</small>
index e7e31d34a3d03d861c522c02f2c0e6a8d7c8ff17..c65cd0ddcd41179dd3e135c8dde4689b6cda99a6 100644 (file)
                                                {if $errorField == 'groupIDs'}
                                                        <small class="innerError">
                                                                <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.user.sendMail.groups.error.{@$errorType}{/lang}
+                                                               {/if}
                                                        </small>
                                                {/if}
                                        </dd>
                                        {if $errorField == 'subject'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.user.sendMail.subject.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="subjectHelpMessage">{lang}wcf.acp.user.sendMail.subject.description{/lang}</small>
                                        {if $errorField == 'from'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.user.sendMail.subject.from.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="fromHelpMessage">{lang}wcf.acp.user.sendMail.from.description{/lang}</small><!-- ToDo: Language variable contains paragraphs! -->
                                        {if $errorField == 'text'}
                                                <small class="innerError">
                                                        <span class="arrowOuter" style="display: none;"><span class="arrowInner"></span></span>
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.acp.user.sendMail.text.error.{@$errorType}{/lang}
+                                                       {/if}
                                                </small>
                                        {/if}
                                        <small id="textHelpMessage">{lang}wcf.acp.user.sendMail.text.description{/lang}</small>