aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/PageBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/PageBuilder.php')
-rw-r--r--application/PageBuilder.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index b133dee8..c86621a2 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -1,5 +1,7 @@
1<?php 1<?php
2 2
3use Shaarli\Config\ConfigManager;
4
3/** 5/**
4 * This class is in charge of building the final page. 6 * This class is in charge of building the final page.
5 * (This is basically a wrapper around RainTPL which pre-fills some fields.) 7 * (This is basically a wrapper around RainTPL which pre-fills some fields.)
@@ -20,15 +22,22 @@ class PageBuilder
20 protected $conf; 22 protected $conf;
21 23
22 /** 24 /**
25 * @var LinkDB $linkDB instance.
26 */
27 protected $linkDB;
28
29 /**
23 * PageBuilder constructor. 30 * PageBuilder constructor.
24 * $tpl is initialized at false for lazy loading. 31 * $tpl is initialized at false for lazy loading.
25 * 32 *
26 * @param ConfigManager $conf Configuration Manager instance (reference). 33 * @param ConfigManager $conf Configuration Manager instance (reference).
34 * @param LinkDB $linkDB instance.
27 */ 35 */
28 public function __construct(&$conf) 36 public function __construct(&$conf, $linkDB = null)
29 { 37 {
30 $this->tpl = false; 38 $this->tpl = false;
31 $this->conf = $conf; 39 $this->conf = $conf;
40 $this->linkDB = $linkDB;
32 } 41 }
33 42
34 /** 43 /**
@@ -79,6 +88,9 @@ class PageBuilder
79 $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');
80 $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));
81 $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->linksCountPerTag());
93 }
82 // To be removed with a proper theme configuration. 94 // To be removed with a proper theme configuration.
83 $this->tpl->assign('conf', $this->conf); 95 $this->tpl->assign('conf', $this->conf);
84 } 96 }