summaryrefslogtreecommitdiff
path: root/src/views/Template.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/Template.class.php')
-rw-r--r--src/views/Template.class.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/views/Template.class.php b/src/views/Template.class.php
index 540e4fc..f57d5dc 100644
--- a/src/views/Template.class.php
+++ b/src/views/Template.class.php
@@ -1,10 +1,12 @@
<?php
+require_once('Login.class.php');
+
class Template {
private $indent = 0;
private $ret = false;
private $base = '/';
- private $mm = null;
+ private $db = null;
public function status($status) {
header($_SERVER["SERVER_PROTOCOL"]." $status");
@@ -13,7 +15,7 @@ class Template {
public function __construct($base_url, $mm=null) {
$this->base = $base_url;
- $this->mm = $mm;
+ $this->db = $mm->database();
}
public function setRet($ret) {
@@ -109,11 +111,11 @@ class Template {
echo $str;
}
public function header($title) {
- $mm = $this->mm;
- if ($mm==null) {
+ $db = $this->db;
+ if ($db==null) {
$username = false;
} else {
- $username = $mm->getUsername($mm->isLoggedIn());
+ $username = $db->getUsername(Login::isLoggedIn());
}
$ret = $this->ret;