From be5848fd4fa280e5a4606fef25669974414547a5 Mon Sep 17 00:00:00 2001 From: maTh Date: Tue, 15 Mar 2022 22:58:30 +0100 Subject: Improved: Sharing/Integration configuration (#4269) * stick plus button to select list * HTML improved very much * drag and drop improved * add URL button * fix remove button behavior * prepare for PR#4238 * improve length of inputs * First draft of documentation of the sharing services * new config option: depricated * i18n for depricated text * Doc: Blogotext depricated to 2023 * dropdown menu with config link and depricated sign * Update entry_bottom.phtml * Update 08_sharing_services.md * Update template.rtl.css * Typo Deprecated/Depricated * typo * updated the documentation comment * Update shares.php * Update app/i18n/fr/conf.php Co-authored-by: Alexandre Alapetite * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite * Documentation: services from #4270 Co-authored-by: Alexandre Alapetite --- app/Models/Share.php | 14 ++- app/i18n/cz/conf.php | 1 + app/i18n/de/conf.php | 1 + app/i18n/en-us/conf.php | 1 + app/i18n/en/conf.php | 1 + app/i18n/es/conf.php | 1 + app/i18n/fr/conf.php | 1 + app/i18n/he/conf.php | 1 + app/i18n/it/conf.php | 1 + app/i18n/ja/conf.php | 1 + app/i18n/ko/conf.php | 1 + app/i18n/nl/conf.php | 1 + app/i18n/oc/conf.php | 1 + app/i18n/pl/conf.php | 1 + app/i18n/pt-br/conf.php | 1 + app/i18n/ru/conf.php | 1 + app/i18n/sk/conf.php | 1 + app/i18n/tr/conf.php | 1 + app/i18n/zh-cn/conf.php | 1 + app/shares.php | 14 ++- app/views/configure/integration.phtml | 124 ++++++++++++++-------- app/views/helpers/index/normal/entry_bottom.phtml | 6 +- docs/en/index.md | 1 + docs/en/users/08_sharing_services.md | 50 +++++++++ p/scripts/draggable.js | 16 ++- p/scripts/integration.js | 4 +- p/themes/base-theme/template.css | 7 +- p/themes/base-theme/template.rtl.css | 7 +- 28 files changed, 202 insertions(+), 59 deletions(-) create mode 100644 docs/en/users/08_sharing_services.md diff --git a/app/Models/Share.php b/app/Models/Share.php index c453fbaac..a36226f69 100644 --- a/app/Models/Share.php +++ b/app/Models/Share.php @@ -20,12 +20,13 @@ class FreshRSS_Share { return; } + $isDeprecated = isset($share_options['deprecated']) ? $share_options['deprecated'] : false; $help_url = isset($share_options['help']) ? $share_options['help'] : ''; $field = isset($share_options['field']) ? $share_options['field'] : null; self::$list_sharing[$type] = new FreshRSS_Share( $type, $share_options['url'], $share_options['transform'], $share_options['form'], $help_url, $share_options['method'], - $field + $field, $isDeprecated ); } @@ -83,6 +84,7 @@ class FreshRSS_Share { private $id = null; private $title = null; private $link = null; + private $isDeprecated = false; private $method = 'GET'; private $field; @@ -97,11 +99,12 @@ class FreshRSS_Share { * @param string $help_url is an optional url to give help on this option. * @param string $method defines the sharing method (GET or POST) */ - private function __construct($type, $url_transform, $transform, $form_type, $help_url, $method, $field) { + private function __construct($type, $url_transform, $transform, $form_type, $help_url, $method, $field, $isDeprecated = false) { $this->type = $type; $this->name = _t('gen.share.' . $type); $this->url_transform = $url_transform; $this->help_url = $help_url; + $this->isDeprecated = $isDeprecated; if (!is_array($transform)) { $transform = array(); @@ -196,6 +199,13 @@ class FreshRSS_Share { return $this->base_url; } + /** + * Return the deprecated status of the share option. + */ + public function isDeprecated() { + return $this->isDeprecated; + } + /** * Return the current url by merging url_transform and base_url. */ diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 3e961e3a9..5c2c73783 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Sdílení', 'add' => 'Přidat metodu sdílení', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'E-mail', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 5a0438f3b..1f95628d8 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Teilen', 'add' => 'Füge eine Teilen-Dienst hinzu', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'Dieser Dienst ist veraltet und wir in einer zukünftigen FreshRSS-Version entfernt.', 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'E-Mail', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.php index dcb530e90..7bcf41d31 100644 --- a/app/i18n/en-us/conf.php +++ b/app/i18n/en-us/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Sharing', // IGNORE 'add' => 'Add a sharing method', // IGNORE 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // IGNORE 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 7050a5cdc..bdb61ec1c 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Sharing', 'add' => 'Add a sharing method', 'blogotext' => 'Blogotext', + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', 'email' => 'Email', 'facebook' => 'Facebook', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 63289f800..49edbb116 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Compartir', 'add' => 'Agregar un método de uso compartido', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // TODO 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index c48a7bb6c..2a2ddb2a0 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Partage', 'add' => 'Ajouter une méthode de partage', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'Ce service est obsolète et sera supprimé dans une prochaine version de FreshRSS.', 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Courriel', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index 7ce29c582..4d71988a3 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'שיתוף', 'add' => 'Add a sharing method', // TODO 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'דואר אלקטרוני', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 41f7e041c..4fd6e6582 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Condivisione', 'add' => 'Add a sharing method', // TODO 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // TODO 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index 29d69cd6b..9faec9720 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -194,6 +194,7 @@ return array( '_' => '共有', 'add' => '共有方法を追加する', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Eメール', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index 01d853585..617243e6b 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -194,6 +194,7 @@ return array( '_' => '공유', 'add' => '공유 방법 추가', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => '메일', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index f8c11707a..7045456af 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Delen', 'add' => 'Deelmethode toevoegen', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // IGNORE 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index 3cca02c2b..43366c23c 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Partatge', 'add' => 'Ajustar un metòde de partatge', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Corrièl', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index fa342abdd..41f66390d 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Podawanie dalej', 'add' => 'Dodaj sposób na podanie dalej wiadomości', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'E-mail', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index 07d1c7872..23c6e17d1 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Compartilhando', 'add' => 'Adicionar um método de compartilhamento', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'E-mail', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 1c6e3af5a..5c29d7ea4 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Поделиться', 'add' => 'Добавить способ поделиться', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Электронная почта', 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 35a34c136..e79d80af3 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Zdieľanie', 'add' => 'Pridať spôsob zdieľania', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'E-mail', // IGNORE 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index e3750235c..d889b5924 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -194,6 +194,7 @@ return array( '_' => 'Paylaşım', 'add' => 'Bir paylaşım türü ekle', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => 'Email', // IGNORE 'facebook' => 'Facebook', // IGNORE diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index 1c9e1100b..8d500d019 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -194,6 +194,7 @@ return array( '_' => '分享', 'add' => '添加分享方式', 'blogotext' => 'Blogotext', // IGNORE + 'deprecated' => 'This service is deprecated and will be removed from FreshRSS in a future release.', // TODO 'diaspora' => 'Diaspora*', // IGNORE 'email' => '邮箱', // IGNORE 'facebook' => '脸书', // IGNORE diff --git a/app/shares.php b/app/shares.php index 9761ed609..16b2787bf 100644 --- a/app/shares.php +++ b/app/shares.php @@ -7,23 +7,27 @@ * * For each share there is different configuration options. Here is the description * of those options: - * - url is a mandatory option. It is a string representing the share URL. It + * - 'deprecated' (optional) is a boolean. Default: 'false'. + * 'true', if the sharing service is planned to remove in the future. + * Add more information into the documentation center. + * - 'url' is a mandatory option. It is a string representing the share URL. It * supports 4 different placeholders for custom data. The ~URL~ placeholder * represents the URL of the system used to share, it is configured by the * user. The ~LINK~ placeholder represents the link of the shared article. * The ~TITLE~ placeholder represents the title of the shared article. The * ~ID~ placeholder represents the id of the shared article (only useful * for internal use) - * - transform is an array of transformation to apply on links and titles - * - help is a URL to a help page (mandatory for form = 'advanced') - * - form is the type of form to display during configuration. It’s either + * - 'transform' is an array of transformation to apply on links and titles + * - 'help' is a URL to a help page (mandatory for form = 'advanced') + * - 'form' is the type of form to display during configuration. It’s either * 'simple' or 'advanced'. 'simple' is used when only the name is configurable, * 'advanced' is used when the name and the location are configurable. - * - method is the HTTP method (POST or GET) used to share a link. + * - 'method' is the HTTP method (POST or GET) used to share a link. */ return array( 'blogotext' => array( + 'deprecated' => true, 'url' => '~URL~/admin/links.php?url=~LINK~', 'transform' => array(), 'help' => 'http://lehollandaisvolant.net/blogotext/fr/', diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml index c8d299f44..15dbb48ed 100644 --- a/app/views/configure/integration.phtml +++ b/app/views/configure/integration.phtml @@ -11,21 +11,28 @@

" size="64" /> - - - ' - data-advanced='
+ data-simple='##label## + +
+
+ +
+
' + data-advanced='##label## -
- - -
- -
' class="draggableList"> +
+ +
+
+ +

+
+
+ +
+
' class="draggableList"> update($share_options); ?> -
-