diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 41ddffdb..3fe6884e 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -159,19 +159,17 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data) } -function advancedcontentfilter_addon_settings(App $a, &$s) +function advancedcontentfilter_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - $advancedcontentfilter = DI::l10n()->t('Advanced Content Filter'); - - $s .= <<
{{$setrandomize}}
+ diff --git a/blockem/blockem.css b/blockem/blockem.css deleted file mode 100644 index 265b6ba8..00000000 --- a/blockem/blockem.css +++ /dev/null @@ -1,18 +0,0 @@ - -#blockem-label { - float: left; - width: 300px; - margin-top: 10px; -} - -#blockem-words { - float: left; - margin-top: 10px; - width: 400px; - height: 150px; -} - -#blockem-submit { - margin-top: 15px; -} - diff --git a/blockem/blockem.php b/blockem/blockem.php index 3183915c..79e04c8b 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -9,6 +9,7 @@ use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Util\Strings; @@ -25,39 +26,25 @@ function blockem_install() Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); } -function blockem_addon_settings (App $a, &$s) +function blockem_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $words = DI::pConfig()->get(local_user(), 'blockem', 'words', ''); - $words = DI::pConfig()->get(local_user(), 'blockem', 'words'); - - if (!$words) { - $words = ''; - } - - $s .= ''; - $s .= '{{$setrandomize}}
+ diff --git a/curweather/curweather.php b/curweather/curweather.php index 118c4a9a..c4b172ca 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -164,40 +164,38 @@ function curweather_addon_settings_post(App $a, $post) DI::pConfig()->set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units'])); } -function curweather_addon_settings(App $a, &$s) +function curweather_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - /* Get the current state of our config variable */ - $curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc'); + $curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc'); $curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units'); - $appid = DI::config()->get('curweather', 'appid'); + $appid = DI::config()->get('curweather', 'appid'); - if ($appid == "") { + if ($appid == '') { $noappidtext = DI::l10n()->t('No APPID found, please contact your admin to obtain one.'); } else { $noappidtext = ''; } - $enable = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable')); - $enable_checked = (($enable) ? ' checked="checked" ' : ''); - - // load template and replace the macros - $t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" ); + $enabled = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable')); - $s = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$header' => DI::l10n()->t('Current Weather').' '.DI::l10n()->t('Settings'), - '$noappidtext' => $noappidtext, - '$info' => DI::l10n()->t('Enter either the name of your location or the zip code.'), - '$curweather_loc' => [ 'curweather_loc', DI::l10n()->t('Your Location'), $curweather_loc, DI::l10n()->t('Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE.') ], - '$curweather_units' => [ 'curweather_units', DI::l10n()->t('Units'), $curweather_units, DI::l10n()->t('select if the temperature should be displayed in °C or °F'), ['metric'=>'°C', 'imperial'=>'°F']], - '$enabled' => [ 'curweather_enable', DI::l10n()->t('Show weather data'), $enable, ''] + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/curweather/'); + $html = Renderer::replaceMacros($t, [ + '$noappidtext' => $noappidtext, + '$info' => DI::l10n()->t('Enter either the name of your location or the zip code.'), + '$curweather_loc' => ['curweather_loc', DI::l10n()->t('Your Location'), $curweather_loc, DI::l10n()->t('Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE.')], + '$curweather_units' => ['curweather_units', DI::l10n()->t('Units'), $curweather_units, DI::l10n()->t('select if the temperature should be displayed in °C or °F'), ['metric' => '°C', 'imperial' => '°F']], + '$enabled' => ['curweather_enable', DI::l10n()->t('Show weather data'), $enabled, ''], ]); - return; + $data = [ + 'addon' => 'curweather', + 'title' => DI::l10n()->t('Current Weather Settings'), + 'html' => $html, + ]; } // Config stuff for the admin panel to let the admin of the node set a APPID diff --git a/curweather/templates/settings.tpl b/curweather/templates/settings.tpl index 09f6f506..d250b9bb 100644 --- a/curweather/templates/settings.tpl +++ b/curweather/templates/settings.tpl @@ -1,15 +1,6 @@ - -{{$noappidtext}}
+{{/if}} +{{include file="field_input.tpl" field=$curweather_loc}} +{{include file="field_select.tpl" field=$curweather_units}} +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/fromapp/fromapp.css b/fromapp/fromapp.css deleted file mode 100644 index 422624a1..00000000 --- a/fromapp/fromapp.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#fromapp-label, #fromapp-force-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#fromapp-input, #fromapp-force { - float: left; -} - - diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index ab1e1518..c00ad3de 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -6,8 +6,11 @@ * Author: Commander Zot * */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function fromapp_install() @@ -28,47 +31,26 @@ function fromapp_settings_post($a, $post) DI::pConfig()->set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); } -function fromapp_settings(&$a, &$s) +function fromapp_settings(App &$a, array &$data) { if (!local_user()) { return; } - /* Add our stylesheet to the page so we can make our settings look nice */ - - DI::page()['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variable */ - $fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', ''); + $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force')); - $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force')); + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/fromapp/'); + $html = Renderer::replaceMacros($t, [ + '$fromapp' => ['fromapp-input', DI::l10n()->t('The application name you would like to show your posts originating from. Separate different app names with a comma. A random one will then be selected for every posting.'), $fromapp], + '$force' => ['fromapp-force', DI::l10n()->t('Use this application name even if another application was used.'), $force], + ]); - $force_enabled = (($force) ? ' checked="checked" ' : ''); - - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '{{$info}}
+{{include file="field_checkbox.tpl" field=$enable}} diff --git a/gnot/gnot.css b/gnot/gnot.css deleted file mode 100644 index ccafdafb..00000000 --- a/gnot/gnot.css +++ /dev/null @@ -1,16 +0,0 @@ - -#gnot-desc { - margin-bottom: 10px; -} - -#gnot-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#gnot { - float: left; -} - - diff --git a/gnot/gnot.php b/gnot/gnot.php index 8b37fb1c..7acf8465 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -8,6 +8,7 @@ * */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -49,31 +50,25 @@ function gnot_settings_post($a,$post) { -function gnot_settings(&$a,&$s) { - - if(! local_user()) +function gnot_settings(App &$a, array &$data) +{ + if (!local_user()) { return; + } - /* Add our stylesheet to the page so we can make our settings look nice */ + $gnot = intval(DI::pConfig()->get(local_user(), 'gnot', 'enable')); - DI::page()['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variable */ - - $gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable')); - - $gnot_checked = (($gnot) ? ' checked="checked" ' : '' ); - - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/'); - /* Add some HTML to the existing form */ - - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Gnot Settings') , - '$submit' => DI::l10n()->t('Save Settings'), - '$enable' => DI::l10n()->t('Enable this addon?'), - '$enabled' => $gnot_checked, - '$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/'); + $html = Renderer::replaceMacros($t, [ + '$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line."), + '$enabled' => ['gnot', DI::l10n()->t('Enable this addon?'), $gnot], ]); + + $data = [ + 'addon' => 'gnot', + 'title' => DI::l10n()->t('Gnot Settings'), + 'html' => $html, + ]; } diff --git a/gnot/templates/settings.tpl b/gnot/templates/settings.tpl index 1323eb4d..b153c623 100644 --- a/gnot/templates/settings.tpl +++ b/gnot/templates/settings.tpl @@ -1,20 +1,2 @@ - -{{$text}}
+{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/group_text/group_text.css b/group_text/group_text.css deleted file mode 100644 index 4122b67e..00000000 --- a/group_text/group_text.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#group_text-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#group_text-checkbox { - float: left; -} - - diff --git a/group_text/group_text.php b/group_text/group_text.php index aa644588..cb2c5eee 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -5,8 +5,11 @@ * Version: 1.0 * Author: Thomas Willingham{{$info}}
+{{include file="field_input.tpl" field=$autochans}} +{{include file="field_input.tpl" field=$sitechats}} diff --git a/krynn/krynn.css b/krynn/krynn.css deleted file mode 100644 index 466a3ecd..00000000 --- a/krynn/krynn.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#krynn-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#krynn-checkbox { - float: left; -} - - diff --git a/krynn/krynn.php b/krynn/krynn.php index 66cdf573..3cb7206d 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -9,8 +9,11 @@ * *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function krynn_install() { @@ -111,42 +114,24 @@ function krynn_settings_post($a,$post) { -function krynn_settings(&$a,&$s) { - - if(! local_user()) +function krynn_settings(App &$a, array &$data) +{ + if(! local_user()) { return; - - /* Add our stylesheet to the page so we can make our settings look nice */ - - DI::page()['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variable */ + } $enabled = DI::pConfig()->get(local_user(),'krynn','enable'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '{{$intro}}
+{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$languages}} +{{include file="field/range_percent.tpl" field=$minconfidence}} +{{include file="field_input.tpl" field=$minlength}} diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 7e3f87f8..33959e1e 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -6,6 +6,7 @@ * Author: Matthew Exon{{$description}}
+{{include file="field_checkbox.tpl" field=$mathjax_use}} diff --git a/notimeline/templates/settings.tpl b/notimeline/templates/settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/notimeline/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/nsfw/nsfw.css b/nsfw/nsfw.css deleted file mode 100644 index a8c1bfe8..00000000 --- a/nsfw/nsfw.css +++ /dev/null @@ -1,19 +0,0 @@ - -#nsfw-label, #nsfw-enable-label { - float: left; - width: 300px; - margin-top: 10px; -} - -#nsfw-words, #nsfw-enable { - float: left; - margin-top: 10px; -} - -#nsfw-submit { - margin-top: 15px; -} - -.nsfw-desc { - margin-top: 10px; -} \ No newline at end of file diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 1cbcf7c8..67b4c188 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -7,7 +7,10 @@ * Author: Mike Macgirvin{{$info}}
+{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_textarea.tpl" field=$words}} diff --git a/numfriends/numfriends.css b/numfriends/numfriends.css deleted file mode 100644 index c92ef8dc..00000000 --- a/numfriends/numfriends.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#numfriends-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#numfriends { - float: left; -} - - diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index 7644c62d..5bea844c 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -5,8 +5,11 @@ * Version: 1.0 * Author: Mike Macgirvin{{$description}}
+{{include file="field_textarea.tpl" field=$words}} diff --git a/randplace/randplace.css b/randplace/randplace.css deleted file mode 100644 index bd7af6d7..00000000 --- a/randplace/randplace.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#randplace-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#randplace-checkbox { - float: left; -} - - diff --git a/randplace/randplace.php b/randplace/randplace.php index d831bfe3..69ad4d52 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -18,8 +18,11 @@ * system will call the name_uninstall() function. * */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function randplace_install() { @@ -145,32 +148,22 @@ function randplace_settings_post($a,$post) { -function randplace_settings(&$a,&$s) { - - if(! local_user()) +function randplace_settings(App &$a, array &$data) +{ + if(! local_user()) { return; - - /* Add our stylesheet to the page so we can make our settings look nice */ - - DI::page()['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variable */ + } $enabled = DI::pConfig()->get(local_user(),'randplace','enable'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= '{{$info}}
+{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$chars}} diff --git a/showmore_dyn/showmore_dyn.php b/showmore_dyn/showmore_dyn.php index bf8f5608..39dfa489 100644 --- a/showmore_dyn/showmore_dyn.php +++ b/showmore_dyn/showmore_dyn.php @@ -45,7 +45,7 @@ function showmore_dyn_settings_post() } } -function showmore_dyn_settings(App &$a, &$o) +function showmore_dyn_settings(App &$a, array &$data) { if(!local_user()) { return; @@ -55,12 +55,15 @@ function showmore_dyn_settings(App &$a, &$o) DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight); $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/'); - $o .= Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$header' => DI::l10n()->t('Show More Dynamic'), + $html = Renderer::replaceMacros($t, [ '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, DI::l10n()->t('The maximal pixel height of posts before the Show More link is added, 0 to disable'), '', '', 'number'], ]); + $data = [ + 'addon' => 'showmore_dyn', + 'title' => DI::l10n()->t('Show More Dynamic'), + 'html' => $html, + ]; } function showmore_dyn_script() diff --git a/showmore_dyn/templates/settings.tpl b/showmore_dyn/templates/settings.tpl index ac37e937..a6a283ad 100644 --- a/showmore_dyn/templates/settings.tpl +++ b/showmore_dyn/templates/settings.tpl @@ -1,13 +1 @@ - -