summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-04-09 20:07:04 +0200
committerneoraider <devnull@localhost>2006-04-09 20:07:04 +0200
commit98a8e34271bb39831f373fb1e320dbb0ef7bca23 (patch)
tree0e8e6475a15d8c39bdc1b4eb1540357bbc922c87
parente90e38401db578819240d4827597cdec61d0727d (diff)
downloadneon-98a8e34271bb39831f373fb1e320dbb0ef7bca23.tar
neon-98a8e34271bb39831f373fb1e320dbb0ef7bca23.zip
Template-Ansatz verworfen. Warnung in der pages.inc.php gefixt.
-rw-r--r--code/pages.inc.php1
-rw-r--r--index.php28
-rw-r--r--templates/default17
3 files changed, 19 insertions, 27 deletions
diff --git a/code/pages.inc.php b/code/pages.inc.php
index d2a0009..50e45fe 100644
--- a/code/pages.inc.php
+++ b/code/pages.inc.php
@@ -16,6 +16,7 @@
return array('title' => $res->fields[1],
'content' => ErrorMessage('Forbidden', array('page' => $res->fields[1])));
+ $data = null;
parse_str($res->fields[4], $data);
$data = array_map('Unquote', $data);
if($extra) $data = array_merge($data, $extra);
diff --git a/index.php b/index.php
index 7c8dc3c..4f4ddd7 100644
--- a/index.php
+++ b/index.php
@@ -8,19 +8,27 @@
header('Content-type: text/html;charset=UTF-8');
- // provisional
- $template = 'default';
- $style = $config['default_style'];
-
if($_GET['page']) $page = Unquote($_GET['page']);
else $page = $config['home'];
- $template_data = join('', file('templates/' . $template));
-
$data = $pages->Get($page, 'c');
- echo Subst($template_data, array('title' => $config['title'] . $data['title'],
- 'stylesheet' => 'styles/' . $style . '/style.css',
- 'content' => $data['content'],
- 'nav' => $nav->ParseEntries()));
+ 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>
+ <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 echo $data['content']; ?>
+ </div>
+ </body>
+</html>
diff --git a/templates/default b/templates/default
deleted file mode 100644
index 4392474..0000000
--- a/templates/default
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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>
- <head>
- <title>$title</title>
- <link rel="stylesheet" type="text/css" href="$stylesheet" />
- </head>
- <body>
- <div id="nav">
- $nav
- </div>
- <div id="content">
- $content
- </div>
- </body>
-</html>