more updates
This commit is contained in:
@@ -421,43 +421,20 @@ class Bootstrap
|
||||
* @param $data associative
|
||||
* array containig the template data
|
||||
*/
|
||||
public function renderTemplate($template, $data = array())
|
||||
public static function renderTemplate($template, $data = array())
|
||||
{
|
||||
if (!defined('PATH_THIRDPARTY')) {
|
||||
throw new Exception('System constant (PATH_THIRDPARTY) is not defined!');
|
||||
}
|
||||
|
||||
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
|
||||
$fInfo = pathinfo($template);
|
||||
|
||||
$tplExists = true;
|
||||
|
||||
|
||||
// file has absolute path
|
||||
if (substr($template, 0, 1) != PATH_SEP) {
|
||||
$template = PATH_TEMPLATE . $template;
|
||||
}
|
||||
|
||||
// fix for template that have dot in its name but is not a valid
|
||||
// extension
|
||||
if (isset($fInfo ['extension']) && ($fInfo ['extension'] != 'tpl' || $fInfo ['extension'] != 'html')) {
|
||||
unset($fInfo ['extension']);
|
||||
}
|
||||
|
||||
if (!isset($fInfo ['extension'])) {
|
||||
if (file_exists($template . '.tpl')) {
|
||||
$template .= '.tpl';
|
||||
} elseif (file_exists($template . '.html')) {
|
||||
$template .= '.html';
|
||||
} else {
|
||||
$tplExists = false;
|
||||
}
|
||||
} else {
|
||||
if (!file_exists($template)) {
|
||||
$tplExists = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$tplExists) {
|
||||
|
||||
if (! file_exists($template)) {
|
||||
throw new Exception("Template: $template, doesn't exist!");
|
||||
}
|
||||
|
||||
@@ -495,7 +472,7 @@ class Bootstrap
|
||||
*
|
||||
* @author <erik@colosa.com>
|
||||
*/
|
||||
public function sys_get_temp_dir()
|
||||
public static function sys_get_temp_dir()
|
||||
{
|
||||
if (!function_exists('sys_get_temp_dir')) {
|
||||
// Based on http://www.phpit.net/
|
||||
|
||||
52
gulliver/templates/error.tpl
Normal file
52
gulliver/templates/error.tpl
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Server Error :: </title>
|
||||
</head>
|
||||
<style>
|
||||
|
||||
.box {
|
||||
-moz-border-radius:6px; /* Rounded edges in Firefox */
|
||||
color :#000;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
border-color:#000;
|
||||
font :normal 8pt Tahoma,sans-serif,MiscFixed;
|
||||
text-decoration:none;
|
||||
|
||||
padding:0 20px;
|
||||
vertical-align:middle;
|
||||
font-weight: bold;
|
||||
background-color:#DBDBDB;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class='box'>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0" class="mainCopy">
|
||||
<tr>
|
||||
<td width="15%" align="left" scope="col">
|
||||
<span class="mxbOnlineTextBlue">{$title}</span><br />
|
||||
<hr/>
|
||||
{$message}<br /><br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<table>
|
||||
<tr><td><small><pre>{$trace}</pre></small></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user