]>
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) {
22 urlencode($value['url']),
24 PluginManager
::$PLUGINS_PATH
26 $value['link_plugin'][] = $qrcode;
33 * When linklist is displayed, include qrcode JS files.
35 * @param array $data - footer data.
37 * @return mixed - footer data with qrcode JS files added.
39 function hook_qrcode_render_footer($data)
41 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
42 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';
49 * When linklist is displayed, include qrcode CSS file.
51 * @param array $data - header data.
53 * @return mixed - header data with qrcode CSS file added.
55 function hook_qrcode_render_includes($data)
57 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
58 $data['css_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.css';
65 * This function is never called, but contains translation calls for GNU gettext extraction.
67 function qrcode_dummy_translation()
70 t('For each link, add a QRCode icon.');