]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - plugins/qrcode/qrcode.php
3 // TODO: Can't be tested in localhost
6 * Add qrcode icon to link_plugin when rendering linklist.
8 * @param $data - linklist data.
9 * @return mixed - linklist data with qrcode plugin.
11 function hook_qrcode_render_linklist($data)
13 $qrcode_html = file_get_contents(PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.html');
15 foreach ($data['links'] as &$value) {
16 $qrcode = sprintf($qrcode_html, $value['url'], $value['url'], PluginManager
::$PLUGINS_PATH);
17 $value['link_plugin'][] = $qrcode;
24 * When linklist is displayed, include qrcode JS files.
26 * @param array $data - footer data.
27 * @return mixed - footer data with qrcode JS files added.
29 function hook_qrcode_render_footer($data)
31 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
32 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';