summaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-04-11 20:34:03 +0200
committerneoraider <devnull@localhost>2006-04-11 20:34:03 +0200
commit3634676b7fab1da7ffb5f3d32bc4608a6f339305 (patch)
treef9a8e5cf5f78c2a76cda3152ee8b58cf286a4292 /code
parent2fe04a4707412ff2f4f8df5f5524bb1b2dcbb3d7 (diff)
downloadneon-3634676b7fab1da7ffb5f3d32bc4608a6f339305.tar
neon-3634676b7fab1da7ffb5f3d32bc4608a6f339305.zip
Handler hei?en jetzt Templates.
Diffstat (limited to 'code')
-rw-r--r--code/modules.inc.php20
-rw-r--r--code/pages.inc.php22
-rw-r--r--code/templates.inc.php (renamed from code/handlers.inc.php)6
3 files changed, 24 insertions, 24 deletions
diff --git a/code/modules.inc.php b/code/modules.inc.php
index 1e84d45..4c17807 100644
--- a/code/modules.inc.php
+++ b/code/modules.inc.php
@@ -4,8 +4,8 @@
function require_mod($file) {
if(isset($GLOBALS['modules']->code[$file]))
require_once($GLOBALS['modules']->code[$file]);
- elseif(isset($GLOBALS['modules']->handlers[$file]))
- require_once($GLOBALS['modules']->handlers[$file]);
+ elseif(isset($GLOBALS['modules']->templates[$file]))
+ require_once($GLOBALS['modules']->templates[$file]);
else
require_once($file);
}
@@ -13,12 +13,12 @@
class Modules {
var $modules;
var $code;
- var $handlers;
+ var $templates;
function Modules() {
$this->modules = array();
$this->code = array();
- $this->handlers = array();
+ $this->templates = array();
$dir = opendir('modules');
@@ -39,7 +39,7 @@
$name = $name['children'][0];
$this->module[$name] = array('name' => $name, 'code' => array(),
- 'handlers' => array());
+ 'templates' => array());
$files = $GLOBALS['xmlparser']->FindTag($data, 'files');
if(!is_array($files)) continue;
@@ -57,12 +57,12 @@
$this->code[$filename] = $realname;
$this->modules[$name]['code'][$filename] = $realname;
break;
- case 'handler':
- $filename = 'handlers/' . $file['children'][0] . '.inc.php';
- $realname = 'modules/' . $moddir . '/handlers/' . $file['children'][0] . '.inc.php';
+ case 'template':
+ $filename = 'templates/' . $file['children'][0] . '.inc.php';
+ $realname = 'modules/' . $moddir . '/templates/' . $file['children'][0] . '.inc.php';
- $this->handlers[$filename] = $realname;
- $this->modules[$name]['handlers'][$filename] = $realname;
+ $this->templates[$filename] = $realname;
+ $this->modules[$name]['templates'][$filename] = $realname;
}
}
}
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();
diff --git a/code/handlers.inc.php b/code/templates.inc.php
index a167ba8..7abfe79 100644
--- a/code/handlers.inc.php
+++ b/code/templates.inc.php
@@ -1,14 +1,14 @@
<?PHP
require_once('code/modules.inc.php');
- $dir = opendir('handlers');
+ $dir = opendir('templates');
while($file = readdir($dir))
if($file[0] != '.' && substr($file, -8) == '.inc.php')
- include('handlers/' . $file);
+ include('templates/' . $file);
closedir($dir);
- foreach($GLOBALS['modules']->handlers as $file)
+ foreach($GLOBALS['modules']->templates as $file)
include($file);
?>