| | |
| | | private $_loaded_classes = array(); |
| | | private $_conf; |
| | | |
| | | public function __construct() |
| | | { |
| | | public function __construct() { |
| | | global $conf; |
| | | |
| | | if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_REQUEST['s']) || isset($_REQUEST['s_old']) || isset($_REQUEST['conf'])) { |
| | |
| | | $this->uses('auth,plugin'); |
| | | } |
| | | |
| | | public function uses($classes) |
| | | { |
| | | public function uses($classes) { |
| | | $cl = explode(',', $classes); |
| | | if(is_array($cl)) { |
| | | foreach($cl as $classname){ |
| | |
| | | } |
| | | } |
| | | |
| | | public function load($files) |
| | | { |
| | | public function load($files) { |
| | | $fl = explode(',', $files); |
| | | if(is_array($fl)) { |
| | | foreach($fl as $file){ |
| | |
| | | } |
| | | |
| | | /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ |
| | | public function log($msg, $priority = 0) |
| | | { |
| | | public function log($msg, $priority = 0) { |
| | | global $conf; |
| | | if($priority >= $this->_conf['log_priority']) { |
| | | // $server_id = $conf["server_id"]; |
| | |
| | | } |
| | | |
| | | /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ |
| | | public function error($msg, $next_link = '', $stop = true, $priority = 1) |
| | | { |
| | | public function error($msg, $next_link = '', $stop = true, $priority = 1) { |
| | | //$this->uses("error"); |
| | | //$this->error->message($msg, $priority); |
| | | if($stop == true){ |
| | | $msg = '<!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" xml:lang="en" lang="en"> |
| | | <head> |
| | | <title>Error</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <link href="../themes/default/css/central.css" rel="stylesheet" type="text/css" /> |
| | | </head> |
| | | <body> |
| | | <div class="uniForm"> |
| | | <div id="errorMsg"> |
| | | <h3>Error</h3> |
| | | <ol> |
| | | <li>'.$msg; |
| | | $content = file_get_contents(dirname(__FILE__) . |
| | | '/../web/themes/' . $_SESSION['s']['theme'] . '/templates/error.tpl.htm'); |
| | | if($next_link != '') $msg .= '<a href="'.$next_link.'">Next</a>'; |
| | | $msg .= '</li> |
| | | </ol> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html>'; |
| | | die($msg); |
| | | $content = str_replace('###ERRORMSG###', $msg, $content); |
| | | die($content); |
| | | } else { |
| | | echo $msg; |
| | | if($next_link != '') echo "<a href='$next_link'>Next</a>"; |
| | |
| | | } |
| | | |
| | | /** Translates strings in current language */ |
| | | public function lng($text) |
| | | { |
| | | public function lng($text) { |
| | | if($this->_language_inc != 1) { |
| | | //* loading global Wordbook |
| | | $this->load_language_file('/lib/lang/'.$_SESSION['s']['language'].'.lng'); |
| | |
| | | } |
| | | } |
| | | |
| | | public function tpl_defaults() |
| | | { |
| | | public function tpl_defaults() { |
| | | $this->tpl->setVar('app_title', $this->_conf['app_title']); |
| | | if(isset($_SESSION['s']['user'])) { |
| | | $this->tpl->setVar('app_version', $this->_conf['app_version']); |