From f0522a998b1ab1be173bb6353e43f738a40f4205 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 20 Nov 2021 04:29:09 -0500 Subject: [PATCH 01/21] [various] Use __DIR__ constant in all Page registerStylesheet and registerFooterScript calls --- cookienotice/cookienotice.php | 7 ++----- diaspora/diaspora.php | 2 +- geonames/geonames.php | 4 +--- js_upload/js_upload.php | 4 ++-- nsfw/nsfw.php | 3 +-- pageheader/pageheader.php | 7 ++----- qcomment/qcomment.php | 2 +- showmore/showmore.php | 4 +--- smileybutton/smileybutton.php | 4 ++-- superblock/superblock.php | 3 +-- 10 files changed, 14 insertions(+), 26 deletions(-) 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/diaspora/diaspora.php b/diaspora/diaspora.php index e47f03b1..7b747bef 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -93,7 +93,7 @@ function diaspora_settings(App $a, &$s) } } - DI::page()->registerStylesheet('addon/diaspora/diaspora.css'); + DI::page()->registerStylesheet(__DIR__ . '/diaspora.css'); $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/diaspora/'); $s .= Renderer::replaceMacros($t, [ diff --git a/geonames/geonames.php b/geonames/geonames.php index eb12728f..5fdf65ef 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -129,9 +129,7 @@ function geonames_addon_settings(App $a, &$s) return; } - /* Add our stylesheet to the page so we can make our settings look nice */ - $stylesheetPath = __DIR__ . '/geonames.css'; - DI::page()->registerStylesheet($stylesheetPath); + DI::page()->registerStylesheet(__DIR__ . '/geonames.css'); /* Get the current state of our config variable */ $enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable')); 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/nsfw/nsfw.php b/nsfw/nsfw.php index 9f81b29d..1cbcf7c8 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -54,9 +54,8 @@ function nsfw_addon_settings(&$a, &$s) return; } - /* Add our stylesheet to the page so we can make our settings look nice */ + DI::page()->registerStylesheet(__DIR__ . '/nsfw.css', 'all'); - DI::page()['htmlhead'] .= '' . "\r\n"; $enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" '); $words = DI::pConfig()->get(local_user(), 'nsfw', 'words'); diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index ce3b2684..9dfe3c02 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -23,9 +23,7 @@ function pageheader_addon_admin(App &$a, &$s) return; } - /* Add our stylesheet to the page so we can make our settings look nice */ - $stylesheetPath = __DIR__ . '/pageheader.css'; - DI::page()->registerStylesheet($stylesheetPath); + DI::page()->registerStylesheet(__DIR__ . '/pageheader.css'); $words = DI::config()->get('pageheader','text'); if(! $words) @@ -62,8 +60,7 @@ function pageheader_fetch(App $a, &$b) $s = DI::config()->get('pageheader', 'text'); } - $stylesheetPath = __DIR__ .'/pageheader.css'; - DI::page()->registerStylesheet($stylesheetPath); + DI::page()->registerStylesheet(__DIR__ .'/pageheader.css'); if ($s) { $b .= ''; diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index ed110f66..f662aecc 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -30,7 +30,7 @@ function qcomment_install() function qcomment_footer(\Friendica\App $a, &$b) { - DI::page()->registerFooterScript(__DIR__ . '/qcomment.js'); + DI::page()->registerFooterScript('addon/qcomment/qcomment.js'); } function qcomment_addon_settings(&$a, &$s) diff --git a/showmore/showmore.php b/showmore/showmore.php index dd6d4773..574be70f 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -24,9 +24,7 @@ function showmore_addon_settings(&$a, &$s) return; } - /* Add our stylesheet to the page so we can make our settings look nice */ - - DI::page()['htmlhead'] .= ''."\r\n"; + DI::page()->registerStylesheet(__DIR__ . '/showmore.css', 'all'); $enable_checked = (intval(DI::pConfig()->get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"'); $chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100); diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index f01a6201..1a1f1d63 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -97,9 +97,9 @@ function smileybutton_jot_tool(Friendica\App $a, &$b) $s .= ''; //Add css to header - $css_file = 'addon/smileybutton/view/' . $a->getCurrentTheme() . '.css'; + $css_file = __DIR__ . '/view/' . $a->getCurrentTheme() . '.css'; if (!file_exists($css_file)) { - $css_file = 'addon/smileybutton/view/default.css'; + $css_file = __DIR__ . '/view/default.css'; } DI::page()->registerStylesheet($css_file); diff --git a/superblock/superblock.php b/superblock/superblock.php index 7bf2bc4c..d3186087 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -25,9 +25,8 @@ function superblock_addon_settings(&$a, &$s) return; } - /* Add our stylesheet to the page so we can make our settings look nice */ + DI::page()->registerStylesheet(__DIR__ . '/superblock.css', 'all'); - DI::page()['htmlhead'] .= '' . "\r\n"; $words = DI::pConfig()->get(local_user(), 'system', 'blocked'); if (!$words) { -- 2.43.5 From 779b38ec0988a2b92e1fe5db3a8f59e76a64f58d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 20 Nov 2021 04:56:55 -0500 Subject: [PATCH 02/21] [various] Convert addon_settings hook functions to the new data array format - Add separate template files to several addons - Remove superfluous addon settings CSS files --- .../advancedcontentfilter.php | 14 +++--- birdavatar/birdavatar.php | 29 ++++++----- birdavatar/templates/settings.tpl | 26 +--------- blockem/blockem.css | 18 ------- blockem/blockem.php | 39 +++++---------- blockem/templates/settings.tpl | 1 + catavatar/catavatar.php | 33 +++++++------ catavatar/templates/settings.tpl | 26 +--------- curweather/curweather.php | 36 +++++++------- curweather/templates/settings.tpl | 21 +++----- fromapp/fromapp.css | 14 ------ fromapp/fromapp.php | 48 ++++++------------- fromapp/templates/settings.tpl | 2 + geonames/geonames.css | 14 ------ geonames/geonames.php | 24 +++++----- geonames/templates/settings.tpl | 16 +------ gnot/gnot.css | 16 ------- gnot/gnot.php | 37 +++++++------- gnot/templates/settings.tpl | 22 +-------- group_text/group_text.css | 14 ------ group_text/group_text.php | 38 +++++++-------- group_text/templates/settings.tpl | 1 + irc/irc.php | 36 +++++++------- irc/templates/settings.tpl | 18 ++----- krynn/krynn.css | 14 ------ krynn/krynn.php | 47 +++++++----------- krynn/templates/settings.tpl | 1 + langfilter/langfilter.php | 24 +++++----- langfilter/templates/settings.tpl | 24 ++-------- mailstream/mailstream.php | 48 +++++++++++-------- mailstream/templates/settings.tpl | 17 ++----- markdown/markdown.php | 16 ++++--- markdown/templates/settings.tpl | 16 +------ mathjax/mathjax.php | 12 +++-- mathjax/templates/settings.tpl | 18 +------ notimeline/templates/settings.tpl | 1 + nsfw/nsfw.css | 19 -------- nsfw/nsfw.php | 47 +++++++----------- nsfw/templates/settings.tpl | 3 ++ numfriends/numfriends.css | 14 ------ numfriends/numfriends.php | 31 +++++------- numfriends/templates/settings.tpl | 1 + opmlexport/opmlexport.php | 12 ++--- opmlexport/templates/settings.tpl | 12 ----- planets/planets.css | 14 ------ planets/planets.php | 47 +++++++----------- planets/templates/settings.tpl | 1 + qcomment/qcomment.php | 26 ++++++---- qcomment/templates/settings.tpl | 23 +-------- randplace/randplace.css | 14 ------ randplace/randplace.php | 39 +++++++-------- randplace/templates/settings.tpl | 1 + securemail/securemail.php | 29 ++++++----- securemail/templates/admin.tpl | 16 ------- securemail/templates/settings.tpl | 2 + showmore/showmore.php | 42 +++++++--------- showmore/templates/settings.tpl | 3 ++ showmore_dyn/showmore_dyn.php | 11 +++-- showmore_dyn/templates/settings.tpl | 14 +----- startpage/startpage.css | 16 ------- startpage/startpage.php | 39 ++++++--------- startpage/templates/settings.tpl | 1 + superblock/superblock.css | 18 ------- superblock/superblock.php | 36 ++++++-------- superblock/templates/settings.tpl | 1 + windowsphonepush/templates/settings.tpl | 3 ++ windowsphonepush/windowsphonepush.css | 36 -------------- windowsphonepush/windowsphonepush.php | 45 +++++------------ 68 files changed, 444 insertions(+), 953 deletions(-) delete mode 100644 blockem/blockem.css create mode 100644 blockem/templates/settings.tpl delete mode 100644 fromapp/fromapp.css create mode 100644 fromapp/templates/settings.tpl delete mode 100644 geonames/geonames.css delete mode 100644 gnot/gnot.css delete mode 100644 group_text/group_text.css create mode 100644 group_text/templates/settings.tpl delete mode 100644 krynn/krynn.css create mode 100644 krynn/templates/settings.tpl create mode 100644 notimeline/templates/settings.tpl delete mode 100644 nsfw/nsfw.css create mode 100644 nsfw/templates/settings.tpl delete mode 100644 numfriends/numfriends.css create mode 100644 numfriends/templates/settings.tpl delete mode 100644 opmlexport/templates/settings.tpl delete mode 100644 planets/planets.css create mode 100644 planets/templates/settings.tpl delete mode 100644 randplace/randplace.css create mode 100644 randplace/templates/settings.tpl delete mode 100644 securemail/templates/admin.tpl create mode 100644 securemail/templates/settings.tpl create mode 100644 showmore/templates/settings.tpl delete mode 100644 startpage/startpage.css create mode 100644 startpage/templates/settings.tpl delete mode 100644 superblock/superblock.css create mode 100644 superblock/templates/settings.tpl create mode 100644 windowsphonepush/templates/settings.tpl delete mode 100644 windowsphonepush/windowsphonepush.css 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 .= <<

$advancedcontentfilter

-HTML; - - return; + $data = [ + 'addon' => 'advancedcontentfilter', + 'title' => DI::l10n()->t('Advanced Content Filter'), + 'href' => 'advancedcontentfilter', + ]; } /* diff --git a/birdavatar/birdavatar.php b/birdavatar/birdavatar.php index af573bbd..0981b35d 100644 --- a/birdavatar/birdavatar.php +++ b/birdavatar/birdavatar.php @@ -24,9 +24,9 @@ define("BIRDAVATAR_SIZE", 256); */ function birdavatar_install() { - Hook::register('avatar_lookup', 'addon/birdavatar/birdavatar.php', 'birdavatar_lookup'); - Hook::register('addon_settings', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings'); - Hook::register('addon_settings_post', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings_post'); + Hook::register('avatar_lookup', __FILE__, 'birdavatar_lookup'); + Hook::register('addon_settings', __FILE__, 'birdavatar_addon_settings'); + Hook::register('addon_settings_post', __FILE__, 'birdavatar_addon_settings_post'); Logger::log('registered birdavatar'); } @@ -34,24 +34,29 @@ function birdavatar_install() /** * Bird avatar user settings page */ -function birdavatar_addon_settings(App $a, &$s) +function birdavatar_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/birdavatar/'); - $s .= Renderer::replaceMacros($t, [ - '$postpost' => !empty($_POST['birdavatar-morebird']) || !empty($_POST['birdavatar-emailbird']), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/birdavatar/'); + $html = Renderer::replaceMacros($t, [ '$uncache' => time(), '$uid' => local_user(), - '$usebird' => DI::l10n()->t('Use Bird as Avatar'), - '$morebird' => DI::l10n()->t('More Random Bird!'), - '$emailbird' => DI::l10n()->t('Reset to email Bird'), - '$seed' => DI::pConfig()->get(local_user(), 'birdavatar', 'seed', false), - '$header' => DI::l10n()->t('Bird Avatar Settings'), '$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the bird.'), ]); + + $data = [ + 'addon' => 'birdavar', + 'title' => DI::l10n()->t('Bird Avatar Settings'), + 'html' => $html, + 'submit' => [ + 'birdavatar-usebird' => DI::l10n()->t('Use Bird as Avatar'), + 'birdavatar-morebird' => DI::l10n()->t('More Random Bird!'), + 'birdavatar-emailbird' => DI::pConfig()->get(local_user(), 'birdavatar', 'seed', false) ? DI::l10n()->t('Reset to email Bird') : null, + ], + ]; } /** diff --git a/birdavatar/templates/settings.tpl b/birdavatar/templates/settings.tpl index a31acfdb..13230bd1 100644 --- a/birdavatar/templates/settings.tpl +++ b/birdavatar/templates/settings.tpl @@ -1,24 +1,2 @@ - -

{{$header}}

-
-
- -

{{$header}}

-
- -

{{$setrandomize}}

-
- - -
- - -
-
-
+

{{$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 .= '

' . DI::l10n()->t('Blockem') . '

'; - $s .= '
'; - $s .= ''; - - return; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/blockem/'); + $html = Renderer::replaceMacros($t, [ + '$info' => DI::l10n()->t("Hides user's content by collapsing posts. Also replaces their avatar with generic image."), + '$words' => ['blockem-words', DI::l10n()->t('Comma separated profile URLS:'), $words], + ]); + $data = [ + 'addon' => 'blockem', + 'title' => DI::l10n()->t('Blockem'), + 'html' => $html, + ]; } function blockem_addon_settings_post(App $a, array &$b) diff --git a/blockem/templates/settings.tpl b/blockem/templates/settings.tpl new file mode 100644 index 00000000..67398400 --- /dev/null +++ b/blockem/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_textarea.tpl" field=$words}} diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 181ac016..1304b24d 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -25,9 +25,9 @@ define("CATAVATAR_SIZE", 256); */ function catavatar_install() { - Hook::register('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); - Hook::register('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); - Hook::register('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); + Hook::register('avatar_lookup', __FILE__, 'catavatar_lookup'); + Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings'); + Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post'); Logger::notice('registered catavatar'); } @@ -35,24 +35,29 @@ function catavatar_install() /** * Cat avatar user settings page */ -function catavatar_addon_settings(App $a, &$s) +function catavatar_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/'); - $s .= Renderer::replaceMacros($t, [ - '$postpost' => !empty($_POST['catavatar-morecat']) || !empty($_POST['catavatar-emailcat']), - '$uncache' => time(), - '$uid' => local_user(), - '$usecat' => DI::l10n()->t('Use Cat as Avatar'), - '$morecat' => DI::l10n()->t('More Random Cat!'), - '$emailcat' => DI::l10n()->t('Reset to email Cat'), - '$seed' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false), - '$header' => DI::l10n()->t('Cat Avatar Settings'), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/'); + $html = Renderer::replaceMacros($t, [ + '$uncache' => time(), + '$uid' => local_user(), '$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the cat.'), ]); + + $data = [ + 'addon' => 'catavar', + 'title' => DI::l10n()->t('Cat Avatar Settings'), + 'html' => $html, + 'submit' => [ + 'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'), + 'catavatar-morecat' => DI::l10n()->t('Another random Cat!'), + 'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null, + ], + ]; } /** diff --git a/catavatar/templates/settings.tpl b/catavatar/templates/settings.tpl index 33563ffe..7659a9c8 100644 --- a/catavatar/templates/settings.tpl +++ b/catavatar/templates/settings.tpl @@ -1,24 +1,2 @@ - -

{{$header}}

-
-
- -

{{$header}}

-
- -

{{$setrandomize}}

-
- - -
- - -
-
-
+

{{$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 @@ - -

{{$header}}

-
- +{{if $noappidtext}} +

{{$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 .= '

' . DI::l10n()->t('FromApp Settings') . '

'; - $s .= '
'; - $s .= ''; + $data = [ + 'addon' => 'fromapp', + 'title' => DI::l10n()->t('FromApp Settings'), + 'html' => $html, + ]; } function fromapp_post_hook(&$a, &$item) diff --git a/fromapp/templates/settings.tpl b/fromapp/templates/settings.tpl new file mode 100644 index 00000000..c74e5783 --- /dev/null +++ b/fromapp/templates/settings.tpl @@ -0,0 +1,2 @@ +{{include file="field_input.tpl" field=$fromapp}} +{{include file="field_checkbox.tpl" field=$force}} \ No newline at end of file diff --git a/geonames/geonames.css b/geonames/geonames.css deleted file mode 100644 index 0c67e7fc..00000000 --- a/geonames/geonames.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#geonames-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#geonames-checkbox { - float: left; -} - - diff --git a/geonames/geonames.php b/geonames/geonames.php index 5fdf65ef..a595a0f0 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -113,32 +113,32 @@ function geonames_addon_settings_post(App $a, array $post) * Called from the Addon Setting form. * Add our own settings info to the page. * - * @param App $a - * @param string $s + * @param App $a + * @param array $data * @throws Exception */ -function geonames_addon_settings(App $a, &$s) +function geonames_addon_settings(App $a, array &$data) { if (!local_user()) { return; } $geo_account = DI::config()->get('geonames', 'username'); - if (!$geo_account) { return; } - DI::page()->registerStylesheet(__DIR__ . '/geonames.css'); - - /* Get the current state of our config variable */ $enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable')); - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Geonames Settings'), - '$description' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/'); + $html = Renderer::replaceMacros($t, [ + '$info' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'), '$enable' => ['geonames-enable', DI::l10n()->t('Enable Geonames Addon'), $enabled], - '$submit' => DI::l10n()->t('Save Settings') ]); + + $data = [ + 'addon' => 'geonames', + 'title' => DI::l10n()->t('Geonames Settings'), + 'html' => $html, + ]; } diff --git a/geonames/templates/settings.tpl b/geonames/templates/settings.tpl index 05897b6a..796a544c 100644 --- a/geonames/templates/settings.tpl +++ b/geonames/templates/settings.tpl @@ -1,14 +1,2 @@ - -

{{$title}}

-
- -
\ No newline at end of file +

