summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-09-22 15:05:04 +0200
committerneoraider <devnull@localhost>2006-09-22 15:05:04 +0200
commitc8ef6f06beafe500b85cdb252477217d9e017114 (patch)
tree1a0c823073810509ad020c7d5716f06e48a2f399
parentd02a8a4f7f23bd63b8d541e3f4290b72c4e15ec0 (diff)
downloadneon-c8ef6f06beafe500b85cdb252477217d9e017114.tar
neon-c8ef6f06beafe500b85cdb252477217d9e017114.zip
Bugfix in messages.inc.php;
Provisorischen base-Seitentyp hinzugef?gt.
-rw-r--r--base.xml3
-rw-r--r--code/message.inc.php10
-rw-r--r--core/modules.inc.php2
-rw-r--r--index.php37
-rw-r--r--lang/de.inc.php10
-rw-r--r--pages/base/default.xml45
6 files changed, 66 insertions, 41 deletions
diff --git a/base.xml b/base.xml
index a350b20..625f42e 100644
--- a/base.xml
+++ b/base.xml
@@ -12,6 +12,8 @@
<code>templates</code>
<code>user</code>
<code>util</code>
+
+ <page type="b">default</page>
<page type="c">Login</page>
<page type="c">Logout</page>
<page type="c">Modules</page>
@@ -35,6 +37,7 @@
<page type="e">default</page>
<page type="e">phpexec</page>
<page type="n">Login</page>
+
<template>default</template>
<template>phpexec</template>
</files>
diff --git a/code/message.inc.php b/code/message.inc.php
index 8545a01..fb9e8fa 100644
--- a/code/message.inc.php
+++ b/code/message.inc.php
@@ -1,11 +1,11 @@
<?PHP
Uses('util');
- $message['Error'] = 'Error';
- $message['PageNotFound'] = 'The page \'$page\' does not exist.';
- $message['Forbidden'] = 'The page \'$page\' is protected.';
- $message['InternalError'] = 'An internal error has occourred.';
- $message['LoginError'] = 'Login failed. Username or password is wrong.';
+ $GLOBALS['message']['Error'] = 'Error';
+ $GLOBALS['message']['PageNotFound'] = 'The page \'$page\' does not exist.';
+ $GLOBALS['message']['Forbidden'] = 'The page \'$page\' is protected.';
+ $GLOBALS['message']['InternalError'] = 'An internal error has occourred.';
+ $GLOBALS['message']['LoginError'] = 'Login failed. Username or password is wrong.';
if($config['language'] != 'en') @include('lang/' . $config['language'] . '.inc.php');
diff --git a/core/modules.inc.php b/core/modules.inc.php
index 395b8ad..a5c8d32 100644
--- a/core/modules.inc.php
+++ b/core/modules.inc.php
@@ -129,7 +129,7 @@
function GetPagePath($name, $type) {
return $this->pages[$name . '.' . $type]['path'] . 'pages/' .
- strtr($type, array('c' => 'content', 'e' => 'editor', 'n' => 'nav')) . '/' . $name . '.xml';
+ strtr($type, array('c' => 'content', 'e' => 'editor', 'n' => 'nav', 'b' => 'base')) . '/' . $name . '.xml';
}
function GetTemplatePath($name) {
diff --git a/index.php b/index.php
index ae92eaf..cef78c6 100644
--- a/index.php
+++ b/index.php
@@ -4,40 +4,17 @@
require_once('core/modules.inc.php');
require_once('core/xmlparser.inc.php');
- Uses('message', 'util', 'pages', 'nav', 'links');
+ Uses('util', 'pages', 'links');
header('Content-type: text/html;charset=UTF-8');
if($_GET['page']) $page = Unquote($_GET['page']);
- else $page = $config['home'];
+ else $page = $GLOBALS['config']['home'];
- if($_GET['mode'] == 'edit') $data = $pages->GetEditor($page, 'c', $GLOBALS['links']->GetNeonLink($page, null, false));
- else $data = $pages->Get($page, 'c');
+ if($_GET['mode'] == 'edit') $data = $GLOBALS['pages']->GetEditor($page, 'c', $GLOBALS['links']->GetNeonLink($page, null, false));
+ else $data = $GLOBALS['pages']->Get($page, 'c');
- echo '<?xml version="1.0" encoding="UTF-8" ?>';
+ $base = $pages->Get($GLOBALS['config']['default_base'], 'b');
+
+ echo $base['content'];
?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><?PHP echo $config['title'] . $data['title']; ?></title>
- <link rel="stylesheet" type="text/css" href="styles/<?PHP echo $config['default_style']; ?>/style.css" />
- </head>
- <body>
- <div id="nav">
- <?PHP echo $nav->ParseEntries(); ?>
- </div>
- <div id="content">
- <?PHP
- if($pages->HasWriteAccess($page, 'c') && $_GET['mode'] != 'edit') {
- $backlink = $GLOBALS['links']->GetNeonLink($page);
-
- echo '<a class="editlink" href="' . $GLOBALS['links']->GetNeonLink($page, 'mode=edit') . '">Bearbeiten</a>';
- }
-
- echo $data['content'];
- ?>
- </div>
- </body>
-</html>
diff --git a/lang/de.inc.php b/lang/de.inc.php
index 868301b..2eaa333 100644
--- a/lang/de.inc.php
+++ b/lang/de.inc.php
@@ -1,7 +1,7 @@
<?PHP
- $message['Error'] = 'Fehler';
- $message['PageNotFound'] = 'Die Seite \'$page\' existiert nicht.';
- $message['Forbidden'] = 'Die Seite \'$page\' ist geschützt.';
- $message['InternalError'] = 'Ein interner Fehler ist aufgetreten.';
- $message['LoginError'] = 'Login fehlgeschlagen. Username oder Passwort ist falsch.';
+ $GLOBALS['message']['Error'] = 'Fehler';
+ $GLOBALS['message']['PageNotFound'] = 'Die Seite \'$page\' existiert nicht.';
+ $GLOBALS['message']['Forbidden'] = 'Die Seite \'$page\' ist geschützt.';
+ $GLOBALS['message']['InternalError'] = 'Ein interner Fehler ist aufgetreten.';
+ $GLOBALS['message']['LoginError'] = 'Login fehlgeschlagen. Username oder Passwort ist falsch.';
?>
diff --git a/pages/base/default.xml b/pages/base/default.xml
new file mode 100644
index 0000000..b28aa56
--- /dev/null
+++ b/pages/base/default.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>base</name>
+ <template>phpexec</template>
+ <access>9:0</access>
+ <type>b</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ Uses('nav', 'pages', 'links');
+
+ echo '<?xml version="1.0" encoding="UTF-8" ?>';
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><?PHP echo $config['title'] . $data['title']; ?></title>
+ <link rel="stylesheet" type="text/css" href="styles/<?PHP echo $GLOBALS['config']['default_style']; ?>/style.css" />
+ </head>
+ <body>
+ <div id="nav">
+ <?PHP echo $GLOBALS['nav']->ParseEntries(); ?>
+ </div>
+ <div id="content">
+ <?PHP
+ if($GLOBALS['pages']->HasWriteAccess($GLOBALS['page'], 'c') && $_GET['mode'] != 'edit') {
+ $backlink = $GLOBALS['links']->GetNeonLink($GLOBALS['page']);
+
+ echo '<a class="editlink" href="' . $GLOBALS['links']->GetNeonLink($GLOBALS['page'], 'mode=edit') . '">Bearbeiten</a>';
+ }
+
+ echo $GLOBALS['data']['content'];
+ ?>
+ </div>
+ </body>
+</html>
+ ]]>
+ </code>
+ </data>
+</page>