00001 <?php 00002 00006 class ExceptionError extends oxUBase 00007 { 00012 protected $_sThisTemplate = 'message/exception.tpl'; 00013 00019 public function displayExceptionError() 00020 { 00021 $aViewData = $this->getViewData(); 00022 00023 //add all exceptions to display 00024 $aErrors = $this->_getErrors(); 00025 00026 if ( is_array( $aErrors ) && count( $aErrors ) ) { 00027 oxUtilsView::getInstance()->passAllErrorsToView( $aViewData, $aErrors ); 00028 } 00029 00030 $oSmarty = oxUtilsView::getInstance()->getSmarty(); 00031 $oSmarty->assign_by_ref( "Errors", $aViewData["Errors"] ); 00032 00033 // resetting errors from session 00034 oxSession::setVar( 'Errors', array() ); 00035 } 00036 00042 protected function _getErrors() 00043 { 00044 $aErrors = oxSession::getVar( 'Errors' ); 00045 00046 if (null === $aErrors) { 00047 $aErrors = array(); 00048 } 00049 00050 return $aErrors; 00051 } 00052 }