From: Marcel Werk Date: Sun, 16 Aug 2020 13:36:46 +0000 (+0200) Subject: Forms: Provide a link to edit an item that was just created X-Git-Tag: 5.3.0_Alpha_1~50^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fb859c9c6de36a787a839a2ce910897a4315ee9;p=GitHub%2FWoltLab%2FWCF.git Forms: Provide a link to edit an item that was just created Closes #3289 --- diff --git a/wcfsetup/install/files/acp/templates/__form.tpl b/wcfsetup/install/files/acp/templates/__form.tpl index d6ad54d0e6..ace2598e29 100644 --- a/wcfsetup/install/files/acp/templates/__form.tpl +++ b/wcfsetup/install/files/acp/templates/__form.tpl @@ -24,7 +24,13 @@ {/if} {if $form->showsSuccessMessage()} -

{@$form->getSuccessMessage()}

+

+ + {@$form->getSuccessMessage()} + {if !$objectEditLink|empty} + {lang}wcf.global.success.add.button.editCreatedObject{/lang} + {/if} +

{/if} {if $form->isAjax()} diff --git a/wcfsetup/install/files/acp/templates/adAdd.tpl b/wcfsetup/install/files/acp/templates/adAdd.tpl index c0e1210446..39a3dbd1a9 100644 --- a/wcfsetup/install/files/acp/templates/adAdd.tpl +++ b/wcfsetup/install/files/acp/templates/adAdd.tpl @@ -24,9 +24,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/articleAdd.tpl b/wcfsetup/install/files/acp/templates/articleAdd.tpl index 9ba2864b79..1f062f4aef 100644 --- a/wcfsetup/install/files/acp/templates/articleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/articleAdd.tpl @@ -91,9 +91,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $action == 'edit'}

isDeleted} style="display: none;"{/if}>{lang}wcf.acp.article.trash.notice{/lang}

diff --git a/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl b/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl index 166ac3802a..828a820199 100644 --- a/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl +++ b/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl @@ -90,9 +90,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/bbcodeMediaProviderAdd.tpl b/wcfsetup/install/files/acp/templates/bbcodeMediaProviderAdd.tpl index b4ae4ba487..c81c5a7983 100644 --- a/wcfsetup/install/files/acp/templates/bbcodeMediaProviderAdd.tpl +++ b/wcfsetup/install/files/acp/templates/bbcodeMediaProviderAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
@@ -99,4 +97,4 @@
-{include file='footer'} \ No newline at end of file +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/boxAdd.tpl b/wcfsetup/install/files/acp/templates/boxAdd.tpl index 16d172d9f1..b31738f01c 100644 --- a/wcfsetup/install/files/acp/templates/boxAdd.tpl +++ b/wcfsetup/install/files/acp/templates/boxAdd.tpl @@ -86,9 +86,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $action == 'edit' && !$lastVersion|empty}

{lang}wcf.acp.box.lastVersion{/lang}

diff --git a/wcfsetup/install/files/acp/templates/captchaQuestionAdd.tpl b/wcfsetup/install/files/acp/templates/captchaQuestionAdd.tpl index eee5ffbbc6..270c96ceec 100644 --- a/wcfsetup/install/files/acp/templates/captchaQuestionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/captchaQuestionAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/categoryAdd.tpl b/wcfsetup/install/files/acp/templates/categoryAdd.tpl index 8297538c72..b95cd355f6 100644 --- a/wcfsetup/install/files/acp/templates/categoryAdd.tpl +++ b/wcfsetup/install/files/acp/templates/categoryAdd.tpl @@ -50,9 +50,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'} {event name='beforeSections'} @@ -176,4 +174,4 @@
-{include file='footer'} \ No newline at end of file +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/contactOptionAdd.tpl b/wcfsetup/install/files/acp/templates/contactOptionAdd.tpl index 1468dd6719..b759c262c9 100644 --- a/wcfsetup/install/files/acp/templates/contactOptionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/contactOptionAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
{include file='customOptionAdd'} diff --git a/wcfsetup/install/files/acp/templates/contactRecipientAdd.tpl b/wcfsetup/install/files/acp/templates/contactRecipientAdd.tpl index 6bab6a3ea4..f67830f303 100644 --- a/wcfsetup/install/files/acp/templates/contactRecipientAdd.tpl +++ b/wcfsetup/install/files/acp/templates/contactRecipientAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/cronjobAdd.tpl b/wcfsetup/install/files/acp/templates/cronjobAdd.tpl index fe3baef0b0..012189854c 100644 --- a/wcfsetup/install/files/acp/templates/cronjobAdd.tpl +++ b/wcfsetup/install/files/acp/templates/cronjobAdd.tpl @@ -18,9 +18,7 @@

