aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-03-15 22:58:30 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-15 22:58:30 +0100
commitbe5848fd4fa280e5a4606fef25669974414547a5 (patch)
treec11af74c2a64bdf4f1e59a4841d81d77f5977d4d /app
parentbdf7e4d29d954c3d2c137948577b6872c3de4656 (diff)
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 <alexandre@alapetite.fr> * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Documentation: services from #4270 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app')
-rw-r--r--app/Models/Share.php14
-rw-r--r--app/i18n/cz/conf.php1
-rw-r--r--app/i18n/de/conf.php1
-rw-r--r--app/i18n/en-us/conf.php1
-rw-r--r--app/i18n/en/conf.php1
-rwxr-xr-xapp/i18n/es/conf.php1
-rw-r--r--app/i18n/fr/conf.php1
-rw-r--r--app/i18n/he/conf.php1
-rw-r--r--app/i18n/it/conf.php1
-rw-r--r--app/i18n/ja/conf.php1
-rw-r--r--app/i18n/ko/conf.php1
-rw-r--r--app/i18n/nl/conf.php1
-rw-r--r--app/i18n/oc/conf.php1
-rw-r--r--app/i18n/pl/conf.php1
-rw-r--r--app/i18n/pt-br/conf.php1
-rw-r--r--app/i18n/ru/conf.php1
-rw-r--r--app/i18n/sk/conf.php1
-rw-r--r--app/i18n/tr/conf.php1
-rw-r--r--app/i18n/zh-cn/conf.php1
-rw-r--r--app/shares.php14
-rw-r--r--app/views/configure/integration.phtml124
-rw-r--r--app/views/helpers/index/normal/entry_bottom.phtml6
22 files changed, 123 insertions, 53 deletions
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();
@@ -197,6 +200,13 @@ class FreshRSS_Share {
}
/**
+ * 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.
*/
public function 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">zukünftigen FreshRSS-Version</a> 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Voir la documentation" target="_blank">prochaine version de FreshRSS</a>.',
'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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 <a href="https://freshrss.github.io/FreshRSS/en/users/08_sharing_services.md" title="Open documentation for more information" target="_blank">future release</a>.', // 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 @@
<h1><?= _t('conf.sharing') ?></h1>
<form method="post" action="<?= _url('configure', 'integration') ?>"
- data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><div class="stick">
- <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="##label##" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" />
- <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled="disabled" />
- <a href="#" class="remove btn btn-attention"><?= _i('close') ?></a></div>
- <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>'
- data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls">
+ data-simple='<formgroup><legend>##label##</legend>
+ <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" />
+ <div class="form-group" id="group-share-##key##">
+ <label class="group-name" for="share_##key##_name"><?= _t('conf.sharing.share_name') ?></label><div class="group-controls">
+ <input type="text" id="share_##key##_name" name="share[##key##][name]" value="##label##" />
+ </div>
+ </div></formgroup>'
+ data-advanced='<formgroup class="group-share"><legend>##label##</legend>
<input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" />
<input type="hidden" id="share_##key##_method" name="share[##key##][method]" value="##method##" />
<input type="hidden" id="share_##key##_field" name="share[##key##][field]" value="##field##" />
- <div class="stick">
- <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" />
- <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" />
- <a href="#" class="remove btn btn-attention" title="<?= _t('conf.sharing.remove') ?>"><?= _i('close') ?></a></div>
- <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="##help##"><?= _i('help') ?></a>
- </div></div>' class="draggableList">
+ <div class="form-group" id="group-share-##key##"><label class="group-name" for="share_##key##_name"><?= _t('conf.sharing.share_name') ?></label><div class="group-controls">
+ <input type="text" id="share_##key##_name" name="share[##key##][name]" value="" />
+ </div>
+ <div class="form-group" id="group-share-##key##"><label class="group-name" for="share_##key##_url"><?= _t('conf.sharing.share_url') ?></label><div class="group-controls">
+ <input type="url" id="share_##key##_url" name="share[##key##][url]" class="long" value="" required />
+ <p class="help"><?= _i('help') ?> <a href="##help##" target="_blank" rel="noreferrer"><?= _t('conf.sharing.more_information') ?></a></p>
+ </div><div class="form-group">
+ <div class="group-controls">
+ <button type="button" class="remove btn btn-attention" title="<?= _t('conf.sharing.remove') ?>"><?= _t('gen.action.remove') ?></button>
+ </div>
+ </div></formgroup>' class="draggableList">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<?php
@@ -33,46 +40,75 @@
$share = FreshRSS_Share::get($share_options['type']);
$share->update($share_options);
?>
- <div class="form-group group-share" id="group-share-<?= $key ?>" draggable="true">
- <label class="group-name">
- <?= $share->name(true) ?>
+ <formgroup class="group-share dragbox" id="group-share-<?= $key ?>">
+ <legend draggable="true"><?= $share->name(true) ?></legend>
+ <input type="hidden" id="share_<?= $key ?>_type" name="share[<?= $key ?>][type]" value="<?= $share->type() ?>" />
+ <input type="hidden" id="share_<?= $key ?>_method" name="share[<?= $key ?>][method]" value="<?= $share->method() ?>" />
+ <input type="hidden" id="share_<?= $key ?>_field" name="share[<?= $key ?>][field]" value="<?= $share->field() ?>" />
+
+ <?php if ($share->isDeprecated()) { ?>
+ <div class="prompt alert alert-warn">
+ <p><?= _t('conf.sharing.deprecated') ?></p>
+ </div>
+ <?php } ?>
+
+ <div class="form-group">
+ <label class="group-name" for="share_<?= $key ?>_name">
+ <?= _t('conf.sharing.share_name') ?>
</label>
<div class="group-controls">
- <input type='hidden' id='share_<?= $key ?>_type' name="share[<?= $key ?>][type]" value='<?= $share->type() ?>' />
- <input type='hidden' id='share_<?= $key ?>_method' name="share[<?= $key ?>][method]" value='<?= $share->method() ?>' />
- <input type='hidden' id='share_<?= $key ?>_field' name="share[<?= $key ?>][field]" value='<?= $share->field() ?>' />
- <div class="stick">
- <input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" class="extend" value="<?= $share->name() ?>"
- placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" data-leave-validation="<?= $share->name() ?>"/>
- <?php if ($share->formType() === 'advanced') { ?>
- <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>"
- placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" data-leave-validation="<?= $share->baseUrl() ?>"/>
- <?php } else { ?>
- <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>"
- placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled="disabled" />
- <?php } ?>
- <a href='#' class='remove btn btn-attention' title="<?= _t('conf.sharing.remove') ?>"><?= _i('close') ?></a>
+ <input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" value="<?= $share->name() ?>"
+ data-leave-validation="<?= $share->name() ?>" />
+ </div>
+ </div>
+
+ <div class="form-group">
+ <?php if ($share->formType() === 'advanced') { ?>
+ <label class="group-name" for="share_<?= $key ?>_url">
+ <?= _t('conf.sharing.share_url') ?>
+ </label>
+
+ <div class="group-controls">
+ <div class="stick">
+ <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="long" value="<?= $share->baseUrl() ?>"
+ data-leave-validation="<?= $share->baseUrl() ?>" required />
+ <a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $share->baseUrl() ?>" title="<?= _t('gen.action.see_url') ?>" data-input="share_<?= $key ?>_url"><?= _i('link') ?></a>
+ </div>
+ <p class="help"><?= _i('help') ?> <a href="<?= $share->help() ?>" target="_blank" rel="noreferrer"><?= _t('conf.sharing.more_information') ?></a></p>
</div>
- <?php if ($share->formType() === 'advanced') { ?>
- <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="<?= $share->help() ?>"><?= _i('help') ?></a>
- <?php } ?>
+ <?php } ?>
+ </div>
+
+ <div class="form-group">
+ <div class="group-controls">
+ <button type="button" class="remove btn btn-attention" title="<?= _t('conf.sharing.remove') ?>"><?= _t('gen.action.remove') ?></button>
</div>
</div>
+
+
+ </formgroup>
<?php } ?>
- <div class="form-group">
- <div class="group-controls">
- <select>
- <?php foreach (FreshRSS_Share::enum() as $share) { ?>
- <option value='<?= $share->type() ?>' data-form='<?= $share->formType() ?>' data-help='<?= $share->help() ?>'
- data-method='<?= $share->method() ?>' data-field='<?= $share->field() ?>'>
- <?= $share->name(true) ?>
- </option>
- <?php } ?>
- </select>
- <a href='#' class='share add btn' title="<?= _t('conf.sharing.add') ?>"><?= _i('add') ?></a>
+ <formgroup>
+ <legend>
+ <?= _t('conf.sharing.add') ?>
+ </legend>
+ <div class="form-group">
+ <div class="group-controls">
+ <div class="stick">
+ <select>
+ <?php foreach (FreshRSS_Share::enum() as $share) { ?>
+ <option value='<?= $share->type() ?>' data-form='<?= $share->formType() ?>' data-help='<?= $share->help() ?>'
+ data-method='<?= $share->method() ?>' data-field='<?= $share->field() ?>'>
+ <?= $share->name(true) ?>
+ </option>
+ <?php } ?>
+ </select>
+ <a href='#' class='share add btn' title="<?= _t('conf.sharing.add') ?>"><?= _i('add') ?></a>
+ </div>
+ </div>
</div>
- </div>
+ </formgroup>
<div class="form-group form-actions">
<div class="group-controls">
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml
index 1b6180c47..9be6b99f7 100644
--- a/app/views/helpers/index/normal/entry_bottom.phtml
+++ b/app/views/helpers/index/normal/entry_bottom.phtml
@@ -80,7 +80,8 @@
</a>
<ul class="dropdown-menu">
- <li class="dropdown-close"><a href="#close">❌</a></li><?php
+ <li class="dropdown-close"><a href="#close">❌</a></li>
+ <li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
$id = $this->entry->id();
$link = $this->entry->link();
$title = $this->entry->title() . ' · ' . $this->feed->name();
@@ -89,11 +90,12 @@
if ($share === null) {
continue;
}
+ $cssClass = $share->isDeprecated() ? ' error' : '';
$share_options['id'] = $id;
$share_options['link'] = $link;
$share_options['title'] = $title;
$share->update($share_options);
- ?><li class="item share">
+ ?><li class="item share<?= $cssClass ?>">
<?php if ('GET' === $share->method()) {?>
<a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
<?php } else {?>