]>
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,
21 urlencode($value['url']),
23 PluginManager
::$PLUGINS_PATH
25 $value['link_plugin'][] = $qrcode;
32 * When linklist is displayed, include qrcode JS files.
34 * @param array $data - footer data.
36 * @return mixed - footer data with qrcode JS files added.
38 function hook_qrcode_render_footer($data)
40 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
41 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';
48 * When linklist is displayed, include qrcode CSS file.
50 * @param array $data - header data.
52 * @return mixed - header data with qrcode CSS file added.
54 function hook_qrcode_render_includes($data)
56 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
57 $data['css_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.css';