| version 1.51, 2007/02/01 18:12:24 |
version 1.52, 2007/02/17 16:55:48 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.50 2007-02-01 12:45:35 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.51 2007-02-01 18:12:24 nepto Exp $ */ |
| |
|
| function ezin_eval($evalcode) /* {{{ */ |
function ezin_eval($evalcode) /* {{{ */ |
| { |
{ |
| Line 1426 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1426 function ezin_cgi_parse() /* {{{ */ |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
/* |
| |
* dir_app - directory application related functions |
| |
*/ |
| |
|
| |
function ezin_dir_app_error_handler() /* {{{ */ |
| |
{ |
| |
// |
| |
// nothing to see here :-) |
| |
// |
| |
} /* }}} */ |
| |
|
| |
function ezin_dir_app_get_evalcode($url_part, $lib2_dir = null) /* {{{ */ |
| |
{ |
| |
if (strlen($lib2_dir) <= 0) { |
| |
$lib2_dir = $url_part; |
| |
} |
| |
|
| |
$ret =<<<END |
| |
\$ezin_old_error_handler = set_error_handler('ezin_dir_app_error_handler'); |
| |
\$ezin_tmpl_dir = getcwd(); |
| |
\$ezin_tmpl_subdir = dirname(Platon::str_replace_prefix(\$ezin_cfg['url'].$url_part, |
| |
'', \$_SERVER['SCRIPT_NAME'])); |
| |
if (@chdir(\$ezin_sys['dir']['root']."/lib2/$lib2_dir/".\$ezin_tmpl_subdir) == false) { |
| |
header('Location: http://'.\$_SERVER['HTTP_HOST'].\$ezin_cfg['url']); |
| |
exit; |
| |
} |
| |
if (@file_exists(basename(\$_SERVER['SCRIPT_NAME']))) { |
| |
@include(basename(\$_SERVER['SCRIPT_NAME'])); |
| |
} else { |
| |
@include('index.php'); |
| |
} |
| |
@chdir(\$ezin_tmpl_dir); |
| |
set_error_handler(\$ezin_old_error_handler); |
| |
END; |
| |
|
| |
return $ret; |
| |
} /* }}} */ |
| |
|
| |
function ezin_dir_app_include($url_part, $lib2_dir = null) /* {{{ */ |
| |
{ |
| |
global $ezin_cfg; |
| |
global $ezin_sys; |
| |
|
| |
// TODO: probably replace before/after slashes from $url_part |
| |
|
| |
if (strlen($lib2_dir) <= 0) { |
| |
$lib2_dir = $url_part; |
| |
} |
| |
|
| |
$ezin_tmpl_dir = getcwd(); |
| |
$ezin_tmpl_subdir = dirname(Platon::str_replace_prefix($ezin_cfg['url'] . $url_part, |
| |
'', $_SERVER['SCRIPT_NAME'])); |
| |
|
| |
if (@chdir($ezin_sys['dir']['root']."/lib2/$lib2_dir/$ezin_tmpl_subdir") == false) { |
| |
header('Location: http://'.$_SERVER['HTTP_HOST'].$ezin_cfg['url']); |
| |
exit; |
| |
} |
| |
|
| |
if (@file_exists(basename($_SERVER['SCRIPT_NAME']))) { |
| |
@include(basename($_SERVER['SCRIPT_NAME'])); |
| |
} else { |
| |
@include('index.php'); |
| |
} |
| |
|
| |
@chdir($ezin_tmpl_dir); |
| |
} /* }}} */ |
| |
|
| /* Modeline for ViM {{{ |
/* Modeline for ViM {{{ |
| * vim: set ts=4: |
* vim: set ts=4: |
| * vim600: fdm=marker fdl=0 fdc=0: |
* vim600: fdm=marker fdl=0 fdc=0: |