+ $page =& self::page();
+
+ $this->mods['core']->handler_403($page);
+ $page->assign('platal', $this);
+ $page->run();
+ }
+
+ public function error404()
+ {
+ $page =& self::page();
+
+ $this->mods['core']->handler_404($page);
+ $page->assign('platal', $this);
+ $page->run();
+ }
+
+ public static function notAllowed()
+ {
+ if (S::admin()) {
+ self::page()->trigWarning('Tu accèdes à cette page car tu es administrateur du site.');
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public static function load($modname, $include = null)
+ {
+ global $platal;
+ $modname = strtolower($modname);
+ if (isset($platal->mods[$modname])) {
+ if (is_null($include)) {
+ return;
+ }
+ $platal->mods[$modname]->load($include);
+ } else {
+ if (is_null($include)) {
+ require_once PLModule::path($modname) . '.php';
+ } else {
+ require_once PLModule::path($modname) . '/' . $include;
+ }
+ }
+ }
+
+ public static function assert($cond, $error, $userfriendly)
+ {
+ global $globals;
+ if ($cond === false) {
+ header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
+ $file = fopen($globals->spoolroot . '/spool/tmp/assert_erros', 'a');
+ fwrite($file, '<pre>' . pl_entities($error) . '</pre>\n');
+ fclose($file);
+
+ Platal::page()->kill($userfriendly);
+ }
+ }
+
+ public function &buildLogger($uid, $suid = 0)
+ {
+ if (defined('PL_LOGGER_CLASS')) {
+ $class = PL_LOGGER_CLASS;
+ return new $class($uid, $suid);
+ } else {
+ return PlLogger::dummy($uid, $suid);
+ }
+ }
+
+ protected function &buildPage()
+ {
+ $pageclass = PL_PAGE_CLASS;
+ $page = new $pageclass();
+ return $page;
+ }
+
+ static public function &page()
+ {
+ if (is_null(self::$_page)) {
+ global $platal;
+ self::$_page = $platal->buildPage();