From 2a86edcae437760b44f7d7e18679c8a83654209b Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 21 Jan 2009 17:12:29 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSerror=20:=20Transformation=20des=20m?= =?UTF-8?q?=C3=A9thodes=20en=20mode=20statique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSerror.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/trunk/includes/class/class.LSerror.php b/trunk/includes/class/class.LSerror.php index c26292e5..18ed313c 100644 --- a/trunk/includes/class/class.LSerror.php +++ b/trunk/includes/class/class.LSerror.php @@ -42,7 +42,7 @@ class LSerror { * * @retval void */ - function addErrorCode($code=-1,$msg='') { + static function addErrorCode($code=-1,$msg='') { $_SESSION['LSerror'][] = array($code,$msg); } @@ -55,8 +55,8 @@ class LSerror { * * @retval void */ - function display($return=False) { - $errors = $this -> getErrors(); + static function display($return=False) { + $errors = self::getErrors(); if ($errors) { if ($return) { return $errors; @@ -75,13 +75,13 @@ class LSerror { * * @retval void */ - function stop($code=-1,$msg='') { + static function stop($code=-1,$msg='') { if(!empty($_SESSION['LSerror'])) { print "

"._('Errors')."

\n"; - print $this -> display(true); + print self::display(true); } print "

"._('Stop')."

\n"; - exit ($this -> getError(array($code,$msg))); + exit (self::getError(array($code,$msg))); } /** @@ -91,12 +91,12 @@ class LSerror { * * @retvat string Le texte des erreurs */ - function getErrors() { + static function getErrors() { if(!empty($_SESSION['LSerror'])) { foreach ($_SESSION['LSerror'] as $error) { - $txt.=$this -> getError($error); + $txt.=self::getError($error); } - $this -> resetError(); + self::resetError(); return $txt; } return; @@ -109,7 +109,7 @@ class LSerror { * * @retvat string Le texte des erreurs */ - function getError($error) { + static function getError($error) { return "(Code ".$error[0].") ".getFData($GLOBALS['LSerror_code'][$error[0]]['msg'],$error[1])."
\n"; } @@ -120,7 +120,7 @@ class LSerror { * * @retvat boolean */ - function errorsDefined() { + static function errorsDefined() { return !empty($_SESSION['LSerror']); } @@ -131,8 +131,7 @@ class LSerror { * * @retvat void */ - function resetError() { - LSlog('reset'); + static function resetError() { unset ($_SESSION['LSerror']); } }