Commit 0822235b5f688d5177f97b6a8dc2909df606e0ff

  • avatar
  • p4bl0 <pablo.rauzy @gm…l.com>
  • Sun Mar 08 00:12:07 CET 2009
cleaning all the code
Belokan.php
(21 / 20)
  
1111class Belokan {
1212
1313 private
14 $_config,
15 $_request;
14 $_config;
1615
1716 public function __construct ($config_file=null)
1817 {
19 spl_autoload_register(array($this, 'autoloader'));
18 spl_autoload_register('Belokan::autoloader');
2019 $this->_config = Belokan_Config::getInstance();
2120 if ($config_file != null) $this->_config->loadFile($config_file);
22 $this->_request = Belokan_Request::getInstance();
2321 }
2422
2523 public function run ()
2624 {
2725 $logBelokan = $this->_config->get('log', 'belokan');
2826 $log = Belokan_Log::getInstance();
29 $ctrl = $this->_request->getController();
30 $action = $this->_request->getAction();
27 $req = Belokan_Request::getInstance();
28 $ctrl = $req->getController();
29 $action = $req->getAction();
3130 $ctrlClass = $ctrl.'Controller';
3231 $actionMethod = $action.'Action';
3332 $RESTCtrl = false;
34
33
3534 if (!class_exists($ctrlClass)) {
3635 if ($logBelokan)
37 $log->add('Belokan', '['.date('Y-m-d H:i').'] Request undefined controller ('.$ctrl.'). HTTP 404 error generated.');
36 $log->add('Belokan', 'Request unknown controller ('.$ctrl.'). HTTP 404 error generated.');
3837 $actionMethod = 'e404';
3938 $ctrlInstance = new HttpErrorsController('HttpErrors', 'e404');
4039 } else {
4140 $ctrlInstance = new $ctrlClass($ctrl, $action);
4241 $RESTCtrl = $ctrlInstance instanceof Belokan_REST_Controller;
43
44 if (!$RESTCtrl && !method_exists($ctrlClass, $actionMethod)) {
42
43 if (0 && !$RESTCtrl && !method_exists($ctrlClass, $actionMethod)) {
4544 if ($logBelokan)
46 $log->add('Belokan', '['.date('Y-m-d H:i').'] Request undefined action ('.$action.') for controller '.$ctrl.'. HTTP 404 error generated.');
45 $log->add('Belokan', 'Request unknown action ('.$action.') for controller '.$ctrl.'. HTTP 404 error generated.');
4746 $actionMethod = 'e404';
4847 $ctrlInstance = new HttpErrorsController('HttpErrors', 'e404');
4948 }
5050
5151 $ctrlInstance->_pre_action();
5252 if ($RESTCtrl)
53 call_user_func(array($ctrlInstance, strtolower($this->_request->getMethod())), $action);
53 call_user_func(array($ctrlInstance, strtolower($req->getMethod())), $action);
5454 else
5555 call_user_func(array($ctrlInstance, $actionMethod));
5656 $ctrlInstance->_post_action();
6464
6565 public static function autoloader ($class_name)
6666 {
67 static $config = null;
68 if ($config == null)
69 $config = Belokan_Config::getInstance();
70
6771 if (substr($class_name, 0, 8) == 'Belokan_')
6872 $classPath = dirname(__FILE__).str_replace('_', '/', substr($class_name, 7)).'.php';
6973 else if (substr($class_name, -10) == 'Controller')
70 $classPath = Belokan_Config::getInstance()->get('dir', 'controllers').substr($class_name, 0, -10).'.php';
74 $classPath = $config->get('dir', 'controllers').substr($class_name, 0, -10).'.php';
7175 else {
72 $classPath = Belokan_Config::getInstance()->get('dir', 'models').str_replace('_', '/', $class_name).'.php';
73 if (!file_exists($classPath) && Belokan_Config::getInstance()->exists('dir', 'lib')) {
74 $classPath = Belokan_Config::getInstance()->get('dir', 'lib').str_replace('_', '/', $class_name).'.php';
75 }
76 $classPath = $config->get('dir', 'models').str_replace('_', '/', $class_name).'.php';
77 if (!file_exists($classPath) && $config->exists('dir', 'lib'))
78 $classPath = $config->get('dir', 'lib').str_replace('_', '/', $class_name).'.php';
7679 }
7780
7881 if (file_exists($classPath)) {
7982 require_once $classPath;
8083 return true;
8184 } else {
82 if (Belokan_Config::getInstance()->get('log', 'belokan')) {
83 Belokan_Log::getInstance()->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: Trying to load an inexistant class ('.$class_name.').');
84 }
85 if ($config->get('log', 'belokan'))
86 Belokan_Log::getInstance()->add('Belokan', 'ERROR: Trying to load an inexistant class ('.$class_name.').');
8587 return false;
8688 }
8789 }
Cache.php
(7 / 10)
  
1616 $_updateValue,
1717 $_buffer;
1818
19 public function __construct ($key, $cond_type='time', $cond_value='3600')
19 public function __construct ($key=null, $cond_type='time', $cond_value='3600')
2020 {
2121 $config = Belokan_Config::getInstance();
2222
23 if ($key === null) $key = md5($_SERVER['REQUEST_URI']);
23 if ($key == null) $key = md5($_SERVER['REQUEST_URI']);
2424
2525 if ($config->exists('dir', 'cache'))
2626 $this->_file = $config->get('dir', 'cache').$key.'.cache';
2727 else if ($config->get('log', 'belokan')) {
28 echo $err = 'ERROR: No cache directory specified in the configuration.';
29 Belokan_Log::getInstance()->add('Belokan', '['.date('Y-m-d H:i').']'.$err);
28 Belokan_Log::getInstance()->add('Belokan', 'ERROR: No cache directory specified in the configuration.');
3029 exit;
3130 }
3231
3939 {
4040 if (!file_exists($this->_file)) return false;
4141 if ($this->_updateType == 'forced') return false;
42 if ($this->_updateType == 'time' &&
43 (time() - filemtime($this->_file))
44 > $this->_updateValue) return false;
45 if ($this->_updateType == 'date' &&
46 date($this->_updateValue, filemtime($this->_file))
47 != date($this->_updateValue)) return false;
42 if ($this->_updateType == 'time' && (time() - filemtime($this->_file)) > $this->_updateValue)
43 return false;
44 if ($this->_updateType == 'date' && date($this->_updateValue, filemtime($this->_file)) != date($this->_updateValue))
45 return false;
4846
4947 readfile($this->_file);
5048 return true;
Config.php
(5 / 8)
  
1616
1717 public static function getInstance ()
1818 {
19 if (null === self::$_instance)
19 if (self::$_instance === null)
2020 self::$_instance = new self;
2121 return self::$_instance;
2222 }
2929 'models' => '../models/',
3030 'views' => '../views/',
3131 'langs' => '../langs/',
32 'logs' => '../log/'
32 'logs' => '../logs/'
3333 );
3434 $this->_config['log'] = array(
3535 'autosave' => true,
3636 'belokan' => true
3737 );
38 $this->_config['cache'] = array(
39 'enabled' => false
40 );
4138 $this->_config['format'] = array(
4239 'enabled' => true,
4340 'default' => 'html'
4848 {
4949 if (!file_exists($config_file)) {
5050 if (Belokan_Config::getInstance()->get('log', 'belokan'))
51 Belokan_Log::getInstance()->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: configuration file not found ('.$config_file.').');
51 Belokan_Log::getInstance()->add('Belokan', 'ERROR: configuration file not found ('.$config_file.').');
5252 return false;
5353 }
5454 $userConfig = include $config_file;
6666 {
6767 if (!$this->exists($group, $key)) return null;
6868 if ($key != null) return $this->_config[$group][$key];
69 else return $this->_config[$group];
69 return $this->_config[$group];
7070 }
7171
7272 public function exists ($group, $key=null)
7373 {
7474 if ($key != null) return isset($this->_config[$group][$key]);
75 else return isset($this->_config[$group]);
75 return isset($this->_config[$group]);
7676 }
7777
7878 private function merge ($user_config)
  
1717 $_layout,
1818 $_controller,
1919 $_action,
20 $_datas;
20 $_data;
2121
2222 public function __construct ($controller, $action)
2323 {
2525 $this->_layout = 'default';
2626 $this->_controller = strtolower($controller);
2727 $this->_action = strtolower($action);
28 $this->_datas = array();
28 $this->_data = array();
2929 }
3030
3131 public function __get ($var)
3232 {
33 if (isset($this->_datas[$var])) return $this->_datas[$var];
33 if (isset($this->_data[$var])) return $this->_data[$var];
3434 else return null;
3535 }
3636
3737 public function __set ($var, $value)
3838 {
39 return $this->_datas[$var] = $value;
39 return $this->_data[$var] = $value;
4040 }
4141
4242 public function __isset ($var)
4343 {
44 return isset($this->_datas[$var]);
44 return isset($this->_data[$var]);
4545 }
4646
4747 public function __unset ($var)
4848 {
49 unset($this->_datas[$var]);
49 unset($this->_data[$var]);
5050 }
5151
5252 public function setLayout ($layout_name)
Db/MySQL.php
(21 / 28)
  
1818
1919 public function connect ()
2020 {
21 if ($this->_persistent) $this->_connection = mysql_pconnect($this->_host,
22 $this->_user,
23 $this->_pass);
24 else $this->_connection = mysql_connect($this->_host,
25 $this->_user,
26 $this->_pass);
21 if ($this->_persistent)
22 $this->_connection = mysql_pconnect($this->_host, $this->_user, $this->_pass);
23 else
24 $this->_connection = mysql_connect($this->_host, $this->_user, $this->_pass);
2725 mysql_select_db($this->_base, $this->_connection);
2826 }
2927
5151
5252 public function fetchRows ($fetch_object=false)
5353 {
54 if ($this->_results != null) {
55 $this->_rows = array();
56 if ($fetch_object)
57 while ($row = mysql_fetch_object($this->_results))
58 $this->_rows[] = $row;
59 else
60 while ($row = mysql_fetch_array($this->_results))
61 $this->_rows[] = $row;
62 return $this->_rows;
63 } else return array();
54 if ($this->_results == null) return null;
55 $this->_rows = array();
56 if ($fetch_object)
57 while ($row = mysql_fetch_object($this->_results))
58 $this->_rows[] = $row;
59 else
60 while ($row = mysql_fetch_array($this->_results))
61 $this->_rows[] = $row;
62 return $this->_rows;
6463 }
6564
6665 public function fetchRow ($fetch_object=false)
6766 {
68 if ($this->_results != null) {
69 if ($fetch_object) return mysql_fetch_object($this->_results);
70 else return mysql_fetch_array($this->_results);
71 } else return null;
67 if ($this->_results == null) return null;
68 if ($fetch_object) return mysql_fetch_object($this->_results);
69 return mysql_fetch_array($this->_results);
7270 }
7371
7472 public function numberOfRows ()
7573 {
76 if (strtolower(substr($this->_query, 0, 6)) == 'select' &&
77 $this->_results != null)
74 if (strtolower(substr($this->_query, 0, 6)) == 'select' && $this->_results != null)
7875 return mysql_num_rows($this->_results);
7976 else if ($this->_results === true)
8077 return $this->affectedRows();
81 else return null;
78 return null;
8279 }
8380
8481 public function affectedRows ()
8582 {
86 if (in_array(strtolower(substr($this->_query, 0, 7)),
87 array('insert ', 'update ', 'replace', 'delete ')))
83 if (in_array(strtolower(substr($this->_query, 0, 7)), array('insert ', 'update ', 'replace', 'delete ')))
8884 return mysql_affected_rows($this->_connection);
89 else return null;
85 return null;
9086 }
9187
9288 public function freeResults ()
9389 {
94 if (strtolower(substr($this->_query, 0, 6)) == 'select' &&
95 $this->_results != null)
90 if (strtolower(substr($this->_query, 0, 6)) == 'select' && $this->_results != null)
9691 mysql_free_result($this->_results);
9792 }
9893
Db/SQLite.php
(16 / 20)
  
5050
5151 public function fetchRows ($fetch_object=false)
5252 {
53 if ($this->_results != null) {
54 $this->_rows = array();
55 if ($fetch_object)
56 while ($row = sqlite_fetch_object($this->_results))
57 $this->_rows[] = $row;
58 else
59 while ($row = sqlite_fetch_array($this->_results))
60 $this->_rows[] = $row;
61 return $this->_rows;
62 } else return null;
53 if ($this->_results == null) return null;
54 $this->_rows = array();
55 if ($fetch_object)
56 while ($row = sqlite_fetch_object($this->_results))
57 $this->_rows[] = $row;
58 else
59 while ($row = sqlite_fetch_array($this->_results))
60 $this->_rows[] = $row;
61 return $this->_rows;
6362 }
6463
6564 public function fetchRow ($fetch_object=false)
6665 {
67 if ($this->_results != null) {
68 if ($fetch_object) return sqlite_fetch_object($this->_results);
69 else return sqlite_fetch_array($this->_results);
70 } else return null;
66 if ($this->_results == null) return null;
67 if ($fetch_object) return sqlite_fetch_object($this->_results);
68 return sqlite_fetch_array($this->_results);
7169 }
7270
7371 public function numberOfRows ()
7472 {
75 if (strtolower(substr($this->_query, 0, 6)) == 'select' &&
76 $this->_results != null)
73 if (strtolower(substr($this->_query, 0, 6)) == 'select' && $this->_results != null)
7774 return sqlite_num_rows($this->_results);
7875 else if ($this->_results === true)
7976 return $this->affectedRows();
80 else return null;
77 return null;
8178 }
8279
8380 public function affectedRows ()
8481 {
85 if (in_array(strtolower(substr($this->_query, 0, 7)),
86 array('insert ', 'update ', 'replace', 'delete ')))
82 if (in_array(strtolower(substr($this->_query, 0, 7)), array('insert ', 'update ', 'replace', 'delete ')))
8783 return sqlite_changes($this->_connection);
88 else return null;
84 return null;
8985 }
9086
9187}
Local.php
(12 / 13)
  
1313 static private
1414 $_instance,
1515 $_langs,
16 $_datas,
16 $_data,
1717 $_lang;
1818
1919 public static function getInstance ()
2020 {
21 if (null === self::$_instance)
21 if (self::$_instance === null)
2222 self::$_instance = new self;
2323 return self::$_instance;
2424 }
2626 public function __construct ()
2727 {
2828 $this->_langs = array();
29 $this->_datas = array();
29 $this->_data = array();
3030 $this->_lang = Belokan_Config::getInstance()->get('lang', 'default');
3131 }
3232
3636
3737 if (strtolower($sourceType) == 'file') {
3838 if (file_exists($source))
39 $this->_datas[$lang] = include $source;
39 $this->_data[$lang] = include $source;
4040 else {
4141 $source = Belokan_Config::getInstance()->get('dir', 'langs').$source;
4242 if (file_exists($source))
43 $this->_datas[$lang] = include $source;
43 $this->_data[$lang] = include $source;
4444 else
45 $log->add('Belokan', '['.date('Y-m-d H:i').'] Source file for language '.$lang.' not found ('.$source.').');
45 $log->add('Belokan', 'Source file for language '.$lang.' not found ('.$source.').');
4646 }
4747 } else if (strtolower($sourceType) == 'mysql') {
4848 $base = new Belokan_Db_MySQL($source);
5050 $rows = $base->getRawResults();
5151 if (mysql_num_rows($rows) > 0)
5252 while ($row = mysql_fetch_array($rows))
53 $this->_datas[$lang][$row['key']] = $row['value'];
53 $this->_data[$lang][$row['key']] = $row['value'];
5454 else
55 $log->add('Belokan', '['.date('Y-m-d H:i').'] Retrieve an empty rowset for language '.$lang.' from the MySQL database.');
55 $log->add('Belokan', 'Retrieve an empty rowset for language '.$lang.' from the MySQL database.');
5656 } else if (strtolower($sourceType) == 'sqlite') {
5757 $base = new Belokan_Db_SQLite($source);
5858 $base->query('SELECT * FROM lang_'.$lang.';')->execute();
5959 $rows = $base->getRawResults();
6060 if (sqlite_num_rows($rows))
6161 while ($row = sqlite_fetch_array($rows))
62 $this->_datas[$lang][$row['key']] = $row['value'];
62 $this->_data[$lang][$row['key']] = $row['value'];
6363 else
64 $log->add('Belokan', '['.date('Y-m-d H:i').'] Retrieve an empty rowset for language '.$lang.' from the SQLite database.');
64 $log->add('Belokan', 'Retrieve an empty rowset for language '.$lang.' from the SQLite database.');
6565 }
6666 }
6767
7272
7373 public function get ($str)
7474 {
75 if ($this->_lang == null || !isset($this->_datas[$this->_lang][$str]))
75 if ($this->_lang == null || !isset($this->_data[$this->_lang][$str]))
7676 return $str;
77 else
78 return $this->_datas[$this->_lang][$str];
77 return $this->_data[$this->_lang][$str];
7978 }
8079
8180}
Log.php
(10 / 6)
  
1111class Belokan_Log {
1212
1313 private static
14 $_instance,
14 $_instance;
15
16 private
1517 $_stacks,
1618 $_logs;
1719
1820 public static function getInstance ()
1921 {
20 if (null === self::$_instance)
22 if (self::$_instance === null)
2123 self::$_instance = new self;
2224 return self::$_instance;
2325 }
3838 public function add ($log, $str)
3939 {
4040 if (!in_array($log, $this->_logs)) $this->_logs[] = $log;
41 $this->_stacks[$log][] = $str;
41 $this->_stacks[$log][] = '['.date('Y-m-d H:i').']'.$str;
4242 }
4343
4444 public function get ($log)
5454 foreach ($this->_logs as $log) {
5555 if (count($this->_stacks[$log]) == 0) continue;
5656 $tmp = '';
57 foreach ($this->_stacks[$log] as $elem) $tmp .= $elem."\n";
57 foreach ($this->_stacks[$log] as $msg) $tmp .= $msg."\n";
5858 $logFile = fopen(Belokan_Config::getInstance()->get('dir', 'logs').$log.'.log', 'a');
59 fwrite($logFile, $tmp);
60 fclose($logFile);
59 if ($logFile !== false) {
60 fwrite($logFile, $tmp);
61 fclose($logFile);
62 }
6163 }
6264
6365 $this->_stacks = array();
  
2929 if (file_exists($pluginFile)) require_once $pluginFile;
3030 }
3131
32 if (class_exists($plugin.'Plugin')) {
33 $plugin = $plugin.'Plugin';
34 $this->_plugins[$plugin_name] = new $plugin;
35 $this->_loaded[] = $plugin_name;
36 } else return false;
32 if (!class_exists($plugin.'Plugin')) return false;
3733
34 $plugin = $plugin.'Plugin';
35 $this->_plugins[$plugin_name] = new $plugin;
36 $this->_loaded[] = $plugin_name;
37
3838 return $this->_plugins[$plugin_name];
3939 }
4040
5151 public function get ($plugin_name)
5252 {
5353 if ($this->isLoaded($plugin_name)) return $this->_plugins[$plugin_name];
54 else return null;
54 return null;
5555 }
5656
5757}
  
2424
2525 public static function getInstance ()
2626 {
27 if (null === self::$_instance) {
27 if (self::$_instance === null)
2828 self::$_instance = new self;
29 }
3029 return self::$_instance;
3130 }
3231
157157 {
158158 if ($this->_xhr === null)
159159 $this->_xhr = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
160 $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
160 $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
161161 return $this->_xhr;
162162 }
163163
164164 public function isReload ()
165165 {
166166 if ($this->_reload === null)
167 $this->_reload = (isset($_SERVER['HTTP_CACHE_CONTROL']) &&
168 strpos($_SERVER['HTTP_CACHE_CONTROL'], 'max-age=0') !== false) ||
167 $this->_reload = (isset($_SERVER['HTTP_CACHE_CONTROL']) && strpos($_SERVER['HTTP_CACHE_CONTROL'], 'max-age=0') !== false) ||
169168 (isset($_SERVER['HTTP_PRAGMA']) && strpos($_SERVER['HTTP_PRAGMA'], 'no-cache'));
170169 return $this->_reload;
171170 }
View.php
(28 / 47)
  
1212
1313 private
1414 $_plugins,
15 $_datas,
15 $_data,
1616 $_logBelokan,
1717 $_log,
1818 $_viewDir,
2222 public function __construct ()
2323 {
2424 $this->_plugins = null;
25 $this->_datas = array();
25 $this->_data = array();
2626 $config = Belokan_Config::getInstance();
2727 $this->_logBelokan = $config->get('log', 'belokan');
2828 $this->_log = Belokan_Log::getInstance();
3333
3434 public function __get ($var)
3535 {
36 if (isset($this->_datas[$var])) {
37 return $this->_datas[$var];
38 } else {
39 return null;
40 }
36 if (isset($this->_data[$var])) return $this->_data[$var];
37 return null;
4138 }
4239
4340 public function __set ($var, $value)
4441 {
45 return $this->_datas[$var] = $value;
42 return $this->_data[$var] = $value;
4643 }
4744
4845 public function __isset ($var)
4946 {
50 return isset($this->_datas[$var]);
47 return isset($this->_data[$var]);
5148 }
5249
5350 public function __unset ($var)
5451 {
55 unset($this->_datas[$var]);
52 unset($this->_data[$var]);
5653 }
5754
5855 public function __call ($plugin_name, $args)
5956 {
60 if ($this->_plugins == null) {
57 if ($this->_plugins == null)
6158 $this->_plugins = new Belokan_Plugins;
62 }
6359 if (!$this->_plugins->isLoaded($plugin_name)) {
6460 if ($this->_plugins->load($plugin_name) === false) {
65 if (Belokan_Config::getInstance()->get('log', 'belokan')) {
66 Belokan_Log::getInstance()->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: Failed to load plugin ('.$plugin_name.').');
67 }
61 if (Belokan_Config::getInstance()->get('log', 'belokan'))
62 Belokan_Log::getInstance()->add('Belokan', 'ERROR: Failed to load plugin ('.$plugin_name.').');
6863 return null;
6964 }
7065 }
7166 $plugin = $this->_plugins->get($plugin_name);
7267 $defaultMethod = $plugin_name;
73 if (method_exists($plugin, $defaultMethod)) {
68 if (method_exists($plugin, $defaultMethod))
7469 return call_user_func_array(array($plugin, $defaultMethod), $args);
75 } else {
76 return $plugin;
77 }
70 return $plugin;
7871 }
7972
8073 public function renderLayoutBefore ($layout)
8174 {
82 if ($layout != null) {
83 $layoutTop = $this->_layoutDir.$layout.'/before.p'.$this->_format;
84 if (file_exists($layoutTop)) {
85 include $layoutTop;
86 } else {
87 if ($this->_logBelokan) {
88 $this->_log->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: Layout before file ('.$layoutTop.') not found.');
89 }
90 }
91 }
75 if ($layout == null) return;
76 $layoutTop = $this->_layoutDir.$layout.'/before.p'.$this->_format;
77 if (file_exists($layoutTop))
78 include $layoutTop;
79 else if ($this->_logBelokan)
80 $this->_log->add('Belokan', 'ERROR: Layout before file ('.$layoutTop.') not found.');
9281 }
9382
9483 public function renderView ($view) {
9584 $viewFile = $this->_viewsDir.$view.'.p'.$this->_format;
96 if (file_exists($viewFile)) {
85 if (file_exists($viewFile))
9786 include $viewFile;
98 } else {
99 if ($this->_logBelokan) {
100 $this->_log->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: View file ('.$viewFile.') not found.');
101 }
102 }
87 else if ($this->_logBelokan)
88 $this->_log->add('Belokan', 'ERROR: View file ('.$viewFile.') not found.');
10389 }
10490
10591 public function renderLayoutAfter ($layout) {
106 if ($layout != null) {
107 $layoutBottom = $this->_layoutDir.$layout.'/after.p'.$this->_format;
108 if (file_exists($layoutBottom)) {
109 include $layoutBottom;
110 } else {
111 if ($this->_logBelokan) {
112 $this->_log->add('Belokan', '['.date('Y-m-d H:i').'] ERROR: Layout after file ('.$layoutBottom.') not found.');
113 }
114 }
115 }
92 if ($layout == null) return;
93 $layoutBottom = $this->_layoutDir.$layout.'/after.p'.$this->_format;
94 if (file_exists($layoutBottom))
95 include $layoutBottom;
96 else if ($this->_logBelokan)
97 $this->_log->add('Belokan', 'ERROR: Layout after file ('.$layoutBottom.') not found.');
11698 }
11799
118100 public function loadPlugin ($plugin_name, $plugin=null, $plugin_file=null)
119101 {
120 if ($this->_plugins == null) {
102 if ($this->_plugins == null)
121103 $this->_plugins = new Belokan_Plugins;
122 }
123104 return $this->_plugins->load($plugin_name, $plugin, $plugin_file);
124105 }
125106