]>
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.
11 * Add qrcode icon to link_plugin when rendering linklist.
13 * @param array $data - linklist data.
15 * @return mixed - linklist data with qrcode plugin.
17 function hook_qrcode_render_linklist($data)
19 $qrcode_html = file_get_contents(PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.html');
21 foreach ($data['links'] as &$value) {
24 urlencode($value['url']),
26 PluginManager
::$PLUGINS_PATH
28 $value['link_plugin'][] = $qrcode;
35 * When linklist is displayed, include qrcode JS files.
37 * @param array $data - footer data.
39 * @return mixed - footer data with qrcode JS files added.
41 function hook_qrcode_render_footer($data)
43 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
44 $data['js_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';
51 * When linklist is displayed, include qrcode CSS file.
53 * @param array $data - header data.
55 * @return mixed - header data with qrcode CSS file added.
57 function hook_qrcode_render_includes($data)
59 if ($data['_PAGE_'] == Router
::$PAGE_LINKLIST) {
60 $data['css_files'][] = PluginManager
::$PLUGINS_PATH . '/qrcode/qrcode.css';
67 * This function is never called, but contains translation calls for GNU gettext extraction.
69 function qrcode_dummy_translation()
72 t('For each link, add a QRCode icon.');