aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--assets/default/js/base.js2
-rw-r--r--assets/default/scss/shaarli.scss2
-rw-r--r--inc/languages/fr/LC_MESSAGES/shaarli.po62
-rw-r--r--index.php5
-rw-r--r--plugins/isso/comment.pngbin0 -> 277 bytes
-rw-r--r--plugins/isso/isso.php31
-rw-r--r--plugins/isso/isso_button.html5
-rw-r--r--tests/plugins/PluginIssoTest.php16
8 files changed, 79 insertions, 44 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 8bf79d3e..1b8d8c36 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -548,7 +548,7 @@ function init(description) {
548 event.preventDefault(); 548 event.preventDefault();
549 const block = findParent(event.target, 'div', { class: 'tag-list-item' }); 549 const block = findParent(event.target, 'div', { class: 'tag-list-item' });
550 const tag = block.getAttribute('data-tag'); 550 const tag = block.getAttribute('data-tag');
551 const refreshedToken = document.getElementById('token'); 551 const refreshedToken = document.getElementById('token').value;
552 552
553 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) { 553 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
554 const xhr = new XMLHttpRequest(); 554 const xhr = new XMLHttpRequest();
diff --git a/assets/default/scss/shaarli.scss b/assets/default/scss/shaarli.scss
index 6b286f1e..b8578ea6 100644
--- a/assets/default/scss/shaarli.scss
+++ b/assets/default/scss/shaarli.scss
@@ -381,8 +381,6 @@ body,
381 box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset; 381 box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset;
382 background: $almost-white; 382 background: $almost-white;
383 padding: 5px 5px 3px 15px; 383 padding: 5px 5px 3px 15px;
384 width: 20%;
385 height: 20px;
386 color: $dark-grey; 384 color: $dark-grey;
387} 385}
388 386
diff --git a/inc/languages/fr/LC_MESSAGES/shaarli.po b/inc/languages/fr/LC_MESSAGES/shaarli.po
index 155eb52e..5fd0f775 100644
--- a/inc/languages/fr/LC_MESSAGES/shaarli.po
+++ b/inc/languages/fr/LC_MESSAGES/shaarli.po
@@ -48,7 +48,7 @@ msgstr "le fichier n'est pas accessible en écriture"
48#: application/Cache.php:16 48#: application/Cache.php:16
49#, php-format 49#, php-format
50msgid "Cannot purge %s: no directory" 50msgid "Cannot purge %s: no directory"
51msgstr "Impossible de purger %s: le répertoire n'existe pas" 51msgstr "Impossible de purger %s : le répertoire n'existe pas"
52 52
53#: application/FeedBuilder.php:151 53#: application/FeedBuilder.php:151
54msgid "Direct link" 54msgid "Direct link"
@@ -98,7 +98,7 @@ msgstr "Vous devez utiliser un entier comme clé."
98 98
99#: application/LinkDB.php:145 99#: application/LinkDB.php:145
100msgid "Array offset and link ID must be equal." 100msgid "Array offset and link ID must be equal."
101msgstr "La clé du tableau et l'ID du lien doivent être égaux." 101msgstr "La clé du tableau et l'ID du lien doivent être identiques."
102 102
103#: application/LinkDB.php:251 103#: application/LinkDB.php:251
104#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14 104#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
@@ -108,7 +108,7 @@ msgstr "La clé du tableau et l'ID du lien doivent être égaux."
108msgid "" 108msgid ""
109"The personal, minimalist, super-fast, database free, bookmarking service" 109"The personal, minimalist, super-fast, database free, bookmarking service"
110msgstr "" 110msgstr ""
111"Le gestionnaire de marque-page personnel, minimaliste, et sans base de " 111"Le gestionnaire de marque-pages personnel, minimaliste, et sans base de "
112"données" 112"données"
113 113
114#: application/LinkDB.php:253 114#: application/LinkDB.php:253
@@ -125,11 +125,11 @@ msgstr ""
125"Bienvenue sur Shaarli ! Ceci est votre premier marque-page public. Pour me " 125"Bienvenue sur Shaarli ! Ceci est votre premier marque-page public. Pour me "
126"modifier ou me supprimer, vous devez d'abord vous connecter.\n" 126"modifier ou me supprimer, vous devez d'abord vous connecter.\n"
127"\n" 127"\n"
128"Pour apprendre comment utiliser Shaarli, consultez le lien « Documentation » " 128"Pour apprendre à utiliser Shaarli, consultez le lien « Documentation » "
129"en bas de page.\n" 129"en bas de page.\n"
130"\n" 130"\n"
131"Vous utilisez la version supportée par la communauté du projet original " 131"Vous utilisez la version supportée par la communauté du projet original "
132"Shaarli, de Sébastien Sauvage." 132"Shaarli de Sébastien Sauvage."
133 133
134#: application/LinkDB.php:267 134#: application/LinkDB.php:267
135msgid "My secret stuff... - Pastebin.com" 135msgid "My secret stuff... - Pastebin.com"
@@ -185,8 +185,8 @@ msgid ""
185"php-gd extension must be loaded to use thumbnails. Thumbnails are now " 185"php-gd extension must be loaded to use thumbnails. Thumbnails are now "
186"disabled. Please reload the page." 186"disabled. Please reload the page."
187msgstr "" 187msgstr ""
188"php-gd extension must be loaded to use thumbnails. Thumbnails are now " 188"l'extension php-gd doit être chargée pour utiliser les miniatures. Les miniatures sont désormais "
189"disabled. Please reload the page." 189"désactivées. Rechargez la page."
190 190
191#: application/Updater.php:86 191#: application/Updater.php:86
192msgid "Couldn't retrieve Updater class methods." 192msgid "Couldn't retrieve Updater class methods."
@@ -286,7 +286,7 @@ msgstr "NON. Vous êtes banni pour le moment. Revenez plus tard."
286 286
287#: index.php:273 287#: index.php:273
288msgid "Wrong login/password." 288msgid "Wrong login/password."
289msgstr "Nom d'utilisateur ou mot de passe incorrects." 289msgstr "Nom d'utilisateur ou mot de passe incorrect(s)."
290 290
291#: index.php:483 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46 291#: index.php:483 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
292#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:46 292#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:46
@@ -343,11 +343,11 @@ msgstr "Votre mot de passe a été modifié"
343#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13 343#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
344#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29 344#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
345msgid "Change password" 345msgid "Change password"
346msgstr "Modification du mot de passe" 346msgstr "Modifier le mot de passe"
347 347
348#: index.php:1043 348#: index.php:1043
349msgid "Configuration was saved." 349msgid "Configuration was saved."
350msgstr "La configuration a été sauvegardé." 350msgstr "La configuration a été sauvegardée."
351 351
352#: index.php:1068 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24 352#: index.php:1068 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
353msgid "Configure" 353msgid "Configure"
@@ -411,7 +411,7 @@ msgstr ""
411#: index.php:1471 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26 411#: index.php:1471 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
412#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22 412#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
413msgid "Plugin administration" 413msgid "Plugin administration"
414msgstr "Administration des extensions" 414msgstr "Administration des plugins"
415 415
416#: index.php:1523 tmp/thumbnails.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14 416#: index.php:1523 tmp/thumbnails.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
417msgid "Thumbnails update" 417msgid "Thumbnails update"
@@ -431,9 +431,9 @@ msgid ""
431"custom hostname without a dot causes cookie storage to fail. We recommend " 431"custom hostname without a dot causes cookie storage to fail. We recommend "
432"accessing your server via it's IP address or Fully Qualified Domain Name.<br>" 432"accessing your server via it's IP address or Fully Qualified Domain Name.<br>"
433msgstr "" 433msgstr ""
434"<pre>Les sesssions ne semble pas fonctionner sur ce serveur.<br>Assurez vous " 434"<pre>Les sesssions ne semblent pas fonctionner sur ce serveur.<br>Assurez vous "
435"que la variable « session.save_path » est correctement définie dans votre " 435"que la variable « session.save_path » est correctement définie dans votre "
436"fichier de configuration PHP, et que vous y avez les droits d'écriture." 436"fichier de configuration PHP, et que vous avez les droits d'écriture dessus."
437"<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains navigateurs, " 437"<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains navigateurs, "
438"accéder à votre serveur depuis un nom d'hôte comme « localhost » ou autre " 438"accéder à votre serveur depuis un nom d'hôte comme « localhost » ou autre "
439"nom personnalisé sans point '.' entraine l'échec de la sauvegarde des " 439"nom personnalisé sans point '.' entraine l'échec de la sauvegarde des "
@@ -455,7 +455,7 @@ msgstr "Shaare"
455 455
456#: plugins/addlink_toolbar/addlink_toolbar.php:50 456#: plugins/addlink_toolbar/addlink_toolbar.php:50
457msgid "Adds the addlink input on the linklist page." 457msgid "Adds the addlink input on the linklist page."
458msgstr "Ajout le formulaire d'ajout de liens sur la page principale." 458msgstr "Ajoute le formulaire d'ajout de liens sur la page principale."
459 459
460#: plugins/archiveorg/archiveorg.php:23 460#: plugins/archiveorg/archiveorg.php:23
461msgid "View on archive.org" 461msgid "View on archive.org"
@@ -471,7 +471,7 @@ msgid ""
471"developers." 471"developers."
472msgstr "" 472msgstr ""
473"Une extension de démonstration couvrant tous les cas d'utilisation pour les " 473"Une extension de démonstration couvrant tous les cas d'utilisation pour les "
474"designers et les développeurs." 474"designers de thèmes et les développeurs d'extensions."
475 475
476#: plugins/isso/isso.php:20 476#: plugins/isso/isso.php:20
477msgid "" 477msgid ""
@@ -484,7 +484,7 @@ msgstr ""
484#: plugins/isso/isso.php:63 484#: plugins/isso/isso.php:63
485msgid "Let visitor comment your shaares on permalinks with Isso." 485msgid "Let visitor comment your shaares on permalinks with Isso."
486msgstr "" 486msgstr ""
487"Permet aux visiteurs de commenter vos shaares sur les permaliens avec Isso." 487"Permettre aux visiteurs de commenter vos shaares sur les permaliens avec Isso."
488 488
489#: plugins/isso/isso.php:64 489#: plugins/isso/isso.php:64
490msgid "Isso server URL (without 'http://')" 490msgid "Isso server URL (without 'http://')"
@@ -578,7 +578,7 @@ msgstr "Active la publication de flux vers PubSubHubbub."
578 578
579#: plugins/qrcode/qrcode.php:69 plugins/wallabag/wallabag.php:68 579#: plugins/qrcode/qrcode.php:69 plugins/wallabag/wallabag.php:68
580msgid "For each link, add a QRCode icon." 580msgid "For each link, add a QRCode icon."
581msgstr "Pour chaque liens, ajouter une icône de QRCode." 581msgstr "Pour chaque lien, ajouter une icône de QRCode."
582 582
583#: plugins/wallabag/wallabag.php:21 583#: plugins/wallabag/wallabag.php:21
584msgid "" 584msgid ""
@@ -752,7 +752,7 @@ msgstr "Activer l'API REST"
752#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170 752#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
753msgid "Allow third party software to use Shaarli such as mobile application" 753msgid "Allow third party software to use Shaarli such as mobile application"
754msgstr "" 754msgstr ""
755"Permets aux applications tierces d'utiliser Shaarli, par exemple les " 755"Permet aux applications tierces d'utiliser Shaarli, par exemple les "
756"applications mobiles" 756"applications mobiles"
757 757
758#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:263 758#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:263
@@ -854,7 +854,7 @@ msgstr "Privé"
854 854
855#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72 855#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
856msgid "Apply Changes" 856msgid "Apply Changes"
857msgstr "Appliquer" 857msgstr "Appliquer les changements"
858 858
859#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16 859#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
860msgid "Export Database" 860msgid "Export Database"
@@ -870,7 +870,7 @@ msgstr "Publics"
870 870
871#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:52 871#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:52
872msgid "Prepend note permalinks with this Shaarli instance's URL" 872msgid "Prepend note permalinks with this Shaarli instance's URL"
873msgstr "Préfixer les liens de notes avec l'URL de l'instance de Shaarli" 873msgstr "Préfixer les liens de note avec l'URL de l'instance de Shaarli"
874 874
875#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:53 875#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:53
876msgid "Useful to import bookmarks in a web browser" 876msgid "Useful to import bookmarks in a web browser"
@@ -1066,7 +1066,7 @@ msgstr "Liens par page"
1066msgid "" 1066msgid ""
1067"You have been banned after too many failed login attempts. Try again later." 1067"You have been banned after too many failed login attempts. Try again later."
1068msgstr "" 1068msgstr ""
1069"Vous avez été banni après trop d'échec d'authentification. Merci de " 1069"Vous avez été banni après trop d'échecs d'authentification. Merci de "
1070"réessayer plus tard." 1070"réessayer plus tard."
1071 1071
1072#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41 1072#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
@@ -1251,7 +1251,7 @@ msgstr "Changer les paramètres de Shaarli : titre, fuseau horaire, etc."
1251 1251
1252#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:17 1252#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:17
1253msgid "Configure your Shaarli" 1253msgid "Configure your Shaarli"
1254msgstr "Conguration de Shaarli" 1254msgstr "Configurer Shaarli"
1255 1255
1256#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:21 1256#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:21
1257msgid "Enable, disable and configure plugins" 1257msgid "Enable, disable and configure plugins"
@@ -1259,19 +1259,19 @@ msgstr "Activer, désactiver et configurer les extensions"
1259 1259
1260#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28 1260#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
1261msgid "Change your password" 1261msgid "Change your password"
1262msgstr "Modification du mot de passe" 1262msgstr "Modifier le mot de passe"
1263 1263
1264#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:35 1264#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:35
1265msgid "Rename or delete a tag in all links" 1265msgid "Rename or delete a tag in all links"
1266msgstr "Rename or delete a tag in all links" 1266msgstr "Renommer ou supprimer un tag dans tous les liens"
1267 1267
1268#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41 1268#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
1269msgid "" 1269msgid ""
1270"Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, " 1270"Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
1271"delicious...)" 1271"delicious)"
1272msgstr "" 1272msgstr ""
1273"Importer des marques pages au format Netscape HTML (comme exportés depuis " 1273"Importer des marques pages au format Netscape HTML (comme exportés depuis "
1274"Firefox, Chrome, Opera, delicious...)" 1274"Firefox, Chrome, Opera, delicious)"
1275 1275
1276#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42 1276#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
1277msgid "Import links" 1277msgid "Import links"
@@ -1280,10 +1280,10 @@ msgstr "Importer des liens"
1280#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47 1280#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
1281msgid "" 1281msgid ""
1282"Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, " 1282"Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
1283"Opera, delicious...)" 1283"Opera, delicious)"
1284msgstr "" 1284msgstr ""
1285"Exporter les marques pages au format Netscape HTML (comme exportés depuis " 1285"Exporter les marques pages au format Netscape HTML (comme exportés depuis "
1286"Firefox, Chrome, Opera, delicious...)" 1286"Firefox, Chrome, Opera, delicious)"
1287 1287
1288#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48 1288#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
1289msgid "Export database" 1289msgid "Export database"
@@ -1298,13 +1298,13 @@ msgid ""
1298"Drag one of these button to your bookmarks toolbar or right-click it and " 1298"Drag one of these button to your bookmarks toolbar or right-click it and "
1299"\"Bookmark This Link\"" 1299"\"Bookmark This Link\""
1300msgstr "" 1300msgstr ""
1301"Glisser un de ces bouttons dans votre barre de favoris ou cliquer droit " 1301"Glisser un de ces boutons dans votre barre de favoris ou cliquer droit "
1302"dessus et « Ajouter aux favoris »" 1302"dessus et « Ajouter aux favoris »"
1303 1303
1304#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:82 1304#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:82
1305msgid "then click on the bookmarklet in any page you want to share." 1305msgid "then click on the bookmarklet in any page you want to share."
1306msgstr "" 1306msgstr ""
1307"puis cliquer sur le marque page depuis un site que vous souhaitez partager." 1307"puis cliquer sur le marque-page depuis un site que vous souhaitez partager."
1308 1308
1309#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86 1309#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
1310#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:110 1310#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:110
@@ -1450,7 +1450,7 @@ msgstr ""
1450#~ "\n" 1450#~ "\n"
1451 1451
1452#~ msgid "Sessions do not seem to work correctly on your server." 1452#~ msgid "Sessions do not seem to work correctly on your server."
1453#~ msgstr "Les sessions ne semblent " 1453#~ msgstr "Les sessions ne semblent pas fonctionner correctement sur votre serveur."
1454 1454
1455#~ msgid "Tag was renamed in " 1455#~ msgid "Tag was renamed in "
1456#~ msgstr "Le tag a été renommé dans " 1456#~ msgstr "Le tag a été renommé dans "
diff --git a/index.php b/index.php
index 9c1e4999..0ef33633 100644
--- a/index.php
+++ b/index.php
@@ -1084,7 +1084,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
1084 die(t('Wrong token.')); 1084 die(t('Wrong token.'));
1085 } 1085 }
1086 1086
1087 $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), escape($_POST['totag'])); 1087 $toTag = isset($_POST['totag']) ? escape($_POST['totag']) : null;
1088 $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), $toTag);
1088 $LINKSDB->save($conf->get('resource.page_cache')); 1089 $LINKSDB->save($conf->get('resource.page_cache'));
1089 foreach ($alteredLinks as $link) { 1090 foreach ($alteredLinks as $link) {
1090 $history->updateLink($link); 1091 $history->updateLink($link);
@@ -1236,10 +1237,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
1236 $id = (int) escape($id); 1237 $id = (int) escape($id);
1237 $link = $LINKSDB[$id]; 1238 $link = $LINKSDB[$id];
1238 $pluginManager->executeHooks('delete_link', $link); 1239 $pluginManager->executeHooks('delete_link', $link);
1240 $history->deleteLink($link);
1239 unset($LINKSDB[$id]); 1241 unset($LINKSDB[$id]);
1240 } 1242 }
1241 $LINKSDB->save($conf->get('resource.page_cache')); // save to disk 1243 $LINKSDB->save($conf->get('resource.page_cache')); // save to disk
1242 $history->deleteLink($link);
1243 1244
1244 // If we are called from the bookmarklet, we must close the popup: 1245 // If we are called from the bookmarklet, we must close the popup:
1245 if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } 1246 if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; }
diff --git a/plugins/isso/comment.png b/plugins/isso/comment.png
new file mode 100644
index 00000000..0158c03b
--- /dev/null
+++ b/plugins/isso/comment.png
Binary files differ
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php
index 5bc1cce2..378c11af 100644
--- a/plugins/isso/isso.php
+++ b/plugins/isso/isso.php
@@ -46,9 +46,36 @@ function hook_isso_render_linklist($data, $conf)
46 46
47 $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); 47 $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']);
48 $data['plugin_end_zone'][] = $isso; 48 $data['plugin_end_zone'][] = $isso;
49 } else {
50 $button = '<span><a href="?%s#isso-thread">';
51 // For the default theme we use a FontAwesome icon which is better than an image
52 if ($conf->get('resource.theme') === 'default') {
53 $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>';
54 } else {
55 $button .= '<img class="linklist-plugin-icon" src="plugins/isso/comment.png" ';
56 $button .= 'title="Comment on this shaare" alt="Comments" />';
57 }
58 $button .= '</a></span>';
59 foreach ($data['links'] as &$value) {
60 $commentLink = sprintf($button, $value['shorturl']);
61 $value['link_plugin'][] = $commentLink;
62 }
63 }
49 64
50 // Hackish way to include this CSS file only when necessary. 65 return $data;
51 $data['plugins_includes']['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css'; 66}
67
68/**
69 * When linklist is displayed, include isso CSS file.
70 *
71 * @param array $data - header data.
72 *
73 * @return mixed - header data with isso CSS file added.
74 */
75function hook_isso_render_includes($data)
76{
77 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
78 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css';
52 } 79 }
53 80
54 return $data; 81 return $data;
diff --git a/plugins/isso/isso_button.html b/plugins/isso/isso_button.html
new file mode 100644
index 00000000..3f828480
--- /dev/null
+++ b/plugins/isso/isso_button.html
@@ -0,0 +1,5 @@
1<span>
2 <a href="?%s#isso-thread">
3 <img class="linklist-plugin-icon" src="plugins/archiveorg/internetarchive.png" title="%s" alt="archive.org" />
4 </a>
5</span>
diff --git a/tests/plugins/PluginIssoTest.php b/tests/plugins/PluginIssoTest.php
index 0ae73183..2c9efbcd 100644
--- a/tests/plugins/PluginIssoTest.php
+++ b/tests/plugins/PluginIssoTest.php
@@ -21,7 +21,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
21 /** 21 /**
22 * Test Isso init without errors. 22 * Test Isso init without errors.
23 */ 23 */
24 public function testWallabagInitNoError() 24 public function testIssoInitNoError()
25 { 25 {
26 $conf = new ConfigManager(''); 26 $conf = new ConfigManager('');
27 $conf->set('plugins.ISSO_SERVER', 'value'); 27 $conf->set('plugins.ISSO_SERVER', 'value');
@@ -32,7 +32,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
32 /** 32 /**
33 * Test Isso init with errors. 33 * Test Isso init with errors.
34 */ 34 */
35 public function testWallabagInitError() 35 public function testIssoInitError()
36 { 36 {
37 $conf = new ConfigManager(''); 37 $conf = new ConfigManager('');
38 $errors = isso_init($conf); 38 $errors = isso_init($conf);
@@ -96,19 +96,22 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
96 array( 96 array(
97 'id' => 12, 97 'id' => 12,
98 'url' => $str, 98 'url' => $str,
99 'shorturl' => $short1 = 'abcd',
99 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date1), 100 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date1),
100 ), 101 ),
101 array( 102 array(
102 'id' => 13, 103 'id' => 13,
103 'url' => $str . '2', 104 'url' => $str . '2',
105 'shorturl' => $short2 = 'efgh',
104 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date2), 106 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date2),
105 ), 107 ),
106 ) 108 )
107 ); 109 );
108 110
109 $processed = hook_isso_render_linklist($data, $conf); 111 $processed = hook_isso_render_linklist($data, $conf);
110 // data shouldn't be altered 112 // link_plugin should be added for the icon
111 $this->assertEquals($data, $processed); 113 $this->assertContains('<a href="?'. $short1 .'#isso-thread">', $processed['links'][0]['link_plugin'][0]);
114 $this->assertContains('<a href="?'. $short2 .'#isso-thread">', $processed['links'][1]['link_plugin'][0]);
112 } 115 }
113 116
114 /** 117 /**
@@ -127,6 +130,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
127 array( 130 array(
128 'id' => 12, 131 'id' => 12,
129 'url' => $str, 132 'url' => $str,
133 'shorturl' => $short1 = 'abcd',
130 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date), 134 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date),
131 ) 135 )
132 ), 136 ),
@@ -135,8 +139,8 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
135 139
136 $processed = hook_isso_render_linklist($data, $conf); 140 $processed = hook_isso_render_linklist($data, $conf);
137 141
138 // data shouldn't be altered 142 // link_plugin should be added for the icon
139 $this->assertEquals($data, $processed); 143 $this->assertContains('<a href="?'. $short1 .'#isso-thread">', $processed['links'][0]['link_plugin'][0]);
140 } 144 }
141 145
142 /** 146 /**