aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/archiveorg/archiveorg.php
blob: 7d172584c45ee9d87aa6169d2cdc186bc82c9059 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
 * Plugin Archive.org.
 *
 * Add an icon in the link list for archive.org.
 */

/**
 * Add archive.org icon to link_plugin when rendering linklist.
 *
 * @param mixed $data - linklist data.
 *
 * @return mixed - linklist data with archive.org plugin.
 */
function hook_archiveorg_render_linklist($data)
{
    $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');

    foreach ($data['links'] as &$value) {
        $archive = sprintf($archive_html, $value['url']);
        $value['link_plugin'][] = $archive;
    }

    return $data;
}