| 3 |
// $Id$ |
// $Id$ |
| 4 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
| 5 |
// $Log$ |
// $Log$ |
| 6 |
|
// Revision 1.2 2002/12/12 21:37:46 joko |
| 7 |
|
// + fixes: now returning success-/error-status |
| 8 |
|
// |
| 9 |
// Revision 1.1 2002/11/12 05:42:31 joko |
// Revision 1.1 2002/11/12 05:42:31 joko |
| 10 |
// + initial checkin |
// + initial checkin |
| 11 |
// |
// |
| 19 |
function includeFile($filename) { |
function includeFile($filename) { |
| 20 |
|
|
| 21 |
// TODO: try to remove these globals! |
// TODO: try to remove these globals! |
| 22 |
|
global $site; |
| 23 |
global $site_state; |
global $site_state; |
| 24 |
global $uservars; |
global $uservars; |
| 25 |
global $request; |
global $request; |
| 26 |
|
global $http_referer; |
| 27 |
|
|
| 28 |
$this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG); |
$this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG); |
| 29 |
$site = &$this->site; |
$site = &$this->site; |
| 30 |
include($filename); |
if (include($filename)) { |
| 31 |
|
return 1; |
| 32 |
|
} |
| 33 |
|
|
| 34 |
} |
} |
| 35 |
|
|
| 36 |
function loadComponent($name, $type = "") { |
function loadComponent($name, $type = "") { |
| 40 |
switch ($type) { |
switch ($type) { |
| 41 |
case "handler": |
case "handler": |
| 42 |
$prefix = $this->site->config[path][base] . 'core/handler/'; |
$prefix = $this->site->config[path][base] . 'core/handler/'; |
| 43 |
$postfix = ".handler.php"; |
//$postfix = ".handler.php"; |
| 44 |
|
$postfix = ".php"; |
| 45 |
break; |
break; |
| 46 |
case "page": |
case "page": |
| 47 |
$prefix = $this->site->config[path][base] . 'core/pages/'; |
$prefix = $this->site->config[path][base] . 'core/pages/'; |
| 49 |
break; |
break; |
| 50 |
} |
} |
| 51 |
$includefile = "$prefix$name$postfix"; |
$includefile = "$prefix$name$postfix"; |
| 52 |
$this->includeFile($includefile); |
return $this->includeFile($includefile); |
| 53 |
} |
} |
| 54 |
|
|
| 55 |
function loadHandler($name) { |
function loadHandler($name) { |
| 56 |
$this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG); |
$this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG); |
| 57 |
$this->loadComponent($name, "handler"); |
return $this->loadComponent($name, "handler"); |
| 58 |
} |
} |
| 59 |
|
|
| 60 |
function loadPage($name) { |
function loadPage($name) { |
| 61 |
$this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG); |
$this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG); |
| 62 |
$this->loadComponent($name, "page"); |
return $this->loadComponent($name, "page"); |
| 63 |
} |
} |
| 64 |
|
|
| 65 |
|
|