{lang}wcf.acp.cronjob.intro{/lang}

-{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/formSuccess.tpl b/wcfsetup/install/files/acp/templates/formSuccess.tpl new file mode 100644 index 0000000000..2150222f33 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/formSuccess.tpl @@ -0,0 +1,10 @@ +{if $success|isset} +

+ + {lang}wcf.global.success.{$action}{/lang} + + {if $action == 'add' && !$objectEditLink|empty} + {lang}wcf.global.success.add.button.editCreatedObject{/lang} + {/if} +

+{/if} diff --git a/wcfsetup/install/files/acp/templates/labelAdd.tpl b/wcfsetup/install/files/acp/templates/labelAdd.tpl index 14ed6e733c..c28fd2de36 100644 --- a/wcfsetup/install/files/acp/templates/labelAdd.tpl +++ b/wcfsetup/install/files/acp/templates/labelAdd.tpl @@ -40,9 +40,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $labelGroupList|count} diff --git a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl index dbb6ef31a6..faab5f8bc7 100644 --- a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl @@ -35,9 +35,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/languageAdd.tpl b/wcfsetup/install/files/acp/templates/languageAdd.tpl index bfb0d90f32..89637d66de 100644 --- a/wcfsetup/install/files/acp/templates/languageAdd.tpl +++ b/wcfsetup/install/files/acp/templates/languageAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/menuAdd.tpl b/wcfsetup/install/files/acp/templates/menuAdd.tpl index ec311ca009..b78b08abb0 100644 --- a/wcfsetup/install/files/acp/templates/menuAdd.tpl +++ b/wcfsetup/install/files/acp/templates/menuAdd.tpl @@ -19,9 +19,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $action == 'edit' && $menu->identifier == 'com.woltlab.wcf.MainMenu'} diff --git a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl index 016a949ca1..1e75a18083 100644 --- a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl +++ b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl @@ -44,9 +44,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/noticeAdd.tpl b/wcfsetup/install/files/acp/templates/noticeAdd.tpl index f782945984..67b7f9b518 100644 --- a/wcfsetup/install/files/acp/templates/noticeAdd.tpl +++ b/wcfsetup/install/files/acp/templates/noticeAdd.tpl @@ -36,9 +36,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/packageUpdateServerAdd.tpl b/wcfsetup/install/files/acp/templates/packageUpdateServerAdd.tpl index 55cdbec297..c47139b82c 100644 --- a/wcfsetup/install/files/acp/templates/packageUpdateServerAdd.tpl +++ b/wcfsetup/install/files/acp/templates/packageUpdateServerAdd.tpl @@ -20,9 +20,7 @@

{lang}wcf.acp.updateServer.lastErrorMessage{/lang}
{$packageUpdateServer->errorMessage}

{/if} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/pageAdd.tpl b/wcfsetup/install/files/acp/templates/pageAdd.tpl index dff6b975e4..beda9e36f7 100644 --- a/wcfsetup/install/files/acp/templates/pageAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageAdd.tpl @@ -98,9 +98,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $action == 'edit' && !$lastVersion|empty}

{lang}wcf.acp.page.lastVersion{/lang}

