aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-10-15 12:47:04 +0200
committerArthurHoaro <arthur@hoa.ro>2015-11-07 16:40:25 +0100
commitb7b9dbb0d5815d04a81ba39c9b23a3a619976f98 (patch)
tree707fd86c33a5c985b3ccb7fe19a9d381f2f9ce44 /plugins
parenta52e8435939c641f964939f1df55cf7ceddcc0fd (diff)
downloadShaarli-b7b9dbb0d5815d04a81ba39c9b23a3a619976f98.tar.gz
Shaarli-b7b9dbb0d5815d04a81ba39c9b23a3a619976f98.tar.zst
Shaarli-b7b9dbb0d5815d04a81ba39c9b23a3a619976f98.zip
PLUGIN archiveorg
Display an archive.org icon in linklist, foreach links.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/archiveorg/archiveorg.html1
-rw-r--r--plugins/archiveorg/archiveorg.php18
-rw-r--r--plugins/archiveorg/internetarchive.pngbin0 -> 878 bytes
3 files changed, 19 insertions, 0 deletions
diff --git a/plugins/archiveorg/archiveorg.html b/plugins/archiveorg/archiveorg.html
new file mode 100644
index 00000000..ce3bc6b7
--- /dev/null
+++ b/plugins/archiveorg/archiveorg.html
@@ -0,0 +1 @@
<span><a href="https://web.archive.org/web/%s"><img width="13" height="13" src="plugins/archiveorg/internetarchive.png" title="View on archive.org" /></a></span> \ No newline at end of file
diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php
new file mode 100644
index 00000000..1db3e4cb
--- /dev/null
+++ b/plugins/archiveorg/archiveorg.php
@@ -0,0 +1,18 @@
1<?php
2
3/**
4 * Add archive.org icon to link_plugin when rendering linklist.
5 *
6 * @param $data - linklist data.
7 * @return mixed - linklist data with archive.org plugin.
8 */
9function hook_archiveorg_render_linklist($data) {
10 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
11
12 foreach ($data['links'] as &$value) {
13 $archive = sprintf($archive_html, $value['url']);
14 $value['link_plugin'][] = $archive;
15 }
16
17 return $data;
18}
diff --git a/plugins/archiveorg/internetarchive.png b/plugins/archiveorg/internetarchive.png
new file mode 100644
index 00000000..ca070769
--- /dev/null
+++ b/plugins/archiveorg/internetarchive.png
Binary files differ