aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/qrcode/qrcode.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/qrcode/qrcode.php')
-rw-r--r--plugins/qrcode/qrcode.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php
index 5f6e76a2..8bc610d1 100644
--- a/plugins/qrcode/qrcode.php
+++ b/plugins/qrcode/qrcode.php
@@ -17,7 +17,11 @@ function hook_qrcode_render_linklist($data)
17 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html'); 17 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
18 18
19 foreach ($data['links'] as &$value) { 19 foreach ($data['links'] as &$value) {
20 $qrcode = sprintf($qrcode_html, $value['real_url'], $value['real_url'], PluginManager::$PLUGINS_PATH); 20 $qrcode = sprintf($qrcode_html,
21 urlencode($value['url']),
22 $value['url'],
23 PluginManager::$PLUGINS_PATH
24 );
21 $value['link_plugin'][] = $qrcode; 25 $value['link_plugin'][] = $qrcode;
22 } 26 }
23 27
@@ -39,3 +43,19 @@ function hook_qrcode_render_footer($data)
39 43
40 return $data; 44 return $data;
41} 45}
46
47/**
48 * When linklist is displayed, include qrcode CSS file.
49 *
50 * @param array $data - header data.
51 *
52 * @return mixed - header data with qrcode CSS file added.
53 */
54function hook_qrcode_render_includes($data)
55{
56 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
57 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css';
58 }
59
60 return $data;
61}