1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-06 00:14:25 +03:00
ifhub.club/engine/modules/message/Message.class.php
Mzhelskiy Maxim 3e4be7be12
2009-08-18 09:10:14 +00:00

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.

<?php
/*-------------------------------------------------------
*
* 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 LsMessage 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;
}
}
?>