5 * Add an icon in the link list for archive.org.
8 use Shaarli\Plugin\PluginManager
;
11 * Add archive.org icon to link_plugin when rendering linklist.
13 * @param mixed $data - linklist data.
15 * @return mixed - linklist data with archive.org plugin.
17 function hook_archiveorg_render_linklist($data)
19 $archive_html = file_get_contents(PluginManager
::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
21 foreach ($data['links'] as &$value) {
22 if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
25 $archive = sprintf($archive_html, $value['url'], t('View on archive.org'));
26 $value['link_plugin'][] = $archive;
33 * This function is never called, but contains translation calls for GNU gettext extraction.
35 function archiveorg_dummy_translation()
38 t('For each link, add an Archive.org icon.');