Web site templates - Part II: Developing Intranet Solutions Listing 4-2 (Continued)
Part II: Developing Intranet Solutions Listing 4-2 (Continued) $this->caller_class = (!empty($params[ caller ])) ? $params[ caller ] : null; $this->error_message = array(); //error_reporting(E_ERROR | E_WARNING | E_NOTICE); $this->load_error_code(); } function alert($code = null, $flag = null) { $msg = $this->get_error_message($code); if (!strlen($msg)) { $msg = $code; } if ($flag == null) { echo ; } else if (!strcmp($flag, close )){ echo ; } else { echo ; } } function get_error_message($code = null) { if (isset($code)) { if (is_array($code)) { $out = array(); foreach ($code as $entry) { array_push($out, $this->error_message[$entry]); } return $out; } else { return (! empty($this->error_message[$code])) ? $this>error_message[$code] : null; } } else { return (! empty($this->error_message[ MISSING ])) ? $this>error_message[ MISSING ] : null; }