From ea4b80c9544bef6bdfdc4261a2258352548baa37 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 21 Mar 2021 09:33:13 +0100 Subject: [PATCH] Add support for `(enable|disable)Title` for toggling in `{objectAction}` --- .../ObjectActionFunctionTemplatePlugin.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wcfsetup/install/files/lib/system/template/plugin/ObjectActionFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/ObjectActionFunctionTemplatePlugin.class.php index f8b79778cc..e0d84a3ed1 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/ObjectActionFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/ObjectActionFunctionTemplatePlugin.class.php @@ -108,6 +108,21 @@ HTML; } $title = StringUtil::encodeHTML($title); + if (isset($tagArgs['disableTitle'])) { + $disableTitle = StringUtil::encodeHTML($language->getDynamicVariable($tagArgs['disableTitle'])); + $additionalAttributes .= 'data-disable-title="' . $disableTitle . '"'; + if (!$tagArgs['isDisabled']) { + $title = $disableTitle; + } + } + if (isset($tagArgs['enableTitle'])) { + $enableTitle = StringUtil::encodeHTML($language->getDynamicVariable($tagArgs['enableTitle'])); + $additionalAttributes .= 'data-enable-title="' . $enableTitle . '"'; + if ($tagArgs['isDisabled']) { + $title = $enableTitle; + } + } + return << HTML; -- 2.20.1