From 80ec21c76bc7a0cc5f1e73acf91db16ceaa06b04 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 4 Oct 2019 07:59:40 +0200 Subject: [PATCH] moved HTML stuff into template --- gnot/gnot.php | 26 +++++++++----------------- gnot/templates/settings.tpl | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 gnot/templates/settings.tpl diff --git a/gnot/gnot.php b/gnot/gnot.php index 95f28e78..2168f97a 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -11,6 +11,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\Core\Renderer; function gnot_install() { @@ -76,25 +77,16 @@ function gnot_settings(&$a,&$s) { $gnot_checked = (($gnot) ? ' checked="checked" ' : '' ); + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/'); /* Add some HTML to the existing form */ - $s .= ''; - $s .= '

' . L10n::t('Gnot Settings') . '

'; - $s .= '
'; - $s .= ''; - + $s .= Renderer::replaceMacros($t, [ + '$title' => L10n::t('Gnot Settings') , + '$submit' => L10n::t('Save Settings'), + '$enable' => L10n::t('Enable this addon?'), + '$enabled' => $gnot_checked, + '$text' => L10n::t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") + ]); } diff --git a/gnot/templates/settings.tpl b/gnot/templates/settings.tpl new file mode 100644 index 00000000..1323eb4d --- /dev/null +++ b/gnot/templates/settings.tpl @@ -0,0 +1,20 @@ + +

{{$title}}

+
+