diff options
-rw-r--r-- | plugins/archiveorg/archiveorg.html | 1 | ||||
-rw-r--r-- | plugins/archiveorg/archiveorg.php | 18 | ||||
-rw-r--r-- | plugins/archiveorg/internetarchive.png | bin | 0 -> 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 | */ | ||
9 | function 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 | |||