diff --git a/wcfsetup/install/files/acp/templates/paidSubscriptionAdd.tpl b/wcfsetup/install/files/acp/templates/paidSubscriptionAdd.tpl index 387ababbc6..c2fee72d2e 100644 --- a/wcfsetup/install/files/acp/templates/paidSubscriptionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/paidSubscriptionAdd.tpl @@ -33,9 +33,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
@@ -195,4 +193,4 @@
-{include file='footer'} \ No newline at end of file +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/paidSubscriptionUserAdd.tpl b/wcfsetup/install/files/acp/templates/paidSubscriptionUserAdd.tpl index 30832b927f..806b95fb99 100644 --- a/wcfsetup/install/files/acp/templates/paidSubscriptionUserAdd.tpl +++ b/wcfsetup/install/files/acp/templates/paidSubscriptionUserAdd.tpl @@ -33,9 +33,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/smileyAdd.tpl b/wcfsetup/install/files/acp/templates/smileyAdd.tpl index 391495a1cd..4bf6c71843 100644 --- a/wcfsetup/install/files/acp/templates/smileyAdd.tpl +++ b/wcfsetup/install/files/acp/templates/smileyAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index 6c1663876c..3ccd097e02 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -65,9 +65,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/tagAdd.tpl b/wcfsetup/install/files/acp/templates/tagAdd.tpl index 2f1b2c97bd..71145f81c2 100644 --- a/wcfsetup/install/files/acp/templates/tagAdd.tpl +++ b/wcfsetup/install/files/acp/templates/tagAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
@@ -101,4 +99,4 @@
-{include file='footer'} \ No newline at end of file +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/templateAdd.tpl b/wcfsetup/install/files/acp/templates/templateAdd.tpl index c79ea5bdc0..29432046c2 100644 --- a/wcfsetup/install/files/acp/templates/templateAdd.tpl +++ b/wcfsetup/install/files/acp/templates/templateAdd.tpl @@ -18,9 +18,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $availableTemplateGroups|count}
diff --git a/wcfsetup/install/files/acp/templates/templateGroupAdd.tpl b/wcfsetup/install/files/acp/templates/templateGroupAdd.tpl index 90607ee32a..221154f4f7 100644 --- a/wcfsetup/install/files/acp/templates/templateGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/templateGroupAdd.tpl @@ -34,9 +34,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/trophyAdd.tpl b/wcfsetup/install/files/acp/templates/trophyAdd.tpl index 0c87dfde3a..ff137c49fc 100644 --- a/wcfsetup/install/files/acp/templates/trophyAdd.tpl +++ b/wcfsetup/install/files/acp/templates/trophyAdd.tpl @@ -64,9 +64,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $trophyCategories|count} diff --git a/wcfsetup/install/files/acp/templates/userAdd.tpl b/wcfsetup/install/files/acp/templates/userAdd.tpl index 19289ed966..644f256094 100644 --- a/wcfsetup/install/files/acp/templates/userAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userAdd.tpl @@ -21,9 +21,7 @@

{lang}wcf.acp.user.edit.warning.selfEdit{/lang}

{/if} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl index a7e2ba3141..64936d4198 100644 --- a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl @@ -79,9 +79,7 @@

{lang}wcf.acp.group.edit.warning.selfIsMember{/lang}

