aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/archiveorg/archiveorg.php
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/archiveorg/archiveorg.php
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/archiveorg/archiveorg.php')
-rw-r--r--plugins/archiveorg/archiveorg.php18
1 files changed, 18 insertions, 0 deletions
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}