+ // Check for delayed errors...
+ if (!$this->delayed_errors) {
+ sqgetGlobalVar('delayed_errors', $delayed_errors, SQ_SESSION);
+ if (is_array($delayed_errors)) {
+ $this->AssignDelayedErrors($delayed_errors);
+ sqsession_unregister("delayed_errors");
+ }
+ }
+
+ if (isset($this->Template->values['aErrors']) && count($this->Template->values['aErrors']) > 0) {
+ foreach ($this->Template->values['aErrors'] as $err) {
+ if (!in_array($err, $this->aErrors, true)) {
+ $this->aErrors[] = $err;
+ }
+ }
+ $this->Template->assign('aErrors',$this->aErrors);
+ }
+
+ if (count($this->aErrors) > 0) {
+ if ($this->delayed_errors) {
+ sqsession_register($this->aErrors,"delayed_errors");
+ } else {
+ $this->Template->display($this->TemplateName);
+ }