diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-10-15 12:47:04 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-11-07 16:40:25 +0100 |
commit | b7b9dbb0d5815d04a81ba39c9b23a3a619976f98 (patch) | |
tree | 707fd86c33a5c985b3ccb7fe19a9d381f2f9ce44 /plugins/archiveorg/archiveorg.php | |
parent | a52e8435939c641f964939f1df55cf7ceddcc0fd (diff) | |
download | Shaarli-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.php | 18 |
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 | */ | ||
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 | } | ||