diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-10 11:40:38 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-10 11:40:38 +0000 |
commit | 2e54eedc16240ddab2efec91e38de73f97e59710 (patch) | |
tree | 0fe82c618ad03297f8c9c92366a7e3139b12b4dd /engine/lib/elgglib.php | |
parent | ae0d8fe986218116baba7fe0e20b26789bbe5e24 (diff) | |
download | elgg-2e54eedc16240ddab2efec91e38de73f97e59710.tar.gz elgg-2e54eedc16240ddab2efec91e38de73f97e59710.tar.bz2 |
Messages and actions: fixed!
git-svn-id: https://code.elgg.org/elgg/trunk@130 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r-- | engine/lib/elgglib.php | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 5594dc497..f7b71268a 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -189,11 +189,10 @@ */
function page_draw($title, $body) {
-
return elgg_view('pageshell', array(
'title' => $title,
'body' => $body,
- 'messages' => system_messages(null,"")
+ 'sysmessages' => system_messages(null,"")
)
);
@@ -268,38 +267,38 @@ * @return true|false|array Either the array of messages, or a response regarding whether the message addition was successful
*/
- function system_messages($message = null, $register = "messages", $count = false) {
+ function system_messages($message = "", $register = "messages", $count = false) {
- static $messages;
- if (!isset($messages)) {
- $messages = array();
+ if (!isset($_SESSION['msg'])) {
+ $_SESSION['msg'] = array();
}
- if (!isset($messages[$register]) && !empty($register)) {
- $messages[$register] = array();
+ if (!isset($_SESSION['msg'][$register]) && !empty($register)) {
+ $_SESSION['msg'][$register] = array();
}
if (!$count) {
if (!empty($message) && is_array($message)) {
- $messages[$register] = array_merge($messages[$register], $message);
+ $_SESSION['msg'][$register] = array_merge($_SESSION['msg'][$register], $message);
+ var_export($_SESSION['msg']); exit;
return true;
} else if (!empty($message) && is_string($message)) {
- $messages[$register][] = $message;
+ $_SESSION['msg'][$register][] = $message;
return true;
- } else if (!is_string($message) && !is_array($message)) {
- if (!empty($register)) {
- $returnarray = $messages[$register];
- $messages[$register] = array();
+ } else if (is_null($message)) {
+ if ($register != "") {
+ $returnarray = $_SESSION['msg'][$register];
+ $_SESSION['msg'][$register] = array();
} else {
- $returnarray = $messages;
- $messages = array();
+ $returnarray = $_SESSION['msg'];
+ $_SESSION['msg'] = array();
}
return $returnarray;
}
} else {
if (!empty($register)) {
- return sizeof($messages[$register]);
+ return sizeof($_SESSION['msg'][$register]);
} else {
$count = 0;
- foreach($messages as $register => $submessages) {
+ foreach($_SESSION['msg'] as $register => $submessages) {
$count += sizeof($submessages);
}
return $count;
|