From 893fd6434f11b6a1fef375f19e6ea427402bc605 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 25 Nov 2017 17:06:01 +0100 Subject: [PATCH] Add craue setting to enable sharing of origin url to Shaarli Also fix the field name used in the query string and add it to baggy theme Signed-off-by: Kevin Decherf --- .../Version20171125164500.php | 52 +++++++++++++++++++ .../translations/CraueConfigBundle.da.yml | 1 + .../translations/CraueConfigBundle.de.yml | 1 + .../translations/CraueConfigBundle.en.yml | 1 + .../translations/CraueConfigBundle.es.yml | 1 + .../translations/CraueConfigBundle.fa.yml | 1 + .../translations/CraueConfigBundle.fr.yml | 1 + .../translations/CraueConfigBundle.it.yml | 1 + .../translations/CraueConfigBundle.oc.yml | 1 + .../translations/CraueConfigBundle.pl.yml | 1 + .../translations/CraueConfigBundle.pt.yml | 1 + .../translations/CraueConfigBundle.ro.yml | 1 + .../translations/CraueConfigBundle.ru.yml | 1 + .../translations/CraueConfigBundle.th.yml | 1 + .../translations/CraueConfigBundle.tr.yml | 1 + app/config/wallabag.yml | 4 ++ .../views/themes/baggy/Entry/entry.html.twig | 2 +- .../themes/material/Entry/entry.html.twig | 2 +- 18 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 app/DoctrineMigrations/Version20171125164500.php diff --git a/app/DoctrineMigrations/Version20171125164500.php b/app/DoctrineMigrations/Version20171125164500.php new file mode 100644 index 00000000..980e0e75 --- /dev/null +++ b/app/DoctrineMigrations/Version20171125164500.php @@ -0,0 +1,52 @@ +container = $container; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $shaarliShareOriginUrl = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url'"); + + $this->skipIf(false !== $shaarliShareOriginUrl, 'It seems that you already played this migration.'); + + $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('shaarli_share_origin_url', '0', 'entry')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';"); + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index c3fd843f..6d6a60d6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -37,3 +37,4 @@ demo_mode_username: "Demobruger" # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index 37da383e..58d024ef 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -37,3 +37,4 @@ download_images_enabled: 'Bilder lokal herunterladen' restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren' api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen' # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 0a89ce2c..a26e451f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -37,3 +37,4 @@ download_images_enabled: Download images locally restricted_access: Enable authentication for paywalled websites api_user_registration: Enable user to be registered using the API store_article_headers: Enable if wallabag stores HTTP headers for each article +shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled \ No newline at end of file diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index db5858d6..f9bd27f2 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -37,3 +37,4 @@ download_images_enabled: Descargar imágenes localmente restricted_access: Activar autenticación para websites con paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index 11cc601b..15e4d6fd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -37,3 +37,4 @@ modify_settings: "اعمال" # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index f23b5bf9..fe91044a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -37,3 +37,4 @@ download_images_enabled: Télécharger les images en local restricted_access: Activer l'authentification pour les articles derrière un paywall api_user_registration: Activer la création de compte depuis l'API store_article_headers: Activer le stockage des en-têtes HTTP de chaque article +shaarli_share_origin_url: Activer le partage de l'adresse d'origine vers Shaarli, si le service est activé diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index ade6f7da..3d5681fb 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -37,3 +37,4 @@ demo_mode_username: "Utente Demo" # restricted_access: Enable authentication for websites with paywall api_user_registration: Abilita la registrazione dell'utente attraverso l'API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 99986642..4c99652a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -37,3 +37,4 @@ download_images_enabled: Telecargar los imatges en local restricted_access: Activar l'autenticacion pels sites amb peatge api_user_registration: Autorizar los utilizaires a se marcar amb l'API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 8b8f2ebd..7c125fcf 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -36,3 +36,4 @@ download_images_enabled: Pobierz obrazy lokalnie restricted_access: Włącz autoryzację dla stron z paywallem api_user_registration: Włącz rejestrację użytkownika przy użyciu API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 76cb0174..a81eda0e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -37,3 +37,4 @@ demo_mode_username: "Usuário demo" # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 8300cec8..9d927cc0 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -37,3 +37,4 @@ modify_settings: "aplică" # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml index 8fed84ae..2eb7b237 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml @@ -37,3 +37,4 @@ download_images_enabled: "Скачивать изображения локаль restricted_access: "Включить авторизацию на сайте с помощью paywall" # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.th.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.th.yml index 4e4d3234..93c0d6b4 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.th.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.th.yml @@ -34,3 +34,4 @@ share_public: ยอมรับ URL สาธารณะจากการเ download_images_enabled: ดาวน์โหลดรูปภาพเฉพาะ restricted_access: เปิดใช้งานการรองรับบนเว็บไซต์กับ paywall api_user_registration: เปิดใช้งานให้ผู้ใช้ลงทะเบียนการใช้ API +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index b992ccc2..6de880ec 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -38,3 +38,4 @@ # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API # store_article_headers: Enable if wallabag stores HTTP headers for each article +# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index ec6aae63..978a48f4 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -158,6 +158,10 @@ wallabag_core: name: store_article_headers value: 0 section: entry + - + name: shaarli_share_origin_url + value: 0 + section: entry wallabag_user: registration_enabled: "%fosuser_registration%" diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index 0c7cbaa6..7ff24dfd 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig @@ -29,7 +29,7 @@ {% endif %} {% if craue_setting('share_twitter') %}
  • {% endif %} {% if craue_setting('share_mail') %}
  • {% endif %} - {% if craue_setting('share_shaarli') %}
  • shaarli
  • {% endif %} + {% if craue_setting('share_shaarli') %}
  • shaarli
  • {% endif %} {% if craue_setting('share_scuttle') %}
  • scuttle
  • {% endif %} {% if craue_setting('share_diaspora') %}
  • diaspora
  • {% endif %} {% if craue_setting('share_unmark') %}
  • unmark.it
  • {% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 019569f7..bd9eb0d7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -125,7 +125,7 @@ {% endif %} {% if craue_setting('share_shaarli') %}
  • - + shaarli
  • -- 2.41.0