diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-05-07 18:39:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-07 18:39:25 +0200 |
commit | a9fe41a818c0a687e0a63795b55decc321a1f57a (patch) | |
tree | 2fc4a60bf43af7d4a9a53eef5a1f55377ac4cbd4 /application | |
parent | 3108f2a8008280f857f56db50d6f0145d680b142 (diff) | |
parent | 73c896265424873a4e8e5dc70f99413e56dfcce9 (diff) | |
download | Shaarli-a9fe41a818c0a687e0a63795b55decc321a1f57a.tar.gz Shaarli-a9fe41a818c0a687e0a63795b55decc321a1f57a.tar.zst Shaarli-a9fe41a818c0a687e0a63795b55decc321a1f57a.zip |
Merge pull request #862 from ArthurHoaro/theme/tags-everywhere
Inject tag list everywhere to make autocomplete work on the fixed search bar
Diffstat (limited to 'application')
-rw-r--r-- | application/PageBuilder.php | 14 |
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 | } |