1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 16:04:24 +03:00
ifhub.club/classes/modules/sys_message/Message.class.php

110 lines
2.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Модуль системных сообщений
*
*/
class Message extends Module {
/**
* Массив сообщений со статусом ОШИБКА
*
* @var array
*/
protected $aMsgError=array();
/**
* Массив сообщений со статусом СООБЩЕНИЕ
*
* @var array
*/
protected $aMsgNotice=array();
/**
* Инициализация модуля
*
*/
public function Init() {
}
/**
* При завершении работы модуля передаем списки сообщений в шаблоны Smarty
*
*/
public function Shutdown() {
$this->Viewer_Assign('aMsgError',$this->GetError());
$this->Viewer_Assign('aMsgNotice',$this->GetNotice());
}
/**
* Добавляет новое сообщение об ошибке
*
* @param string $sMsg
* @param string $sTitle
*/
public function AddError($sMsg,$sTitle=null) {
$this->aMsgError[]=array('msg'=>$sMsg,'title'=>$sTitle);
}
/**
* Создаёт идинственное сообщение об ошибке(т.е. очищает все предыдущие)
*
* @param string $sMsg
* @param string $sTitle
*/
public function AddErrorSingle($sMsg,$sTitle=null) {
$this->aMsgError=array();
$this->aMsgError[]=array('msg'=>$sMsg,'title'=>$sTitle);
}
/**
* Добавляет новое сообщение
*
* @param string $sMsg
* @param string $sTitle
*/
public function AddNotice($sMsg,$sTitle=null) {
$this->aMsgNotice[]=array('msg'=>$sMsg,'title'=>$sTitle);
}
/**
* Создаёт идинственное сообщение, удаляя предыдущие
*
* @param string $sMsg
* @param string $sTitle
*/
public function AddNoticeSingle($sMsg,$sTitle=null) {
$this->aMsgNotice=array();
$this->aMsgNotice[]=array('msg'=>$sMsg,'title'=>$sTitle);
}
/**
* Получает список сообщений об ошибке
*
* @return array
*/
public function GetError() {
return $this->aMsgError;
}
/**
* Получает список сообщений
*
* @return array
*/
public function GetNotice() {
return $this->aMsgNotice;
}
}
?>