From c8326d5e6d0615a062f7f32b4f7bae902edbb9d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Sun, 6 Aug 2017 11:53:41 +0200 Subject: [PATCH] Make trophy description optional See #2315 --- com.woltlab.wcf/templates/boxUserTrophyList.tpl | 2 +- com.woltlab.wcf/templates/groupedUserTrophyList.tpl | 2 +- com.woltlab.wcf/templates/trophy.tpl | 4 ++-- com.woltlab.wcf/templates/trophyList.tpl | 2 +- wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php | 1 + .../install/files/lib/acp/form/UserTrophyAddForm.class.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/com.woltlab.wcf/templates/boxUserTrophyList.tpl b/com.woltlab.wcf/templates/boxUserTrophyList.tpl index b01116a789..74c0acf5e8 100644 --- a/com.woltlab.wcf/templates/boxUserTrophyList.tpl +++ b/com.woltlab.wcf/templates/boxUserTrophyList.tpl @@ -24,7 +24,7 @@

{$boxUserTrophy->getTrophy()->getTitle()}

-

{@$boxUserTrophy->getDescription()}

{@$boxUserTrophy->getUserProfile()->getAnchorTag()} - {@$boxUserTrophy->time|time}

+ {if !$boxUserTrophy->getDescription()|empty}

{$boxUserTrophy->getDescription()}

{/if}

{@$boxUserTrophy->getUserProfile()->getAnchorTag()} - {@$boxUserTrophy->time|time}

{/foreach} diff --git a/com.woltlab.wcf/templates/groupedUserTrophyList.tpl b/com.woltlab.wcf/templates/groupedUserTrophyList.tpl index 48cb1fe668..d652f72b66 100644 --- a/com.woltlab.wcf/templates/groupedUserTrophyList.tpl +++ b/com.woltlab.wcf/templates/groupedUserTrophyList.tpl @@ -7,7 +7,7 @@

{@$userTrophy->getTrophy()->getTitle()}

- {$userTrophy->getDescription()} - {@$userTrophy->time|time} + {if !$userTrophy->getDescription()|empty}{$userTrophy->getDescription()} – {/if}{@$userTrophy->time|time}
diff --git a/com.woltlab.wcf/templates/trophy.tpl b/com.woltlab.wcf/templates/trophy.tpl index f238c92bf7..33c3a52059 100644 --- a/com.woltlab.wcf/templates/trophy.tpl +++ b/com.woltlab.wcf/templates/trophy.tpl @@ -18,7 +18,7 @@

{$trophy->getTitle()}

@@ -43,7 +43,7 @@

{@$userTrophy->getUserProfile()->getAnchorTag()}

- {$userTrophy->getDescription()} – {@$userTrophy->time|time} + {if !$userTrophy->getDescription()|empty}{$userTrophy->getDescription()} – {/if}{@$userTrophy->time|time}
{/foreach} diff --git a/com.woltlab.wcf/templates/trophyList.tpl b/com.woltlab.wcf/templates/trophyList.tpl index 4ab470b819..3c1b122861 100644 --- a/com.woltlab.wcf/templates/trophyList.tpl +++ b/com.woltlab.wcf/templates/trophyList.tpl @@ -52,7 +52,7 @@

{@$trophy->getTitle()}

- {$trophy->getDescription()} + {if !$trophy->getDescription()|empty}{$trophy->getDescription()}{/if}
{/foreach} diff --git a/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php index 490b701369..67b15bc314 100644 --- a/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php @@ -145,6 +145,7 @@ class TrophyAddForm extends AbstractAcpForm { $descriptionI18n = new I18nValue('description'); $descriptionI18n->setLanguageItem('wcf.user.trophy.description', 'wcf.user.trophy', 'com.woltlab.wcf'); + $descriptionI18n->setFlags(I18nValue::ALLOW_EMPTY); $this->registerI18nValue($descriptionI18n); if (isset($_POST['tmpHash'])) { diff --git a/wcfsetup/install/files/lib/acp/form/UserTrophyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserTrophyAddForm.class.php index 0b2b984349..08906ff84b 100644 --- a/wcfsetup/install/files/lib/acp/form/UserTrophyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserTrophyAddForm.class.php @@ -171,7 +171,7 @@ class UserTrophyAddForm extends AbstractAcpForm { ]) ]))->executeAction(); - $this->saveI18n($databaseObject, UserTrophyEditor::class); + $this->saveI18n($databaseObject['returnValues'], UserTrophyEditor::class); } $this->reset(); -- 2.20.1