diff options
Diffstat (limited to 'code/pages.inc.php')
-rw-r--r-- | code/pages.inc.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/code/pages.inc.php b/code/pages.inc.php index 3a84aa3..7bdd907 100644 --- a/code/pages.inc.php +++ b/code/pages.inc.php @@ -1,7 +1,7 @@ <?PHP require_once('code/db.inc.php'); require_once('code/user.inc.php'); - require_once('code/handlers.inc.php'); + require_once('code/templates.inc.php'); class Pages { function Get($page, $type = null, $extra = null) { @@ -9,8 +9,8 @@ return array('title' => $page, 'content' => ErrorMessage('PageNotFound', array('page' => $page))); - if($type) $res = $GLOBALS['db']->Execute('SELECT id, name, type, handler, data FROM pages WHERE name = ? AND type = ?', array($page, $type)); - else $res = $GLOBALS['db']->Execute('SELECT id, name, type, handler, data FROM pages WHERE id = ?', $page); + if($type) $res = $GLOBALS['db']->Execute('SELECT id, name, type, template, data FROM pages WHERE name = ? AND type = ?', array($page, $type)); + else $res = $GLOBALS['db']->Execute('SELECT id, name, type, template, data FROM pages WHERE id = ?', $page); if(!$this->HasAccess($page, $type)) return array('title' => $res->fields[1], @@ -24,7 +24,7 @@ $data['_page'] = $res->fields[1]; $data['_type'] = $res->fields[2]; - return $GLOBALS['handlers'][$res->fields[3]]->Get($data); + return $GLOBALS['templates'][$res->fields[3]]->Get($data); } function GetEditor($page, $type = null) { @@ -32,8 +32,8 @@ return array('title' => $page, 'content' => ErrorMessage('PageNotFound', array('page' => $page))); - if($type) $res = $GLOBALS['db']->Execute('SELECT id, name, type, handler, data FROM pages WHERE name = ? AND type = ?', array($page, $type)); - else $res = $GLOBALS['db']->Execute('SELECT id, name, type, handler, data FROM pages WHERE id = ?', $page); + if($type) $res = $GLOBALS['db']->Execute('SELECT id, name, type, template, data FROM pages WHERE name = ? AND type = ?', array($page, $type)); + else $res = $GLOBALS['db']->Execute('SELECT id, name, type, template, data FROM pages WHERE id = ?', $page); if(!$GLOBALS['user']->IsAdmin()) return array('title' => $res->fields[1], @@ -76,11 +76,11 @@ return ($GLOBALS['user']->IsAdmin() || (ord($res->fields[0][$gid/8]) & (1 << ($gid%8))) != 0); } - function Add($name, $handler, $type) { + function Add($name, $template, $type) { if($this->Exists($name, $type)) return 0; - $GLOBALS['db']->Execute('INSERT INTO pages (name, handler, access, data, type) VALUES (?, ?, 0, "", ?)', - array($name, $handler, $type)); + $GLOBALS['db']->Execute('INSERT INTO pages (name, template, access, data, type) VALUES (?, ?, 0, "", ?)', + array($name, $templates, $type)); return $GLOBALS['db']->Insert_ID(); } @@ -123,10 +123,10 @@ else { if($this->Exists($new_name, $this->GetType($type))) return 0; - $res = $GLOBALS['db']->Execute('SELECT handler, data, type FROM pages WHERE id = ?', $page); + $res = $GLOBALS['db']->Execute('SELECT template, data, type FROM pages WHERE id = ?', $page); } - $GLOBALS['db']->Execute('INSERT INTO pages (name, handler, access, data, type) VALUES (?, ?, 0, ?, ?)', + $GLOBALS['db']->Execute('INSERT INTO pages (name, template, access, data, type) VALUES (?, ?, 0, ?, ?)', array($new_name, $res->fields[0], $res->fields[1], $res->fields[2])); return $GLOBALS['db']->Insert_ID(); |