require_once 'smarty/libs/Smarty.class.php';
require_once 'platal/smarty.plugins.inc.php';
-// {{{ class PlatalPage
-
class PlatalPage extends Smarty
{
// {{{ properties
// }}}
// {{{ function PlatalPage()
- function PlatalPage($tpl, $type=SKINNED)
+ function PlatalPage($tpl, $type = SKINNED)
{
global $globals;
$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();
$this->register_prefilter('at_to_globals');
$this->register_prefilter('trimwhitespace');
$this->addJsLink('javascript/xorg.js');
-
- $this->doAuth();
}
// }}}
// }}}
// {{{ 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);
}
$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) {
$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 />";
}
// }}}
- // {{{ 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)
}
// }}}
- // {{{ function gassign
-
- function gassign($varname)
- {
- global $$varname;
- $this->assign($varname, $$varname);
- }
-
- // }}}
}
-// }}}
-
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>