]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add craue setting to enable sharing of origin url to Shaarli 3436/head
authorKevin Decherf <kevin@kdecherf.com>
Sat, 25 Nov 2017 16:06:01 +0000 (17:06 +0100)
committerKevin Decherf <kevin@kdecherf.com>
Sat, 25 Nov 2017 16:07:55 +0000 (17:07 +0100)
Also fix the field name used in the query string and add it to baggy
theme

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
18 files changed:
app/DoctrineMigrations/Version20171125164500.php [new file with mode: 0644]
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.th.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml
app/config/wallabag.yml
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig

diff --git a/app/DoctrineMigrations/Version20171125164500.php b/app/DoctrineMigrations/Version20171125164500.php
new file mode 100644 (file)
index 0000000..980e0e7
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Add shaarli_share_origin_url in craue_config_setting.
+ */
+class Version20171125164500 extends AbstractMigration implements ContainerAwareInterface
+{
+    /**
+     * @var ContainerInterface
+     */
+    private $container;
+
+    public function setContainer(ContainerInterface $container = null)
+    {
+        $this->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;
+    }
+}
index c3fd843f2df3bf3e6b267c69f3e4a6add717020b..6d6a60d60cfb125c68e1d856a46b885288e23bfc 100644 (file)
@@ -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
index 37da383e9cb094c94de4586e3628801b68106629..58d024eff70f40834d26d14936904b069f3d655c 100644 (file)
@@ -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
index 0a89ce2ccdcfa60bf60057a33798c86920a5412e..a26e451f7a16519dc452aba532c149f142e8073b 100644 (file)
@@ -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
index db5858d694fb0401d96ef6aea5c5da73bb5c8452..f9bd27f2ec2f8831063dd5335cef979df4950115 100644 (file)
@@ -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
index 11cc601b7493e927e4b2434ec0268c38b988d60b..15e4d6fd20f40467a520457c57ac17ef1354c1a5 100644 (file)
@@ -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
index f23b5bf966703e0528fc3e565c45836b172d32b2..fe91044a18bef319abb0efc82bcbe78eae93424e 100644 (file)
@@ -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é
index ade6f7da90ee02e41890eaa7b3c7be5d1cca4dc4..3d5681fbcce6d844c20558bffa4be6d8c79e2d42 100644 (file)
@@ -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
index 999866426655f2c0b8dccc5228f5677be7361921..4c99652a7161d09d666ed148db8e07d408eb7e20 100644 (file)
@@ -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
index 8b8f2ebdf9152f48ae4bde8cff254c5b7ec5272e..7c125fcfef59777ab0a231f12c3363500671ef58 100644 (file)
@@ -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
index 76cb01747e38eb6cdc0037b45a9d9abfd9145131..a81eda0ec7d1aef35346a3d18be2b5fd5fa076b2 100644 (file)
@@ -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
index 8300cec8f6cf7c1622017e844a0efd0025a6b2b6..9d927cc01f625c34c11a11962eaa9011efe1c5f9 100644 (file)
@@ -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
index 8fed84ae0df7ab4de9d0b960bb1e6612820268b4..2eb7b237dabd5450d1539623f94c83917a3de290 100644 (file)
@@ -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
index 4e4d323463cede2c060b7b68588caf318c2b530a..93c0d6b4f2a86ccd8a9cca55c8af27b6e1d4a393 100644 (file)
@@ -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
index b992ccc215b26177826af65977a8f6ce2dd04f2a..6de880ecef5103562b3e60aa530dee67f68c76a8 100644 (file)
@@ -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
index ec6aae63a72fd07811922d06799abbfc3b53e8be..978a48f4b4e90c8526043ef4a9fb655113dde810 100644 (file)
@@ -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%"
index 0c7cbaa6e4183a46d2d08e7876a503d5215490c4..7ff24dfd12072f207165f61bda586273e94c7008 100644 (file)
@@ -29,7 +29,7 @@
                 {% endif %}
                 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
                 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
-                {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}" target="_blank" class="tool icon-image icon-image--shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
+                {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}{% if craue_setting('shaarli_share_origin_url') %}&amp;original_url={{ entry.originUrl|url_encode }}{% endif %}" target="_blank" class="tool icon-image icon-image--shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
                 {% if craue_setting('share_scuttle') %}<li><a href="{{ craue_setting('scuttle_url') }}/bookmarks.php?action=add&amp;address={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}" target="_blank" class="tool icon-image icon-image--scuttle" title="scuttle"><span>scuttle</span></a></li>{% endif %}
                 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %}
                 {% if craue_setting('share_unmark') %}<li><a href="{{ craue_setting('unmark_url') }}/mark/add?url={{ entry.url|url_encode }}&amp;title={{entry.title|url_encode}}&amp;v=6" target="_blank" class="tool unmark icon-image icon-image--unmark" title="unmark"><span>unmark.it</span></a></li>{% endif %}
index 019569f793978acc94e644704760ab7b3d80c42e..bd9eb0d7e43c78a74ee1c543a2323c5e9236f89c 100644 (file)
                     {% endif %}
                     {% if craue_setting('share_shaarli') %}
                         <li>
-                        <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;tags={{ entry.tags|join(',')|striptags|url_encode }}&amp;lf_original_url={{ entry.originUrl|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli">
+                        <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;tags={{ entry.tags|join(',')|striptags|url_encode }}{% if craue_setting('shaarli_share_origin_url') %}&amp;original_url={{ entry.originUrl|url_encode }}{% endif %}" target="_blank" title="shaarli" class="tool icon-image shaarli">
                                 <span>shaarli</span>
                             </a>
                         </li>