1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

More admin tools work

This commit is contained in:
secretr
2009-11-01 19:05:26 +00:00
parent fc9419038b
commit 0c717f3d3d
8 changed files with 280 additions and 40 deletions

View File

@@ -9,8 +9,8 @@
* Message Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/message_handler.php,v $
* $Revision: 1.23 $
* $Date: 2009-10-30 17:59:32 $
* $Revision: 1.24 $
* $Date: 2009-11-01 19:05:25 $
* $Author: secretr $
*
*/
@@ -466,7 +466,6 @@ class eMessage
/**
* Merge _SESSION message array with the current messages
* TODO - merge stacks, merge custom stack to default
*
* @param boolean $reset
* @return eMessage
@@ -499,6 +498,38 @@ class eMessage
return $this;
}
/**
* Convert current messages to Session messages
*
* @param string $mstack false - move all message stacks
* @param string $message_type false - move all types
* @return unknown
*/
public function moveToSession($mstack = false, $message_type = false)
{
foreach (array_keys($this->_sysmsg) as $type)
{
if(!$this->isType($type) || ($message_type && $message_type !== $type))
{
unset($this->_sysmsg[$type]);
continue;
}
if(false === $mstack)
{
$_SESSION[$this->_session_id][$type] = array_merge_recursive( $_SESSION[$this->_session_id][$type], $this->_sysmsg[$type]);
continue;
}
if(isset($this->_sysmsg[$type][$mstack]))
{
$_SESSION[$this->_session_id][$type][$mstack] = $this->_sysmsg[$type][$mstack];
}
}
$this->reset($message_type, $mstack, false);
return $this;
}
/**
* Merge messages from source stack with destination stack
* and reset source stack