+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-// {{{ class XOrgErrors
-
-class XOrgErrors
-{
- // {{{ properties
-
- var $errs = Array();
- var $failure = false;
-
- // }}}
- // {{{ constructor
-
- function XOrgErrors()
- { }
-
- // }}}
- // {{{ function trig
-
- function trig($text) {
- $this->errs[] = $text;
- }
-
- // }}}
- // {{{
-
- function fail($text) {
- $this->trig($text);
- $this->failure = true;
- }
-
- // }}}
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
***************************************************************************/
require_once 'smarty/libs/Smarty.class.php';
-require_once 'platal/errors.inc.php';
require_once 'platal/smarty.plugins.inc.php';
// {{{ class PlatalPage
var $_page_type;
var $_tpl;
var $_errors;
+ var $_failure;
// defaults
var $caching = false;
$this->_page_type = $type;
$this->_tpl = $tpl;
- $this->_errors = new XOrgErrors;
+ $this->_errors = array();
+ $this->_failure = false;
$this->register_prefilter('at_to_globals');
$this->register_prefilter('trimwhitespace');
function _run($skin)
{
global $globals, $TIME_BEGIN;
- $this->assign("xorg_error", $this->_errors);
+ $this->assign("xorg_errors", $this->_errors);
+ $this->assign("xorg_failure", $this->_failure);
if ($this->_page_type == NO_SKIN) {
$this->display($this->_tpl);
function nb_errs()
{
- return count($this->_errors->errs);
+ return count($this->_errors);
}
// }}}
function trig($msg)
{
- $this->_errors->trig($msg);
+ $this->_errors[] = $msg;
}
// }}}
function trig_run($msg)
{
- $this->_errors->trig($msg);
+ $this->trig($msg);
$this->run();
}
function fail($msg)
{
- $this->_errors->fail($msg);
+ $this->trig($msg);
+ $this->_failure = true;
}
// }}}