{{$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 @@ - -

{{$title}}

-
- +

{{$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 */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function group_text_install() { @@ -42,31 +45,22 @@ function group_text_settings_post($a,$post) { -function group_text_settings(&$a,&$s) { - - if(! local_user()) +function group_text_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(),'system','groupedit_image_limit'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - /* Add some HTML to the existing form */ - - $s .= '
'; - $s .= '

' . DI::l10n()->t('Group Text') . '

'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - /* provide a submit button */ - - $s .= '
'; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/group_text/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['group_text', DI::l10n()->t('Use a text only (non-image) group selector in the "group edit" menu'), $enabled], + ]); + $data = [ + 'addon' => 'group_text', + 'title' => DI::l10n()->t('Group Text'), + 'html' => $html, + ]; } diff --git a/group_text/templates/settings.tpl b/group_text/templates/settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/group_text/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/irc/irc.php b/irc/irc.php index b441cebf..75dc89c0 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -7,6 +7,7 @@ * Author: Tobias Diekershoff */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; @@ -17,30 +18,27 @@ function irc_install() { Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post'); } -function irc_addon_settings(&$a,&$s) { - if(! local_user()) +function irc_addon_settings(App &$a, array &$data) +{ + if (!local_user()) { return; + } - /* Add our stylesheet to the page so we can make our settings look nice */ + $sitechats = DI::pConfig()->get(local_user(), 'irc', 'sitechats'); /* popular channels */ + $autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans'); /* auto connect chans */ -// DI::page()['htmlhead'] .= '' . "\r\n"; - - /* setting popular channels, auto connect channels */ - $sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */ - $autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */ - - $t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" ); - $s .= Renderer::replaceMacros($t, [ - '$header' => DI::l10n()->t('IRC Settings'), - '$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'), - '$submit' => DI::l10n()->t('Save Settings'), - '$autochans' => [ 'autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')], - '$sitechats' => [ 'sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/irc/'); + $html = Renderer::replaceMacros($t, [ + '$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'), + '$autochans' => ['autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')], + '$sitechats' => ['sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.')], ]); - - return; - + $data = [ + 'addon' => 'irc', + 'title' => DI::l10n()->t('IRC Settings'), + 'html' => $html, + ]; } function irc_addon_settings_post(&$a, &$b) { diff --git a/irc/templates/settings.tpl b/irc/templates/settings.tpl index e463a59c..215b8f3f 100644 --- a/irc/templates/settings.tpl +++ b/irc/templates/settings.tpl @@ -1,15 +1,3 @@ - -

{{$header}}

-
- +

{{$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 .= '

' . DI::l10n()->t('Krynn') . '

'; - $s .= '
'; - $s .= ''; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/krynn/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['krynn', DI::l10n()->t('Enable Krynn Addon'), $enabled], + ]); + $data = [ + 'addon' => 'krynn', + 'title' => DI::l10n()->t('Krynn Settings'), + 'html' => $html, + ]; } diff --git a/krynn/templates/settings.tpl b/krynn/templates/settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/krynn/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index aeb53eeb..c75a07b5 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -31,7 +31,7 @@ function langfilter_install() * 3rd parse a SMARTY3 template, replacing some translateable strings for the form */ -function langfilter_addon_settings(App $a, &$s) +function langfilter_addon_settings(App $a, array &$data) { if (!local_user()) { return; @@ -40,23 +40,25 @@ function langfilter_addon_settings(App $a, &$s) $enabled = DI::pConfig()->get(local_user(), 'langfilter', 'enable', !DI::pConfig()->get(local_user(), 'langfilter', 'disable')); - $enable_checked = $enabled ? ' checked="checked"' : ''; - $languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages'); - $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence', 0) * 100; - $minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength' , 32); + $languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages'); + $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence', 0) * 100; + $minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32); - $t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/"); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t("Language Filter"), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/langfilter/'); + $html = Renderer::replaceMacros($t, [ '$intro' => DI::l10n()->t('This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'), - '$enabled' => ['langfilter_enable', DI::l10n()->t('Use the language filter'), $enable_checked, ''], + '$enabled' => ['langfilter_enable', DI::l10n()->t('Use the language filter'), $enabled], '$languages' => ['langfilter_languages', DI::l10n()->t('Able to read'), $languages, DI::l10n()->t('List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".')], '$minconfidence' => ['langfilter_minconfidence', DI::l10n()->t('Minimum confidence in language detection'), $minconfidence, DI::l10n()->t('Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.')], '$minlength' => ['langfilter_minlength', DI::l10n()->t('Minimum length of message body'), $minlength, DI::l10n()->t('Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).')], - '$submit' => DI::l10n()->t('Save Settings'), ]); - return; + $data = [ + 'addon' => 'langfilter', + 'title' => DI::l10n()->t('Language Filter'), + 'html' => $html, + 'submit' => ['langfilter-settings-submit' => DI::l10n()->t('Save Settings')], + ]; } /* Save the settings diff --git a/langfilter/templates/settings.tpl b/langfilter/templates/settings.tpl index d2de7fce..1197e9f2 100644 --- a/langfilter/templates/settings.tpl +++ b/langfilter/templates/settings.tpl @@ -1,19 +1,5 @@ - -

{{$title}}

-
- +

{{$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 */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; @@ -462,51 +463,58 @@ function mailstream_convert_table_entries() /** * Form for configuring mailstream features for a user * - * @param Friendica\App $a App object - * @param string $o HTML form data + * @param App $a App object + * @param array $data Hook data array + * @throws \Friendica\Network\HTTPException\ServiceUnavailableException */ -function mailstream_addon_settings(&$a, &$s) +function mailstream_addon_settings(App &$a, array &$data) { - $enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled'); - $address = DI::pConfig()->get(local_user(), 'mailstream', 'address'); - $nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes'); - $attachimg= DI::pConfig()->get(local_user(), 'mailstream', 'attachimg'); - $template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/'); - $s .= Renderer::replaceMacros($template, [ - '$enabled' => [ + $enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled'); + $address = DI::pConfig()->get(local_user(), 'mailstream', 'address'); + $nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes'); + $attachimg = DI::pConfig()->get(local_user(), 'mailstream', 'attachimg'); + + $template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/'); + $html = Renderer::replaceMacros($template, [ + '$enabled' => [ 'mailstream_enabled', DI::l10n()->t('Enabled'), $enabled ], - '$address' => [ + '$address' => [ 'mailstream_address', DI::l10n()->t('Email Address'), $address, - DI::l10n()->t("Leave blank to use your account email address") + DI::l10n()->t('Leave blank to use your account email address') ], - '$nolikes' => [ + '$nolikes' => [ 'mailstream_nolikes', DI::l10n()->t('Exclude Likes'), $nolikes, - DI::l10n()->t("Check this to omit mailing \"Like\" notifications") + DI::l10n()->t('Check this to omit mailing "Like" notifications') ], '$attachimg' => [ 'mailstream_attachimg', DI::l10n()->t('Attach Images'), $attachimg, - DI::l10n()->t("Download images in posts and attach them to the email. " . - "Useful for reading email while offline.") + DI::l10n()->t('Download images in posts and attach them to the email. ' . + 'Useful for reading email while offline.') ], - '$title' => DI::l10n()->t('Mail Stream Settings'), - '$submit' => DI::l10n()->t('Save Settings')]); + ]); + + $data = [ + 'addon' => 'mailstream', + 'title' => DI::l10n()->t('Mail Stream Settings'), + 'html' => $html, + ]; } /** * Process data submitted to user's mailstream features form - * @param \Friendica\App $a + * @param App $a * @param array $post POST data */ -function mailstream_addon_settings_post(\Friendica\App $a, array $post) +function mailstream_addon_settings_post(App $a, array $post) { if (!local_user() || empty($post['mailstream-submit'])) { return; diff --git a/mailstream/templates/settings.tpl b/mailstream/templates/settings.tpl index aa02b274..6e5d1729 100644 --- a/mailstream/templates/settings.tpl +++ b/mailstream/templates/settings.tpl @@ -1,13 +1,4 @@ - -

{{$title}}

-
- +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$address}} +{{include file="field_checkbox.tpl" field=$nolikes}} +{{include file="field_checkbox.tpl" field=$attachimg}} diff --git a/markdown/markdown.php b/markdown/markdown.php index fe533147..283d8ee2 100644 --- a/markdown/markdown.php +++ b/markdown/markdown.php @@ -17,7 +17,7 @@ function markdown_install() { Hook::register('addon_settings_post', __FILE__, 'markdown_addon_settings_post'); } -function markdown_addon_settings(App $a, &$s) +function markdown_addon_settings(App $a, array &$data) { if (!local_user()) { return; @@ -25,12 +25,16 @@ function markdown_addon_settings(App $a, &$s) $enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled')); - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Markdown'), - '$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, self created items will additionally be parsed via Markdown.')], - '$submit' => DI::l10n()->t('Save Settings'), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')], ]); + + $data = [ + 'addon' => 'markdown', + 'title' => DI::l10n()->t('Markdown Settings'), + 'html' => $html, + ]; } function markdown_addon_settings_post(App $a, &$b) diff --git a/markdown/templates/settings.tpl b/markdown/templates/settings.tpl index 3d013515..2f3f4ce7 100644 --- a/markdown/templates/settings.tpl +++ b/markdown/templates/settings.tpl @@ -1,15 +1 @@ - -

{{$title}}

-
- +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index 9734457d..43b9d861 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -29,7 +29,7 @@ function mathjax_settings_post($a) DI::pConfig()->set(local_user(), 'mathjax', 'use', intval($_POST['mathjax_use'])); } -function mathjax_settings(App $a, &$s) +function mathjax_settings(App $a, array &$data) { if (!local_user()) { return; @@ -38,12 +38,16 @@ function mathjax_settings(App $a, &$s) $use = DI::pConfig()->get(local_user(), 'mathjax', 'use', false); $tpl = Renderer::getMarkupTemplate('settings.tpl', 'addon/mathjax'); - $s .= Renderer::replaceMacros($tpl, [ - '$title' => 'MathJax', + $html = Renderer::replaceMacros($tpl, [ '$description' => DI::l10n()->t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.'), '$mathjax_use' => ['mathjax_use', DI::l10n()->t('Use the MathJax renderer'), $use, ''], - '$savesettings' => DI::l10n()->t('Save Settings'), ]); + + $data = [ + 'addon' => 'mathjax', + 'title' => 'MathJax', + 'html' => $html, + ]; } function mathjax_footer(App $a, &$b) diff --git a/mathjax/templates/settings.tpl b/mathjax/templates/settings.tpl index e26e5a2b..0966595f 100644 --- a/mathjax/templates/settings.tpl +++ b/mathjax/templates/settings.tpl @@ -1,16 +1,2 @@ - - -

{{$title}}

-
- \ No newline at end of file +

{{$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 * */ + +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; function nsfw_install() @@ -48,41 +51,27 @@ function nsfw_extract_photos($body) return $new_body; } -function nsfw_addon_settings(&$a, &$s) +function nsfw_addon_settings(App &$a, array &$data) { if (!local_user()) { return; } - DI::page()->registerStylesheet(__DIR__ . '/nsfw.css', 'all'); + $enabled = !DI::pConfig()->get(local_user(), 'nsfw', 'disable'); + $words = DI::pConfig()->get(local_user(), 'nsfw', 'words', 'nsfw,'); + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/nsfw/'); + $html = Renderer::replaceMacros($t, [ + '$info' => DI::l10n()->t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.'), + '$enabled' => ['nsfw-enable', DI::l10n()->t('Enable Content filter'), $enabled], + '$words' => ['nsfw-words', DI::l10n()->t('Comma separated list of keywords to hide'), $words, DI::l10n()->t('Use /expression/ to provide regular expressions')], + ]); - $enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" '); - $words = DI::pConfig()->get(local_user(), 'nsfw', 'words'); - if (!$words) { - $words = 'nsfw,'; - } - - $s .= ''; - $s .= '

' . DI::l10n()->t('Content Filter (NSFW and more)') . '

'; - $s .= '
'; - $s .= ''; - return; + $data = [ + 'addon' => 'nsfw', + 'title' => DI::l10n()->t('Content Filter (NSFW and more)'), + 'html' => $html, + ]; } function nsfw_addon_settings_post(&$a, &$b) @@ -99,7 +88,7 @@ function nsfw_addon_settings_post(&$a, &$b) } } -function nsfw_prepare_body_content_filter(\Friendica\App $a, &$hook_data) +function nsfw_prepare_body_content_filter(App $a, &$hook_data) { $words = null; if (DI::pConfig()->get(local_user(), 'nsfw', 'disable')) { diff --git a/nsfw/templates/settings.tpl b/nsfw/templates/settings.tpl new file mode 100644 index 00000000..1e3a2cbe --- /dev/null +++ b/nsfw/templates/settings.tpl @@ -0,0 +1,3 @@ +

{{$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 */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function numfriends_install() { @@ -39,30 +42,22 @@ function numfriends_settings_post($a,$post) { * Add our own settings info to the page. * */ -function numfriends_settings(&$a, &$s) +function numfriends_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 */ - $numfriends = DI::pConfig()->get(local_user(), 'system', 'display_friend_count', 24); - /* Add some HTML to the existing form */ + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/numfriends/'); + $html = Renderer::replaceMacros($t, [ + '$numfriends' => ['numfriends', DI::l10n()->t('How many contacts to display on profile sidebar'), $numfriends], + ]); - $s .= '
'; - $s .= '

' . DI::l10n()->t('Numfriends Settings') . '

'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - /* provide a submit button */ - - $s .= '
'; + $data = [ + 'addon' => 'numfriends', + 'title' => DI::l10n()->t('Numfriends Settings'), + 'html' => $html, + ]; } diff --git a/numfriends/templates/settings.tpl b/numfriends/templates/settings.tpl new file mode 100644 index 00000000..c8221bb4 --- /dev/null +++ b/numfriends/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_input.tpl" field=$numfriends}} diff --git a/opmlexport/opmlexport.php b/opmlexport/opmlexport.php index 238185ed..c92b5960 100644 --- a/opmlexport/opmlexport.php +++ b/opmlexport/opmlexport.php @@ -68,17 +68,17 @@ function opmlexport(App $a) } -function opmlexport_addon_settings(App $a, &$s) +function opmlexport_addon_settings(App $a, array &$data) { if (!local_user()) { return; } - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/opmlexport/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('OPML Export'), - '$submit' => DI::l10n()->t('Export RSS/Atom contacts'), - ]); + $data = [ + 'addon' => 'opmlexport', + 'title' => DI::l10n()->t('OPML Export'), + 'submit' => DI::l10n()->t('Export RSS/Atom contacts'), + ]; } diff --git a/opmlexport/templates/settings.tpl b/opmlexport/templates/settings.tpl deleted file mode 100644 index 9f26c512..00000000 --- a/opmlexport/templates/settings.tpl +++ /dev/null @@ -1,12 +0,0 @@ - -

{{$title}}

-
- diff --git a/planets/planets.css b/planets/planets.css deleted file mode 100644 index 668b65bc..00000000 --- a/planets/planets.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#planets-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#planets-checkbox { - float: left; -} - - diff --git a/planets/planets.php b/planets/planets.php index 14ae0b3c..ef88db13 100644 --- a/planets/planets.php +++ b/planets/planets.php @@ -6,8 +6,11 @@ * Author: Mike Macgirvin * Author: Tony Baldwin */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; function planets_install() { @@ -110,40 +113,22 @@ function planets_settings_post($a,$post) { -function planets_settings(&$a,&$s) { - - if(! local_user()) +function planets_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(),'planets','enable'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

' . DI::l10n()->t('Planets') . '

'; - $s .= '
'; - $s .= ''; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/planets/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['planets', DI::l10n()->t('Enable Planets Addon'), $enabled], + ]); + $data = [ + 'addon' => 'planets', + 'title' => DI::l10n()->t('Planets Settings'), + 'html' => $html, + ]; } diff --git a/planets/templates/settings.tpl b/planets/templates/settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/planets/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index f662aecc..aec4e9bf 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -17,7 +17,10 @@ * them to open the comment window fully and insert the qcomment. Then "Submit" will submit it. * */ + +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Util\XML; @@ -28,27 +31,30 @@ function qcomment_install() Hook::register('footer' , __FILE__, 'qcomment_footer'); } -function qcomment_footer(\Friendica\App $a, &$b) +function qcomment_footer(App $a, &$b) { DI::page()->registerFooterScript('addon/qcomment/qcomment.js'); } -function qcomment_addon_settings(&$a, &$s) +function qcomment_addon_settings(App &$a, array &$data) { - if (! local_user()) { + if (!local_user()) { return; } - $words = DI::pConfig()->get(local_user(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol')); + $words = DI::pConfig()->get(local_user(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol')); - $t = \Friendica\Core\Renderer::getMarkupTemplate('settings.tpl', 'addon/qcomment/'); - $s .= \Friendica\Core\Renderer::replaceMacros($t, [ - '$postpost' => isset($_POST['qcomment-words']), - '$header' => DI::l10n()->t('Quick Comment Settings'), - '$description' => DI::l10n()->t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies."), - '$save' => DI::l10n()->t('Save Settings'), + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/qcomment/'); + $html = Renderer::replaceMacros($t, [ + '$description' => DI::l10n()->t('Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.'), '$words' => ['qcomment-words', DI::l10n()->t('Enter quick comments, one per line'), $words, null, ' rows="10"'], ]); + + $data = [ + 'addon' => 'qcomment', + 'title' => DI::l10n()->t('Quick Comment Settings'), + 'html' => $html, + ]; } function qcomment_addon_settings_post(&$a, &$b) diff --git a/qcomment/templates/settings.tpl b/qcomment/templates/settings.tpl index 31ccea86..a9bf0d2e 100644 --- a/qcomment/templates/settings.tpl +++ b/qcomment/templates/settings.tpl @@ -1,21 +1,2 @@ - -

{{$header}}

-
-
- -

{{$header}}

-
- -
-

{{$description}}

- - {{include file="field_textarea.tpl" field=$words}} - -
- -
-
-
+

{{$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 .= '
'; - $s .= '

' . DI::l10n()->t('Randplace Settings') . '

'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - /* provide a submit button */ - - $s .= '
'; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/randplace/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['randplace', DI::l10n()->t('Enable Randplace Addon'), $enabled], + ]); + $data = [ + 'addon' => 'randplace', + 'title' => DI::l10n()->t('Randplace Settings'), + 'html' => $html, + ]; } diff --git a/randplace/templates/settings.tpl b/randplace/templates/settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/randplace/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/securemail/securemail.php b/securemail/securemail.php index 9ab596ab..62673eb1 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -36,24 +36,30 @@ function securemail_install() * * @see App */ -function securemail_settings(App &$a, &$s) +function securemail_settings(App &$a, array &$data) { if (!local_user()) { return; } - $enable = intval(DI::pConfig()->get(local_user(), 'securemail', 'enable')); + $enabled = intval(DI::pConfig()->get(local_user(), 'securemail', 'enable')); $publickey = DI::pConfig()->get(local_user(), 'securemail', 'pkey'); - $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/securemail/'); - - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('"Secure Mail" Settings'), - '$submit' => DI::l10n()->t('Save Settings'), - '$test' => DI::l10n()->t('Save and send test'), //NOTE: update also in 'post' - '$enable' => ['securemail-enable', DI::l10n()->t('Enable Secure Mail'), $enable, ''], + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/securemail/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['securemail-enable', DI::l10n()->t('Enable Secure Mail'), $enabled], '$publickey' => ['securemail-pkey', DI::l10n()->t('Public key'), $publickey, DI::l10n()->t('Your public PGP key, ascii armored format')] ]); + + $data = [ + 'addon' => 'securemail', + 'title' => DI::l10n()->t('"Secure Mail" Settings'), + 'html' => $html, + 'submit' => [ + 'securemail-submit' => DI::l10n()->t('Save Settings'), + 'securemail-test' => DI::l10n()->t('Save and send test'), + ], + ]; } /** @@ -72,13 +78,12 @@ function securemail_settings_post(App &$a, array &$b) return; } - if ($_POST['securemail-submit']) { + if (!empty($_POST['securemail-submit']) || !empty($_POST['securemail-test'])) { DI::pConfig()->set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey'])); $enable = (!empty($_POST['securemail-enable']) ? 1 : 0); DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable); - if ($_POST['securemail-submit'] == 'test') { - + if (!empty($_POST['securemail-test'])) { $res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl())); // revert to saved value diff --git a/securemail/templates/admin.tpl b/securemail/templates/admin.tpl deleted file mode 100644 index ec35e332..00000000 --- a/securemail/templates/admin.tpl +++ /dev/null @@ -1,16 +0,0 @@ - -

{{$title}}

-
- diff --git a/securemail/templates/settings.tpl b/securemail/templates/settings.tpl new file mode 100644 index 00000000..110a3a7d --- /dev/null +++ b/securemail/templates/settings.tpl @@ -0,0 +1,2 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_textarea.tpl" field=$publickey}} diff --git a/showmore/showmore.php b/showmore/showmore.php index 574be70f..945277ae 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -7,7 +7,10 @@ * based upon NSFW from Mike Macgirvin * */ + +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Util\Strings; @@ -18,7 +21,7 @@ function showmore_install() Hook::register('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); } -function showmore_addon_settings(&$a, &$s) +function showmore_addon_settings(App &$a, array &$data) { if (!local_user()) { return; @@ -26,31 +29,20 @@ function showmore_addon_settings(&$a, &$s) DI::page()->registerStylesheet(__DIR__ . '/showmore.css', 'all'); - $enable_checked = (intval(DI::pConfig()->get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"'); - $chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100); + $enabled = !DI::pConfig()->get(local_user(), 'showmore', 'disable'); + $chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100); - $s .= ''; - $s .= '

' . DI::l10n()->t('"Show more" Settings').'

'; - $s .= '
'; - $s .= ''; - - return; + $data = [ + 'addon' => 'showmore', + 'title' => DI::l10n()->t('"Show more" Settings'), + 'html' => $html, + ]; } function showmore_addon_settings_post(&$a, &$b) @@ -101,7 +93,7 @@ function get_body_length($body) return strlen($string); } -function showmore_prepare_body(\Friendica\App $a, &$hook_data) +function showmore_prepare_body(App $a, &$hook_data) { // No combination with content filters if (!empty($hook_data['filter_reasons'])) { diff --git a/showmore/templates/settings.tpl b/showmore/templates/settings.tpl new file mode 100644 index 00000000..b1887d62 --- /dev/null +++ b/showmore/templates/settings.tpl @@ -0,0 +1,3 @@ +

{{$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 @@ - -

{{$header}}

-
- +{{include file="field_input.tpl" field=$limitHeight}} diff --git a/startpage/startpage.css b/startpage/startpage.css deleted file mode 100644 index e78be7ec..00000000 --- a/startpage/startpage.css +++ /dev/null @@ -1,16 +0,0 @@ - - - -#startpage-page-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#startpage-page { - float: left; -} - -#startpage-desc { - margin-bottom: 10px; -} diff --git a/startpage/startpage.php b/startpage/startpage.php index 8cdf444f..d72effde 100644 --- a/startpage/startpage.php +++ b/startpage/startpage.php @@ -6,7 +6,10 @@ * Author: Mike Macgirvin * */ + +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; function startpage_install() { @@ -54,36 +57,22 @@ function startpage_settings_post($a, $post) * Add our own settings info to the page. * */ -function startpage_settings(&$a, &$s) +function startpage_settings(App &$a, array &$data) { if (!local_user()) { return; } - /* Add our stylesheet to the page so we can make our settings look nice */ + $startpage = DI::pConfig()->get(local_user(), 'startpage', 'startpage'); - DI::page()['htmlhead'] .= '' . "\r\n"; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/startpage/'); + $html = Renderer::replaceMacros($t, [ + '$startpage' => ['startpage', DI::l10n()->t('Home page to load after login - leave blank for profile wall'), $startpage, DI::l10n()->t('Examples: "network" or "notifications/system"')], + ]); - /* Get the current state of our config variable */ - - $page = DI::pConfig()->get(local_user(), 'startpage', 'startpage'); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

' . DI::l10n()->t('Startpage') . '

'; - $s .= '
'; - $s .= ''; + $data = [ + 'addon' => 'startpage', + 'title' => DI::l10n()->t('Startpage'), + 'html' => $html, + ]; } diff --git a/startpage/templates/settings.tpl b/startpage/templates/settings.tpl new file mode 100644 index 00000000..7078a83a --- /dev/null +++ b/startpage/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_input.tpl" field=$startpage}} diff --git a/superblock/superblock.css b/superblock/superblock.css deleted file mode 100644 index 368355bd..00000000 --- a/superblock/superblock.css +++ /dev/null @@ -1,18 +0,0 @@ - -#superblock-label { - float: left; - width: 300px; - margin-top: 10px; -} - -#superblock-words { - float: left; - margin-top: 10px; - width: 400px; - height: 150px; -} - -#superblock-submit { - margin-top: 15px; -} - diff --git a/superblock/superblock.php b/superblock/superblock.php index d3186087..5c5cfcc3 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -6,7 +6,10 @@ * Author: Mike Macgirvin * */ + +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Util\Strings; @@ -19,35 +22,24 @@ function superblock_install() Hook::register('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); } -function superblock_addon_settings(&$a, &$s) +function superblock_addon_settings(App &$a, array &$data) { if (!local_user()) { return; } - DI::page()->registerStylesheet(__DIR__ . '/superblock.css', 'all'); + $blocked = DI::pConfig()->get(local_user(), 'system', 'blocked', ''); + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/superblock/'); + $html = Renderer::replaceMacros($t, [ + '$urls' => ['superblock-words', DI::l10n()->t('Comma separated profile URLs to block'), $blocked], + ]); - $words = DI::pConfig()->get(local_user(), 'system', 'blocked'); - if (!$words) { - $words = ''; - } - - $s .= ''; - $s .= '

' . DI::l10n()->t('Superblock') . '

'; - $s .= '
'; - $s .= ''; - - return; + $data = [ + 'addon' => 'superblock', + 'title' => DI::l10n()->t('Superblock'), + 'html' => $html, + ]; } function superblock_addon_settings_post(&$a, &$b) diff --git a/superblock/templates/settings.tpl b/superblock/templates/settings.tpl new file mode 100644 index 00000000..113588e3 --- /dev/null +++ b/superblock/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_textarea.tpl" field=$urls}} diff --git a/windowsphonepush/templates/settings.tpl b/windowsphonepush/templates/settings.tpl new file mode 100644 index 00000000..9198225c --- /dev/null +++ b/windowsphonepush/templates/settings.tpl @@ -0,0 +1,3 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_checkbox.tpl" field=$senditemtext}} +{{include file="field_input.tpl" field=$device_url}} diff --git a/windowsphonepush/windowsphonepush.css b/windowsphonepush/windowsphonepush.css deleted file mode 100644 index 95ba6d2c..00000000 --- a/windowsphonepush/windowsphonepush.css +++ /dev/null @@ -1,36 +0,0 @@ -#windowsphonepush-device_url-wrapper { - margin-top: 25px; -} - - -#windowsphonepush-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#windowsphonepush-enable-chk { - float: left; -} - -#windowsphonepush-device_url-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#windowsphonepush-device_url-text { - float: left; - background-color: #C0C0C0; - width: 500px; -} - -#windowsphonepush-senditemtext-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#windowsphonepush-senditemtext-chk { - float: left; -} diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index d2529eea..8f289d12 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -31,6 +31,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; @@ -86,48 +87,28 @@ function windowsphonepush_settings_post($a, $post) /* Called from the Addon Setting form. * Add our own settings info to the page. */ -function windowsphonepush_settings(&$a, &$s) +function windowsphonepush_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 variables */ $enabled = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable'); - $checked_enabled = (($enabled) ? ' checked="checked" ' : ''); - $senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext'); - $checked_senditemtext = (($senditemtext) ? ' checked="checked" ' : ''); - $device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url'); - /* Add some HTML to the existing form */ - $s .= '
'; - $s .= '

' . DI::l10n()->t('WindowsPhonePush Settings') . '

'; + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/windowsphonepush/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['windowsphonepush', DI::l10n()->t('Enable WindowsPhonePush Addon'), $enabled], + '$senditemtext' => ['windowsphonepush-senditemtext', DI::l10n()->t('Push text of new item'), $senditemtext], + '$device_url' => ['', DI::l10n()->t('Device URL'), $device_url, '', false, ' readonly'], + ]); - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - /* provide a submit button - enable und senditemtext can be changed by the user */ - $s .= '
'; - - /* provide further read-only information concerning the addon (useful for */ - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - return; + $data = [ + 'addon' => 'windowsphonepush', + 'title' => DI::l10n()->t('WindowsPhonePush Settings'), + 'html' => $html, + ]; } /* Cron function used to regularly check all users on the server with active windowsphonepushaddon and send -- 2.43.5 From 9acfdb409020ee678cfa07dc81a4f731ce5f17e0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 21 Nov 2021 17:10:13 -0500 Subject: [PATCH 03/21] [various] Convert connector_settings hook functions to the new data array format - Add separate template files to several addons - Remove superfluous addon settings CSS files --- diaspora/diaspora.css | 16 -- diaspora/diaspora.php | 59 ++--- diaspora/templates/connector_settings.tpl | 32 +++ diaspora/templates/settings.tpl | 47 ---- discourse/discourse.php | 16 +- discourse/templates/connector_settings.tpl | 1 + discourse/templates/settings.tpl | 15 -- dwpost/dwpost.css | 15 -- dwpost/dwpost.php | 63 ++---- dwpost/templates/connector_settings.tpl | 4 + ifttt/ifttt.php | 59 +++-- ifttt/templates/connector_settings.tpl | 15 ++ ijpost/ijpost.css | 15 -- ijpost/ijpost.php | 67 ++---- ijpost/templates/connector_settings.tpl | 4 + libertree/libertree.css | 16 -- libertree/libertree.php | 78 ++----- libertree/templates/connector_settings.tpl | 4 + ljpost/livejournal.png | Bin 0 -> 3594 bytes ljpost/ljpost.php | 74 +++---- ljpost/templates/connector_settings.tpl | 4 + pumpio/pumpio.css | 16 -- pumpio/pumpio.php | 200 +++++++---------- pumpio/templates/connector_settings.tpl | 13 ++ statusnet/statusnet.css | 59 ----- statusnet/statusnet.php | 241 ++++++++------------- statusnet/templates/connector_settings.tpl | 50 +++++ tumblr/templates/connector_settings.tpl | 10 + tumblr/tumblr.css | 16 -- tumblr/tumblr.php | 103 +++------ twitter/templates/connector_settings.tpl | 23 ++ twitter/twitter.css | 31 --- twitter/twitter.php | 118 +++++----- wppost/templates/connector_settings.tpl | 5 + wppost/wppost.css | 20 -- wppost/wppost.php | 115 +++------- 36 files changed, 612 insertions(+), 1012 deletions(-) delete mode 100644 diaspora/diaspora.css create mode 100644 diaspora/templates/connector_settings.tpl delete mode 100644 diaspora/templates/settings.tpl create mode 100644 discourse/templates/connector_settings.tpl delete mode 100644 discourse/templates/settings.tpl delete mode 100644 dwpost/dwpost.css create mode 100644 dwpost/templates/connector_settings.tpl create mode 100644 ifttt/templates/connector_settings.tpl delete mode 100644 ijpost/ijpost.css create mode 100644 ijpost/templates/connector_settings.tpl delete mode 100644 libertree/libertree.css create mode 100644 libertree/templates/connector_settings.tpl create mode 100644 ljpost/livejournal.png create mode 100644 ljpost/templates/connector_settings.tpl delete mode 100644 pumpio/pumpio.css create mode 100644 pumpio/templates/connector_settings.tpl create mode 100644 statusnet/templates/connector_settings.tpl create mode 100644 tumblr/templates/connector_settings.tpl delete mode 100644 tumblr/tumblr.css create mode 100644 twitter/templates/connector_settings.tpl create mode 100644 wppost/templates/connector_settings.tpl delete mode 100644 wppost/wppost.css 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 7b747bef..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(__DIR__ . '/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/templates/connector_settings.tpl b/diaspora/templates/connector_settings.tpl new file mode 100644 index 00000000..9f8e270e --- /dev/null +++ b/diaspora/templates/connector_settings.tpl @@ -0,0 +1,32 @@ +{{if $info}} +
+
+

{{$l10n.info_header}}

+
+

+ {{$info nofilter}} +

+
+{{/if}} +{{if $error}} +
+
+

{{$l10n.error_header}}

+
+

+ {{$error nofilter}} +

+
+{{/if}} + + {{include file="field_checkbox.tpl" field=$enabled}} + +{{if $aspect_select}} + {{include file="field_select.tpl" field=$aspect_select}} + + {{include file="field_checkbox.tpl" field=$post_by_default}} +{{else}} + {{include file="field_input.tpl" field=$handle}} + + {{include file="field_password.tpl" field=$password}} +{{/if}} diff --git a/diaspora/templates/settings.tpl b/diaspora/templates/settings.tpl deleted file mode 100644 index dadebe44..00000000 --- a/diaspora/templates/settings.tpl +++ /dev/null @@ -1,47 +0,0 @@ - - -

{{$header}}

-
- \ No newline at end of file diff --git a/discourse/discourse.php b/discourse/discourse.php index 35ec9be5..3d085d92 100644 --- a/discourse/discourse.php +++ b/discourse/discourse.php @@ -36,7 +36,7 @@ function discourse_install() Hook::register('connector_settings_post', __FILE__, 'discourse_settings_post'); } -function discourse_settings(App $a, &$s) +function discourse_settings(App $a, array &$data) { if (!local_user()) { return; @@ -44,12 +44,18 @@ function discourse_settings(App $a, &$s) $enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled')); - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Discourse'), + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/discourse/'); + $html = Renderer::replaceMacros($t, [ '$enabled' => ['enabled', DI::l10n()->t('Enable processing of Discourse mailing list mails'), $enabled, DI::l10n()->t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')], - '$submit' => DI::l10n()->t('Save Settings'), ]); + + $data = [ + 'connector' => 'discourse', + 'title' => DI::l10n()->t('Discourse'), + 'image' => 'images/discourse.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } function discourse_settings_post(App $a) diff --git a/discourse/templates/connector_settings.tpl b/discourse/templates/connector_settings.tpl new file mode 100644 index 00000000..2f3f4ce7 --- /dev/null +++ b/discourse/templates/connector_settings.tpl @@ -0,0 +1 @@ +{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/discourse/templates/settings.tpl b/discourse/templates/settings.tpl deleted file mode 100644 index d4b0bf8c..00000000 --- a/discourse/templates/settings.tpl +++ /dev/null @@ -1,15 +0,0 @@ - -

{{$title}}

-
- diff --git a/dwpost/dwpost.css b/dwpost/dwpost.css deleted file mode 100644 index 3b0ee32a..00000000 --- a/dwpost/dwpost.css +++ /dev/null @@ -1,15 +0,0 @@ - -#dwpost-enable-label, #dwpost-username-label, #dwpost-password-label, #dwpost-bydefault-label { -float: left; -width: 200px; -margin-top: 10px; -} - -#dwpost-checkbox, #dwpost-username, #dwpost-password, #dwpost-bydefault { -float: left; -margin-top: 10px; -} - -#dwpost-submit { -margin-top: 15px; -} diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 397dc88f..286d8012 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -12,7 +12,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; -use Friendica\Database\DBA; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Model\Post; use Friendica\Model\Tag; @@ -48,58 +48,31 @@ function dwpost_jot_nets(App $a, array &$jotnets_fields) } -function dwpost_settings(App $a, &$s) +function dwpost_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 variables */ - $enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post'); - - $checked = (($enabled) ? ' checked="checked" ' : ''); - + $enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post', false); + $dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username'); $def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default'); - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/dwpost/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['dwpost', DI::l10n()->t('Enable Dreamwidth Post Addon'), $enabled], + '$username' => ['dw_username', DI::l10n()->t('Dreamwidth username'), $dw_username], + '$password' => ['dw_password', DI::l10n()->t('Dreamwidth password')], + '$bydefault' => ['dw_bydefault', DI::l10n()->t('Post to Dreamwidth by default'), $def_enabled], + ]); - $dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username'); - $dw_password = DI::pConfig()->get(local_user(), 'dwpost', 'dw_password'); - - /* Add some HTML to the existing form */ - $s .= ''; - $s .= '

'. DI::l10n()->t("Dreamwidth Export").'

'; - $s .= '
'; - $s .= ''; + $data = [ + 'connector' => 'dwpost', + 'title' => DI::l10n()->t('Dreamwidth Export'), + 'image' => 'images/dreamwidth.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } diff --git a/dwpost/templates/connector_settings.tpl b/dwpost/templates/connector_settings.tpl new file mode 100644 index 00000000..0abcd24e --- /dev/null +++ b/dwpost/templates/connector_settings.tpl @@ -0,0 +1,4 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$username}} +{{include file="field_password.tpl" field=$password}} +{{include file="field_checkbox.tpl" field=$bydefault}} diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 813ebad5..5962e2ae 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -11,6 +11,7 @@ use Friendica\Content\PageInfo; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; @@ -33,55 +34,47 @@ function ifttt_content() } -function ifttt_settings(App $a, &$s) +function ifttt_settings(App $a, array &$data) { if (!local_user()) { return; } $key = DI::pConfig()->get(local_user(), 'ifttt', 'key'); - if (!$key) { $key = Strings::getRandomHex(20); DI::pConfig()->set(local_user(), 'ifttt', 'key', $key); } - $s .= ''; - $s .= '

' . DI::l10n()->t('IFTTT Mirror') . '

'; - $s .= '
'; - $s .= ''; + $data = [ + 'connector' => 'ifttt', + 'title' => DI::l10n()->t('IFTTT Mirror'), + 'image' => 'addon/ifttt/ifttt.png', + 'html' => $html, + 'submit' => DI::l10n()->t('Generate new key'), + ]; } function ifttt_settings_post() { - if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) { + if (!empty($_POST['ifttt-submit'])) { DI::pConfig()->delete(local_user(), 'ifttt', 'key'); } } diff --git a/ifttt/templates/connector_settings.tpl b/ifttt/templates/connector_settings.tpl new file mode 100644 index 00000000..dfa824c0 --- /dev/null +++ b/ifttt/templates/connector_settings.tpl @@ -0,0 +1,15 @@ +

{{$l10n.intro nofilter}}

+
+
{{$l10n.url}}
+
{{$url}}
+
{{$l10n.method}}
+
POST
+
{{$l10n.content_type}}
+
application/x-www-form-urlencoded
+
{{$l10n.new_status_message_body}}
+
{{$new_status_message_body}}
+
{{$l10n.new_photo_upload_body}}
+
{{$new_photo_upload_body}}
+
{{$l10n.new_link_post_body}}
+
{{$new_link_post_body}}
+
diff --git a/ijpost/ijpost.css b/ijpost/ijpost.css deleted file mode 100644 index 8b424917..00000000 --- a/ijpost/ijpost.css +++ /dev/null @@ -1,15 +0,0 @@ - -#ijpost-enable-label, #ijpost-username-label, #ijpost-password-label, #ijpost-bydefault-label { -float: left; -width: 200px; -margin-top: 10px; -} - -#ijpost-checkbox, #ijpost-username, #ijpost-password, #ijpost-bydefault { -float: left; -margin-top: 10px; -} - -#ijpost-submit { -margin-top: 15px; -} diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 7ead0fb8..79cd75c8 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -8,9 +8,11 @@ * Author: Cat Gray */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Model\Tag; use Friendica\Model\User; @@ -26,7 +28,7 @@ function ijpost_install() Hook::register('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } -function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) +function ijpost_jot_nets(App &$a, array &$jotnets_fields) { if (!local_user()) { return; @@ -44,60 +46,31 @@ function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) } } -function ijpost_settings(&$a, &$s) +function ijpost_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 variables */ - - $enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post'); - - $checked = (($enabled) ? ' checked="checked" ' : ''); - + $enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post', false); + $ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username'); $def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default'); - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ijpost/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['ijpost', DI::l10n()->t('Enable InsaneJournal Post Addon'), $enabled], + '$username' => ['ij_username', DI::l10n()->t('InsaneJournal username'), $ij_username], + '$password' => ['ij_password', DI::l10n()->t('InsaneJournal password')], + '$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to InsaneJournal by default'), $def_enabled], + ]); - $ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username'); - $ij_password = DI::pConfig()->get(local_user(), 'ijpost', 'ij_password'); - - /* Add some HTML to the existing form */ - $s .= ''; - $s .= '

'. DI::l10n()->t("InsaneJournal Export").'

'; - $s .= '
'; - $s .= ''; + $data = [ + 'connector' => 'ijpost', + 'title' => DI::l10n()->t('InsaneJournal Export'), + 'image' => 'images/insanejournal.gif', + 'enabled' => $enabled, + 'html' => $html, + ]; } function ijpost_settings_post(&$a, &$b) diff --git a/ijpost/templates/connector_settings.tpl b/ijpost/templates/connector_settings.tpl new file mode 100644 index 00000000..0abcd24e --- /dev/null +++ b/ijpost/templates/connector_settings.tpl @@ -0,0 +1,4 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$username}} +{{include file="field_password.tpl" field=$password}} +{{include file="field_checkbox.tpl" field=$bydefault}} diff --git a/libertree/libertree.css b/libertree/libertree.css deleted file mode 100644 index 1554048b..00000000 --- a/libertree/libertree.css +++ /dev/null @@ -1,16 +0,0 @@ - -#libertree-enable-label, #libertree-api_token-label, #libertree-url-label, #libertree-bydefault-label { - float: left; - width: 200px; - margin-top: 10px; -} - -#libertree-checkbox, #libertree-api_token, #libertree-url, #libertree-bydefault { - float: left; - margin-top: 10px; -} - -#libertree-submit { - margin-top: 15px; -} - diff --git a/libertree/libertree.php b/libertree/libertree.php index 90910a39..df53aa18 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -10,6 +10,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Post; @@ -43,63 +44,32 @@ function libertree_jot_nets(App &$a, array &$jotnets_fields) } -function libertree_settings(&$a,&$s) { +function libertree_settings(App $a, array &$data) +{ + if (!local_user()) { + return; + } - if(! local_user()) - return; + $enabled = DI::pConfig()->get(local_user(), 'libertree', 'post', false); + $ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token'); + $ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url'); + $def_enabled = DI::pConfig()->get(local_user(), 'libertree', 'post_by_default'); - /* 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 variables */ - - $enabled = DI::pConfig()->get(local_user(),'libertree','post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - $css = (($enabled) ? '' : '-disabled'); - - $def_enabled = DI::pConfig()->get(local_user(),'libertree','post_by_default'); - - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - - $ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token'); - $ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url'); - - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

