Modified:
trunk/library/Framework/ErrorManager.php
Log:
Lets use the object factory for this.
Modified: trunk/library/Framework/ErrorManager.php
==============================================================================
--- trunk/library/Framework/ErrorManager.php (original)
+++ trunk/library/Framework/ErrorManager.php Sun Sep 30 13:59:15 2007
@@ -34,7 +34,7 @@
{
// Public Variables
var $StyleSheet; // A custom stylesheet may be supplied for the error display
-
+
// Public, Read Only Variables
var $ErrorCount; // Number of errors encountered
@@ -46,33 +46,29 @@
}
function AddError($AffectedElement, $AffectedFunction, $Message, $Code = "", $WriteAndKill = 1) {
- if ($Context) {
- $Error = ObjectFactory::getInstance()->NewObject("Error");
- } else {
- $Error = new Error();
- }
+ $Error = ObjectFactory::getInstance()->NewObject('Error');
$Error->AffectedElement = $AffectedElement;
$Error->AffectedFunction = $AffectedFunction;
$Error->Message = $Message;
$Error->Code = $Code;
$this->Errors[] = $Error;
- $this->ErrorCount += 1;
+ $this->ErrorCount += 1;
if ($WriteAndKill == 1) $this->Write($Context);
}
-
+
function Clear() {
$this->ErrorCount = 0;
$this->Errors = array();
}
-
+
function Iif($True = "1", $False = "0") {
if ($this->ErrorCount == 0) {
return $True;
} else {
- return $False;
+ return $False;
}
- }
-
+ }
+
function Write() {
$context = Context::getInstance();
@include(ThemeFilePath($context->Configuration, 'fatal_error.php'));