aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/PageBuilder.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-07 18:19:09 +0200
committerArthurHoaro <arthur@hoa.ro>2017-05-07 18:21:38 +0200
commit73c896265424873a4e8e5dc70f99413e56dfcce9 (patch)
treef67159684de55371f4de68d893c896cf0f12696e /application/PageBuilder.php
parentb4189928f84758e1589715dfe04e2d966a4f3b88 (diff)
downloadShaarli-73c896265424873a4e8e5dc70f99413e56dfcce9.tar.gz
Shaarli-73c896265424873a4e8e5dc70f99413e56dfcce9.tar.zst
Shaarli-73c896265424873a4e8e5dc70f99413e56dfcce9.zip
Inject tag list everywhere to make autocomplete work on the fixed search bar
Diffstat (limited to 'application/PageBuilder.php')
-rw-r--r--application/PageBuilder.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 8e39455b..50e3f124 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -22,15 +22,22 @@ class PageBuilder
22 protected $conf; 22 protected $conf;
23 23
24 /** 24 /**
25 * @var LinkDB $linkDB instance.
26 */
27 protected $linkDB;
28
29 /**
25 * PageBuilder constructor. 30 * PageBuilder constructor.
26 * $tpl is initialized at false for lazy loading. 31 * $tpl is initialized at false for lazy loading.
27 * 32 *
28 * @param ConfigManager $conf Configuration Manager instance (reference). 33 * @param ConfigManager $conf Configuration Manager instance (reference).
34 * @param LinkDB $linkDB instance.
29 */ 35 */
30 public function __construct(&$conf) 36 public function __construct(&$conf, $linkDB = null)
31 { 37 {
32 $this->tpl = false; 38 $this->tpl = false;
33 $this->conf = $conf; 39 $this->conf = $conf;
40 $this->linkDB = $linkDB;
34 } 41 }
35 42
36 /** 43 /**
@@ -81,6 +88,9 @@ class PageBuilder
81 $this->tpl->assign('feed_type', $this->conf->get('feed.show_atom', true) !== false ? 'atom' : 'rss'); 88 $this->tpl->assign('feed_type', $this->conf->get('feed.show_atom', true) !== false ? 'atom' : 'rss');
82 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false)); 89 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false));
83 $this->tpl->assign('token', getToken($this->conf)); 90 $this->tpl->assign('token', getToken($this->conf));
91 if ($this->linkDB !== null) {
92 $this->tpl->assign('tags', $this->linkDB->allTags());
93 }
84 // To be removed with a proper theme configuration. 94 // To be removed with a proper theme configuration.
85 $this->tpl->assign('conf', $this->conf); 95 $this->tpl->assign('conf', $this->conf);
86 } 96 }