'. DI::l10n()->t('libertree Export').'

'; - $s .= '
'; - $s .= ''; + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/libertree/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['libertree', DI::l10n()->t('Enable Libertree Post Addon'), $enabled], + '$ltree_url' => ['libertree_url', DI::l10n()->t('Libertree site URL'), $ltree_url], + '$ltree_api_token' => ['libertree_api_token', DI::l10n()->t('Libertree API token'), $ltree_api_token], + '$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to Libertree by default'), $def_enabled], + ]); + $data = [ + 'connector' => 'libertree', + 'title' => DI::l10n()->t('Libertree Export'), + 'image' => 'images/libertree.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } diff --git a/libertree/templates/connector_settings.tpl b/libertree/templates/connector_settings.tpl new file mode 100644 index 00000000..63aa52fc --- /dev/null +++ b/libertree/templates/connector_settings.tpl @@ -0,0 +1,4 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$ltree_url}} +{{include file="field_input.tpl" field=$ltree_api_token}} +{{include file="field_checkbox.tpl" field=$bydefault}} diff --git a/ljpost/livejournal.png b/ljpost/livejournal.png new file mode 100644 index 0000000000000000000000000000000000000000..ecf004fac8fd10cc67e62995cfbaf878edf34405 GIT binary patch literal 3594 zcmV+l4)yVgP)s$1eD&EWq0TOLskMRuo~Y>GT(Q;IWzapIp?1_XYQG~l>EaB{i_Z5zW{jh z{fy+45ccPdOeweu><^m&H(M2MUhMBX8Onk{fvyB>q7mIh|Qbuo9$y zFE0`iHg>K|Dp}E(GWXG|L?USuZ?HZfSCB2pNc*@1lnS~CN=Vr}CF7L=sMYGNAAY`d z?7<_+#K%gXt?p@0k3TFXtCO=yUWJOeI@?k+Lpi&2GmREwWfq16Rs{ug=>ZU@pOw{q z48lYr?+dW+QcC-wt7)|l(rVR8kO)ly)plr~@zqQKy9hvjc_{!Iji&eR1E-J7Te^d` zGn0|8{adiGGnq8uw<6N6jU8F=@dyV0r>UvgENW{4-HjCz3WaRX=Ghr-TU&ccCE_Ps zj^~68O{qXQ6~;_M(*nkv0e=E~vZ}KDwzA~OqpI?vN`an4AThKs)sq`J<9Ro{Hv)A# zZX0+t_!SzJa{i_0nHrq{R905ScN_efe_mcOi4AB?B7VsxNf{-iqpJfM;@^P;2KFEV z0j+kQsF=fKTWli9%q<}HHs<8}=+L+=36}%+oVf7;M1_Fvf})sOweM2&jC@`F+H2BR zeNaV!T(n)=HC2^kF2{WET%6Sb5FZ~eGPZCmdS`ODth2R2^$Kjh`j~a|YE3zSYCmr8 z$a0Fx==v>jEIlia%H&calSx>9UJ>o&>q2rRMgJ(_{#joE#SD%q>htAhSB>|~! z?pv&Q&h>&Lq(X^25-Sj_b*)gi)5^vGNQv08WJ+kH(9K*t zwYITj-Fy1bR!;UrS*c{3*6pH2g(YNsa9>qGf8Xxzt*p*GmFqV0ORA@D z>;W14JJJQlv;%L+{hxa++IeUvgWso7t9D)5GQEP2a}5lm(x#T%z>dZ{72LHjDGwTS zp+`9di9Lrc>{?z?NyK_0GI2;(B9-WoGPL&`xkw6%%ZN`WchY}gccP8E>XMP3O`;>e zCnBMM?1`G4u5Z}HYuvH}s&b`zA|7)RfRaGhK$i+mCL@k^XKO--rhtm6_enBotQ*VM0Y1#Adid6iJPAf%f9n~ zjvYUk$>q}8I|n_Tm_iQ6B{2tE3)*{dk1K~R+!x|Q7>h6V&Xmnl?>6N3?SsSR*kWfu z)Ix|7qw8JFb}WD9Jvp*J`VXPM7y)gGfUc|;fEL7nQ*p*gL;D$nM-qrS04t$(Qp-ed^|DwT!$(K>&Az zs06TL$aBMtr)v9eqMxrqcK}Ol5CAWQMWr!A$FB^&pPEgC0s*mbupyqkyVg9vcj;H+ zXlX>==;BdlTt&HpARb6@Q7J*Hp&Bu$^P4iM_zZc80%Lis90ElFz+`RTVpQ`$AE9qe zqX6>r3-q&ciZ2YGxT>w9vWm9v(V1AccBnnuEamV?I_T}Lga>r(57EQ4M>J;hJ|Yqc z*xt<{51k#Gdm~@Udl?XLn|O%wRaF#QT-_e30)T!{5r;?NSb>m60cc&xZSTReXFvOL zr@mBQPPz{3NAx7(8UV@)1-*X!3>i0JFq6sZ#zWGHWO6j&G;3jJL1VYfImk51!RBUW zI_FCO@D4=nfq)n_9MG@Cyfqx%bToP5FCQ06y_eq7Q9x(W1n<4Xz z^v&%H@aQYFr|ArUm*_*u2iC3KGYB6m()JBc(!#xMo#*#bu9H?)#>BUC`#SyQWfj%& zP=c-Zi%)`7!{6@I9U#u?qSJYBs7T+UCC`=o;Pa>21k5#%n>!Su{UzG-bq3Jk{YYzj z3!@qHM)(AboD$JSsZz5y2KJ^+EzJJ#dwhygj+~@}2X-UPtu5-rL)vedG-k_wA{GhR z-l&j=PA#nv50XaXq0Nv_C2}+S3J7nV5;g69yLXpbOAJhThB_H5uvsSn?xR*vk<4(3 zm9cD5Y}mVP_Z~cR=JRE{WHJMN+I46@CYDNS46Q^w+(0~xoe+R{kkpBX6F;9P$Bv#u zJXrGc!w<$yn*=llz+>E+mI9F^MOm6}dVSYCHG0kzs~|FofVH#Jr*C;0lii8A zY~{WT`mfM;$mrqSI|u}Viwyz5E)>aAZ~)k*1@IMAw1z#sYQIMt5HM3!S+?=YwvW}? zb}(LcTQv5~FKi6O$$^u?TUDtww9}y8#K_#V=1Y9;yZ!89gnJzq;(Wrzd^T;Io4FeRV8#n)f6Qtzj-bbw zMl&EKYHE>I|1yYjf=xr8eg8QCUK2Ok5Gru|WA-=O zNTQ#L;qSnv#Kr+k`YN!hym0Te9dnts{V6H|1}}N`-QwaBqx)%(lLIG*J1Uhb;^SmU z)=z0g%nU^@bd52qZbt%`H@`Id9J)r;>YKoaqR;O|GV1`qF^|g4 zY=;2-KHhd2zJN-No8Jc83j)$#Bmnu6_wECyPlZM7m8w)~BGIEP;0-f6p-(g7*i2ey z1s3j1quYerUzIewj7AQFEA*O>&@DbTtTztOk>c06oKY7_u`%?*0W zVC(}edVW$`i?%Omps3X9pq$4=%Xh>k+U-7YiscuUR-4_!y(yd2ry2EeG9W*k&tuDD z(`im&6^UFmg?00BvXaZ?In{;+hYPUlYy!ImhTf<(`yW6M|8ND?r@IaS40s#H9;($2 zLnT7rJkm&c@Zf>a!NFk&f_vtVN0Pg3`|ddT_4e;@t zgL5#R3MKl>(Y+sf&eqb+&&=mRT^qXOssq4t{CacjyEXTmSdkN0k#!JI@1Fglf@7p7 zs+qrBz84g;`qp-|2| z5PzY|Pp7UED;KAf%XhPS#jOY~s{Jlprvs{JWTAe@LJR*4fY#WN?x-rut*>nRDC^Gv zs9n@*wYOTsW+Lk_k%&cuo-y7YRXjW`5VL<>7kLc*_j5QzR@-9gRC?|)kO9~Yi-aQ8S@S(J0}*F6h0uOk0{4&d)p{_z0*3j^hGi=kmZ Q */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Model\Post; use Friendica\Model\Tag; @@ -27,7 +29,7 @@ function ljpost_install() { } -function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) +function ljpost_jot_nets(App &$a, array &$jotnets_fields) { if(! local_user()) { return; @@ -46,57 +48,31 @@ function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) } -function ljpost_settings(&$a,&$s) { +function ljpost_settings(App &$a, array &$data) +{ + if (!local_user()) { + return; + } - if(! local_user()) - return; + $enabled = DI::pConfig()->get(local_user(), 'ljpost', 'post', false); + $ij_username = DI::pConfig()->get(local_user(), 'ljpost', 'ij_username'); + $def_enabled = DI::pConfig()->get(local_user(), 'ljpost', 'post_by_default'); - /* 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 variables */ - - $enabled = DI::pConfig()->get(local_user(),'ljpost','post'); - - $checked = (($enabled) ? ' checked="checked" ' : ''); - - $def_enabled = DI::pConfig()->get(local_user(),'ljpost','post_by_default'); - - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - - $lj_username = DI::pConfig()->get(local_user(), 'ljpost', 'lj_username'); - $lj_password = DI::pConfig()->get(local_user(), 'ljpost', 'lj_password'); - - - /* Add some HTML to the existing form */ - - $s .= '
'; - $s .= '

' . DI::l10n()->t('LiveJournal Post Settings') . '

'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - /* provide a submit button */ - - $s .= '
'; + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ljpost/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['ljpost', DI::l10n()->t('Enable LiveJournal Post Addon'), $enabled], + '$username' => ['ij_username', DI::l10n()->t('LiveJournal username'), $ij_username], + '$password' => ['ij_password', DI::l10n()->t('LiveJournal password')], + '$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to LiveJournal by default'), $def_enabled], + ]); + $data = [ + 'connector' => 'ljpost', + 'title' => DI::l10n()->t('LiveJournal Export'), + 'image' => 'addon/ljpost/livejournal.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } diff --git a/ljpost/templates/connector_settings.tpl b/ljpost/templates/connector_settings.tpl new file mode 100644 index 00000000..0abcd24e --- /dev/null +++ b/ljpost/templates/connector_settings.tpl @@ -0,0 +1,4 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$username}} +{{include file="field_password.tpl" field=$password}} +{{include file="field_checkbox.tpl" field=$bydefault}} diff --git a/pumpio/pumpio.css b/pumpio/pumpio.css deleted file mode 100644 index 86dc5a0d..00000000 --- a/pumpio/pumpio.css +++ /dev/null @@ -1,16 +0,0 @@ - -#pumpio-import-label,#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label, #pumpio-delete-label { - float: left; - width: 200px; - margin-top: 10px; -} - -#pumpio-import,#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault, #pumpio-delete { - float: left; - margin-top: 10px; -} - -#pumpio-submit { - margin-top: 15px; -} - diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index e9084534..62ad7712 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -13,6 +13,7 @@ use Friendica\Core\Addon; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Renderer; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; @@ -216,150 +217,99 @@ function pumpio_jot_nets(App $a, array &$jotnets_fields) } } -function pumpio_settings(App $a, &$s) +function pumpio_settings(App $a, array &$data) { if (!local_user()) { return; } - /* Add our stylesheet to the page so we can make our settings look nice */ + $pumpio_host = DI::pConfig()->get(local_user(), 'pumpio', 'host'); + $pumpio_user = DI::pConfig()->get(local_user(), 'pumpio', 'user'); + $oauth_token = DI::pConfig()->get(local_user(), 'pumpio', 'oauth_token'); + $oauth_token_secret = DI::pConfig()->get(local_user(), 'pumpio', 'oauth_token_secret'); - DI::page()['htmlhead'] .= '' . "\r\n"; + $import_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'import', false); + $enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post', false); + $def_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default', false); + $public_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'public', false); + $mirror_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'mirror', false); - /* Get the current state of our config variables */ - - $import_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'import'); - $import_checked = (($import_enabled) ? ' checked="checked" ' : ''); - - $enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - $css = (($enabled) ? '' : '-disabled'); - - $def_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default'); - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - - $public_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'public'); - $public_checked = (($public_enabled) ? ' checked="checked" ' : ''); - - $mirror_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'mirror'); - $mirror_checked = (($mirror_enabled) ? ' checked="checked" ' : ''); - - $servername = DI::pConfig()->get(local_user(), "pumpio", "host"); - $username = DI::pConfig()->get(local_user(), "pumpio", "user"); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

'. DI::l10n()->t('Pump.io Import/Export/Mirror').'

'; - $s .= '
'; - $s .= ''; + $data = [ + 'connector' => 'pumpio', + 'title' => DI::l10n()->t('Pump.io Import/Export/Mirror'), + 'image' => 'images/pumpio.png', + 'enabled' => $enabled, + 'html' => $html, + 'submit' => $submit, + ]; } function pumpio_settings_post(App $a, array &$b) { - if (!empty($_POST['pumpio-submit'])) { - if (!empty($_POST['pumpio_delete'])) { - DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , ''); - DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , ''); - DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token' , ''); - DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token_secret', ''); - DI::pConfig()->set(local_user(), 'pumpio', 'post' , false); - DI::pConfig()->set(local_user(), 'pumpio', 'import' , false); - DI::pConfig()->set(local_user(), 'pumpio', 'host' , ''); - DI::pConfig()->set(local_user(), 'pumpio', 'user' , ''); - DI::pConfig()->set(local_user(), 'pumpio', 'public' , false); - DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , false); - DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false); - DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0); - DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , ''); - } else { - // filtering the username if it is filled wrong - $user = $_POST['pumpio_user']; - if (strstr($user, "@")) { - $pos = strpos($user, "@"); + if (!empty($_POST['pumpio_delete'])) { + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token_secret', ''); + DI::pConfig()->set(local_user(), 'pumpio', 'post' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'import' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'host' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'user' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'public' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0); + DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , ''); + } elseif (!empty($_POST['pumpio-submit'])) { + // filtering the username if it is filled wrong + $user = $_POST['pumpio_user']; + if (strstr($user, "@")) { + $pos = strpos($user, "@"); - if ($pos > 0) { - $user = substr($user, 0, $pos); - } + if ($pos > 0) { + $user = substr($user, 0, $pos); } + } - // Filtering the hostname if someone is entering it with "http" - $host = $_POST['pumpio_host']; - $host = trim($host); - $host = str_replace(["https://", "http://"], ["", ""], $host); + // Filtering the hostname if someone is entering it with "http" + $host = $_POST['pumpio_host']; + $host = trim($host); + $host = str_replace(["https://", "http://"], ["", ""], $host); - DI::pConfig()->set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false); - DI::pConfig()->set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false); - DI::pConfig()->set(local_user(), 'pumpio', 'host' , $host); - DI::pConfig()->set(local_user(), 'pumpio', 'user' , $user); - DI::pConfig()->set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false); - DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror'] ?? false); - DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'host' , $host); + DI::pConfig()->set(local_user(), 'pumpio', 'user' , $user); + DI::pConfig()->set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false); - if (!empty($_POST['pumpio_mirror'])) { - DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate'); - } + if (!empty($_POST['pumpio_mirror'])) { + DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate'); } } } diff --git a/pumpio/templates/connector_settings.tpl b/pumpio/templates/connector_settings.tpl new file mode 100644 index 00000000..6c688ad4 --- /dev/null +++ b/pumpio/templates/connector_settings.tpl @@ -0,0 +1,13 @@ +{{include file="field_input.tpl" field=$servername}} +{{include file="field_input.tpl" field=$username}} + +{{if $oauth_token && $oauth_token_secret}} + {{include file="field_checkbox.tpl" field=$enabled}} + {{include file="field_checkbox.tpl" field=$bydefault}} + {{include file="field_checkbox.tpl" field=$public}} + {{include file="field_checkbox.tpl" field=$mirror}} +{{elseif $pumpio_host && $pumpio_user}} + +{{/if}} diff --git a/statusnet/statusnet.css b/statusnet/statusnet.css index f50d9c05..21f4733f 100644 --- a/statusnet/statusnet.css +++ b/statusnet/statusnet.css @@ -10,62 +10,3 @@ height: 52px; vertical-align: middle; } -#statusnet-disconnect-label { - float: left; - width: 250px; - margin-bottom: 25px; -} -#statusnet-disconnect { - float: left; -} - -#statusnet-default-label, -#statusnet-applicationname-label, -#statusnet-sendtaglinks-label, -#statusnet-shortening-label, -#statusnet-mirror-label, -#statusnet-import-label, -#statusnet-create_user-label, -#statusnet-pin-label, -#statusnet-enable-label { - float: left; - width: 250px; - margin-bottom: 5px; -} - -#statusnet-checkbox { - float: left; -} - -#statusnet-pin { - float: left; -} - - -#statusnet-consumerkey-label { - float: left; - width: 250px; - margin-bottom: 8px; -} -#statusnet-consumerkey { - float: left; - margin-bottom: 8px; -} -#statusnet-consumersecret-label { - float: left; - width: 250px; - margin-bottom: 8px; -} -#statusnet-consumersecret { - float: left; - margin-bottom: 8px; -} -#statusnet-baseapi-label { - float: left; - width: 250px; - margin-bottom: 25px; -} -#statusnet-baseapi { - float: left; - margin-bottom: 8px; -} diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 75e44151..b2582b86 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -107,13 +107,13 @@ function statusnet_settings_post(App $a, $post) return; } // don't check GNU Social settings if GNU Social submit button is not clicked - if (empty($_POST['statusnet-submit'])) { + if (empty($_POST['statusnet-submit']) && empty($_POST['statusnet-disconnect'])) { return; } - if (isset($_POST['statusnet-disconnect'])) { + if (!empty($_POST['statusnet-disconnect'])) { /* * * - * if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration + * if the GNU Social-disconnect button is clicked, clear the GNU Social configuration */ DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey'); DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret'); @@ -149,7 +149,6 @@ function statusnet_settings_post(App $a, $post) } } } - DI::baseUrl()->redirect('settings/connectors'); } else { if (isset($_POST['statusnet-consumersecret'])) { // check if we can reach the API of the GNU Social server @@ -177,7 +176,6 @@ function statusnet_settings_post(App $a, $post) notice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL); } } - DI::baseUrl()->redirect('settings/connectors'); } else { if (isset($_POST['statusnet-pin'])) { // if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen @@ -195,7 +193,6 @@ function statusnet_settings_post(App $a, $post) DI::pConfig()->set(local_user(), 'statusnet', 'post', 1); DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1); // 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 dent for every new __public__ posting to the wall @@ -213,171 +210,125 @@ function statusnet_settings_post(App $a, $post) } } -function statusnet_settings(App $a, &$s) +function statusnet_settings(App $a, array &$data) { if (!local_user()) { return; } - $user = User::getById(local_user()); + DI::page()->registerStylesheet(__DIR__ . '/statusnet.css', 'all'); - DI::page()['htmlhead'] .= '' . "\r\n"; /* * * * 1) Check that we have a base api url and a consumer key & secret * 2) If no OAuthtoken & stuff is present, generate button to get some * allow the user to cancel the connection process at this step * 3) Checkbox for "Send public notices (respect size limitation) */ - $api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi'); - $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret'); - $otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret'); - $enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - $defenabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default'); - $defchecked = (($defenabled) ? ' checked="checked" ' : ''); - $mirrorenabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts'); - $mirrorchecked = (($mirrorenabled) ? ' checked="checked" ' : ''); - $import = DI::pConfig()->get(local_user(), 'statusnet', 'import'); - $importselected = ["", "", ""]; - $importselected[$import] = ' selected="selected"'; - //$importenabled = DI::pConfig()->get(local_user(),'statusnet','import'); - //$importchecked = (($importenabled) ? ' checked="checked" ' : ''); - $create_userenabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user'); - $create_userchecked = (($create_userenabled) ? ' checked="checked" ' : ''); + $baseapi = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi'); + $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey'); + $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret'); + $otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken'); + $osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret'); + $enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post', false); + $def_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default', false); + $mirror_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts', false); + $createuser_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user', false); + $import = DI::pConfig()->get(local_user(), 'statusnet', 'import'); - $css = (($enabled) ? '' : '-disabled'); + // Radio button list to select existing application credentials + $sites = array_map(function ($site) { + return ['statusnet-preconf-apiurl', $site['sitename'], $site['apiurl']]; + }, DI::config()->get('statusnet', 'sites', [])); - $s .= ''; - $s .= '

' . DI::l10n()->t('GNU Social Import/Export/Mirror') . '

'; - $s .= '
'; - $s .= '
'; + + + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/statusnet/'); + $html = Renderer::replaceMacros($t, [ + '$l10n' => [ + 'global_title' => DI::l10n()->t('Globally Available GNU Social OAuthKeys'), + 'global_info' => DI::l10n()->t(DI::l10n()->t('There are preconfigured OAuth key pairs for some GNU Social servers available. If you are using one of them, please use these credentials. If not feel free to connect to any other GNU Social instance (see below).')), + 'credentials_title' => DI::l10n()->t('Provide your own OAuth Credentials'), + 'credentials_info' => DI::l10n()->t('No consumer key pair for GNU Social found. Register your Friendica Account as a desktop application on your GNU Social account, copy the consumer key pair here and enter the API base root.
Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorite GNU Social installation.'), + 'oauth_info' => DI::l10n()->t('To connect to your GNU Social account click the button below to get a security code from GNU Social which you have to copy into the input box below and submit the form. Only your public posts will be posted to GNU Social.'), + 'oauth_alt' => DI::l10n()->t('Log in with GNU Social'), + 'oauth_cancel' => DI::l10n()->t('Cancel Connection Process'), + 'oauth_api' => DI::l10n()->t('Current GNU Social API is: %s', $baseapi), + 'connected_account' => $connected_account ?? '', + 'privacy_warning' => $privacy_warning ?? '', + ], + + '$ckey' => $ckey, + '$csecret' => $csecret, + '$otoken' => $otoken, + '$osecret' => $osecret, + '$sites' => $sites, + + '$authorize_url' => $authorize_url ?? '', + '$request_token' => $request_token ?? null, + '$account' => $account ?? null, + + '$authenticate_url' => DI::baseUrl()->get() . '/statusnet/connect', + + '$consumerkey' => ['statusnet-consumerkey', DI::l10n()->t('OAuth Consumer Key'), '', '', false, ' size="35'], + '$consumersecret' => ['statusnet-consumersecret', DI::l10n()->t('OAuth Consumer Secret'), '', '', false, ' size="35'], + + '$baseapi' => ['statusnet-baseapi', DI::l10n()->t('Base API Path (remember the trailing /)'), '', '', false, ' size="35'], + '$pin' => ['statusnet-pin', DI::l10n()->t('Copy the security code from GNU Social here')], + + '$enable' => ['statusnet-enabled', DI::l10n()->t('Allow posting to GNU Social'), $enabled, DI::l10n()->t('If enabled all your public postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')], + '$default' => ['statusnet-default', DI::l10n()->t('Post to GNU Social by default'), $def_enabled], + '$mirror' => ['statusnet-mirror', DI::l10n()->t('Mirror all public posts'), $mirror_enabled], + '$create_user' => ['statusnet-create_user', DI::l10n()->t('Automatically create contacts'), $createuser_enabled], + '$import' => ['statusnet-import', DI::l10n()->t('Import the remote timeline'), $import, '', [ + 0 => DI::l10n()->t('Disabled'), + 1 => DI::l10n()->t('Full Timeline'), + 2 => DI::l10n()->t('Only Mentions'), + ]], + ]); + + $data = [ + 'connector' => 'statusnet', + 'title' => DI::l10n()->t('GNU Social Import/Export/Mirror'), + 'image' => 'images/gnusocial.png', + 'enabled' => $enabled, + 'html' => $html, + 'submit' => $submit, + ]; } function statusnet_hook_fork(App $a, array &$b) diff --git a/statusnet/templates/connector_settings.tpl b/statusnet/templates/connector_settings.tpl new file mode 100644 index 00000000..b5a497a8 --- /dev/null +++ b/statusnet/templates/connector_settings.tpl @@ -0,0 +1,50 @@ +{{if $ckey && $csecret}} + {{if $otoken && $osecret}} + {{if $account}} +
+ +

+ {{$l10n.connected_account nofilter}}
+ {{$account->description}} +

+
+ {{/if}} + {{include file="field_checkbox.tpl" field=$enable}} +

{{$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_alt}} +
+ + + {{include file="field_input.tpl" field=$pin}} +
+ +

{{$l10n.oauth_api}}

+ {{/if}} +{{else}} + {{if $sites}} +

{{$l10n.global_title}}

+

{{$l10n.global_info}}

+
+ {{foreach $sites as $site}} + {{include file="field_radio.tpl" field=$site}} + {{/foreach}} +
+ {{/if}} +

{{$l10n.credentials_title}}

+

{{$l10n.credentials_info nofilter}}

+
+ {{include file="field_input.tpl" field=$consumerkey}} + {{include file="field_input.tpl" field=$consumersecret}} + {{include file="field_input.tpl" field=$baseapi}} +
+{{/if}} \ No newline at end of file diff --git a/tumblr/templates/connector_settings.tpl b/tumblr/templates/connector_settings.tpl new file mode 100644 index 00000000..d28fab9d --- /dev/null +++ b/tumblr/templates/connector_settings.tpl @@ -0,0 +1,10 @@ +

{{$l10n.connect}}

+ +{{include file="field_checkbox.tpl" field=$enable}} +{{include file="field_checkbox.tpl" field=$bydefault}} + +{{if $page_select}} + {{include file="field_select.tpl" field=$page_select}} +{{else}} + {{$l10n.noconnect}} +{{/if}} diff --git a/tumblr/tumblr.css b/tumblr/tumblr.css deleted file mode 100644 index c76fb61e..00000000 --- a/tumblr/tumblr.css +++ /dev/null @@ -1,16 +0,0 @@ - -#tumblr-enable-label, #tumblr-username-label, #tumblr-page-label, #tumblr-bydefault-label { - float: left; - width: 200px; - margin-top: 10px; -} - -#tumblr-checkbox, #tumblr-username, #tumblr-page, #tumblr-bydefault { - float: left; - margin-top: 10px; -} - -#tumblr-submit { - margin-top: 15px; -} - diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index e664ed7b..5ae0dd1b 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -198,89 +198,54 @@ function tumblr_jot_nets(App $a, array &$jotnets_fields) } } -function tumblr_settings(App $a, &$s) +function tumblr_settings(App $a, array &$data) { - if (! local_user()) { + if (!local_user()) { return; } - /* Add our stylesheet to the page so we can make our settings look nice */ + $enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post', false); + $def_enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default', false); - DI::page()['htmlhead'] .= '' . "\r\n"; + $oauth_token = DI::pConfig()->get(local_user(), 'tumblr', 'oauth_token'); + $oauth_token_secret = DI::pConfig()->get(local_user(), 'tumblr', 'oauth_token_secret'); - /* Get the current state of our config variables */ - - $enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - $css = (($enabled) ? '' : '-disabled'); - - $def_enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default'); - - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

'. DI::l10n()->t('Tumblr Export').'

'; - $s .= '
'; - $s .= ''; + '$authenticate_url' => DI::baseUrl()->get() . '/tumblr/connect', + + '$enable' => ['tumblr', DI::l10n()->t('Enable Tumblr Post Addon'), $enabled], + '$bydefault' => ['tumblr_bydefault', DI::l10n()->t('Post to Tumblr by default'), $def_enabled], + '$page_select' => $page_select ?? '', + ]); + + $data = [ + 'connector' => 'tumblr', + 'title' => DI::l10n()->t('Tumblr Export'), + 'image' => 'images/tumblr.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } function tumblr_settings_post(App $a, array &$b) diff --git a/twitter/templates/connector_settings.tpl b/twitter/templates/connector_settings.tpl new file mode 100644 index 00000000..1c6b7131 --- /dev/null +++ b/twitter/templates/connector_settings.tpl @@ -0,0 +1,23 @@ +
+{{if $l10n.connected}} +

{{$l10n.connected nofilter}}

+

+ + {{$account->description}} +

+{{else}} +

{{$l10n.invalid}}

+ +{{/if}} +
+ +
+ +{{include file="field_checkbox.tpl" field=$enable}} +{{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}} 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 .= '

' . DI::l10n()->t('Twitter Import/Export/Mirror') . '

'; - $s .= '
'; - $s .= '
'; + + $data = [ + 'connector' => 'twitter', + 'title' => DI::l10n()->t('Twitter Import/Export/Mirror'), + 'enabled' => $enabled, + 'image' => 'images/twitter.png', + 'html' => $html, + 'submit' => $submit ?? null, + ]; } function twitter_hook_fork(App $a, array &$b) diff --git a/wppost/templates/connector_settings.tpl b/wppost/templates/connector_settings.tpl new file mode 100644 index 00000000..0afd676c --- /dev/null +++ b/wppost/templates/connector_settings.tpl @@ -0,0 +1,5 @@ +{{include file="field_checkbox.tpl" field=$enabled}} +{{include file="field_input.tpl" field=$username}} +{{include file="field_password.tpl" field=$password}} +{{include file="field_input.tpl" field=$blog}} +{{include file="field_checkbox.tpl" field=$bydefault}} diff --git a/wppost/wppost.css b/wppost/wppost.css deleted file mode 100644 index d5a39fde..00000000 --- a/wppost/wppost.css +++ /dev/null @@ -1,20 +0,0 @@ - -#wppost-enable-label, #wppost-username-label, #wppost-password-label, -#wppost-blog-label, #wppost-bydefault-label, -#wppost-backlink-label, #wppost-shortcheck-label { - float: left; - width: 200px; - margin-top: 10px; -} - -#wppost-checkbox, #wppost-username, #wppost-password, -#wppost-blog, #wppost-bydefault, -#wppost-shortcheck, #wppost-backlink { - float: left; - margin-top: 10px; -} - -#wppost-submit { - margin-top: 15px; -} - diff --git a/wppost/wppost.php b/wppost/wppost.php index c78157c8..f57772d3 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -6,10 +6,12 @@ * Author: Mike Macgirvin */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Hook; use Friendica\Core\Logger; +use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Post; @@ -25,7 +27,7 @@ function wppost_install() Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); } -function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) +function wppost_jot_nets(App &$a, array &$jotnets_fields) { if (!local_user()) { return; @@ -44,92 +46,39 @@ function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) } -function wppost_settings(&$a, &$s) { - - if(! local_user()) +function wppost_settings(App &$a, array &$data) +{ + if (!local_user()) { return; + } - /* Add our stylesheet to the page so we can make our settings look nice */ + $enabled = DI::pConfig()->get(local_user(), 'wppost', 'post', false); + $wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username'); + $wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog'); + $def_enabled = DI::pConfig()->get(local_user(), 'wppost', 'post_by_default', false); + $back_enabled = DI::pConfig()->get(local_user(), 'wppost', 'backlink', false); + $wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text'); + $shortcheck_enabled = DI::pConfig()->get(local_user(), 'wppost', 'shortcheck', false); - DI::page()['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variables */ - - $enabled = DI::pConfig()->get(local_user(),'wppost','post'); - $checked = (($enabled) ? ' checked="checked" ' : ''); - - $css = (($enabled) ? '' : '-disabled'); - - $def_enabled = DI::pConfig()->get(local_user(),'wppost','post_by_default'); - $back_enabled = DI::pConfig()->get(local_user(),'wppost','backlink'); - $shortcheck_enabled = DI::pConfig()->get(local_user(),'wppost','shortcheck'); - - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $back_checked = (($back_enabled) ? ' checked="checked" ' : ''); - $shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : ''); - - $wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username'); - $wp_password = DI::pConfig()->get(local_user(), 'wppost', 'wp_password'); - $wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog'); - $wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text'); - - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

