mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
add message type to ModuleObject
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8618 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
88d86a973c
commit
de47638d12
2 changed files with 35 additions and 1 deletions
|
|
@ -58,6 +58,35 @@
|
|||
function getRedirectUrl(){
|
||||
return $this->get('redirect_url');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set message
|
||||
* @param $message a message string
|
||||
* @param $type type of message (error, info, update)
|
||||
**/
|
||||
function setMessage($message, $type = null){
|
||||
parent::setMessage($message);
|
||||
$this->setMessageType($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set type of message
|
||||
* @param $type type of message (error, info, update)
|
||||
**/
|
||||
function setMessageType($type){
|
||||
$this->add('message_type', $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get type of message
|
||||
**/
|
||||
function getMessageType(){
|
||||
$type = $this->get('message_type');
|
||||
if (!in_array($type, array('error', 'info', 'update'))){
|
||||
$type = $this->getError()?'error':'info';
|
||||
}
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief sett to set the template path for refresh.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue