aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/archiveorg
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2015-11-07 16:52:41 +0100
committerArthur <arthur@hoa.ro>2015-11-07 16:52:41 +0100
commit1b4ea59f93386594a6e6f35e581244b65c2db57f (patch)
treebf1da3832056f942227ac4173e3a27dc9e33508f /plugins/archiveorg
parenta52e8435939c641f964939f1df55cf7ceddcc0fd (diff)
parent9a364c283e3e9b5ccb5fc7a9a8e2946b1918c6a5 (diff)
downloadShaarli-1b4ea59f93386594a6e6f35e581244b65c2db57f.tar.gz
Shaarli-1b4ea59f93386594a6e6f35e581244b65c2db57f.tar.zst
Shaarli-1b4ea59f93386594a6e6f35e581244b65c2db57f.zip
Merge pull request #283 from ArthurHoaro/plugin-archiveorg
PLUGIN archiveorg
Diffstat (limited to 'plugins/archiveorg')
-rw-r--r--plugins/archiveorg/archiveorg.html1
-rw-r--r--plugins/archiveorg/archiveorg.php25
-rw-r--r--plugins/archiveorg/internetarchive.pngbin0 -> 878 bytes
3 files changed, 26 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..7d172584
--- /dev/null
+++ b/plugins/archiveorg/archiveorg.php
@@ -0,0 +1,25 @@
1<?php
2/**
3 * Plugin Archive.org.
4 *
5 * Add an icon in the link list for archive.org.
6 */
7
8/**
9 * Add archive.org icon to link_plugin when rendering linklist.
10 *
11 * @param mixed $data - linklist data.
12 *
13 * @return mixed - linklist data with archive.org plugin.
14 */
15function hook_archiveorg_render_linklist($data)
16{
17 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
18
19 foreach ($data['links'] as &$value) {
20 $archive = sprintf($archive_html, $value['url']);
21 $value['link_plugin'][] = $archive;
22 }
23
24 return $data;
25}
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