{/if} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/userGroupAssignmentAdd.tpl b/wcfsetup/install/files/acp/templates/userGroupAssignmentAdd.tpl index fe1221ee47..29a299cda3 100644 --- a/wcfsetup/install/files/acp/templates/userGroupAssignmentAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupAssignmentAdd.tpl @@ -16,9 +16,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{@$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/userOptionAdd.tpl b/wcfsetup/install/files/acp/templates/userOptionAdd.tpl index df8f6fcc1a..27bae71f06 100644 --- a/wcfsetup/install/files/acp/templates/userOptionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userOptionAdd.tpl @@ -17,9 +17,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if !$availableCategories|empty} diff --git a/wcfsetup/install/files/acp/templates/userOptionCategoryAdd.tpl b/wcfsetup/install/files/acp/templates/userOptionCategoryAdd.tpl index b2f81558c3..1c7612b21b 100644 --- a/wcfsetup/install/files/acp/templates/userOptionCategoryAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userOptionCategoryAdd.tpl @@ -17,9 +17,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/userRankAdd.tpl b/wcfsetup/install/files/acp/templates/userRankAdd.tpl index 008445caf4..677577f149 100644 --- a/wcfsetup/install/files/acp/templates/userRankAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userRankAdd.tpl @@ -40,9 +40,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'}
diff --git a/wcfsetup/install/files/acp/templates/userTrophyAdd.tpl b/wcfsetup/install/files/acp/templates/userTrophyAdd.tpl index bf114a1a37..3e559cbe0b 100644 --- a/wcfsetup/install/files/acp/templates/userTrophyAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userTrophyAdd.tpl @@ -37,9 +37,7 @@ {include file='formError'} -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} +{include file='formSuccess'} {if $hasSuitableTrophy} diff --git a/wcfsetup/install/files/lib/acp/form/AdAddForm.class.php b/wcfsetup/install/files/lib/acp/form/AdAddForm.class.php index a4827be93e..1c9aee2a2f 100644 --- a/wcfsetup/install/files/lib/acp/form/AdAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AdAddForm.class.php @@ -8,6 +8,7 @@ use wcf\system\ad\AdHandler; use wcf\system\ad\location\IAdLocation; use wcf\system\condition\ConditionHandler; use wcf\system\exception\UserInputException; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -216,7 +217,10 @@ class AdAddForm extends AbstractForm { $condition->getProcessor()->reset(); } - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('AdEdit', ['id' => $returnValues['returnValues']->adID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php index 65c7aa9e92..3b05e4f657 100644 --- a/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php @@ -454,7 +454,10 @@ class ArticleAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('ArticleEdit', ['id' => $article->getObjectID()]), + ]); // reset variables $this->publicationDate = ''; diff --git a/wcfsetup/install/files/lib/acp/form/ArticleCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ArticleCategoryAddForm.class.php index d08f2615f8..812e987034 100644 --- a/wcfsetup/install/files/lib/acp/form/ArticleCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ArticleCategoryAddForm.class.php @@ -1,6 +1,7 @@ assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('ArticleCategoryEdit', ['id' => $this->objectAction->getReturnValues()['returnValues']->categoryID]), + ]); + $this->sortField = 'publicationDate'; $this->sortOrder = 'DESC'; } diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php index e9c8cd7fbe..56c54dc1e4 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php @@ -8,6 +8,7 @@ use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -269,7 +270,10 @@ class BBCodeAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('BBCodeEdit', ['id' => $returnValues['returnValues']->bbcodeID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php index 323109321c..0748d5e5b4 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php @@ -6,6 +6,7 @@ use wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -133,7 +134,10 @@ class BBCodeMediaProviderAddForm extends AbstractForm { $this->title = $this->regex = $this->html = $this->className = ''; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('BBCodeMediaProviderEdit', ['id' => $provider->providerID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php index 2c36e1f543..52f9d385ac 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php @@ -562,7 +562,10 @@ class BoxAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('BoxEdit', ['id' => $box->getObjectID()]), + ]); // reset variables $this->cssClassName = $this->name = ''; diff --git a/wcfsetup/install/files/lib/acp/form/CaptchaQuestionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/CaptchaQuestionAddForm.class.php index 3820b04e32..0b51d42d18 100644 --- a/wcfsetup/install/files/lib/acp/form/CaptchaQuestionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CaptchaQuestionAddForm.class.php @@ -6,6 +6,7 @@ use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -117,7 +118,10 @@ class CaptchaQuestionAddForm extends AbstractForm { $this->isDisabled = 0; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('CaptchaQuestionEdit', ['id' => $questionID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/ContactOptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ContactOptionAddForm.class.php index 4da4864fc6..95545dd477 100644 --- a/wcfsetup/install/files/lib/acp/form/ContactOptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ContactOptionAddForm.class.php @@ -3,6 +3,8 @@ namespace wcf\acp\form; use wcf\data\contact\option\ContactOption; use wcf\data\contact\option\ContactOptionAction; use wcf\data\contact\option\ContactOptionEditor; +use wcf\system\request\LinkHandler; +use wcf\system\WCF; /** * Shows the contact option add form. @@ -61,4 +63,15 @@ class ContactOptionAddForm extends AbstractCustomOptionForm { $this->getI18nValue('optionTitle')->setLanguageItem('wcf.contact.option', 'wcf.contact', 'com.woltlab.wcf'); $this->getI18nValue('optionDescription')->setLanguageItem('wcf.contact.optionDescription', 'wcf.contact', 'com.woltlab.wcf'); } + + /** + * @inheritDoc + */ + public function save() { + parent::save(); + + WCF::getTPL()->assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('ContactOptionEdit', ['id' => $this->objectAction->executeAction()['returnValues']->getObjectID()]), + ]); + } } diff --git a/wcfsetup/install/files/lib/acp/form/ContactOptionEditForm.class.php b/wcfsetup/install/files/lib/acp/form/ContactOptionEditForm.class.php index b712f2f615..f4ee58c7d9 100644 --- a/wcfsetup/install/files/lib/acp/form/ContactOptionEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ContactOptionEditForm.class.php @@ -15,4 +15,11 @@ class ContactOptionEditForm extends ContactOptionAddForm { * @inheritDoc */ public $action = 'edit'; + + /** + * @inheritDoc + */ + public function save() { + AbstractCustomOptionForm::save(); + } } diff --git a/wcfsetup/install/files/lib/acp/form/ContactRecipientAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ContactRecipientAddForm.class.php index bdd31f6a62..a92fcccf6e 100644 --- a/wcfsetup/install/files/lib/acp/form/ContactRecipientAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ContactRecipientAddForm.class.php @@ -7,6 +7,7 @@ use wcf\form\AbstractForm; use wcf\system\email\Mailbox; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; /** @@ -155,7 +156,10 @@ class ContactRecipientAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('ContactRecipientEdit', ['id' => $recipientID]), + ]); // reset values $this->email = $this->name = 0; diff --git a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php index c91fba1f39..402a0638da 100755 --- a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php @@ -7,6 +7,7 @@ use wcf\form\AbstractForm; use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\CronjobUtil; use wcf\util\StringUtil; @@ -188,7 +189,10 @@ class CronjobAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('CronjobEdit', ['id' => $cronjobID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php index 30edd88d49..c76f20be8c 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php @@ -8,6 +8,7 @@ use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -173,10 +174,10 @@ class LabelAddForm extends AbstractForm { 'showOrder' => $this->showOrder ])]); $this->objectAction->executeAction(); + $returnValues = $this->objectAction->getReturnValues(); + $labelID = $returnValues['returnValues']->labelID; if (!I18nHandler::getInstance()->isPlainValue('label')) { - $returnValues = $this->objectAction->getReturnValues(); - $labelID = $returnValues['returnValues']->labelID; I18nHandler::getInstance()->save('label', 'wcf.acp.label.label'.$labelID, 'wcf.acp.label', 1); // update group name @@ -200,7 +201,10 @@ class LabelAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('LabelEdit', ['id' => $labelID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index db8a8c68d6..7b69464a57 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -9,6 +9,7 @@ use wcf\system\exception\UserInputException; use wcf\system\label\object\type\ILabelObjectTypeHandler; use wcf\system\label\object\type\LabelObjectTypeContainer; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -197,7 +198,10 @@ class LabelGroupAddForm extends AbstractForm { $this->setObjectTypeRelations(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('LabelGroupEdit', ['id' => $returnValues['returnValues']->groupID]), + ]); I18nHandler::getInstance()->reset(); } diff --git a/wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php index 2a690913e3..5f9bb8f0e0 100644 --- a/wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php @@ -5,6 +5,7 @@ use wcf\data\language\LanguageEditor; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\LanguageFactory; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -155,7 +156,10 @@ class LanguageAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('LanguageEdit', ['id' => $this->language->languageID]), + ]); // reset values $this->countryCode = $this->languageCode = $this->languageName = ''; diff --git a/wcfsetup/install/files/lib/acp/form/MediaCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MediaCategoryAddForm.class.php index 292d2753fe..90a28a38a4 100644 --- a/wcfsetup/install/files/lib/acp/form/MediaCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MediaCategoryAddForm.class.php @@ -1,5 +1,7 @@ assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('MediaCategoryEdit', ['id' => $this->objectAction->getReturnValues()['returnValues']->categoryID]), + ]); + } } diff --git a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php index ff9080b2bf..fa7deb1d0b 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php @@ -10,6 +10,7 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\language\LanguageFactory; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\ArrayUtil; use wcf\util\StringUtil; @@ -210,7 +211,10 @@ class MenuAddForm extends AbstractForm { $this->pageIDs = $this->aclValues = []; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('MenuEdit', ['id' => $menuEditor->menuID]), + ]); I18nHandler::getInstance()->reset(); } diff --git a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php index dec77ce547..76d26de80a 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php @@ -12,6 +12,7 @@ use wcf\system\exception\IllegalLinkException; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\page\handler\ILookupPageHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -269,7 +270,10 @@ class MenuItemAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('MenuItemEdit', ['id' => $menuItem->itemID]), + ]); // reset variables $this->isInternalLink = true; diff --git a/wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php index f94907456e..d2803350a9 100644 --- a/wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php @@ -9,6 +9,7 @@ use wcf\system\condition\ConditionHandler; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -240,7 +241,10 @@ class NoticeAddForm extends AbstractForm { $condition->getProcessor()->reset(); } - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('NoticeEdit', ['id' => $returnValues['returnValues']->noticeID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php index 576b0c7e83..e67eb1830f 100755 --- a/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php @@ -4,6 +4,7 @@ use wcf\data\package\update\server\PackageUpdateServer; use wcf\data\package\update\server\PackageUpdateServerAction; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\system\WCFACP; use wcf\util\StringUtil; @@ -83,14 +84,17 @@ class PackageUpdateServerAddForm extends AbstractForm { 'loginUsername' => $this->loginUsername, 'loginPassword' => $this->loginPassword ])]); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); $this->saved(); // reset values $this->serverURL = $this->loginUsername = $this->loginPassword = ''; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('PackageUpdateServerEdit', ['id' => $returnValues['returnValues']->packageUpdateServerID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 1cdac321f9..aa3048c84e 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -636,7 +636,10 @@ class PageAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('PageEdit', ['id' => $page->pageID]), + ]); // reset variables $this->parentPageID = $this->isDisabled = $this->isLandingPage = $this->availableDuringOfflineMode = $this->enableShareButtons = $this->addPageToMainMenu = 0; diff --git a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php index 188a136278..bdaf074d74 100644 --- a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php @@ -10,6 +10,7 @@ use wcf\system\exception\NamedUserException; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\payment\method\PaymentMethodHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\ArrayUtil; @@ -283,7 +284,10 @@ class PaidSubscriptionAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('PaidSubscriptionEdit', ['id' => $returnValues['returnValues']->subscriptionID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php index 9def606500..e416bc59c6 100644 --- a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php @@ -44,6 +44,11 @@ class ReactionTypeAddForm extends AbstractFormBuilderForm { */ public $neededModules = ['MODULE_LIKE']; + /** + * @inheritDoc + */ + public $objectEditLinkController = 'ReactionTypeEdit'; + /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php index 16ad4615cb..04068283ba 100644 --- a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php @@ -8,6 +8,7 @@ use wcf\form\AbstractForm; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\FileUtil; use wcf\util\ImageUtil; @@ -224,7 +225,10 @@ class SmileyAddForm extends AbstractForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('SmileyEdit', ['id' => $smileyID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/SmileyCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/SmileyCategoryAddForm.class.php index fe98b3b637..af8e1fcc57 100644 --- a/wcfsetup/install/files/lib/acp/form/SmileyCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/SmileyCategoryAddForm.class.php @@ -1,5 +1,7 @@ assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('SmileyCategoryEdit', ['id' => $this->objectAction->getReturnValues()['returnValues']->categoryID]), + ]); + } } diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index 445878a400..bf9598ed8e 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -15,6 +15,7 @@ use wcf\system\file\upload\UploadHandler; use wcf\system\image\ImageHandler; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\style\exception\FontDownloadFailed; use wcf\system\style\FontManager; use wcf\system\WCF; @@ -805,7 +806,10 @@ class StyleAddForm extends AbstractForm { // reload variables $this->readStyleVariables(); - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('StyleEdit', ['id' => $style->styleID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/TagAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TagAddForm.class.php index 212fcb4316..d715438852 100644 --- a/wcfsetup/install/files/lib/acp/form/TagAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TagAddForm.class.php @@ -6,6 +6,7 @@ use wcf\data\tag\TagEditor; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\LanguageFactory; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\ArrayUtil; use wcf\util\StringUtil; @@ -179,7 +180,10 @@ class TagAddForm extends AbstractForm { $this->synonyms = []; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('TagEdit', ['id' => $returnValues['returnValues']->tagID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php index 0e1c12ed6c..199e4108c1 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php @@ -9,6 +9,7 @@ use wcf\form\AbstractForm; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\UserInputException; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -196,7 +197,7 @@ class TemplateAddForm extends AbstractForm { 'packageID' => $this->packageID, 'templateGroupID' => $this->templateGroupID ]), 'source' => $this->templateSource]); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); $this->saved(); // reset values @@ -204,7 +205,10 @@ class TemplateAddForm extends AbstractForm { $this->templateGroupID = 0; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('TemplateEdit', ['id' => $returnValues['returnValues']->templateID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php index 761428def4..d77b461120 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php @@ -4,6 +4,7 @@ use wcf\data\template\group\TemplateGroup; use wcf\data\template\group\TemplateGroupAction; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\FileUtil; use wcf\util\StringUtil; @@ -132,7 +133,7 @@ class TemplateGroupAddForm extends AbstractForm { 'templateGroupFolderName' => $this->templateGroupFolderName, 'parentTemplateGroupID' => $this->parentTemplateGroupID ?: null ])]); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); $this->saved(); // reset values @@ -140,7 +141,10 @@ class TemplateGroupAddForm extends AbstractForm { $this->parentTemplateGroupID = 0; // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('TemplateGroupEdit', ['id' => $returnValues['returnValues']->templateGroupID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php index 4dd41d9965..79ccc7bdf0 100644 --- a/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php @@ -9,6 +9,7 @@ use wcf\data\trophy\TrophyEditor; use wcf\system\condition\ConditionHandler; use wcf\system\exception\UserInputException; use wcf\system\language\I18nValue; +use wcf\system\request\LinkHandler; use wcf\system\trophy\condition\TrophyConditionHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -308,9 +309,9 @@ class TrophyAddForm extends AbstractAcpForm { ]), 'tmpHash' => $this->tmpHash ]); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); - $this->saveI18n($this->objectAction->getReturnValues()['returnValues'], TrophyEditor::class); + $this->saveI18n($returnValues['returnValues'], TrophyEditor::class); // transform conditions array into one-dimensional array $conditions = []; @@ -325,9 +326,13 @@ class TrophyAddForm extends AbstractAcpForm { } } - ConditionHandler::getInstance()->createConditions($this->objectAction->getReturnValues()['returnValues']->trophyID, $conditions); + ConditionHandler::getInstance()->createConditions($returnValues['returnValues']->trophyID, $conditions); $this->reset(); + + WCF::getTPL()->assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('TrophyEdit', ['id' => $returnValues['returnValues']->trophyID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php index 56a3e7d453..64bb45b9f4 100644 --- a/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TrophyCategoryAddForm.class.php @@ -1,5 +1,7 @@ assign([ + 'objectEditLink' => LinkHandler::getInstance()->getLink('TrophyCategoryEdit', ['id' => $this->objectAction->getReturnValues()['returnValues']->categoryID]), + ]); + } } diff --git a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php index 696f4e759d..e79572a647 100644 --- a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php @@ -8,6 +8,7 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\UserInputException; use wcf\system\html\input\HtmlInputProcessor; use wcf\system\language\LanguageFactory; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\ArrayUtil; use wcf\util\StringUtil; @@ -269,12 +270,13 @@ class UserAddForm extends UserOptionListForm { } $this->objectAction = new UserAction([], 'create', $data); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); $this->saved(); // show empty add form WCF::getTPL()->assign([ - 'success' => true + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserEdit', ['id' => $returnValues['returnValues']->userID]), ]); // reset values diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php index a2e74ecdb7..9bf9c8c63f 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php @@ -5,6 +5,7 @@ use wcf\data\user\group\UserGroupEditor; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\option\user\group\UserGroupOptionHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\system\WCFACP; use wcf\util\StringUtil; @@ -188,7 +189,10 @@ class UserGroupAddForm extends AbstractOptionListForm { $this->saved(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserGroupEdit', ['id' => $groupID]), + ]); // reset values $this->groupName = ''; diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php index 35436f059b..23a3aff77e 100644 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php @@ -6,6 +6,7 @@ use wcf\data\user\group\UserGroup; use wcf\form\AbstractForm; use wcf\system\condition\ConditionHandler; use wcf\system\exception\UserInputException; +use wcf\system\request\LinkHandler; use wcf\system\user\group\assignment\UserGroupAssignmentHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -150,7 +151,10 @@ class UserGroupAssignmentAddForm extends AbstractForm { } } - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserGroupAssignmentEdit', ['id' => $returnValues['returnValues']->assignmentID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php index 0acc822ade..d99c1bce27 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php @@ -8,6 +8,7 @@ use wcf\data\user\option\UserOptionEditor; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -331,7 +332,10 @@ class UserOptionAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserOptionEdit', ['id' => $userOption->optionID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php index d8d081ff99..460833339f 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php @@ -5,6 +5,7 @@ use wcf\data\user\option\category\UserOptionCategoryEditor; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\request\LinkHandler; use wcf\system\WCF; /** @@ -101,7 +102,10 @@ class UserOptionCategoryAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserOptionCategoryEdit', ['id' => $categoryID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php index 2ff6548ee6..86c95f9ada 100644 --- a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php @@ -8,6 +8,7 @@ use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\Regex; +use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -201,11 +202,10 @@ class UserRankAddForm extends AbstractForm { 'requiredGender' => $this->requiredGender, 'hideTitle' => ($this->hideTitle ? 1 : 0) ])]); - $this->objectAction->executeAction(); + $returnValues = $this->objectAction->executeAction(); + $rankID = $returnValues['returnValues']->rankID; if (!I18nHandler::getInstance()->isPlainValue('rankTitle')) { - $returnValues = $this->objectAction->getReturnValues(); - $rankID = $returnValues['returnValues']->rankID; I18nHandler::getInstance()->save('rankTitle', 'wcf.user.rank.userRank'.$rankID, 'wcf.user', 1); // update name @@ -224,7 +224,10 @@ class UserRankAddForm extends AbstractForm { I18nHandler::getInstance()->reset(); // show success message - WCF::getTPL()->assign('success', true); + WCF::getTPL()->assign([ + 'success' => true, + 'objectEditLink' => LinkHandler::getInstance()->getLink('UserRankEdit', ['id' => $rankID]), + ]); } /** diff --git a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php index 49e8f68027..5281103583 100644 --- a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php @@ -58,6 +58,20 @@ abstract class AbstractFormBuilderForm extends AbstractForm { */ public $objectActionClass; + /** + * name of the controller for the link to the edit form + * @var string + * @since 5.3 + */ + public $objectEditLinkController = ''; + + /** + * name of the application for the link to the edit form + * @var string + * @since 5.3 + */ + public $objectEditLinkApplication = 'wcf'; + /** * @inheritDoc */ @@ -166,6 +180,13 @@ abstract class AbstractFormBuilderForm extends AbstractForm { $this->saved(); WCF::getTPL()->assign('success', true); + + if ($this->formAction === 'create' && $this->objectEditLinkController) { + WCF::getTPL()->assign('objectEditLink', LinkHandler::getInstance()->getLink($this->objectEditLinkController, [ + 'application' => $this->objectEditLinkApplication, + 'id' => $this->objectAction->getReturnValues()['returnValues']->getObjectID(), + ])); + } } /** diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 72bbf710c0..17e945e86c 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -3873,6 +3873,7 @@ Dateianhänge: + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 304620bfce..25ad5b148a 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -3818,6 +3818,7 @@ Attachments: +