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/cookienotice/cookienotice.php b/cookienotice/cookienotice.php index bec98184..f3529973 100644 --- a/cookienotice/cookienotice.php +++ b/cookienotice/cookienotice.php @@ -85,11 +85,8 @@ function cookienotice_addon_admin_post(App $a) */ function cookienotice_page_content_top(App $a, &$b) { - $stylesheetPath = __DIR__ . '/cookienotice.css'; - $footerscriptPath = __DIR__ . '/cookienotice.js'; - - DI::page()->registerStylesheet($stylesheetPath); - DI::page()->registerFooterScript($footerscriptPath); + DI::page()->registerStylesheet(__DIR__ . '/cookienotice.css'); + DI::page()->registerFooterScript(__DIR__ . '/cookienotice.js'); } /** 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/lang/C/messages.po b/curweather/lang/C/messages.po index 30a6f0fc..ec442c9c 100644 --- a/curweather/lang/C/messages.po +++ b/curweather/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:14-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$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/diaspora/diaspora.css b/diaspora/diaspora.css deleted file mode 100644 index 21ef9bc5..00000000 --- a/diaspora/diaspora.css +++ /dev/null @@ -1,16 +0,0 @@ - -#diaspora-enable-label, #diaspora-username-label, #diaspora-password-label, #diaspora-bydefault-label, #diaspora-aspect-label { - float: left; - width: 200px; - margin-top: 10px; -} - -#diaspora-checkbox, #diaspora-username, #diaspora-password, #diaspora-bydefault, #diaspora-aspect { - float: left; - margin-top: 10px; -} - -#diaspora-submit { - margin-top: 15px; -} - diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index e47f03b1..82042fc9 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -48,22 +48,20 @@ function diaspora_jot_nets(App $a, array &$jotnets_fields) } } -function diaspora_settings(App $a, &$s) +function diaspora_settings(App $a, array &$data) { - if (! local_user()) { + if (!local_user()) { return; } - /* Get the current state of our config variables */ + $enabled = DI::pConfig()->get(local_user(), 'diaspora', 'post', false); + $def_enabled = DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default'); - $enabled = DI::pConfig()->get(local_user(),'diaspora','post'); - $def_enabled = DI::pConfig()->get(local_user(),'diaspora','post_by_default'); - - $handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle'); + $handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle'); $password = DI::pConfig()->get(local_user(), 'diaspora', 'password'); - $aspect = DI::pConfig()->get(local_user(),'diaspora','aspect'); + $aspect = DI::pConfig()->get(local_user(), 'diaspora', 'aspect'); - $info = ''; + $info = ''; $error = ''; if (Session::get('my_address')) { $info = DI::l10n()->t('Please remember: You can always be reached from Diaspora with your Friendica handle %s. ', Session::get('my_address')); @@ -79,37 +77,44 @@ function diaspora_settings(App $a, &$s) if ($rawAspects) { $availableAspects = [ 'all_aspects' => DI::l10n()->t('All aspects'), - 'public' => DI::l10n()->t('Public'), + 'public' => DI::l10n()->t('Public'), ]; foreach ($rawAspects as $rawAspect) { $availableAspects[$rawAspect->id] = $rawAspect->name; } $aspect_select = ['aspect', DI::l10n()->t('Post to aspect:'), $aspect, '', $availableAspects]; - $info = DI::l10n()->t('Connected with your Diaspora account %s', $handle); + $info = DI::l10n()->t('Connected with your Diaspora account %s', $handle); } else { - $info = ''; + $info = ''; $error = DI::l10n()->t("Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."); } } - DI::page()->registerStylesheet('addon/diaspora/diaspora.css'); + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/diaspora/'); + $html = Renderer::replaceMacros($t, [ + '$l10n' => [ + 'info_header' => DI::l10n()->t('Information'), + 'error_header' => DI::l10n()->t('Error'), + ], - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/diaspora/'); - $s .= Renderer::replaceMacros($t, [ - '$header' => DI::l10n()->t('Diaspora Export'), - '$info_header' => DI::l10n()->t('Information'), - '$error_header' => DI::l10n()->t('Error'), - '$submit' => DI::l10n()->t('Save Settings'), - '$info' => $info, - '$error' => $error, - '$enabled' => $enabled, - '$enabled_checkbox' => ['enabled', DI::l10n()->t('Enable Diaspora Post Addon'), $enabled], - '$handle' => ['handle', DI::l10n()->t('Diaspora handle'), $handle, null, null, 'placeholder="user@domain.tld"'], - '$password' => ['password', DI::l10n()->t('Diaspora password'), '', DI::l10n()->t('Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it.')], - '$aspect_select' => $aspect_select, - '$post_by_default' => ['post_by_default', DI::l10n()->t('Post to Diaspora by default'), $def_enabled], + '$info' => $info, + '$error' => $error, + + '$enabled' => ['enabled', DI::l10n()->t('Enable Diaspora Post Addon'), $enabled], + '$handle' => ['handle', DI::l10n()->t('Diaspora handle'), $handle, null, null, 'placeholder="user@domain.tld"'], + '$password' => ['password', DI::l10n()->t('Diaspora password'), '', DI::l10n()->t('Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it.')], + '$aspect_select' => $aspect_select, + '$post_by_default' => ['post_by_default', DI::l10n()->t('Post to Diaspora by default'), $def_enabled], ]); + + $data = [ + 'connector' => 'diaspora', + 'title' => DI::l10n()->t('Diaspora Export'), + 'image' => 'images/diaspora-logo.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } diff --git a/diaspora/lang/C/messages.po b/diaspora/lang/C/messages.po index 749d3f25..262e4cd8 100644 --- a/diaspora/lang/C/messages.po +++ b/diaspora/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME+ {{$info nofilter}} +
++ {{$error nofilter}} +
+{{$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/lang/C/messages.po b/gnot/lang/C/messages.po index 11b67cfb..8ca06d33 100644 --- a/gnot/lang/C/messages.po +++ b/gnot/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:14-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$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{{$new_status_message_body}}
{{$new_photo_upload_body}}
{{$new_link_post_body}}
{{$info}}
+{{include file="field_input.tpl" field=$autochans}} +{{include file="field_input.tpl" field=$sitechats}} diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index e67d2ff0..72653d55 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -29,8 +29,8 @@ function js_upload_form(App $a, array &$b) { $b['default_upload'] = false; - DI::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css'); - DI::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js'); + DI::page()->registerStylesheet(__DIR__ . '/file-uploader/client/fileuploader.css'); + DI::page()->registerFooterScript(__DIR__ . '/file-uploader/client/fileuploader.js'); $tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload'); $b['addon_text'] .= Renderer::replaceMacros($tpl, [ 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/libertree/lang/C/messages.po b/libertree/lang/C/messages.po index 47054070..6feeef8d 100644 --- a/libertree/lang/C/messages.po +++ b/libertree/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$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/lang/C/messages.po b/nsfw/lang/C/messages.po index 77297a3a..a44f3e95 100644 --- a/nsfw/lang/C/messages.po +++ b/nsfw/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:15-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$info}}
+{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_textarea.tpl" field=$words}} diff --git a/numfriends/lang/C/messages.po b/numfriends/lang/C/messages.po index 7036f840..40b8146e 100644 --- a/numfriends/lang/C/messages.po +++ b/numfriends/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:15-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$description}}
+{{include file="field_textarea.tpl" field=$words}} diff --git a/randplace/lang/C/messages.po b/randplace/lang/C/messages.po index 419123e4..e1a95548 100644 --- a/randplace/lang/C/messages.po +++ b/randplace/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:16-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME{{$info}}
+{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$chars}} diff --git a/showmore_dyn/lang/C/messages.po b/showmore_dyn/lang/C/messages.po index 4bf4c94f..81dec184 100644 --- a/showmore_dyn/lang/C/messages.po +++ b/showmore_dyn/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"POT-Creation-Date: 2021-11-21 19:16-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME
+ {{$l10n.connected_account nofilter}}
+ {{$account->description}}
+
{{$l10n.connected_public nofilter}}
+ {{if $l10n.privacy_warning}} +{{$l10n.privacy_warning nofilter}}
+ {{/if}} + + {{include file="field_checkbox.tpl" field=$default}} + {{include file="field_checkbox.tpl" field=$mirror}} + {{include file="field_checkbox.tpl" field=$import}} + {{*include file="field_checkbox.tpl" field=$create_user*}} + {{else}} +{{$l10n.oauth_info}}
+ +{{$l10n.oauth_api}}
+ {{/if}} +{{else}} + {{if $sites}} +{{$l10n.global_info}}
+{{$l10n.credentials_info nofilter}}
+{{$l10n.connected nofilter}}
++ + {{$account->description}} +
+{{else}} +{{$l10n.invalid}}
+ +{{/if}} +{{$l10n.privacy_warning nofilter}}
+{{/if}} +{{include file="field_checkbox.tpl" field=$default}} +{{include file="field_checkbox.tpl" field=$mirror}} +{{include file="field_checkbox.tpl" field=$import}} +{{include file="field_checkbox.tpl" field=$create_user}} diff --git a/twitter/twitter.css b/twitter/twitter.css index 99ee0bef..480ce28d 100644 --- a/twitter/twitter.css +++ b/twitter/twitter.css @@ -10,34 +10,3 @@ height: 52px; vertical-align: middle; } -#twitter-disconnect-label { - float: left; - width: 250px; - margin-bottom: 25px; -} - -#twitter-disconnect { - float: left; -} -#twitter-default-label, -#twitter-sendtaglinks-label, -#twitter-enable-label, -#twitter-shortening-label, -#twitter-mirror-label, -#twitter-import-label, -#twitter-create_user-label, -#twitter-pin-label { - float: left; - width: 250px; - margin-bottom: 10px; -} - -#twitter-checkbox { - float: left; -} - -#twitter-pin { - float: left; -} - - diff --git a/twitter/twitter.php b/twitter/twitter.php index e3e664f3..33af5663 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -269,8 +269,6 @@ function twitter_settings_post(App $a) } catch(TwitterOAuthException $e) { notice($e->getMessage()); } - // reload the Addon Settings page, if we don't do it see Bug #42 - DI::baseUrl()->redirect('settings/connectors'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall @@ -287,7 +285,7 @@ function twitter_settings_post(App $a) } } -function twitter_settings(App $a, &$s) +function twitter_settings(App $a, array &$data) { if (!local_user()) { return; @@ -295,7 +293,8 @@ function twitter_settings(App $a, &$s) $user = User::getById(local_user()); - DI::page()['htmlhead'] .= '' . "\r\n"; + DI::page()->registerStylesheet(__DIR__ . '/twitter.css', 'all'); + /* * * * 1) Check that we have global consumer key & secret * 2) If no OAuthtoken & stuff is present, generate button to get some @@ -312,21 +311,14 @@ function twitter_settings(App $a, &$s) $importenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'import')); $create_userenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'create_user')); - $css = (($enabled) ? '' : '-disabled'); - - $s .= ''; - $s .= '