]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - plugins/qrcode/qrcode.php
4 * Add QRCode containing URL for each links.
5 * Display a QRCode icon in link list.
9 * Add qrcode icon to link_plugin when rendering linklist.
11 * @param array $data - linklist data.
13 * @return mixed - linklist data with qrcode plugin.
15 function hook_qrcode_render_linklist($data)
17 $qrcode_html = file_get_contents(PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.html');
19 foreach ($data['links'] as &$value) {
20 $qrcode = sprintf($qrcode_html, $value['url'], $value['url'], PluginManager
::$PLUGINS_PATH);
21 $value['link_plugin'][] = $qrcode;
28 * When linklist is displayed, include qrcode JS files.
30 * @param array $data - footer data.
32 * @return mixed - footer data with qrcode JS files added.
34 function hook_qrcode_render_footer($data)
36 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
37 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';