remove fail() that is not used
[platal.git] / include / platal / page.inc.php
index b309c67..f81f994 100644 (file)
@@ -22,8 +22,6 @@
 require_once 'smarty/libs/Smarty.class.php';
 require_once 'platal/smarty.plugins.inc.php';
 
-// {{{ class PlatalPage
-
 class PlatalPage extends Smarty
 {
     // {{{ properties
@@ -41,7 +39,7 @@ class PlatalPage extends Smarty
     // }}}
     // {{{ function PlatalPage()
 
-    function PlatalPage($tpl, $type=SKINNED)
+    function PlatalPage($tpl, $type = SKINNED)
     {
         global $globals;
 
@@ -54,11 +52,6 @@ class PlatalPage extends Smarty
 
         $this->compile_check = !empty($globals->debug);
 
-        if ($type == SKINNED) {
-            $this->register_modifier('escape_html', 'escape_html');
-            $this->default_modifiers[] = '@escape_html';
-        }
-
         $this->_page_type = $type;
         $this->_tpl       = $tpl;
         $this->_errors    = array();
@@ -67,8 +60,6 @@ class PlatalPage extends Smarty
         $this->register_prefilter('at_to_globals');
         $this->register_prefilter('trimwhitespace');
         $this->addJsLink('javascript/xorg.js');
-
-        $this->doAuth();
     }
 
     // }}}
@@ -90,15 +81,10 @@ class PlatalPage extends Smarty
     // }}}
     // {{{ function changeTpl()
 
-    function changeTpl($tpl, $type=SKINNED)
+    function changeTpl($tpl, $type = SKINNED)
     {
        $this->_tpl       = $tpl;
        $this->_page_type = $type;
-       if ($type == SKINNED) {
-           $this->register_modifier('escape_html', 'escape_html');
-           $this->default_modifiers = Array('@escape_html');
-       }
-
         $this->_page_type = $type;
        $this->assign('xorg_tpl', $tpl);
     }
@@ -115,9 +101,16 @@ class PlatalPage extends Smarty
         $this->assign("xorg_errors", $this->_errors);
         $this->assign("xorg_failure", $this->_failure);
 
-        if ($this->_page_type == NO_SKIN) {
+        switch ($this->_page_type) {
+          case NO_SKIN:
             $this->display($this->_tpl);
             exit;
+
+          case SIMPLE:
+            $this->assign('simple', true);
+          case SKINNED:
+           $this->register_modifier('escape_html', 'escape_html');
+           $this->default_modifiers = Array('@escape_html');
         }
 
         if (!$globals->debug) {
@@ -129,7 +122,7 @@ class PlatalPage extends Smarty
             $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
         }
 
-        $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
+        $this->assign('validate', true);
         $result = $this->fetch($skin);
         $ttime .= sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
         $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
@@ -182,38 +175,16 @@ class PlatalPage extends Smarty
     }
 
     // }}}
-    // {{{ function trig()
-
-    function trig_run($msg)
-    {
-        $this->trig($msg);
-        $this->run();
-    }
-
-    // }}}
-    // {{{ function fail()
-
-    function fail($msg)
-    {
-        $this->trig($msg);
-        $this->_failure = true;
-    }
-
-    // }}}
     // {{{ function kill()
 
     function kill($msg)
     {
-        $this->fail($msg);
+        $this->trig($msg);
+        $this->_failure = true;
         $this->run();
     }
 
     // }}}
-    // {{{ function doAuth()
-
-    function doAuth() { }
-
-    // }}}
     // {{{ function loadModule()
 
     function loadModule($modname)
@@ -238,18 +209,7 @@ class PlatalPage extends Smarty
     }
 
     // }}}
-    // {{{ function gassign
-
-    function gassign($varname)
-    {
-        global $$varname;
-        $this->assign($varname, $$varname);
-    }
-
-    // }}}
 }
 
-// }}}
-
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>