summaryrefslogtreecommitdiffstats
path: root/code/pages.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'code/pages.inc.php')
-rw-r--r--code/pages.inc.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/code/pages.inc.php b/code/pages.inc.php
index e3af67a..549e24c 100644
--- a/code/pages.inc.php
+++ b/code/pages.inc.php
@@ -1,5 +1,5 @@
<?PHP
- Uses('user', 'templates');
+ Uses('user', 'templates', 'subst');
class Pages {
@@ -9,11 +9,11 @@
function Get($page, $type) {
if(!$this->Exists($page, $type))
return array('title' => $page,
- 'content' => ErrorMessage('PageNotFound', array('page' => $page)));
+ 'content' => Subst('<span class="error">{{The page \'' . $page . '\' does not exist.}}</span>'));
if(!$this->HasReadAccess($page, $type))
return array('title' => $page,
- 'content' => ErrorMessage('Forbidden', array('page' => $page)));
+ 'content' => Subst('<span class="error">{{The page \'' . $page . '\' is protected.}}</span>'));
$pagedata = $this->GetPageData($page, $type);
@@ -22,17 +22,19 @@
$data['_page'] = $page;
$data['_type'] = $type;
- return $GLOBALS['templates'][$pagedata['template']]->GetPage($data);
+ $ret = $GLOBALS['templates'][$pagedata['template']]->GetPage($data);
+
+ return array('title' => Subst($ret['title']), 'content' => Subst($ret['content']));
}
function GetEditor($page, $type, $backlink) {
if(!$this->Exists($page, $type))
return array('title' => $page,
- 'content' => ErrorMessage('PageNotFound', array('page' => $page)));
+ 'content' => Subst('<span class="error">{{The page \'' . $page . '\' does not exist.}}</span>'));
if(!$this->HasWriteAccess($page, $type))
return array('title' => $page,
- 'content' => ErrorMessage('Forbidden', array('page' => $page)));
+ 'content' => Subst('<span class="error">{{The page \'' . $page . '\' is protected.}}</span>'));
$pagedata = $this->GetPageData($page, $type);
@@ -41,7 +43,9 @@
$data['_type'] = $type;
$data['_backlink'] = $backlink;
- return $GLOBALS['templates'][$pagedata['template']]->GetEditor($data);
+ $ret = $GLOBALS['templates'][$pagedata['template']]->GetEditor($data);
+
+ return array('title' => Subst($ret['title']), 'content' => Subst($ret['content']));
}
function Exists($page, $type) {