'. DI::l10n()->t('Wordpress Export').'

'; - $s .= '
'; - $s .= ''; + $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/wppost/'); + $html = Renderer::replaceMacros($t, [ + '$enabled' => ['wppost', DI::l10n()->t('Enable Wordpress Post Addon'), $enabled], + '$username' => ['wp_username', DI::l10n()->t('Wordpress username'), $wp_username], + '$password' => ['wp_password', DI::l10n()->t('Wordpress password')], + '$blog' => ['wp_blog', DI::l10n()->t('WordPress API URL'), $wp_blog], + '$bydefault' => ['wp_bydefault', DI::l10n()->t('Post to Wordpress by default'), $def_enabled], + '$backlink' => ['wp_backlink', DI::l10n()->t('Provide a backlink to the Friendica post'), $back_enabled], + '$backlink_text' => ['wp_backlink_text', DI::l10n()->t('Text for the backlink, e.g. Read the original post and comment stream on Friendica.'), $wp_backlink_text], + '$shortcheck' => ['wp_shortcheck', DI::l10n()->t('Don\'t post messages that are too short'), $shortcheck_enabled], + ]); + $data = [ + 'connector' => 'wppost', + 'title' => DI::l10n()->t('Wordpress Export'), + 'image' => 'images/wordpress.png', + 'enabled' => $enabled, + 'html' => $html, + ]; } -- 2.43.5 From 3104d176e74566c4f22e4eaa15cd167947aef3c2 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 21 Nov 2021 19:19:32 -0500 Subject: [PATCH 04/21] [various] Updated translation files after editing several strings --- advancedcontentfilter/lang/C/messages.po | 70 +++---- birdavatar/lang/C/messages.po | 44 ++--- blockem/lang/C/messages.po | 20 +- catavatar/lang/C/messages.po | 34 ++-- curweather/lang/C/messages.po | 46 ++--- diaspora/lang/C/messages.po | 46 ++--- discourse/lang/C/messages.po | 34 ++++ dwpost/lang/C/messages.po | 42 ++-- fromapp/lang/C/messages.po | 14 +- geonames/lang/C/messages.po | 14 +- gnot/lang/C/messages.po | 26 ++- group_text/lang/C/messages.po | 12 +- ifttt/lang/C/messages.po | 34 ++-- ijpost/lang/C/messages.po | 20 +- irc/lang/C/messages.po | 32 +-- krynn/lang/C/messages.po | 16 +- langfilter/lang/C/messages.po | 30 +-- libertree/lang/C/messages.po | 26 ++- ljpost/lang/C/messages.po | 20 +- mailstream/lang/C/messages.po | 40 ++-- markdown/lang/C/messages.po | 15 +- mathjax/lang/C/messages.po | 10 +- nsfw/lang/C/messages.po | 26 ++- numfriends/lang/C/messages.po | 12 +- opmlexport/lang/C/messages.po | 26 +++ planets/lang/C/messages.po | 16 +- pumpio/lang/C/messages.po | 98 +++++----- qcomment/lang/C/messages.po | 22 +-- randplace/lang/C/messages.po | 12 +- securemail/lang/C/messages.po | 36 ++-- showmore/lang/C/messages.po | 18 +- showmore_dyn/lang/C/messages.po | 18 +- startpage/lang/C/messages.po | 16 +- statusnet/lang/C/messages.po | 238 ++++++++++++----------- superblock/lang/C/messages.po | 18 +- tumblr/lang/C/messages.po | 36 ++-- twitter/lang/C/messages.po | 89 +++++---- windowsphonepush/lang/C/messages.po | 18 +- wppost/lang/C/messages.po | 40 ++-- 39 files changed, 681 insertions(+), 703 deletions(-) create mode 100644 discourse/lang/C/messages.po create mode 100644 opmlexport/lang/C/messages.po diff --git a/advancedcontentfilter/lang/C/messages.po b/advancedcontentfilter/lang/C/messages.po index d285d071..742647b9 100644 --- a/advancedcontentfilter/lang/C/messages.po +++ b/advancedcontentfilter/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:15+0000\n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,28 +17,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: advancedcontentfilter.php:153 +#: advancedcontentfilter.php:154 #, php-format msgid "Filtered by rule: %s" msgstr "" -#: advancedcontentfilter.php:167 advancedcontentfilter.php:224 +#: advancedcontentfilter.php:170 advancedcontentfilter.php:225 msgid "Advanced Content Filter" msgstr "" -#: advancedcontentfilter.php:223 +#: advancedcontentfilter.php:224 msgid "Back to Addon Settings" msgstr "" -#: advancedcontentfilter.php:225 +#: advancedcontentfilter.php:226 msgid "Add a Rule" msgstr "" -#: advancedcontentfilter.php:226 +#: advancedcontentfilter.php:227 msgid "Help" msgstr "" -#: advancedcontentfilter.php:227 +#: advancedcontentfilter.php:228 msgid "" "Add and manage your personal content filter rules in this screen. Rules have " "a name and an arbitrary expression that will be matched against post data. " @@ -46,108 +46,108 @@ msgid "" "the help page." msgstr "" -#: advancedcontentfilter.php:228 +#: advancedcontentfilter.php:229 msgid "Your rules" msgstr "" -#: advancedcontentfilter.php:229 +#: advancedcontentfilter.php:230 msgid "" "You have no rules yet! Start adding one by clicking on the button above next " "to the title." msgstr "" -#: advancedcontentfilter.php:230 +#: advancedcontentfilter.php:231 msgid "Disabled" msgstr "" -#: advancedcontentfilter.php:231 +#: advancedcontentfilter.php:232 msgid "Enabled" msgstr "" -#: advancedcontentfilter.php:232 +#: advancedcontentfilter.php:233 msgid "Disable this rule" msgstr "" -#: advancedcontentfilter.php:233 +#: advancedcontentfilter.php:234 msgid "Enable this rule" msgstr "" -#: advancedcontentfilter.php:234 +#: advancedcontentfilter.php:235 msgid "Edit this rule" msgstr "" -#: advancedcontentfilter.php:235 +#: advancedcontentfilter.php:236 msgid "Edit the rule" msgstr "" -#: advancedcontentfilter.php:236 +#: advancedcontentfilter.php:237 msgid "Save this rule" msgstr "" -#: advancedcontentfilter.php:237 +#: advancedcontentfilter.php:238 msgid "Delete this rule" msgstr "" -#: advancedcontentfilter.php:238 +#: advancedcontentfilter.php:239 msgid "Rule" msgstr "" -#: advancedcontentfilter.php:239 +#: advancedcontentfilter.php:240 msgid "Close" msgstr "" -#: advancedcontentfilter.php:240 +#: advancedcontentfilter.php:241 msgid "Add new rule" msgstr "" -#: advancedcontentfilter.php:241 +#: advancedcontentfilter.php:242 msgid "Rule Name" msgstr "" -#: advancedcontentfilter.php:242 +#: advancedcontentfilter.php:243 msgid "Rule Expression" msgstr "" -#: advancedcontentfilter.php:243 +#: advancedcontentfilter.php:244 msgid "Cancel" msgstr "" -#: advancedcontentfilter.php:310 advancedcontentfilter.php:321 -#: advancedcontentfilter.php:332 advancedcontentfilter.php:366 -#: advancedcontentfilter.php:395 advancedcontentfilter.php:416 +#: advancedcontentfilter.php:312 advancedcontentfilter.php:323 +#: advancedcontentfilter.php:334 advancedcontentfilter.php:370 +#: advancedcontentfilter.php:401 advancedcontentfilter.php:424 msgid "You must be logged in to use this method" msgstr "" -#: advancedcontentfilter.php:336 advancedcontentfilter.php:370 -#: advancedcontentfilter.php:399 +#: advancedcontentfilter.php:338 advancedcontentfilter.php:374 +#: advancedcontentfilter.php:405 msgid "Invalid form security token, please refresh the page." msgstr "" -#: advancedcontentfilter.php:348 +#: advancedcontentfilter.php:350 msgid "The rule name and expression are required." msgstr "" -#: advancedcontentfilter.php:360 +#: advancedcontentfilter.php:364 msgid "Rule successfully added" msgstr "" -#: advancedcontentfilter.php:374 advancedcontentfilter.php:403 +#: advancedcontentfilter.php:378 advancedcontentfilter.php:409 msgid "Rule doesn't exist or doesn't belong to you." msgstr "" -#: advancedcontentfilter.php:389 +#: advancedcontentfilter.php:395 msgid "Rule successfully updated" msgstr "" -#: advancedcontentfilter.php:410 +#: advancedcontentfilter.php:418 msgid "Rule successfully deleted" msgstr "" -#: advancedcontentfilter.php:420 +#: advancedcontentfilter.php:428 msgid "Missing argument: guid." msgstr "" -#: advancedcontentfilter.php:428 +#: advancedcontentfilter.php:436 #, php-format msgid "Unknown post with guid: %s" msgstr "" diff --git a/birdavatar/lang/C/messages.po b/birdavatar/lang/C/messages.po index 35db2528..0d90e08a 100644 --- a/birdavatar/lang/C/messages.po +++ b/birdavatar/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-24 12:04+0100\n" +"POT-Creation-Date: 2021-11-24 08:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,38 +17,38 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: birdavatar.php:49 -msgid "Use Bird as Avatar" -msgstr "" - -#: birdavatar.php:50 -msgid "More Random Bird!" -msgstr "" - -#: birdavatar.php:51 -msgid "Reset to email Bird" -msgstr "" - -#: birdavatar.php:53 -msgid "Bird Avatar Settings" -msgstr "" - -#: birdavatar.php:54 +#: birdavatar.php:47 msgid "Set default profile avatar or randomize the bird." msgstr "" -#: birdavatar.php:72 +#: birdavatar.php:52 +msgid "Bird Avatar Settings" +msgstr "" + +#: birdavatar.php:55 +msgid "Use Bird as Avatar" +msgstr "" + +#: birdavatar.php:56 +msgid "More Random Bird!" +msgstr "" + +#: birdavatar.php:57 +msgid "Reset to email Bird" +msgstr "" + +#: birdavatar.php:76 msgid "The bird has not found itself." msgstr "" -#: birdavatar.php:81 +#: birdavatar.php:85 msgid "There was an error, the bird flew away." msgstr "" -#: birdavatar.php:87 +#: birdavatar.php:91 msgid "Profile Photos" msgstr "" -#: birdavatar.php:97 +#: birdavatar.php:101 msgid "Meow!" msgstr "" diff --git a/blockem/lang/C/messages.po b/blockem/lang/C/messages.po index 1d9ed121..64bb3fc4 100644 --- a/blockem/lang/C/messages.po +++ b/blockem/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:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,33 +17,29 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: blockem.php:42 blockem.php:46 -msgid "Blockem" -msgstr "" - -#: blockem.php:50 +#: blockem.php:39 msgid "" "Hides user's content by collapsing posts. Also replaces their avatar with " "generic image." msgstr "" -#: blockem.php:51 +#: blockem.php:40 msgid "Comma separated profile URLS:" msgstr "" -#: blockem.php:55 -msgid "Save Settings" +#: blockem.php:45 +msgid "Blockem" msgstr "" -#: blockem.php:131 +#: blockem.php:120 #, php-format msgid "Filtered user: %s" msgstr "" -#: blockem.php:190 +#: blockem.php:183 msgid "Unblock Author" msgstr "" -#: blockem.php:192 +#: blockem.php:185 msgid "Block Author" msgstr "" diff --git a/catavatar/lang/C/messages.po b/catavatar/lang/C/messages.po index e6efdf77..24735ca1 100644 --- a/catavatar/lang/C/messages.po +++ b/catavatar/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:16+0000\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 \n" "Language-Team: LANGUAGE \n" @@ -17,38 +17,38 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: catavatar.php:49 -msgid "Use Cat as Avatar" -msgstr "" - -#: catavatar.php:50 -msgid "More Random Cat!" -msgstr "" - -#: catavatar.php:51 -msgid "Reset to email Cat" +#: catavatar.php:48 +msgid "Set default profile avatar or randomize the cat." msgstr "" #: catavatar.php:53 msgid "Cat Avatar Settings" msgstr "" -#: catavatar.php:54 -msgid "Set default profile avatar or randomize the cat." +#: catavatar.php:56 +msgid "Use Cat as Avatar" msgstr "" -#: catavatar.php:72 +#: catavatar.php:57 +msgid "Another random Cat!" +msgstr "" + +#: catavatar.php:58 +msgid "Reset to email Cat" +msgstr "" + +#: catavatar.php:77 msgid "The cat hadn't found itself." msgstr "" -#: catavatar.php:81 +#: catavatar.php:86 msgid "There was an error, the cat ran away." msgstr "" -#: catavatar.php:87 +#: catavatar.php:92 msgid "Profile Photos" msgstr "" -#: catavatar.php:97 +#: catavatar.php:102 msgid "Meow!" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -21,7 +21,7 @@ msgstr "" msgid "Error fetching weather data. Error was: " msgstr "" -#: curweather.php:130 curweather.php:192 +#: curweather.php:130 msgid "Current Weather" msgstr "" @@ -57,66 +57,66 @@ msgstr "" msgid "at OpenWeatherMap" msgstr "" -#: curweather.php:179 +#: curweather.php:178 msgid "No APPID found, please contact your admin to obtain one." msgstr "" -#: curweather.php:191 curweather.php:229 -msgid "Save Settings" -msgstr "" - -#: curweather.php:192 -msgid "Settings" -msgstr "" - -#: curweather.php:194 +#: curweather.php:188 msgid "Enter either the name of your location or the zip code." msgstr "" -#: curweather.php:195 +#: curweather.php:189 msgid "Your Location" msgstr "" -#: curweather.php:195 +#: curweather.php:189 msgid "" "Identifier of your location (name or zip code), e.g. Berlin,DE or " "14476,DE." msgstr "" -#: curweather.php:196 +#: curweather.php:190 msgid "Units" msgstr "" -#: curweather.php:196 +#: curweather.php:190 msgid "select if the temperature should be displayed in °C or °F" msgstr "" -#: curweather.php:197 +#: curweather.php:191 msgid "Show weather data" msgstr "" -#: curweather.php:232 +#: curweather.php:196 +msgid "Current Weather Settings" +msgstr "" + +#: curweather.php:227 +msgid "Save Settings" +msgstr "" + +#: curweather.php:230 msgid "Caching Interval" msgstr "" -#: curweather.php:234 +#: curweather.php:232 msgid "" "For how long should the weather data be cached? Choose according your " "OpenWeatherMap account type." msgstr "" -#: curweather.php:235 +#: curweather.php:233 msgid "no cache" msgstr "" -#: curweather.php:236 curweather.php:237 curweather.php:238 curweather.php:239 +#: curweather.php:234 curweather.php:235 curweather.php:236 curweather.php:237 msgid "minutes" msgstr "" -#: curweather.php:242 +#: curweather.php:240 msgid "Your APPID" msgstr "" -#: curweather.php:242 +#: curweather.php:240 msgid "Your API key provided by OpenWeatherMap" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,88 +17,84 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: diaspora.php:43 +#: diaspora.php:44 msgid "Post to Diaspora" msgstr "" -#: diaspora.php:68 +#: diaspora.php:67 #, php-format msgid "" "Please remember: You can always be reached from Diaspora with your Friendica " "handle %s. " msgstr "" -#: diaspora.php:69 +#: diaspora.php:68 msgid "" "This connector is only meant if you still want to use your old Diaspora " "account for some time. " msgstr "" -#: diaspora.php:70 +#: diaspora.php:69 #, php-format msgid "" "However, it is preferred that you tell your Diaspora contacts the new handle " "%s instead." msgstr "" -#: diaspora.php:80 +#: diaspora.php:79 msgid "All aspects" msgstr "" -#: diaspora.php:81 +#: diaspora.php:80 msgid "Public" msgstr "" -#: diaspora.php:87 +#: diaspora.php:86 msgid "Post to aspect:" msgstr "" -#: diaspora.php:88 +#: diaspora.php:87 #, php-format msgid "Connected with your Diaspora account %s" msgstr "" -#: diaspora.php:91 +#: diaspora.php:90 msgid "" "Can't login to your Diaspora account. Please check handle (in the format " "user@domain.tld) and password." msgstr "" -#: diaspora.php:99 -msgid "Diaspora Export" -msgstr "" - -#: diaspora.php:100 +#: diaspora.php:97 msgid "Information" msgstr "" -#: diaspora.php:101 +#: diaspora.php:98 msgid "Error" msgstr "" -#: diaspora.php:102 -msgid "Save Settings" -msgstr "" - -#: diaspora.php:106 +#: diaspora.php:104 msgid "Enable Diaspora Post Addon" msgstr "" -#: diaspora.php:107 +#: diaspora.php:105 msgid "Diaspora handle" msgstr "" -#: diaspora.php:108 +#: diaspora.php:106 msgid "Diaspora password" msgstr "" -#: diaspora.php:108 +#: diaspora.php:106 msgid "" "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." msgstr "" -#: diaspora.php:110 +#: diaspora.php:108 msgid "Post to Diaspora by default" msgstr "" + +#: diaspora.php:113 +msgid "Diaspora Export" +msgstr "" diff --git a/discourse/lang/C/messages.po b/discourse/lang/C/messages.po new file mode 100644 index 00000000..ba0809ee --- /dev/null +++ b/discourse/lang/C/messages.po @@ -0,0 +1,34 @@ +# ADDON discourse +# Copyright (C) +# This file is distributed under the same license as the Friendica discourse addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \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 \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: discourse.php:49 +msgid "Enable processing of Discourse mailing list mails" +msgstr "" + +#: discourse.php:49 +msgid "" +"If enabled, incoming mails from Discourse will be improved so they look much " +"better. To make it work, you have to configure the e-mail settings in " +"Friendica. You also have to enable the mailing list mode in Discourse. Then " +"you have to add the Discourse mail account as contact." +msgstr "" + +#: discourse.php:54 +msgid "Discourse" +msgstr "" diff --git a/dwpost/lang/C/messages.po b/dwpost/lang/C/messages.po index 3787f75b..0b27a70c 100644 --- a/dwpost/lang/C/messages.po +++ b/dwpost/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 \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: dwpost.php:41 +#: dwpost.php:43 msgid "Post to Dreamwidth" msgstr "" -#: dwpost.php:72 dwpost.php:76 +#: dwpost.php:63 +msgid "Enable Dreamwidth Post Addon" +msgstr "" + +#: dwpost.php:64 +msgid "Dreamwidth username" +msgstr "" + +#: dwpost.php:65 +msgid "Dreamwidth password" +msgstr "" + +#: dwpost.php:66 +msgid "Post to Dreamwidth by default" +msgstr "" + +#: dwpost.php:71 msgid "Dreamwidth Export" msgstr "" - -#: dwpost.php:80 -msgid "Enable dreamwidth Post Addon" -msgstr "" - -#: dwpost.php:85 -msgid "dreamwidth username" -msgstr "" - -#: dwpost.php:90 -msgid "dreamwidth password" -msgstr "" - -#: dwpost.php:95 -msgid "Post to dreamwidth by default" -msgstr "" - -#: dwpost.php:100 -msgid "Save Settings" -msgstr "" diff --git a/fromapp/lang/C/messages.po b/fromapp/lang/C/messages.po index 195d6178..ce4a7827 100644 --- a/fromapp/lang/C/messages.po +++ b/fromapp/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 \n" "Language-Team: LANGUAGE \n" @@ -17,21 +17,17 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: fromapp.php:53 fromapp.php:57 -msgid "FromApp Settings" -msgstr "" - -#: fromapp.php:60 +#: fromapp.php:45 msgid "" "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." msgstr "" -#: fromapp.php:64 +#: fromapp.php:46 msgid "Use this application name even if another application was used." msgstr "" -#: fromapp.php:71 -msgid "Save Settings" +#: fromapp.php:51 +msgid "FromApp Settings" msgstr "" diff --git a/geonames/lang/C/messages.po b/geonames/lang/C/messages.po index af1a126a..c7f73046 100644 --- a/geonames/lang/C/messages.po +++ b/geonames/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 \n" "Language-Team: LANGUAGE \n" @@ -17,20 +17,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: geonames.php:141 -msgid "Geonames Settings" -msgstr "" - -#: geonames.php:142 +#: geonames.php:135 msgid "" "Replace numerical coordinates by the nearest populated location name in your " "posts." msgstr "" -#: geonames.php:143 +#: geonames.php:136 msgid "Enable Geonames Addon" msgstr "" -#: geonames.php:144 -msgid "Save Settings" +#: geonames.php:141 +msgid "Geonames Settings" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,25 +17,21 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: gnot.php:71 -msgid "Gnot Settings" -msgstr "" - -#: gnot.php:72 -msgid "Save Settings" -msgstr "" - -#: gnot.php:73 -msgid "Enable this addon?" -msgstr "" - -#: gnot.php:75 +#: gnot.php:63 msgid "" "Allows threading of email comment notifications on Gmail and anonymising the " "subject line." msgstr "" -#: gnot.php:84 +#: gnot.php:64 +msgid "Enable this addon?" +msgstr "" + +#: gnot.php:69 +msgid "Gnot Settings" +msgstr "" + +#: gnot.php:79 #, php-format msgid "[Friendica:Notify] Comment to conversation #%d" msgstr "" diff --git a/group_text/lang/C/messages.po b/group_text/lang/C/messages.po index 87b94b86..0b7ce62e 100644 --- a/group_text/lang/C/messages.po +++ b/group_text/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 \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: group_text.php:62 -msgid "Group Text" -msgstr "" - -#: group_text.php:64 +#: group_text.php:58 msgid "Use a text only (non-image) group selector in the \"group edit\" menu" msgstr "" -#: group_text.php:70 -msgid "Save Settings" +#: group_text.php:63 +msgid "Group Text" msgstr "" diff --git a/ifttt/lang/C/messages.po b/ifttt/lang/C/messages.po index f8f88f70..077328b0 100644 --- a/ifttt/lang/C/messages.po +++ b/ifttt/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:17+0000\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 \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ifttt.php:50 ifttt.php:54 -msgid "IFTTT Mirror" -msgstr "" - -#: ifttt.php:58 +#: ifttt.php:52 msgid "" "Create an account at IFTTT. Create " "three Facebook recipes that are connected with \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ijpost.php:39 +#: ijpost.php:42 msgid "Post to Insanejournal" msgstr "" -#: ijpost.php:71 ijpost.php:75 -msgid "InsaneJournal Export" -msgstr "" - -#: ijpost.php:79 +#: ijpost.php:61 msgid "Enable InsaneJournal Post Addon" msgstr "" -#: ijpost.php:84 +#: ijpost.php:62 msgid "InsaneJournal username" msgstr "" -#: ijpost.php:89 +#: ijpost.php:63 msgid "InsaneJournal password" msgstr "" -#: ijpost.php:94 +#: ijpost.php:64 msgid "Post to InsaneJournal by default" msgstr "" -#: ijpost.php:99 -msgid "Save Settings" +#: ijpost.php:69 +msgid "InsaneJournal Export" msgstr "" diff --git a/irc/lang/C/messages.po b/irc/lang/C/messages.po index bf560eac..859cdf16 100644 --- a/irc/lang/C/messages.po +++ b/irc/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 \n" "Language-Team: LANGUAGE \n" @@ -17,45 +17,45 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: irc.php:34 -msgid "IRC Settings" -msgstr "" - -#: irc.php:35 +#: irc.php:32 msgid "" "Here you can change the system wide settings for the channels to " "automatically join and access via the side bar. Note the changes you do " "here, only effect the channel selection if you are logged in." msgstr "" -#: irc.php:36 irc.php:134 -msgid "Save Settings" -msgstr "" - -#: irc.php:37 irc.php:135 +#: irc.php:33 irc.php:133 msgid "Channel(s) to auto connect (comma separated)" msgstr "" -#: irc.php:37 irc.php:135 +#: irc.php:33 irc.php:133 msgid "" "List of channels that shall automatically connected to when the app is " "launched." msgstr "" -#: irc.php:38 irc.php:136 +#: irc.php:34 irc.php:134 msgid "Popular Channels (comma separated)" msgstr "" -#: irc.php:38 irc.php:136 +#: irc.php:34 irc.php:134 msgid "" "List of popular channels, will be displayed at the side and hotlinked for " "easy joining." msgstr "" -#: irc.php:62 +#: irc.php:39 +msgid "IRC Settings" +msgstr "" + +#: irc.php:60 msgid "IRC Chatroom" msgstr "" -#: irc.php:90 +#: irc.php:88 msgid "Popular Channels" msgstr "" + +#: irc.php:132 +msgid "Save Settings" +msgstr "" diff --git a/krynn/lang/C/messages.po b/krynn/lang/C/messages.po index 429271bd..266044b1 100644 --- a/krynn/lang/C/messages.po +++ b/krynn/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 \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: krynn.php:132 krynn.php:136 -msgid "Krynn" -msgstr "" - -#: krynn.php:141 -msgid "Krynn Settings" -msgstr "" - -#: krynn.php:143 +#: krynn.php:127 msgid "Enable Krynn Addon" msgstr "" -#: krynn.php:148 -msgid "Save Settings" +#: krynn.php:132 +msgid "Krynn Settings" msgstr "" diff --git a/langfilter/lang/C/messages.po b/langfilter/lang/C/messages.po index 92fa129c..e211d38b 100644 --- a/langfilter/lang/C/messages.po +++ b/langfilter/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 \n" "Language-Team: LANGUAGE \n" @@ -17,58 +17,58 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: langfilter.php:50 -msgid "Language Filter" -msgstr "" - -#: langfilter.php:51 +#: langfilter.php:49 msgid "" "This addon tries to identify the language posts are written in. If it does " "not match any language specified below, posts will be hidden by collapsing " "them." msgstr "" -#: langfilter.php:52 +#: langfilter.php:50 msgid "Use the language filter" msgstr "" -#: langfilter.php:53 +#: langfilter.php:51 msgid "Able to read" msgstr "" -#: langfilter.php:53 +#: langfilter.php:51 msgid "" "List of abbreviations (ISO 639-1 codes) for languages you speak, comma " "separated. For example \"de,it\"." msgstr "" -#: langfilter.php:54 +#: langfilter.php:52 msgid "Minimum confidence in language detection" msgstr "" -#: langfilter.php:54 +#: langfilter.php:52 msgid "" "Minimum confidence in language detection being correct, from 0 to 100. Posts " "will not be filtered when the confidence of language detection is below this " "percent value." msgstr "" -#: langfilter.php:55 +#: langfilter.php:53 msgid "Minimum length of message body" msgstr "" -#: langfilter.php:55 +#: langfilter.php:53 msgid "" "Minimum number of characters in message body for filter to be used. Posts " "shorter than this will not be filtered. Note: Language detection is " "unreliable for short content (<200 characters)." msgstr "" -#: langfilter.php:56 +#: langfilter.php:58 +msgid "Language Filter" +msgstr "" + +#: langfilter.php:60 msgid "Save Settings" msgstr "" -#: langfilter.php:187 +#: langfilter.php:193 #, php-format msgid "Filtered language: %s" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: libertree.php:37 +#: libertree.php:39 msgid "Post to libertree" msgstr "" -#: libertree.php:71 libertree.php:75 -msgid "libertree Export" -msgstr "" - -#: libertree.php:79 +#: libertree.php:60 msgid "Enable Libertree Post Addon" msgstr "" -#: libertree.php:84 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:89 +#: libertree.php:61 msgid "Libertree site URL" msgstr "" -#: libertree.php:94 +#: libertree.php:62 +msgid "Libertree API token" +msgstr "" + +#: libertree.php:63 msgid "Post to Libertree by default" msgstr "" -#: libertree.php:100 -msgid "Save Settings" +#: libertree.php:68 +msgid "Libertree Export" msgstr "" diff --git a/ljpost/lang/C/messages.po b/ljpost/lang/C/messages.po index 6ee7e27c..7f5417b7 100644 --- a/ljpost/lang/C/messages.po +++ b/ljpost/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 \n" "Language-Team: LANGUAGE \n" @@ -17,30 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ljpost.php:39 +#: ljpost.php:43 msgid "Post to LiveJournal" msgstr "" -#: ljpost.php:73 -msgid "LiveJournal Post Settings" -msgstr "" - -#: ljpost.php:75 +#: ljpost.php:63 msgid "Enable LiveJournal Post Addon" msgstr "" -#: ljpost.php:80 +#: ljpost.php:64 msgid "LiveJournal username" msgstr "" -#: ljpost.php:85 +#: ljpost.php:65 msgid "LiveJournal password" msgstr "" -#: ljpost.php:90 +#: ljpost.php:66 msgid "Post to LiveJournal by default" msgstr "" -#: ljpost.php:96 -msgid "Save Settings" +#: ljpost.php:71 +msgid "LiveJournal Export" msgstr "" diff --git a/mailstream/lang/C/messages.po b/mailstream/lang/C/messages.po index 1a5e293c..5115d8cb 100644 --- a/mailstream/lang/C/messages.po +++ b/mailstream/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 \n" "Language-Team: LANGUAGE \n" @@ -17,80 +17,80 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: mailstream.php:66 +#: mailstream.php:77 msgid "From Address" msgstr "" -#: mailstream.php:68 +#: mailstream.php:79 msgid "Email address that stream items will appear to be from." msgstr "" -#: mailstream.php:71 mailstream.php:382 +#: mailstream.php:82 msgid "Save Settings" msgstr "" -#: mailstream.php:225 +#: mailstream.php:301 msgid "Re:" msgstr "" -#: mailstream.php:233 +#: mailstream.php:314 mailstream.php:317 msgid "Friendica post" msgstr "" -#: mailstream.php:236 +#: mailstream.php:320 msgid "Diaspora post" msgstr "" -#: mailstream.php:246 +#: mailstream.php:330 msgid "Feed item" msgstr "" -#: mailstream.php:249 +#: mailstream.php:333 msgid "Email" msgstr "" -#: mailstream.php:251 +#: mailstream.php:335 msgid "Friendica Item" msgstr "" -#: mailstream.php:296 +#: mailstream.php:404 msgid "Upstream" msgstr "" -#: mailstream.php:297 +#: mailstream.php:405 msgid "Local" msgstr "" -#: mailstream.php:364 +#: mailstream.php:481 msgid "Enabled" msgstr "" -#: mailstream.php:368 +#: mailstream.php:486 msgid "Email Address" msgstr "" -#: mailstream.php:370 +#: mailstream.php:488 msgid "Leave blank to use your account email address" msgstr "" -#: mailstream.php:373 +#: mailstream.php:492 msgid "Exclude Likes" msgstr "" -#: mailstream.php:375 +#: mailstream.php:494 msgid "Check this to omit mailing \"Like\" notifications" msgstr "" -#: mailstream.php:378 +#: mailstream.php:498 msgid "Attach Images" msgstr "" -#: mailstream.php:380 +#: mailstream.php:500 msgid "" "Download images in posts and attach them to the email. Useful for reading " "email while offline." msgstr "" -#: mailstream.php:381 +#: mailstream.php:507 msgid "Mail Stream Settings" msgstr "" diff --git a/markdown/lang/C/messages.po b/markdown/lang/C/messages.po index c8b8219c..33175204 100644 --- a/markdown/lang/C/messages.po +++ b/markdown/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 \n" "Language-Team: LANGUAGE \n" @@ -18,18 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: markdown.php:30 -msgid "Markdown" -msgstr "" - -#: markdown.php:31 msgid "Enable Markdown parsing" msgstr "" -#: markdown.php:31 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." +#: markdown.php:30 +msgid "If enabled, adds Markdown support to the Compose Post form." msgstr "" -#: markdown.php:32 -msgid "Save Settings" +#: markdown.php:35 +msgid "Markdown Settings" msgstr "" diff --git a/mathjax/lang/C/messages.po b/mathjax/lang/C/messages.po index 96d5e2c3..7063a192 100644 --- a/mathjax/lang/C/messages.po +++ b/mathjax/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 \n" "Language-Team: LANGUAGE \n" @@ -17,17 +17,13 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: mathjax.php:43 +#: mathjax.php:42 msgid "" "The MathJax addon renders mathematical formulae written using the LaTeX " "syntax surrounded by the usual $$ or an eqnarray block in the postings of " "your wall,network tab and private mail." msgstr "" -#: mathjax.php:44 +#: mathjax.php:43 msgid "Use the MathJax renderer" msgstr "" - -#: mathjax.php:45 -msgid "Save Settings" -msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: nsfw.php:68 nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:76 +#: nsfw.php:65 msgid "" "This addon searches for specified words/text in posts and collapses them. It " "can be used to filter content tagged with for instance #NSFW that may be " @@ -29,28 +25,28 @@ msgid "" "is also useful for hiding irrelevant or annoying content from direct view." msgstr "" -#: nsfw.php:77 +#: nsfw.php:66 msgid "Enable Content filter" msgstr "" -#: nsfw.php:80 +#: nsfw.php:67 msgid "Comma separated list of keywords to hide" msgstr "" -#: nsfw.php:84 -msgid "Save Settings" -msgstr "" - -#: nsfw.php:85 +#: nsfw.php:67 msgid "Use /expression/ to provide regular expressions" msgstr "" -#: nsfw.php:152 +#: nsfw.php:72 +msgid "Content Filter (NSFW and more)" +msgstr "" + +#: nsfw.php:140 #, php-format msgid "Filtered tag: %s" msgstr "" -#: nsfw.php:154 +#: nsfw.php:142 #, php-format msgid "Filtered word: %s" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: numfriends.php:59 -msgid "Numfriends Settings" -msgstr "" - -#: numfriends.php:61 +#: numfriends.php:55 msgid "How many contacts to display on profile sidebar" msgstr "" -#: numfriends.php:67 -msgid "Save Settings" +#: numfriends.php:60 +msgid "Numfriends Settings" msgstr "" diff --git a/opmlexport/lang/C/messages.po b/opmlexport/lang/C/messages.po new file mode 100644 index 00000000..fe485540 --- /dev/null +++ b/opmlexport/lang/C/messages.po @@ -0,0 +1,26 @@ +# ADDON opmlexport +# Copyright (C) +# This file is distributed under the same license as the Friendica opmlexport addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \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 \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: opmlexport.php:79 +msgid "OPML Export" +msgstr "" + +#: opmlexport.php:80 +msgid "Export RSS/Atom contacts" +msgstr "" diff --git a/planets/lang/C/messages.po b/planets/lang/C/messages.po index f69141db..e09be45a 100644 --- a/planets/lang/C/messages.po +++ b/planets/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 \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: planets.php:131 planets.php:135 -msgid "Planets" -msgstr "" - -#: planets.php:139 -msgid "Planets Settings" -msgstr "" - -#: planets.php:141 +#: planets.php:126 msgid "Enable Planets Addon" msgstr "" -#: planets.php:147 -msgid "Save Settings" +#: planets.php:131 +msgid "Planets Settings" msgstr "" diff --git a/pumpio/lang/C/messages.po b/pumpio/lang/C/messages.po index a0d0a55d..baac56e6 100644 --- a/pumpio/lang/C/messages.po +++ b/pumpio/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:16+0000\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 \n" "Language-Team: LANGUAGE \n" @@ -17,76 +17,76 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: pumpio.php:54 +#: pumpio.php:57 msgid "Permission denied." msgstr "" -#: pumpio.php:149 +#: pumpio.php:152 #, php-format msgid "Unable to register the client at the pump.io server '%s'." msgstr "" -#: pumpio.php:189 +#: pumpio.php:192 msgid "You are now authenticated to pumpio." msgstr "" -#: pumpio.php:190 +#: pumpio.php:193 msgid "return to the connector page" msgstr "" -#: pumpio.php:210 +#: pumpio.php:213 msgid "Post to pumpio" msgstr "" -#: pumpio.php:251 pumpio.php:255 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:259 -msgid "pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:264 -msgid "pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:275 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:279 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:284 -msgid "Enable pump.io Post Addon" -msgstr "" - -#: pumpio.php:289 -msgid "Post to pump.io by default" -msgstr "" - -#: pumpio.php:294 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:299 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:304 -msgid "Check to delete this preset" -msgstr "" - -#: pumpio.php:314 +#: pumpio.php:237 msgid "Save Settings" msgstr "" -#: pumpio.php:983 +#: pumpio.php:239 +msgid "Delete this preset" +msgstr "" + +#: pumpio.php:245 +msgid "Authenticate your pump.io connection" +msgstr "" + +#: pumpio.php:252 +msgid "Pump.io servername (without \"http://\" or \"https://\" )" +msgstr "" + +#: pumpio.php:253 +msgid "Pump.io username (without the servername)" +msgstr "" + +#: pumpio.php:254 +msgid "Import the remote timeline" +msgstr "" + +#: pumpio.php:255 +msgid "Enable Pump.io Post Addon" +msgstr "" + +#: pumpio.php:256 +msgid "Post to Pump.io by default" +msgstr "" + +#: pumpio.php:257 +msgid "Should posts be public?" +msgstr "" + +#: pumpio.php:258 +msgid "Mirror all public posts" +msgstr "" + +#: pumpio.php:263 +msgid "Pump.io Import/Export/Mirror" +msgstr "" + +#: pumpio.php:920 msgid "status" msgstr "" -#: pumpio.php:987 +#: pumpio.php:924 #, php-format msgid "%1$s likes %2$s's %3$s" msgstr "" diff --git a/qcomment/lang/C/messages.po b/qcomment/lang/C/messages.po index a76eea1f..2c9ba17a 100644 --- a/qcomment/lang/C/messages.po +++ b/qcomment/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 \n" "Language-Team: LANGUAGE \n" @@ -17,32 +17,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: qcomment.php:42 +#: qcomment.php:45 msgid ":-)" msgstr "" -#: qcomment.php:42 +#: qcomment.php:45 msgid ":-(" msgstr "" -#: qcomment.php:42 +#: qcomment.php:45 msgid "lol" msgstr "" -#: qcomment.php:47 -msgid "Quick Comment Settings" -msgstr "" - -#: qcomment.php:48 +#: qcomment.php:49 msgid "" "Quick comments are found near comment boxes, sometimes hidden. Click them to " "provide simple replies." msgstr "" -#: qcomment.php:49 -msgid "Save Settings" -msgstr "" - #: qcomment.php:50 msgid "Enter quick comments, one per line" msgstr "" + +#: qcomment.php:55 +msgid "Quick Comment Settings" +msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" - -#: randplace.php:168 +#: randplace.php:161 msgid "Enable Randplace Addon" msgstr "" -#: randplace.php:174 -msgid "Save Settings" +#: randplace.php:166 +msgid "Randplace Settings" msgstr "" diff --git a/securemail/lang/C/messages.po b/securemail/lang/C/messages.po index 7cb81e20..b985ae83 100644 --- a/securemail/lang/C/messages.po +++ b/securemail/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 \n" "Language-Team: LANGUAGE \n" @@ -17,34 +17,34 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: securemail.php:51 -msgid "\"Secure Mail\" Settings" -msgstr "" - -#: securemail.php:52 -msgid "Save Settings" -msgstr "" - -#: securemail.php:53 securemail.php:80 -msgid "Save and send test" -msgstr "" - -#: securemail.php:54 +#: securemail.php:50 msgid "Enable Secure Mail" msgstr "" -#: securemail.php:55 +#: securemail.php:51 msgid "Public key" msgstr "" -#: securemail.php:55 +#: securemail.php:51 msgid "Your public PGP key, ascii armored format" msgstr "" -#: securemail.php:88 +#: securemail.php:56 +msgid "\"Secure Mail\" Settings" +msgstr "" + +#: securemail.php:59 +msgid "Save Settings" +msgstr "" + +#: securemail.php:60 +msgid "Save and send test" +msgstr "" + +#: securemail.php:93 msgid "Test email sent" msgstr "" -#: securemail.php:90 +#: securemail.php:95 msgid "There was an error sending the test email" msgstr "" diff --git a/showmore/lang/C/messages.po b/showmore/lang/C/messages.po index 2060eb1a..17b9b17c 100644 --- a/showmore/lang/C/messages.po +++ b/showmore/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 \n" "Language-Team: LANGUAGE \n" @@ -17,22 +17,18 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: showmore.php:35 showmore.php:39 -msgid "\"Show more\" Settings" -msgstr "" - -#: showmore.php:44 +#: showmore.php:37 msgid "Enable Show More" msgstr "" -#: showmore.php:47 -msgid "Cutting posts after how much characters" +#: showmore.php:38 +msgid "Cutting posts after how many characters" msgstr "" -#: showmore.php:51 -msgid "Save Settings" +#: showmore.php:43 +msgid "\"Show more\" Settings" msgstr "" -#: showmore.php:129 +#: showmore.php:119 msgid "show more" msgstr "" 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 \n" "Language-Team: LANGUAGE \n" @@ -18,23 +18,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: showmore_dyn.php:59 -msgid "Save Settings" -msgstr "" - -#: showmore_dyn.php:60 -msgid "Show More Dynamic" -msgstr "" - -#: showmore_dyn.php:61 msgid "Limit Height" msgstr "" -#: showmore_dyn.php:61 +#: showmore_dyn.php:59 msgid "" "The maximal pixel height of posts before the Show More link is added, 0 to " "disable" msgstr "" -#: showmore_dyn.php:69 +#: showmore_dyn.php:64 +msgid "Show More Dynamic" +msgstr "" + +#: showmore_dyn.php:72 msgid "Show more..." msgstr "" diff --git a/startpage/lang/C/messages.po b/startpage/lang/C/messages.po index 1636361e..8a011403 100644 --- a/startpage/lang/C/messages.po +++ b/startpage/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 \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,14 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: startpage.php:74 startpage.php:78 -msgid "Startpage" -msgstr "" - -#: startpage.php:81 +#: startpage.php:70 msgid "Home page to load after login - leave blank for profile wall" msgstr "" -#: startpage.php:84 -msgid "Examples: "network" or "notifications/system"" +#: startpage.php:70 +msgid "Examples: \"network\" or \"notifications/system\"" msgstr "" -#: startpage.php:88 -msgid "Save Settings" +#: startpage.php:75 +msgid "Startpage" msgstr "" diff --git a/statusnet/lang/C/messages.po b/statusnet/lang/C/messages.po index d5bce141..04d481be 100644 --- a/statusnet/lang/C/messages.po +++ b/statusnet/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 \n" "Language-Team: LANGUAGE \n" @@ -17,105 +17,30 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: statusnet.php:95 +#: statusnet.php:97 msgid "Post to GNU Social" msgstr "" -#: statusnet.php:146 +#: statusnet.php:148 msgid "" "Please contact your site administrator.
The provided API URL is not " "valid." msgstr "" -#: statusnet.php:175 +#: statusnet.php:176 msgid "We could not contact the GNU Social API with the Path you entered." msgstr "" -#: statusnet.php:248 statusnet.php:252 -msgid "GNU Social Import/Export/Mirror" -msgstr "" - -#: statusnet.php:267 -msgid "Globally Available GNU Social OAuthKeys" -msgstr "" - -#: statusnet.php:268 -msgid "" -"There are preconfigured OAuth key pairs for some GNU Social servers " -"available. If you are using one of them, please use these credentials. If " -"not feel free to connect to any other GNU Social instance (see below)." -msgstr "" - -#: statusnet.php:274 statusnet.php:291 statusnet.php:318 statusnet.php:325 -#: statusnet.php:372 statusnet.php:698 +#: statusnet.php:243 statusnet.php:656 msgid "Save Settings" msgstr "" -#: statusnet.php:276 -msgid "Provide your own OAuth Credentials" +#: statusnet.php:255 +#, php-format +msgid "Currently connected to:
%s" msgstr "" -#: statusnet.php:277 -msgid "" -"No consumer key pair for GNU Social found. Register your Friendica Account " -"as an desktop client on your GNU Social account, copy the consumer key pair " -"here and enter the API base root.
Before you register your own OAuth " -"key pair ask the administrator if there is already a key pair for this " -"Friendica installation at your favorited GNU Social installation." -msgstr "" - -#: statusnet.php:279 -msgid "OAuth Consumer Key" -msgstr "" - -#: statusnet.php:282 -msgid "OAuth Consumer Secret" -msgstr "" - -#: statusnet.php:285 statusnet.php:678 statusnet.php:690 -msgid "Base API Path (remember the trailing /)" -msgstr "" - -#: statusnet.php:310 -msgid "" -"To connect to your GNU Social account click the button below to get a " -"security code from GNU Social which you have to copy into the input box " -"below and submit the form. Only your public posts will be " -"posted to GNU Social." -msgstr "" - -#: statusnet.php:311 -msgid "Log in with GNU Social" -msgstr "" - -#: statusnet.php:313 -msgid "Copy the security code from GNU Social here" -msgstr "" - -#: statusnet.php:319 -msgid "Cancel Connection Process" -msgstr "" - -#: statusnet.php:321 -msgid "Current GNU Social API is" -msgstr "" - -#: statusnet.php:322 -msgid "Cancel GNU Social Connection" -msgstr "" - -#: statusnet.php:334 -msgid "Currently connected to: " -msgstr "" - -#: statusnet.php:336 -msgid "" -"If enabled all your public postings can be posted to the " -"associated GNU Social account. You can choose to do so by default (here) or " -"for every posting separately in the posting options when writing the entry." -msgstr "" - -#: statusnet.php:338 +#: statusnet.php:260 msgid "" "Note: Due your privacy settings (Hide your profile " "details from unknown viewers?) the link potentially included in public " @@ -123,47 +48,126 @@ msgid "" "informing the visitor that the access to your profile has been restricted." msgstr "" -#: statusnet.php:341 -msgid "Allow posting to GNU Social" -msgstr "" - -#: statusnet.php:344 -msgid "Send public postings to GNU Social by default" -msgstr "" - -#: statusnet.php:348 -msgid "" -"Mirror all posts from GNU Social that are no replies or repeated messages" -msgstr "" - -#: statusnet.php:354 -msgid "Import the remote timeline" -msgstr "" - -#: statusnet.php:358 -msgid "Disabled" -msgstr "" - -#: statusnet.php:359 -msgid "Full Timeline" -msgstr "" - -#: statusnet.php:360 -msgid "Only Mentions" -msgstr "" - -#: statusnet.php:369 +#: statusnet.php:263 msgid "Clear OAuth configuration" msgstr "" -#: statusnet.php:689 +#: statusnet.php:275 +msgid "Cancel GNU Social Connection" +msgstr "" + +#: statusnet.php:283 +msgid "Globally Available GNU Social OAuthKeys" +msgstr "" + +#: statusnet.php:284 +msgid "" +"There are preconfigured OAuth key pairs for some GNU Social servers " +"available. If you are using one of them, please use these credentials. If " +"not feel free to connect to any other GNU Social instance (see below)." +msgstr "" + +#: statusnet.php:285 +msgid "Provide your own OAuth Credentials" +msgstr "" + +#: statusnet.php:286 +msgid "" +"No consumer key pair for GNU Social found. Register your Friendica Account " +"as a desktop application on your GNU Social account, copy the consumer key " +"pair here and enter the API base root.
Before you register your own " +"OAuth key pair ask the administrator if there is already a key pair for this " +"Friendica installation at your favorite GNU Social installation." +msgstr "" + +#: statusnet.php:287 +msgid "" +"To connect to your GNU Social account click the button below to get a " +"security code from GNU Social which you have to copy into the input box " +"below and submit the form. Only your public posts will be " +"posted to GNU Social." +msgstr "" + +#: statusnet.php:288 +msgid "Log in with GNU Social" +msgstr "" + +#: statusnet.php:289 +msgid "Cancel Connection Process" +msgstr "" + +#: statusnet.php:290 +#, php-format +msgid "Current GNU Social API is: %s" +msgstr "" + +#: statusnet.php:307 +msgid "OAuth Consumer Key" +msgstr "" + +#: statusnet.php:308 +msgid "OAuth Consumer Secret" +msgstr "" + +#: statusnet.php:310 statusnet.php:636 statusnet.php:648 +msgid "Base API Path (remember the trailing /)" +msgstr "" + +#: statusnet.php:311 +msgid "Copy the security code from GNU Social here" +msgstr "" + +#: statusnet.php:313 +msgid "Allow posting to GNU Social" +msgstr "" + +#: statusnet.php:313 +msgid "" +"If enabled all your public postings can be posted to the " +"associated GNU Social account. You can choose to do so by default (here) or " +"for every posting separately in the posting options when writing the entry." +msgstr "" + +#: statusnet.php:314 +msgid "Post to GNU Social by default" +msgstr "" + +#: statusnet.php:315 +msgid "Mirror all public posts" +msgstr "" + +#: statusnet.php:316 +msgid "Automatically create contacts" +msgstr "" + +#: statusnet.php:317 +msgid "Import the remote timeline" +msgstr "" + +#: statusnet.php:318 +msgid "Disabled" +msgstr "" + +#: statusnet.php:319 +msgid "Full Timeline" +msgstr "" + +#: statusnet.php:320 +msgid "Only Mentions" +msgstr "" + +#: statusnet.php:326 +msgid "GNU Social Import/Export/Mirror" +msgstr "" + +#: statusnet.php:647 msgid "Site name" msgstr "" -#: statusnet.php:691 +#: statusnet.php:649 msgid "Consumer Secret" msgstr "" -#: statusnet.php:692 +#: statusnet.php:650 msgid "Consumer Key" msgstr "" diff --git a/superblock/lang/C/messages.po b/superblock/lang/C/messages.po index 50f07868..6c09db62 100644 --- a/superblock/lang/C/messages.po +++ b/superblock/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 \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,14 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: superblock.php:38 superblock.php:42 +#: superblock.php:35 +msgid "Comma separated profile URLs to block" +msgstr "" + +#: superblock.php:40 msgid "Superblock" msgstr "" -#: superblock.php:45 -msgid "Comma separated profile URLS to block" -msgstr "" - -#: superblock.php:49 -msgid "Save Settings" -msgstr "" - -#: superblock.php:138 +#: superblock.php:129 msgid "Block Completely" msgstr "" diff --git a/tumblr/lang/C/messages.po b/tumblr/lang/C/messages.po index 22292f37..83434406 100644 --- a/tumblr/lang/C/messages.po +++ b/tumblr/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:15+0000\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 \n" "Language-Team: LANGUAGE \n" @@ -17,54 +17,54 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: tumblr.php:40 +#: tumblr.php:39 msgid "Permission denied." msgstr "" -#: tumblr.php:70 tumblr.php:284 +#: tumblr.php:69 msgid "Save Settings" msgstr "" -#: tumblr.php:72 +#: tumblr.php:71 msgid "Consumer Key" msgstr "" -#: tumblr.php:73 +#: tumblr.php:72 msgid "Consumer Secret" msgstr "" -#: tumblr.php:178 +#: tumblr.php:177 msgid "You are now authenticated to tumblr." msgstr "" -#: tumblr.php:179 +#: tumblr.php:178 msgid "return to the connector page" msgstr "" -#: tumblr.php:195 +#: tumblr.php:194 msgid "Post to Tumblr" msgstr "" -#: tumblr.php:225 tumblr.php:229 -msgid "Tumblr Export" +#: tumblr.php:225 +msgid "Post to page:" msgstr "" -#: tumblr.php:233 +#: tumblr.php:231 msgid "(Re-)Authenticate your tumblr page" msgstr "" +#: tumblr.php:232 +msgid "You are not authenticated to tumblr" +msgstr "" + #: tumblr.php:237 msgid "Enable Tumblr Post Addon" msgstr "" -#: tumblr.php:243 +#: tumblr.php:238 msgid "Post to Tumblr by default" msgstr "" -#: tumblr.php:264 -msgid "Post to page:" -msgstr "" - -#: tumblr.php:278 -msgid "You are not authenticated to tumblr" +#: tumblr.php:244 +msgid "Tumblr Export" msgstr "" diff --git a/twitter/lang/C/messages.po b/twitter/lang/C/messages.po index d943b4f1..1154c1c9 100644 --- a/twitter/lang/C/messages.po +++ b/twitter/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-23 18:33-0500\n" +"POT-Creation-Date: 2021-11-27 10:25-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,17 +27,13 @@ msgid "" "one." msgstr "" -#: twitter.php:318 twitter.php:322 -msgid "Twitter Import/Export/Mirror" -msgstr "" - -#: twitter.php:329 +#: twitter.php:321 msgid "" "No consumer key pair for Twitter found. Please contact your site " "administrator." msgstr "" -#: twitter.php:341 +#: twitter.php:334 msgid "" "At this Friendica instance the Twitter addon was enabled but you have not " "yet connected your account to your Twitter account. To do so click the " @@ -46,42 +42,26 @@ msgid "" "be posted to Twitter." msgstr "" -#: twitter.php:342 +#: twitter.php:335 msgid "Log in with Twitter" msgstr "" -#: twitter.php:344 +#: twitter.php:337 msgid "Copy the PIN from Twitter here" msgstr "" -#: twitter.php:349 twitter.php:404 twitter.php:924 -msgid "Save Settings" -msgstr "" - -#: twitter.php:351 twitter.php:406 +#: twitter.php:345 twitter.php:388 msgid "An error occured: " msgstr "" -#: twitter.php:368 -msgid "Currently connected to: " -msgstr "" - -#: twitter.php:369 twitter.php:379 -msgid "Disconnect" -msgstr "" - -#: twitter.php:386 -msgid "Allow posting to Twitter" -msgstr "" - -#: twitter.php:386 +#: twitter.php:359 +#, php-format msgid "" -"If enabled all your public postings can be posted to the " -"associated Twitter account. You can choose to do so by default (here) or for " -"every posting separately in the posting options when writing the entry." +"Currently connected to: %1$s" msgstr "" -#: twitter.php:389 +#: twitter.php:365 msgid "" "Note: Due to your privacy settings (Hide your profile " "details from unknown viewers?) the link potentially included in public " @@ -89,23 +69,42 @@ msgid "" "the visitor that the access to your profile has been restricted." msgstr "" -#: twitter.php:392 +#: twitter.php:372 +msgid "Invalid Twitter info" +msgstr "" + +#: twitter.php:373 +msgid "Disconnect" +msgstr "" + +#: twitter.php:378 +msgid "Allow posting to Twitter" +msgstr "" + +#: twitter.php:378 +msgid "" +"If enabled all your public postings can be posted to the " +"associated Twitter account. You can choose to do so by default (here) or for " +"every posting separately in the posting options when writing the entry." +msgstr "" + +#: twitter.php:379 msgid "Send public postings to Twitter by default" msgstr "" -#: twitter.php:395 +#: twitter.php:380 msgid "Mirror all posts from twitter that are no replies" msgstr "" -#: twitter.php:398 +#: twitter.php:381 msgid "Import the remote timeline" msgstr "" -#: twitter.php:401 +#: twitter.php:382 msgid "Automatically create contacts" msgstr "" -#: twitter.php:401 +#: twitter.php:382 msgid "" "This will automatically create a contact in Friendica as soon as you receive " "a message from an existing contact via the Twitter network. If you do not " @@ -113,25 +112,33 @@ msgid "" "from whom you would like to see posts here." msgstr "" -#: twitter.php:557 +#: twitter.php:395 +msgid "Twitter Import/Export/Mirror" +msgstr "" + +#: twitter.php:547 msgid "" "Please connect a Twitter account in your Social Network settings to import " "Twitter posts." msgstr "" -#: twitter.php:564 +#: twitter.php:554 msgid "Twitter post not found." msgstr "" -#: twitter.php:926 +#: twitter.php:914 +msgid "Save Settings" +msgstr "" + +#: twitter.php:916 msgid "Consumer key" msgstr "" -#: twitter.php:927 +#: twitter.php:917 msgid "Consumer secret" msgstr "" -#: twitter.php:1123 +#: twitter.php:1113 #, php-format msgid "%s on Twitter" msgstr "" diff --git a/windowsphonepush/lang/C/messages.po b/windowsphonepush/lang/C/messages.po index 0e0cf1f2..819735ce 100644 --- a/windowsphonepush/lang/C/messages.po +++ b/windowsphonepush/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-25 13:16+0000\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 \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,18 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: windowsphonepush.php:108 -msgid "WindowsPhonePush Settings" -msgstr "" - -#: windowsphonepush.php:111 +#: windowsphonepush.php:102 msgid "Enable WindowsPhonePush Addon" msgstr "" -#: windowsphonepush.php:116 +#: windowsphonepush.php:103 msgid "Push text of new item" msgstr "" -#: windowsphonepush.php:121 -msgid "Save Settings" +#: windowsphonepush.php:104 +msgid "Device URL" +msgstr "" + +#: windowsphonepush.php:109 +msgid "WindowsPhonePush Settings" msgstr "" diff --git a/wppost/lang/C/messages.po b/wppost/lang/C/messages.po index cc3ed548..fea16eee 100644 --- a/wppost/lang/C/messages.po +++ b/wppost/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:16+0100\n" +"POT-Creation-Date: 2021-11-21 19:18-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,56 +17,52 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: wppost.php:39 +#: wppost.php:41 msgid "Post to Wordpress" msgstr "" -#: wppost.php:80 wppost.php:84 -msgid "Wordpress Export" +#: wppost.php:65 +msgid "Enable Wordpress Post Addon" msgstr "" -#: wppost.php:87 -msgid "Enable WordPress Post Addon" +#: wppost.php:66 +msgid "Wordpress username" msgstr "" -#: wppost.php:93 -msgid "WordPress username" +#: wppost.php:67 +msgid "Wordpress password" msgstr "" -#: wppost.php:98 -msgid "WordPress password" -msgstr "" - -#: wppost.php:103 +#: wppost.php:68 msgid "WordPress API URL" msgstr "" -#: wppost.php:108 -msgid "Post to WordPress by default" +#: wppost.php:69 +msgid "Post to Wordpress by default" msgstr "" -#: wppost.php:114 +#: wppost.php:70 msgid "Provide a backlink to the Friendica post" msgstr "" -#: wppost.php:119 +#: wppost.php:71 msgid "" "Text for the backlink, e.g. Read the original post and comment stream on " "Friendica." msgstr "" -#: wppost.php:124 +#: wppost.php:72 msgid "Don't post messages that are too short" msgstr "" -#: wppost.php:131 -msgid "Save Settings" +#: wppost.php:77 +msgid "Wordpress Export" msgstr "" -#: wppost.php:231 +#: wppost.php:182 msgid "Read the orig­i­nal post and com­ment stream on Friendica" msgstr "" -#: wppost.php:289 +#: wppost.php:240 msgid "Post from Friendica" msgstr "" -- 2.43.5 From f039a07ff939b5308aa6dc354528e5bfb0e73ae4 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 3 Dec 2021 07:31:53 +0100 Subject: [PATCH 05/21] =?UTF-8?q?twitter=20addon=20HU=20translations=20upd?= =?UTF-8?q?ated=20THX=20Bal=C3=A1zs=20=C3=9Ar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twitter/lang/hu/messages.po | 64 +++++++++++++++++++++---------------- twitter/lang/hu/strings.php | 4 ++- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/twitter/lang/hu/messages.po b/twitter/lang/hu/messages.po index 7d6000eb..80a65847 100644 --- a/twitter/lang/hu/messages.po +++ b/twitter/lang/hu/messages.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:16+0100\n" -"PO-Revision-Date: 2021-03-27 00:57+0000\n" +"POT-Creation-Date: 2021-11-23 18:33-0500\n" +"PO-Revision-Date: 2021-12-03 00:08+0000\n" "Last-Translator: Balázs Úr\n" "Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n" "MIME-Version: 1.0\n" @@ -19,27 +19,27 @@ msgstr "" "Language: hu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: twitter.php:189 +#: twitter.php:213 msgid "Post to Twitter" msgstr "Beküldés a Twitterre" -#: twitter.php:234 +#: twitter.php:258 msgid "" "You submitted an empty PIN, please Sign In with Twitter again to get a new " "one." msgstr "Üres PIN-kódot küldött be. Jelentkezzen be a Twitter használatával újra, hogy egy újat kapjon." -#: twitter.php:291 twitter.php:295 +#: twitter.php:318 twitter.php:322 msgid "Twitter Import/Export/Mirror" msgstr "Twitter importálás, exportálás vagy tükrözés" -#: twitter.php:302 +#: twitter.php:329 msgid "" "No consumer key pair for Twitter found. Please contact your site " "administrator." msgstr "Nem találhatók felhasználói kulcspárok a Twitterhez. Vegye fel a kapcsolatot az oldal adminisztrátorával." -#: twitter.php:314 +#: twitter.php:341 msgid "" "At this Friendica instance the Twitter addon was enabled but you have not " "yet connected your account to your Twitter account. To do so click the " @@ -48,42 +48,42 @@ msgid "" " be posted to Twitter." msgstr "Ennél a Friendica példánynál a Twitter bővítmény engedélyezve lett, de még nem kapcsolta hozzá a fiókját a Twitter-fiókjához. Ehhez kattintson a lenti gombra, hogy kapjon egy PIN-kódot a Twittertől, amelyet a lenti beviteli mezőbe kell bemásolnia, majd el kell küldenie az űrlapot. Csak a nyilvános bejegyzései lesznek beküldve a Twitterre." -#: twitter.php:315 +#: twitter.php:342 msgid "Log in with Twitter" msgstr "Bejelentkezés Twitter használatával" -#: twitter.php:317 +#: twitter.php:344 msgid "Copy the PIN from Twitter here" msgstr "Másolja be ide a Twittertől kapott PIN-kódot" -#: twitter.php:322 twitter.php:377 twitter.php:768 +#: twitter.php:349 twitter.php:404 twitter.php:924 msgid "Save Settings" msgstr "Beállítások mentése" -#: twitter.php:324 twitter.php:379 +#: twitter.php:351 twitter.php:406 msgid "An error occured: " msgstr "Hiba történt: " -#: twitter.php:341 +#: twitter.php:368 msgid "Currently connected to: " msgstr "Jelenleg ehhez van kapcsolódva: " -#: twitter.php:342 twitter.php:352 +#: twitter.php:369 twitter.php:379 msgid "Disconnect" msgstr "Leválasztás" -#: twitter.php:359 +#: twitter.php:386 msgid "Allow posting to Twitter" msgstr "Beküldés engedélyezése a Twitterre" -#: twitter.php:359 +#: twitter.php:386 msgid "" "If enabled all your public postings can be posted to the " "associated Twitter account. You can choose to do so by default (here) or for" " every posting separately in the posting options when writing the entry." msgstr "Ha engedélyezve van, akkor az összes nyilvános beküldés beküldhető a hozzárendelt Twitter-fiókba. Kiválaszthatja, hogy ezt alapértelmezetten szeretné-e (itt), vagy minden egyes beküldésnél különállóan a beküldési beállításokban, amikor megírja a bejegyzést." -#: twitter.php:362 +#: twitter.php:389 msgid "" "Note: Due to your privacy settings (Hide your profile " "details from unknown viewers?) the link potentially included in public " @@ -91,41 +91,49 @@ msgid "" "the visitor that the access to your profile has been restricted." msgstr "Megjegyzés: az adatvédelmi beállításai miatt (Elrejti a profilja részleteit az ismeretlen megtekintők elől?) a Twitterre továbbított nyilvános beküldésekben vélhetően tartalmazott hivatkozás a látogatót egy üres oldalra fogja vezetni, amely arról tájékoztatja a látogatót, hogy a profiljához való hozzáférés korlátozva lett." -#: twitter.php:365 +#: twitter.php:392 msgid "Send public postings to Twitter by default" msgstr "Nyilvános beküldések küldése a Twitterre alapértelmezetten" -#: twitter.php:368 +#: twitter.php:395 msgid "Mirror all posts from twitter that are no replies" msgstr "A Twittertől származó összes bejegyzés tükrözése, amelyek nem válaszok" -#: twitter.php:371 +#: twitter.php:398 msgid "Import the remote timeline" msgstr "A távoli idővonal importálása" -#: twitter.php:374 +#: twitter.php:401 msgid "Automatically create contacts" msgstr "Partnerek automatikus létrehozása" -#: twitter.php:374 +#: twitter.php:401 msgid "" "This will automatically create a contact in Friendica as soon as you receive" " a message from an existing contact via the Twitter network. If you do not " "enable this, you need to manually add those Twitter contacts in Friendica " -"from whom you would like to see posts here. However if enabled, you cannot " -"merely remove a twitter contact from the Friendica contact list, as it will " -"recreate this contact when they post again." -msgstr "Ez automatikusan létre fog hozni egy partnert a Friendicán, amint üzenetet fogad egy meglévő partnertől a Twitter hálózaton keresztül. Ha ezt nem engedélyezi, akkor kézzel kell hozzáadnia azokat a Twitter-partnereket a Friendicában, akiktől bejegyzéseket szeretne látni itt. Azonban ha engedélyezve van, akkor nem tudja egyszerűen eltávolítani a Twitter-partnert a Friendica partnerlistájából, mivel az újra létrehozza ezt a partnert, amikor ismét beküld valamit." +"from whom you would like to see posts here." +msgstr "Ez automatikusan létre fog hozni egy partnert a Friendicán, amint üzenetet fogad egy meglévő partnertől a Twitter hálózaton keresztül. Ha ezt nem engedélyezi, akkor kézzel kell hozzáadnia azokat a Twitter-partnereket a Friendicában, akiktől bejegyzéseket szeretne látni itt." -#: twitter.php:770 +#: twitter.php:557 +msgid "" +"Please connect a Twitter account in your Social Network settings to import " +"Twitter posts." +msgstr "Kapcsoljon hozzá egy Twitter-fiókot a közösségi hálózatok beállításában a Twitter-bejegyzések importálásához." + +#: twitter.php:564 +msgid "Twitter post not found." +msgstr "A Twitter-bejegyzés nem található." + +#: twitter.php:926 msgid "Consumer key" msgstr "Felhasználói kulcs" -#: twitter.php:771 +#: twitter.php:927 msgid "Consumer secret" msgstr "Felhasználói titok" -#: twitter.php:967 +#: twitter.php:1123 #, php-format msgid "%s on Twitter" msgstr "%s a Twitteren" diff --git a/twitter/lang/hu/strings.php b/twitter/lang/hu/strings.php index 15c802da..964b48bb 100644 --- a/twitter/lang/hu/strings.php +++ b/twitter/lang/hu/strings.php @@ -23,7 +23,9 @@ $a->strings['Send public postings to Twitter by default'] = 'Nyilvános beküld $a->strings['Mirror all posts from twitter that are no replies'] = 'A Twittertől származó összes bejegyzés tükrözése, amelyek nem válaszok'; $a->strings['Import the remote timeline'] = 'A távoli idővonal importálása'; $a->strings['Automatically create contacts'] = 'Partnerek automatikus létrehozása'; -$a->strings['This will automatically create a contact in Friendica as soon as you receive a message from an existing contact via the Twitter network. If you do not enable this, you need to manually add those Twitter contacts in Friendica from whom you would like to see posts here. However if enabled, you cannot merely remove a twitter contact from the Friendica contact list, as it will recreate this contact when they post again.'] = 'Ez automatikusan létre fog hozni egy partnert a Friendicán, amint üzenetet fogad egy meglévő partnertől a Twitter hálózaton keresztül. Ha ezt nem engedélyezi, akkor kézzel kell hozzáadnia azokat a Twitter-partnereket a Friendicában, akiktől bejegyzéseket szeretne látni itt. Azonban ha engedélyezve van, akkor nem tudja egyszerűen eltávolítani a Twitter-partnert a Friendica partnerlistájából, mivel az újra létrehozza ezt a partnert, amikor ismét beküld valamit.'; +$a->strings['This will automatically create a contact in Friendica as soon as you receive a message from an existing contact via the Twitter network. If you do not enable this, you need to manually add those Twitter contacts in Friendica from whom you would like to see posts here.'] = 'Ez automatikusan létre fog hozni egy partnert a Friendicán, amint üzenetet fogad egy meglévő partnertől a Twitter hálózaton keresztül. Ha ezt nem engedélyezi, akkor kézzel kell hozzáadnia azokat a Twitter-partnereket a Friendicában, akiktől bejegyzéseket szeretne látni itt.'; +$a->strings['Please connect a Twitter account in your Social Network settings to import Twitter posts.'] = 'Kapcsoljon hozzá egy Twitter-fiókot a közösségi hálózatok beállításában a Twitter-bejegyzések importálásához.'; +$a->strings['Twitter post not found.'] = 'A Twitter-bejegyzés nem található.'; $a->strings['Consumer key'] = 'Felhasználói kulcs'; $a->strings['Consumer secret'] = 'Felhasználói titok'; $a->strings['%s on Twitter'] = '%s a Twitteren'; -- 2.43.5 From fd29c1a0744451fc926a81f3b8421ee4db5c3e8f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 3 Dec 2021 07:35:02 -0500 Subject: [PATCH 06/21] [various] Replace references to UTC_TIMESTAMP in SQL queries with a DateTimeFormat generated parameter --- public_server/public_server.php | 16 ++++++++-------- testdrive/testdrive.php | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public_server/public_server.php b/public_server/public_server.php index 70aaacee..c6e3c364 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -50,8 +50,8 @@ function public_server_cron($a, $b) { Logger::notice("public_server: cron start"); - $users = DBA::selectToArray('user', [], ["`account_expires_on` < UTC_TIMESTAMP() + INTERVAL ? DAY AND - `account_expires_on` > ? AND `expire_notification_sent` <= ?", 5, DBA::NULL_DATETIME, DBA::NULL_DATETIME]); + $users = DBA::selectToArray('user', [], ["`account_expires_on` > ? AND `account_expires_on` < ? + AND `expire_notification_sent` <= ?", DBA::NULL_DATETIME, DateTimeFormat::utc('now + 5 days'), DBA::NULL_DATETIME]); foreach ($users as $rr) { DI::notify()->createFromArray([ 'type' => Notification\Type::SYSTEM, @@ -68,8 +68,8 @@ function public_server_cron($a, $b) $nologin = DI::config()->get('public_server', 'nologin', false); if ($nologin) { - $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` <= ? AND `register_date` < UTC_TIMESTAMP() - INTERVAL ? DAY AND `account_expires_on` <= ?", - DBA::NULL_DATETIME, $nologin, DBA::NULL_DATETIME]); + $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` <= ? AND `register_date` < ? AND `account_expires_on` <= ?", + DBA::NULL_DATETIME, DateTimeFormat::utc('now - ' . (int)$nologin . ' days'), DBA::NULL_DATETIME]); foreach ($users as $rr) { $fields = ['account_expires_on' => DateTimeFormat::utc('now +6 days')]; DBA::update('user', $fields, ['uid' => $rr['uid']]); @@ -78,8 +78,8 @@ function public_server_cron($a, $b) $flagusers = DI::config()->get('public_server', 'flagusers', false); if ($flagusers) { - $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` < UTC_TIMESTAMP() - INTERVAL ? DAY AND `account_expires_on` <= ? AND `page-flags` = ?", - $flagusers, DBA::NULL_DATETIME, User::PAGE_FLAGS_NORMAL]); + $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` < ? AND `account_expires_on` <= ? AND `page-flags` = ?", + DateTimeFormat::utc('now - ' . (int)$flagusers . ' days'), DBA::NULL_DATETIME, User::PAGE_FLAGS_NORMAL]); foreach ($users as $rr) { $fields = ['account_expires_on' => DateTimeFormat::utc('now +6 days')]; DBA::update('user', $fields, ['uid' => $rr['uid']]); @@ -89,8 +89,8 @@ function public_server_cron($a, $b) $flagposts = DI::config()->get('public_server', 'flagposts'); $flagpostsexpire = DI::config()->get('public_server', 'flagpostsexpire'); if ($flagposts && $flagpostsexpire) { - $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` < UTC_TIMESTAMP() - INTERVAL ? DAY AND `account_expires_on` <= ? AND NOT `expire` AND `page-flags` = ?", - $flagposts, DBA::NULL_DATETIME, User::PAGE_FLAGS_NORMAL]); + $users = DBA::selectToArray('user', [], ["NOT `account_expired` AND `login_date` < ? AND `account_expires_on` <= ? AND NOT `expire` AND `page-flags` = ?", + DateTimeFormat::utc('now - ' . (int)$flagposts . ' days'), DBA::NULL_DATETIME, User::PAGE_FLAGS_NORMAL]); foreach ($users as $rr) { DBA::update('user', ['expire' => $flagpostsexpire], ['uid' => $rr['uid']]); } diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 58bcd886..042edcc9 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -48,8 +48,8 @@ function testdrive_register_account($a,$b) { function testdrive_cron($a,$b) { - $users = DBA::selectToArray('user', [], ["`account_expires_on` < UTC_TIMESTAMP() + INTERVAL ? DAY AND `expire_notification_sent` <= ?", - 5, DBA::NULL_DATETIME]); + $users = DBA::selectToArray('user', [], ["`account_expires_on` < ? AND `expire_notification_sent` <= ?", + DateTimeFormat::utc('now + 5 days'), DBA::NULL_DATETIME]); foreach($users as $rr) { DI::notify()->createFromArray([ 'type' => Notification\Type::SYSTEM, @@ -63,7 +63,7 @@ function testdrive_cron($a,$b) { DBA::update('user', ['expire_notification_sent' => DateTimeFormat::utcNow()], ['uid' => $rr['uid']]); } - $users = DBA::selectToArray('user', [], ["`account_expired` AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL ? DAY", 5]); + $users = DBA::selectToArray('user', [], ["`account_expired` AND `account_expires_on` < ?", DateTimeFormat::utc('now - 5 days')]); foreach($users as $rr) { User::remove($rr['uid']); } -- 2.43.5 From dfdc47879ad70fba00b13659b3d2e5bc7e7df126 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 5 Dec 2021 10:38:10 +0100 Subject: [PATCH 07/21] jsupload addon DE translation updated --- js_upload/lang/de/messages.po | 34 ++++++++++++++++++---------------- js_upload/lang/de/strings.php | 4 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/js_upload/lang/de/messages.po b/js_upload/lang/de/messages.po index 5df835a2..6cbf8445 100644 --- a/js_upload/lang/de/messages.po +++ b/js_upload/lang/de/messages.po @@ -11,9 +11,9 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2021-02-01 20:21+0000\n" -"Last-Translator: Transifex Bot <>\n" +"POT-Creation-Date: 2021-03-23 23:53-0400\n" +"PO-Revision-Date: 2021-12-05 08:34+0000\n" +"Last-Translator: Tobias Diekershoff \n" "Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,38 +21,40 @@ msgstr "" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: js_upload.php:33 +#: js_upload.php:34 msgid "Select files for upload" msgstr "Dateien für den Upload auswählen" -#: js_upload.php:34 +#: js_upload.php:35 msgid "Drop files here to upload" msgstr "Ziehe die Dateien hierher, die du hochladen willst" -#: js_upload.php:35 +#: js_upload.php:36 msgid "Cancel" msgstr "Abbrechen" -#: js_upload.php:36 +#: js_upload.php:37 msgid "Failed" msgstr "Fehlgeschlagen" -#: js_upload.php:214 +#: js_upload.php:215 msgid "No files were uploaded." msgstr "Keine Dateien hochgeladen." -#: js_upload.php:220 +#: js_upload.php:221 msgid "Uploaded file is empty" msgstr "Hochgeladene Datei ist leer" -#: js_upload.php:232 -msgid "Image exceeds size limit of " -msgstr "Die Bildgröße übersteigt das Limit von " +#: js_upload.php:233 +#, php-format +msgid "Image exceeds size limit of %s" +msgstr "Bildgröße überschreitet das Limit von %s" -#: js_upload.php:246 -msgid "File has an invalid extension, it should be one of " -msgstr "Die Dateiextension ist nicht erlaubt, sie muss eine der folgenden sein " +#: js_upload.php:245 +#, php-format +msgid "File has an invalid extension, it should be one of %s." +msgstr "Die Dateiextension ist nicht erlaubt, sie muss eine der folgenden sein %s." -#: js_upload.php:257 +#: js_upload.php:256 msgid "Upload was cancelled, or server error encountered" msgstr "Upload abgebrochen oder Serverfehler aufgetreten" diff --git a/js_upload/lang/de/strings.php b/js_upload/lang/de/strings.php index 4282f3e3..8d8d518b 100644 --- a/js_upload/lang/de/strings.php +++ b/js_upload/lang/de/strings.php @@ -11,6 +11,6 @@ $a->strings['Cancel'] = 'Abbrechen'; $a->strings['Failed'] = 'Fehlgeschlagen'; $a->strings['No files were uploaded.'] = 'Keine Dateien hochgeladen.'; $a->strings['Uploaded file is empty'] = 'Hochgeladene Datei ist leer'; -$a->strings['Image exceeds size limit of '] = 'Die Bildgröße übersteigt das Limit von '; -$a->strings['File has an invalid extension, it should be one of '] = 'Die Dateiextension ist nicht erlaubt, sie muss eine der folgenden sein '; +$a->strings['Image exceeds size limit of %s'] = 'Bildgröße überschreitet das Limit von %s'; +$a->strings['File has an invalid extension, it should be one of %s.'] = 'Die Dateiextension ist nicht erlaubt, sie muss eine der folgenden sein %s.'; $a->strings['Upload was cancelled, or server error encountered'] = 'Upload abgebrochen oder Serverfehler aufgetreten'; -- 2.43.5 From 9f69e050696a551ef079c5e886fac389b8cb0a69 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 8 Dec 2021 20:00:45 +0000 Subject: [PATCH 08/21] Blockbot: add more bots to the allow and deny lists --- blockbot/blockbot.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index 0ff372c5..fd7528ff 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -75,7 +75,7 @@ function blockbot_init_1(App $a) { 'Google-Apps-Script; beanserver;', 'woorankreview/', 'Seekport Crawler;', 'AHC/', 'SkypeUriPreview Preview/', 'Semanticbot/', 'Embed PHP library', 'XoviOnpageCrawler;', 'GetHPinfo.com-Bot/', 'BoardReader Favicon Fetcher', 'Google-Adwords-Instant', 'newspaper/', - 'YurichevBot/', 'Crawling at Home Project']; + 'YurichevBot/', 'Crawling at Home Project', 'InfoTigerBot/']; if (!DI::config()->get('blockbot', 'good_crawlers')) { $agents = array_merge($agents, $good_agents); @@ -117,7 +117,8 @@ function blockbot_init_1(App $a) { 'Dispatch/', 'Ruby', 'Java/', 'libwww-perl/', 'Mastodon/', 'FeedlyApp/', 'lua-resty-http/', 'Tiny Tiny RSS/', 'Wget/', 'PostmanRuntime/', 'W3C_Validator/', 'NetNewsWire', 'FeedValidator/', 'theoldreader.com', 'axios/', - 'Paw/', 'PeerTube/', 'fedi.inex.dev', 'FediDB/', 'index.community crawler']; + 'Paw/', 'PeerTube/', 'fedi.inex.dev', 'FediDB/', 'index.community crawler', + 'Poduptime/', 'Slackbot-LinkExpanding']; if (DI::config()->get('blockbot', 'good_crawlers')) { $agents = array_merge($agents, $good_agents); -- 2.43.5 From eb967c54334445e0e950ae512f04e3430e620c6d Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 8 Dec 2021 20:08:14 +0000 Subject: [PATCH 09/21] Moved a bot to the good crawlers --- blockbot/blockbot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index fd7528ff..451aca29 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -50,7 +50,7 @@ function blockbot_init_1(App $a) { // List of "good" crawlers $good_agents = ['fediverse.space crawler', 'fediverse.network crawler', 'Active_Pods_CheckBot_3.0', 'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot', 'UptimeRobot/', - 'PTST/', 'Zabbix']; + 'PTST/', 'Zabbix', 'Poduptime/']; // List of known crawlers. $agents = ['SemrushBot', 's~feedly-nikon3', 'Qwantify/Bleriot/', 'ltx71', 'Sogou web spider/', @@ -118,7 +118,7 @@ function blockbot_init_1(App $a) { 'lua-resty-http/', 'Tiny Tiny RSS/', 'Wget/', 'PostmanRuntime/', 'W3C_Validator/', 'NetNewsWire', 'FeedValidator/', 'theoldreader.com', 'axios/', 'Paw/', 'PeerTube/', 'fedi.inex.dev', 'FediDB/', 'index.community crawler', - 'Poduptime/', 'Slackbot-LinkExpanding']; + 'Slackbot-LinkExpanding']; if (DI::config()->get('blockbot', 'good_crawlers')) { $agents = array_merge($agents, $good_agents); -- 2.43.5 From ce42fc43ceb4f7bef8b95359929820991c352fa1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 12 Dec 2021 05:57:21 +0000 Subject: [PATCH 10/21] Rendertime: Admin configuration added --- rendertime/lang/C/messages.po | 18 +++++++++++++++--- rendertime/rendertime.php | 21 +++++++++++++++++++++ rendertime/templates/admin.tpl | 3 +++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 rendertime/templates/admin.tpl diff --git a/rendertime/lang/C/messages.po b/rendertime/lang/C/messages.po index c96c596f..ab35dd16 100644 --- a/rendertime/lang/C/messages.po +++ b/rendertime/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-12-12 05:56+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: rendertime.php:36 +#: rendertime.php:30 +msgid "Save Settings" +msgstr "" + +#: rendertime.php:31 +msgid "Show callstack" +msgstr "" + +#: rendertime.php:32 +msgid "Minimal time" +msgstr "" + +#: rendertime.php:57 #, php-format msgid "" "Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " "%s, Total: %s" msgstr "" -#: rendertime.php:53 +#: rendertime.php:74 #, php-format msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" msgstr "" diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index 79476689..9d26697b 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -8,15 +8,36 @@ */ use Friendica\Core\Hook; +use Friendica\Core\Renderer; use Friendica\DI; function rendertime_install() { Hook::register('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); + DI::config()->set('system', 'profiler', true); +} + +function rendertime_uninstall() { + DI::config()->delete('system', 'profiler'); } function rendertime_init_1(&$a) { } +function rendertime_addon_admin(&$a, &$o) { + $t = Renderer::getMarkupTemplate("admin.tpl", "addon/rendertime/"); + + $o = Renderer::replaceMacros($t, [ + '$submit' => DI::l10n()->t('Save Settings'), + '$callstack' => ['callstack', DI::l10n()->t('Show callstack'), DI::config()->get('rendertime', 'callstack'), 'Show detailed performance measures in the callstack. When deactivated, only the summary will be displayed.'], + '$minimal_time' => ['minimal_time', DI::l10n()->t('Minimal time'), DI::config()->get('rendertime', 'minimal_time'), 'Minimal time that an activity needs to be listed in the callstack.'], + ]); +} + +function rendertime_addon_admin_post(&$a) { + DI::config()->set('rendertime', 'callstack', $_POST['callstack'] ?? false); + DI::config()->set('rendertime', 'minimal_time', $_POST['minimal_time'] ?? 0); +} + /** * @param Friendica\App $a * @param string $o diff --git a/rendertime/templates/admin.tpl b/rendertime/templates/admin.tpl new file mode 100644 index 00000000..e99072e7 --- /dev/null +++ b/rendertime/templates/admin.tpl @@ -0,0 +1,3 @@ +{{include file="field_checkbox.tpl" field=$callstack}} +{{include file="field_input.tpl" field=$minimal_time}} +
-- 2.43.5 From 2413c74b720192377bfbebd806ad9ba6ba160cdd Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 12 Dec 2021 23:08:52 +0100 Subject: [PATCH 11/21] Apply suggestions from code review Co-authored-by: Philipp --- rendertime/rendertime.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index 9d26697b..f433c3a4 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -28,8 +28,8 @@ function rendertime_addon_admin(&$a, &$o) { $o = Renderer::replaceMacros($t, [ '$submit' => DI::l10n()->t('Save Settings'), - '$callstack' => ['callstack', DI::l10n()->t('Show callstack'), DI::config()->get('rendertime', 'callstack'), 'Show detailed performance measures in the callstack. When deactivated, only the summary will be displayed.'], - '$minimal_time' => ['minimal_time', DI::l10n()->t('Minimal time'), DI::config()->get('rendertime', 'minimal_time'), 'Minimal time that an activity needs to be listed in the callstack.'], + '$callstack' => ['callstack', DI::l10n()->t('Show callstack'), DI::config()->get('rendertime', 'callstack'), DI::l10n()->t('Show detailed performance measures in the callstack. When deactivated, only the summary will be displayed.')], + '$minimal_time' => ['minimal_time', DI::l10n()->t('Minimal time'), DI::config()->get('rendertime', 'minimal_time'), DI::l10n()->t('Minimal time that an activity needs to be listed in the callstack.')], ]); } -- 2.43.5 From 207794143267bf1de15f60fd7e60885eccd1af94 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 12 Dec 2021 22:10:12 +0000 Subject: [PATCH 12/21] Updated messages.po --- rendertime/lang/C/messages.po | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rendertime/lang/C/messages.po b/rendertime/lang/C/messages.po index ab35dd16..7d482ca1 100644 --- a/rendertime/lang/C/messages.po +++ b/rendertime/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-12 05:56+0000\n" +"POT-Creation-Date: 2021-12-12 22:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,10 +25,20 @@ msgstr "" msgid "Show callstack" msgstr "" +#: rendertime.php:31 +msgid "" +"Show detailed performance measures in the callstack. When deactivated, only " +"the summary will be displayed." +msgstr "" + #: rendertime.php:32 msgid "Minimal time" msgstr "" +#: rendertime.php:32 +msgid "Minimal time that an activity needs to be listed in the callstack." +msgstr "" + #: rendertime.php:57 #, php-format msgid "" -- 2.43.5 From 8b5c8d78a468a4a4bc26b50e39a4642d3c57afa9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 13 Dec 2021 07:02:30 +0100 Subject: [PATCH 13/21] openstreetmap DE translation update --- openstreetmap/lang/de/messages.po | 59 +++++++++++++++++++++---------- openstreetmap/lang/de/strings.php | 12 ++++--- 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/openstreetmap/lang/de/messages.po b/openstreetmap/lang/de/messages.po index b346e525..693ed136 100644 --- a/openstreetmap/lang/de/messages.po +++ b/openstreetmap/lang/de/messages.po @@ -4,44 +4,65 @@ # # # Translators: -# Abrax , 2014 -# bavatar , 2014 +# Andreas H., 2014 +# Tobias Diekershoff , 2014 +# Tobias Diekershoff , 2021 +# Ulf Rompe , 2019 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2014-10-15 12:32+0000\n" -"Last-Translator: Abrax \n" -"Language-Team: German (http://www.transifex.com/projects/p/friendica/language/de/)\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2021-12-13 05:55+0000\n" +"Last-Translator: Tobias Diekershoff \n" +"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: openstreetmap.php:94 +#: openstreetmap.php:167 +msgid "View Larger" +msgstr "Vergrößern" + +#: openstreetmap.php:194 msgid "Submit" msgstr "Senden" -#: openstreetmap.php:95 +#: openstreetmap.php:195 msgid "Tile Server URL" msgstr "Die URL des Servers" -#: openstreetmap.php:95 +#: openstreetmap.php:195 msgid "" "A list of public tile servers" -msgstr "Eine Liste öffentlicher Tile Server" +"target=\"_blank\" rel=\"noopener noreferrer\">public tile servers" +msgstr "Eine Liste öffentlicher Tile-Server" -#: openstreetmap.php:96 +#: openstreetmap.php:196 +msgid "Nominatim (reverse geocoding) Server URL" +msgstr "Nominatim (umgekehrte Geokodierung) Server URL" + +#: openstreetmap.php:196 +msgid "" +"A list of Nominatim servers" +msgstr "Eine Liste von Nominatim Servern" + +#: openstreetmap.php:197 msgid "Default zoom" -msgstr "Standard Zoom" +msgstr "Standard-Zoom" -#: openstreetmap.php:96 -msgid "The default zoom level. (1:world, 18:highest)" -msgstr "Standard Zoo,level (1: Welt; 18: höchstes)" +#: openstreetmap.php:197 +msgid "" +"The default zoom level. (1:world, 18:highest, also depends on tile server)" +msgstr "Das voreingestellte Zoom Level (1 Welt, 18 höchstes; hängt auch vom Tile-Server ab)" -#: openstreetmap.php:104 -msgid "Settings updated." -msgstr "Einstellungen aktualisiert." +#: openstreetmap.php:198 +msgid "Include marker on map" +msgstr "Markierung auf der Karte anzeigen" + +#: openstreetmap.php:198 +msgid "Include a marker on the map." +msgstr "Eine Markierung auf der Karte anzeigen." diff --git a/openstreetmap/lang/de/strings.php b/openstreetmap/lang/de/strings.php index 5688c8d7..8430c6cc 100644 --- a/openstreetmap/lang/de/strings.php +++ b/openstreetmap/lang/de/strings.php @@ -5,9 +5,13 @@ function string_plural_select_de($n){ $n = intval($n); return intval($n != 1); }} +$a->strings['View Larger'] = 'Vergrößern'; $a->strings['Submit'] = 'Senden'; $a->strings['Tile Server URL'] = 'Die URL des Servers'; -$a->strings['A list of public tile servers'] = 'Eine Liste öffentlicher Tile Server'; -$a->strings['Default zoom'] = 'Standard Zoom'; -$a->strings['The default zoom level. (1:world, 18:highest)'] = 'Standard Zoo,level (1: Welt; 18: höchstes)'; -$a->strings['Settings updated.'] = 'Einstellungen aktualisiert.'; +$a->strings['A list of public tile servers'] = 'Eine Liste öffentlicher Tile-Server'; +$a->strings['Nominatim (reverse geocoding) Server URL'] = 'Nominatim (umgekehrte Geokodierung) Server URL'; +$a->strings['A list of Nominatim servers'] = 'Eine Liste von Nominatim Servern'; +$a->strings['Default zoom'] = 'Standard-Zoom'; +$a->strings['The default zoom level. (1:world, 18:highest, also depends on tile server)'] = 'Das voreingestellte Zoom Level (1 Welt, 18 höchstes; hängt auch vom Tile-Server ab)'; +$a->strings['Include marker on map'] = 'Markierung auf der Karte anzeigen'; +$a->strings['Include a marker on the map.'] = 'Eine Markierung auf der Karte anzeigen.'; -- 2.43.5 From 57db23c6416a2a503fe56787ce67a5ca9c2c82a4 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Dec 2021 06:16:31 +0000 Subject: [PATCH 14/21] Blockbot: Added translation to the setings descrption --- blockbot/blockbot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index 451aca29..5a9cc4e3 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -28,9 +28,9 @@ function blockbot_addon_admin(&$a, &$o) { $o = Renderer::replaceMacros($t, [ '$submit' => DI::l10n()->t('Save Settings'), - '$good_crawlers' => ['good_crawlers', DI::l10n()->t('Allow "good" crawlers'), DI::config()->get('blockbot', 'good_crawlers'), "Don't block fediverse crawlers, relay servers and other bots with good purposes."], - '$block_gab' => ['block_gab', DI::l10n()->t('Block GabSocial'), DI::config()->get('blockbot', 'block_gab'), 'Block the software GabSocial. This will block every access for that software. You can block dedicated gab instances in the blocklist settings in the admin section.'], - '$training' => ['training', DI::l10n()->t('Training mode'), DI::config()->get('blockbot', 'training'), "Activates the training mode. This is only meant for developing purposes. Don't activate this on a production machine. This can cut communication with some systems."], + '$good_crawlers' => ['good_crawlers', DI::l10n()->t('Allow "good" crawlers'), DI::config()->get('blockbot', 'good_crawlers'), DI::l10n()->t("Don't block fediverse crawlers, relay servers and other bots with good purposes.")], + '$block_gab' => ['block_gab', DI::l10n()->t('Block GabSocial'), DI::config()->get('blockbot', 'block_gab'), DI::l10n()->t('Block the software GabSocial. This will block every access for that software. You can block dedicated gab instances in the blocklist settings in the admin section.')], + '$training' => ['training', DI::l10n()->t('Training mode'), DI::config()->get('blockbot', 'training'), DI::l10n()->t("Activates the training mode. This is only meant for developing purposes. Don't activate this on a production machine. This can cut communication with some systems.")], ]); } -- 2.43.5 From 767d76682b2c78676996bf1b9517bde3e530aac9 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Dec 2021 06:19:14 +0000 Subject: [PATCH 15/21] messages.po updated --- blockbot/lang/C/messages.po | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/blockbot/lang/C/messages.po b/blockbot/lang/C/messages.po index 79f5d1b5..6f30e845 100644 --- a/blockbot/lang/C/messages.po +++ b/blockbot/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-12-13 06:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,18 +17,38 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: blockbot.php:29 +#: blockbot.php:30 msgid "Save Settings" msgstr "" -#: blockbot.php:30 +#: blockbot.php:31 msgid "Allow \"good\" crawlers" msgstr "" #: blockbot.php:31 +msgid "" +"Don't block fediverse crawlers, relay servers and other bots with good " +"purposes." +msgstr "" + +#: blockbot.php:32 msgid "Block GabSocial" msgstr "" #: blockbot.php:32 +msgid "" +"Block the software GabSocial. This will block every access for that " +"software. You can block dedicated gab instances in the blocklist settings in " +"the admin section." +msgstr "" + +#: blockbot.php:33 msgid "Training mode" msgstr "" + +#: blockbot.php:33 +msgid "" +"Activates the training mode. This is only meant for developing purposes. " +"Don't activate this on a production machine. This can cut communication with " +"some systems." +msgstr "" -- 2.43.5 From 9a3ca26fa95626c63f3cc8017d8d38ce4cc1c95f Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 13 Dec 2021 18:43:12 +0100 Subject: [PATCH 16/21] FR catavatar translations THX Walter Bulbazor --- catavatar/lang/fr/messages.po | 25 +++++++++++++++---------- catavatar/lang/fr/strings.php | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/catavatar/lang/fr/messages.po b/catavatar/lang/fr/messages.po index 3c4e03f6..56be5643 100644 --- a/catavatar/lang/fr/messages.po +++ b/catavatar/lang/fr/messages.po @@ -5,15 +5,16 @@ # # Translators: # Vladimir Núñez , 2019 +# Walter Bulbazor, 2021 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-13 09:35+0000\n" +"POT-Creation-Date: 2021-07-25 13:16+0000\n" "PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Last-Translator: Vladimir Núñez , 2019\n" +"Last-Translator: Walter Bulbazor, 2021\n" "Language-Team: French (https://www.transifex.com/Friendica/teams/12172/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,34 +22,38 @@ msgstr "" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: catavatar.php:60 +#: catavatar.php:49 msgid "Use Cat as Avatar" msgstr "Utiliser Chat comme avatar" -#: catavatar.php:61 +#: catavatar.php:50 msgid "More Random Cat!" msgstr "Autres Chats au hasard" -#: catavatar.php:62 +#: catavatar.php:51 msgid "Reset to email Cat" msgstr "Réinitialiser à Chat courriel" -#: catavatar.php:64 +#: catavatar.php:53 msgid "Cat Avatar Settings" msgstr "Paramètres de Chat avatar" -#: catavatar.php:100 +#: catavatar.php:54 +msgid "Set default profile avatar or randomize the cat." +msgstr "Mettre l'avatar par défaut ou tirer au sort le Chat." + +#: catavatar.php:72 msgid "The cat hadn't found itself." msgstr "Le Chat ne s'y est pas retrouvé" -#: catavatar.php:109 +#: catavatar.php:81 msgid "There was an error, the cat ran away." msgstr "Il y a eu une erreur et le chat s'est enfui" -#: catavatar.php:115 +#: catavatar.php:87 msgid "Profile Photos" msgstr "Photos de profil" -#: catavatar.php:130 +#: catavatar.php:97 msgid "Meow!" msgstr "Miaou !" diff --git a/catavatar/lang/fr/strings.php b/catavatar/lang/fr/strings.php index 4cb612d1..a3d432f6 100644 --- a/catavatar/lang/fr/strings.php +++ b/catavatar/lang/fr/strings.php @@ -9,6 +9,7 @@ $a->strings['Use Cat as Avatar'] = 'Utiliser Chat comme avatar'; $a->strings['More Random Cat!'] = 'Autres Chats au hasard'; $a->strings['Reset to email Cat'] = 'Réinitialiser à Chat courriel'; $a->strings['Cat Avatar Settings'] = 'Paramètres de Chat avatar'; +$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le Chat.'; $a->strings['The cat hadn\'t found itself.'] = 'Le Chat ne s\'y est pas retrouvé'; $a->strings['There was an error, the cat ran away.'] = 'Il y a eu une erreur et le chat s\'est enfui'; $a->strings['Profile Photos'] = 'Photos de profil'; -- 2.43.5 From 4abb880f571bb9e09218c99077cdf729546555e3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 22 Dec 2021 15:52:56 +0100 Subject: [PATCH 17/21] [smileybutton] generated missing lang/C/messages.po file --- smileybutton/lang/C/messages.po | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 smileybutton/lang/C/messages.po diff --git a/smileybutton/lang/C/messages.po b/smileybutton/lang/C/messages.po new file mode 100644 index 00000000..e69de29b -- 2.43.5 From dab21d0ba5c8d07e562e2f5ffcd2fcc58516edc3 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 30 Dec 2021 13:51:35 +0100 Subject: [PATCH 18/21] Replace Drone with Woodpecker --- .drone.yml | 282 ------------------------- .woodpecker/.code_standards_check.yml | 35 +++ .woodpecker/.continuous-deployment.yml | 126 +++++++++++ .woodpecker/.messages.po_check.yml | 35 +++ .woodpecker/.releaser.yml | 121 +++++++++++ 5 files changed, 317 insertions(+), 282 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker/.code_standards_check.yml create mode 100644 .woodpecker/.continuous-deployment.yml create mode 100644 .woodpecker/.messages.po_check.yml create mode 100644 .woodpecker/.releaser.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index b80d4344..00000000 --- a/.drone.yml +++ /dev/null @@ -1,282 +0,0 @@ ---- -kind: pipeline -type: docker -name: Check messages.po - -clone: - disable: true - -trigger: - event: - - pull_request - -steps: - - name: clone friendica base - image: alpine/git - commands: - - git clone https://github.com/friendica/friendica.git . - - git checkout $DRONE_COMMIT_BRANCH - - name: clone friendica addon - image: alpine/git - commands: - - git clone $DRONE_REPO_LINK addon - - cd addon/ - - git checkout $DRONE_COMMIT_BRANCH - - git fetch origin $DRONE_COMMIT_REF - - git merge $DRONE_COMMIT_SHA - - name: Run Xgettext for addons - image: friendicaci/transifex - commands: - - /xgettext-addon.sh - - name: Check update necessary - image: friendicaci/transifex - commands: - - /check-addons.sh ---- -kind: pipeline -type: docker -name: php-cs check - -clone: - disable: true - -trigger: - event: - - pull_request - -steps: - - name: Clone friendica base - image: alpine/git - commands: - - git clone https://github.com/friendica/friendica.git . - - git checkout $DRONE_COMMIT_BRANCH - - name: Clone friendica addon - image: alpine/git - commands: - - git clone $DRONE_REPO_LINK addon - - cd addon/ - - git checkout $DRONE_COMMIT_BRANCH - - git fetch origin $DRONE_COMMIT_REF - - git merge $DRONE_COMMIT_SHA - - name: Install dependencies - image: composer - commands: - - ./bin/composer.phar run cs:install - - name: Run coding standards check - image: friendicaci/php-cs - commands: - - cd addon/ - - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")" - - cd ../ - - /check-php-cs.sh ---- -kind: pipeline -type: docker -name: continuous-deployment - -trigger: - repo: - - friendica/friendica-addons - branch: - - develop - - 20*-rc - event: - - push - -node: - node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca - -clone: - disable: true - -steps: - - name: Clone friendica base - image: alpine/git - commands: - - git clone https://github.com/friendica/friendica.git . - - git checkout $DRONE_COMMIT_BRANCH - - name: Clone friendica addon - image: alpine/git - commands: - - git clone $DRONE_REPO_LINK addon - - cd addon/ - - git checkout $DRONE_COMMIT_BRANCH - - git fetch origin $DRONE_COMMIT_REF - - git merge $DRONE_COMMIT_SHA - - name: Create artifacts - image: debian - commands: - - apt-get update - - apt-get install bzip2 - - export VERSION="$(cat VERSION)" - - export RELEASE="friendica-addons-$VERSION" - - export ARTIFACT="$RELEASE.tar.gz" - - mkdir ./build - - # Create artifact for friendica-addons - - tar - --exclude='.tx' - --exclude='.git' - --exclude='.editorconfig' - --exclude='.gitattributes' - --exclude='.gitignore' - --exclude='.drone.yml' - --exclude='**/*/messages.po' - -cvzf ./build/$ARTIFACT addon/ - - # calculate SHA256 checksum - - cd ./build - - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" - - chmod 664 ./* - - ls -lh - - # output the sha256 sum for checking - - cat "$ARTIFACT.sum256" - - sha256sum "$ARTIFACT" - - name: Sign artifacts - image: plugins/gpgsign - settings: - key: - from_secret: gpg_key - passphrase: - from_secret: gpg_password - files: - - build/* - exclude: - - build/*.sum256 - detach_sign: true - - name: Upload artifacts - image: alpine - environment: - LFTP_HOST: - from_secret: sftp_host - LFTP_USER: - from_secret: sftp_user - LFTP_KEY: - from_secret: ssh_key - LFTP_PORT: "22" - LFTP_SOURCE: "build" - LFTP_TARGET: "/http" - commands: - - apk add lftp openssh openssl - - touch drone.key - - chmod 400 drone.key - - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key - - lftp -c " - set net:timeout 5; - set net:max-retries 2; - set net:reconnect-interval-base 5; - set sftp:auto-confirm true; - set sftp:connect-program 'ssh -q -a -x -i drone.key'; - connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT; - cd $LFTP_TARGET; - mput $LFTP_SOURCE/*; - " - - rm drone.key - -volumes: - - name: cache - host: - path: /tmp/drone-cache ---- -kind: pipeline -type: docker -name: release-deployment - -trigger: - repo: - - friendica/friendica-addons - branch: - - stable - event: - - tag - -node: - node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca - -clone: - disable: true - -steps: - - name: Clone friendica base - image: alpine/git - commands: - - git clone https://github.com/friendica/friendica.git . - - git checkout $DRONE_COMMIT_BRANCH - - name: Clone friendica addon - image: alpine/git - commands: - - git clone $DRONE_REPO_LINK addon - - cd addon/ - - git checkout $DRONE_COMMIT_BRANCH - - git fetch origin $DRONE_COMMIT_REF - - git merge $DRONE_COMMIT_SHA - - name: Create artifacts - image: debian - commands: - - apt-get update - - apt-get install bzip2 - - export VERSION="$(cat VERSION)" - - export RELEASE="friendica-addons-$VERSION" - - export ARTIFACT="$RELEASE.tar.gz" - - mkdir ./build - - # Create artifact for friendica-addons - - tar - --exclude='.tx' - --exclude='.git' - --exclude='.editorconfig' - --exclude='.gitattributes' - --exclude='.gitignore' - --exclude='.drone.yml' - --exclude='**/*/messages.po' - -cvzf ./build/$ARTIFACT addon/ - - # calculate SHA256 checksum - - cd ./build - - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" - - chmod 664 ./* - - ls -lh - - # output the sha256 sum for checking - - cat "$ARTIFACT.sum256" - - sha256sum "$ARTIFACT" - - name: Sign artifacts - image: plugins/gpgsign - settings: - key: - from_secret: gpg_key - passphrase: - from_secret: gpg_password - files: - - build/* - exclude: - - build/*.sum256 - detach_sign: true - - name: Upload artifacts - image: alpine - environment: - LFTP_HOST: - from_secret: sftp_host - LFTP_USER: - from_secret: sftp_user - LFTP_KEY: - from_secret: ssh_key - LFTP_PORT: "22" - LFTP_SOURCE: "build" - LFTP_TARGET: "/http" - commands: - - apk add lftp openssh openssl - - touch drone.key - - chmod 400 drone.key - - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key - - lftp -c " - set net:timeout 5; - set net:max-retries 2; - set net:reconnect-interval-base 5; - set sftp:auto-confirm true; - set sftp:connect-program 'ssh -q -a -x -i drone.key'; - connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT; - cd $LFTP_TARGET; - mput $LFTP_SOURCE/*; - " - - rm drone.key - -volumes: - - name: cache - host: - path: /tmp/drone-cache diff --git a/.woodpecker/.code_standards_check.yml b/.woodpecker/.code_standards_check.yml new file mode 100644 index 00000000..ba31f36b --- /dev/null +++ b/.woodpecker/.code_standards_check.yml @@ -0,0 +1,35 @@ +skip_clone: true + +pipeline: + clone_friendica_base: + image: alpine/git + commands: + - git clone https://github.com/friendica/friendica.git . + - git checkout $CI_COMMIT_BRANCH + when: + event: pull_request + clone_friendica_addon: + image: alpine/git + commands: + - git clone $CI_REPO_LINK addon + - cd addon/ + - git checkout $CI_COMMIT_BRANCH + - git fetch origin $CI_COMMIT_REF + - git merge $CI_COMMIT_SHA + when: + event: pull_request + composer_install: + image: composer + commands: + - ./bin/composer.phar run cs:install + when: + event: pull_request + check: + image: friendicaci/php-cs + commands: + - cd addon/ + - export CHANGED_FILES="$(git diff --name-status ${CI_PREV_COMMIT_SHA}..${CI_COMMIT_SHA} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")" + - cd ../ + - /check-php-cs.sh + when: + event: pull_request diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml new file mode 100644 index 00000000..2d3a43f1 --- /dev/null +++ b/.woodpecker/.continuous-deployment.yml @@ -0,0 +1,126 @@ +matrix: + include: + - PHP_MAJOR_VERSION: 7.4 + PHP_VERSION: 7.4.18 + +depends_on: + - code_standards_check + - messages.po_check + +platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca + +skip_clone: true + +pipeline: + clone_friendica_base: + image: alpine/git + commands: + - git clone https://github.com/friendica/friendica.git . + - git checkout $CI_COMMIT_BRANCH + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push + clone_friendica_addon: + image: alpine/git + commands: + - git clone $CI_REPO_LINK addon + - cd addon/ + - git checkout $CI_COMMIT_BRANCH + - git fetch origin $CI_COMMIT_REF + - git merge $CI_COMMIT_SHA + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push + composer_install: + image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} + commands: + - export COMPOSER_HOME=.composer + - composer validate + - composer install --no-dev --optimize-autoloader + volumes: + - /etc/hosts:/etc/hosts + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push + create_artifacts: + image: debian + commands: + - apt-get update + - apt-get install bzip2 + - export VERSION="$(cat VERSION)" + - export RELEASE="friendica-addons-$VERSION" + - export ARTIFACT="$RELEASE.tar.gz" + - mkdir ./build + - tar + --exclude='.tx' + --exclude='.git' + --exclude='.editorconfig' + --exclude='.gitattributes' + --exclude='.gitignore' + --exclude='.drone.yml' + --exclude='**/*/messages.po' + -cvzf ./build/$ARTIFACT addon/ + - cd ./build + - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" + - chmod 664 ./* + - ls -lh + - cat "$ARTIFACT.sum256" + - sha256sum "$ARTIFACT" + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push + sign_artifacts: + image: plugins/gpgsign + settings: + key: + from_secret: gpg_key + passphrase: + from_secret: gpg_password + files: + - build/* + exclude: + - build/*.sum256 + detach_sign: true + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push + upload_artifacts: + image: alpine + secrets: + - source: sftp_host + target: lftp_host + - source: sftp_user + target: lftp_user + - source: ssh_key + target: lftp_key + environment: + LFTP_PORT: "22" + LFTP_SOURCE: "build" + LFTP_TARGET: "/http" + volumes: + - /etc/hosts:/etc/hosts + commands: + - apk add lftp openssh openssl + - touch drone.key + - chmod 400 drone.key + - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key + - lftp -c " + set net:timeout 5; + set net:max-retries 2; + set net:reconnect-interval-base 5; + set sftp:auto-confirm true; + set sftp:connect-program 'ssh -q -a -x -i drone.key'; + connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT; + cd $LFTP_TARGET; + mput $LFTP_SOURCE/*; + " + - rm drone.key + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml new file mode 100644 index 00000000..d9012869 --- /dev/null +++ b/.woodpecker/.messages.po_check.yml @@ -0,0 +1,35 @@ +skip_clone: true + +branches: + exclude: [ stable ] + +pipeline: + clone_friendica_base: + image: alpine/git + commands: + - git clone https://github.com/friendica/friendica.git . + - git checkout $CI_COMMIT_BRANCH + when: + event: pull_request + clone_friendica_addon: + image: alpine/git + commands: + - git clone $CI_REPO_LINK addon + - cd addon/ + - git checkout $CI_COMMIT_BRANCH + - git fetch origin $CI_COMMIT_REF + - git merge $CI_COMMIT_SHA + when: + event: pull_request + build_xgettext: + image: friendicaci/transifex + commands: + - /xgettext-addon.sh + when: + event: pull_request + check: + image: friendicaci/transifex + commands: + - /check-addons.sh + when: + event: pull_request diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml new file mode 100644 index 00000000..0b2f79f5 --- /dev/null +++ b/.woodpecker/.releaser.yml @@ -0,0 +1,121 @@ +matrix: + include: + - PHP_MAJOR_VERSION: 7.4 + PHP_VERSION: 7.4.18 + +depends_on: + - code_standards_check + +platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca + +skip_clone: true + +pipeline: + clone_friendica_base: + image: alpine/git + commands: + - git clone https://github.com/friendica/friendica.git . + - git checkout $CI_COMMIT_BRANCH + when: + repo: friendica/friendica-addons + branch: stable + event: tag + clone_friendica_addon: + image: alpine/git + commands: + - git clone $CI_REPO_LINK addon + - cd addon/ + - git checkout $CI_COMMIT_BRANCH + - git fetch origin $CI_COMMIT_REF + - git merge $CI_COMMIT_SHA + when: + repo: friendica/friendica-addons + branch: stable + event: tag + composer_install: + image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} + commands: + - export COMPOSER_HOME=.composer + - composer validate + - composer install --no-dev --optimize-autoloader + volumes: + - /etc/hosts:/etc/hosts + when: + repo: friendica/friendica-addons + branch: stable + event: tag + create_artifacts: + image: debian + commands: + - apt-get update + - apt-get install bzip2 + - mkdir ./build + - export VERSION="$(cat VERSION)" + - export RELEASE="friendica-full-$VERSION" + - export ARTIFACT="$RELEASE.tar.gz" + - tar + --transform "s,^,$RELEASE/," + -X mods/release-list-exclude.txt + -T mods/release-list-include.txt + -cvzf ./build/$ARTIFACT + - cd ./build + - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" + - chmod 664 ./* + - ls -lh + - cat "$ARTIFACT.sum256" + - sha256sum "$ARTIFACT" + when: + repo: friendica/friendica-addons + branch: stable + event: tag + sign_artifacts: + image: plugins/gpgsign + settings: + key: + from_secret: gpg_key + passphrase: + from_secret: gpg_password + files: + - build/* + exclude: + - build/*.sum256 + detach_sign: true + when: + repo: friendica/friendica-addons + branch: stable + event: tag + upload_artifacts: + image: alpine + secrets: + - source: sftp_host + target: lftp_host + - source: sftp_user + target: lftp_user + - source: ssh_key + target: lftp_key + environment: + LFTP_PORT: "22" + LFTP_SOURCE: "build" + LFTP_TARGET: "/http" + volumes: + - /etc/hosts:/etc/hosts + commands: + - apk add lftp openssh openssl + - touch drone.key + - chmod 400 drone.key + - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key + - lftp -c " + set net:timeout 5; + set net:max-retries 2; + set net:reconnect-interval-base 5; + set sftp:auto-confirm true; + set sftp:connect-program 'ssh -q -a -x -i drone.key'; + connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT; + cd $LFTP_TARGET; + mput $LFTP_SOURCE/*; + " + - rm drone.key + when: + repo: friendica/friendica-addons + branch: stable + event: tag -- 2.43.5 From 05f7e4264ce899e9c759937805d71171f4afaf60 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 30 Dec 2021 19:26:35 +0100 Subject: [PATCH 19/21] Fixup woodpecker --- .woodpecker/.code_standards_check.yml | 27 ++++++++++++++++++++++++++ .woodpecker/.continuous-deployment.yml | 21 +++++++++++++++----- .woodpecker/.messages.po_check.yml | 6 +++--- .woodpecker/.releaser.yml | 22 ++++++++++++++++----- 4 files changed, 63 insertions(+), 13 deletions(-) diff --git a/.woodpecker/.code_standards_check.yml b/.woodpecker/.code_standards_check.yml index ba31f36b..df81376f 100644 --- a/.woodpecker/.code_standards_check.yml +++ b/.woodpecker/.code_standards_check.yml @@ -18,12 +18,39 @@ pipeline: - git merge $CI_COMMIT_SHA when: event: pull_request + restore_cache: + image: meltwater/drone-cache:dev + settings: + backend: "filesystem" + restore: true + cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}' + archive_format: "gzip" + mount: + - '.composer' + volumes: + - /tmp/drone-cache:/tmp/cache + when: + event: pull_request composer_install: image: composer commands: + - export COMPOSER_HOME=.composer - ./bin/composer.phar run cs:install when: event: pull_request + rebuild_cache: + image: meltwater/drone-cache:dev + settings: + backend: "filesystem" + rebuild: true + cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}' + archive_format: "gzip" + mount: + - '.composer' + volumes: + - /tmp/drone-cache:/tmp/cache + when: + event: pull_request check: image: friendicaci/php-cs commands: diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml index 2d3a43f1..ae720e54 100644 --- a/.woodpecker/.continuous-deployment.yml +++ b/.woodpecker/.continuous-deployment.yml @@ -3,10 +3,6 @@ matrix: - PHP_MAJOR_VERSION: 7.4 PHP_VERSION: 7.4.18 -depends_on: - - code_standards_check - - messages.po_check - platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca skip_clone: true @@ -33,6 +29,21 @@ pipeline: repo: friendica/friendica-addons branch: [ develop, '*-rc' ] event: push + restore_cache: + image: meltwater/drone-cache:dev + settings: + backend: "filesystem" + restore: true + cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}" + archive_format: "gzip" + mount: + - '.composer' + volumes: + - /tmp/drone-cache:/tmp/cache + when: + repo: friendica/friendica-addons + branch: [ develop, '*-rc' ] + event: push composer_install: image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} commands: @@ -50,10 +61,10 @@ pipeline: commands: - apt-get update - apt-get install bzip2 + - mkdir ./build - export VERSION="$(cat VERSION)" - export RELEASE="friendica-addons-$VERSION" - export ARTIFACT="$RELEASE.tar.gz" - - mkdir ./build - tar --exclude='.tx' --exclude='.git' diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml index d9012869..c04c663d 100644 --- a/.woodpecker/.messages.po_check.yml +++ b/.woodpecker/.messages.po_check.yml @@ -1,8 +1,5 @@ skip_clone: true -branches: - exclude: [ stable ] - pipeline: clone_friendica_base: image: alpine/git @@ -33,3 +30,6 @@ pipeline: - /check-addons.sh when: event: pull_request + +branches: + exclude: [ stable ] \ No newline at end of file diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml index 0b2f79f5..112507c4 100644 --- a/.woodpecker/.releaser.yml +++ b/.woodpecker/.releaser.yml @@ -3,9 +3,6 @@ matrix: - PHP_MAJOR_VERSION: 7.4 PHP_VERSION: 7.4.18 -depends_on: - - code_standards_check - platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca skip_clone: true @@ -32,18 +29,33 @@ pipeline: repo: friendica/friendica-addons branch: stable event: tag + restore_cache: + image: meltwater/drone-cache:dev + settings: + backend: "filesystem" + restore: true + cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}" + archive_format: "gzip" + mount: + - '.composer' + volumes: + - /tmp/drone-cache:/tmp/cache + when: + repo: friendica/friendica-addons + branch: stable + event: tag composer_install: image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} commands: - export COMPOSER_HOME=.composer - composer validate - composer install --no-dev --optimize-autoloader - volumes: - - /etc/hosts:/etc/hosts when: repo: friendica/friendica-addons branch: stable event: tag + volumes: + - /etc/hosts:/etc/hosts create_artifacts: image: debian commands: -- 2.43.5 From 61c614c4da07e009110d78d828c1277a942ecdd2 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 30 Dec 2021 19:28:50 +0100 Subject: [PATCH 20/21] Fixup woodpecker --- .woodpecker/.messages.po_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml index c04c663d..93651b6b 100644 --- a/.woodpecker/.messages.po_check.yml +++ b/.woodpecker/.messages.po_check.yml @@ -32,4 +32,4 @@ pipeline: event: pull_request branches: - exclude: [ stable ] \ No newline at end of file + exclude: [ stable ] -- 2.43.5 From 327bfcb2b59a9d3e2a99b8b2f41185629197da47 Mon Sep 17 00:00:00 2001 From: Gidi Kroon Date: Fri, 7 Jan 2022 02:14:24 +0100 Subject: [PATCH 21/21] Add name check for webdav configuration options The webdav_storage addon should check whether it should provide its config options and its instance based on the provided `$data['name']`. Not doing this will override the configuration and instance of another storage add-on. --- webdav_storage/webdav_storage.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webdav_storage/webdav_storage.php b/webdav_storage/webdav_storage.php index 7686ca9f..a93caeff 100644 --- a/webdav_storage/webdav_storage.php +++ b/webdav_storage/webdav_storage.php @@ -26,11 +26,15 @@ function webdav_storage_uninstall() function webdav_storage_instance(App $a, array &$data) { - $config = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient()); - $data['storage'] = new WebDav($config->getUrl(), $config->getAuthOptions(), DI::httpClient(), DI::logger()); + if ($data['name'] == WebDav::getName()) { + $config = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient()); + $data['storage'] = new WebDav($config->getUrl(), $config->getAuthOptions(), DI::httpClient(), DI::logger()); + } } function webdav_storage_config(App $a, array &$data) { - $data['storage_config'] = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient()); + if ($data['name'] == WebDav::getName()) { + $data['storage_config'] = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient()); + } } -- 2.43.5