summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-09-05 01:22:27 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-09-05 01:22:27 -0400
commit570901ba4e526be37afd0cbbe018cb0500a7cda1 (patch)
tree81f13e66cfd795141cac216fd2af610e877a1a31 /src/views
parentad4a7ff9159c2c64cea98d7189f46fa7d6174fc2 (diff)
Refactor a bit
* move a lot of stuff out of MessageManager * move models from lib to models
Diffstat (limited to 'src/views')
-rw-r--r--src/views/Template.class.php12
-rw-r--r--src/views/pages/plugins/index.html.php2
-rw-r--r--src/views/pages/users/500.html.php3
3 files changed, 10 insertions, 7 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;
diff --git a/src/views/pages/plugins/index.html.php b/src/views/pages/plugins/index.html.php
index 0e14161..d62b555 100644
--- a/src/views/pages/plugins/index.html.php
+++ b/src/views/pages/plugins/index.html.php
@@ -2,4 +2,4 @@
$t = $VARS['template'];
$t->header('Administrator Plugin Management');
-$t->openTag('form',array('method'=>'post','action'=>$m->baseUrl().plugins));
+$t->openTag('form',array('method'=>'post','action'=>$t->url('plugins')));
diff --git a/src/views/pages/users/500.html.php b/src/views/pages/users/500.html.php
index 27038a4..f4f1c42 100644
--- a/src/views/pages/users/500.html.php
+++ b/src/views/pages/users/500.html.php
@@ -1,5 +1,6 @@
<?php global $VARS, $mm;
$t = $VARS['template'];
+$db = $mm->database();
$t->status('500 Internal Server Error');
$t->header('Unknown error');
@@ -9,5 +10,5 @@ $t->paragraph("An unknown error was encountered when creating ".
"error is on our end. Sorry.");
$t->paragraph("Here's a dump of the SQL error stack, it may ".
"help us find the issue:");
-$t->tag('pre', array(), htmlentities($mm->mysql_error()));
+$t->tag('pre', array(), htmlentities($db->mysql_error()));
$t->footer();