]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - plugins/archiveorg/archiveorg.php
docker: generate the HTML documentation
[github/shaarli/Shaarli.git] / plugins / archiveorg / archiveorg.php
CommitLineData
b7b9dbb0 1<?php
9a364c28
A
2/**
3 * Plugin Archive.org.
4 *
5 * Add an icon in the link list for archive.org.
6 */
b7b9dbb0
A
7
8/**
9 * Add archive.org icon to link_plugin when rendering linklist.
10 *
9a364c28
A
11 * @param mixed $data - linklist data.
12 *
b7b9dbb0
A
13 * @return mixed - linklist data with archive.org plugin.
14 */
9a364c28
A
15function hook_archiveorg_render_linklist($data)
16{
b7b9dbb0
A
17 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
18
19 foreach ($data['links'] as &$value) {
5e148f8a
T
20 if($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
21 continue;
22 }
b7b9dbb0
A
23 $archive = sprintf($archive_html, $value['url']);
24 $value['link_plugin'][] = $archive;
25 }
26
27 return $data;
28}