diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-06 12:47:29 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-06 12:47:29 +0000 |
commit | b2b840fd9a86732542845addc4e1d458daeb7cc6 (patch) | |
tree | 0571779de99f27a402f30010261fa991c822d7bf /engine/lib | |
parent | 92f9928dc58c635abd1af8d5748afedd687225d3 (diff) | |
download | elgg-b2b840fd9a86732542845addc4e1d458daeb7cc6.tar.gz elgg-b2b840fd9a86732542845addc4e1d458daeb7cc6.tar.bz2 |
cleaned up system messages display code
git-svn-id: http://code.elgg.org/elgg/trunk@7548 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 10 | ||||
-rw-r--r-- | engine/lib/views.php | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index dcc468cd7..e6bbb3c01 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -608,7 +608,7 @@ function get_register($register_name) { * whether the message addition was successful. * @todo Clean up. Separate registering messages and retrieving them. */ -function system_messages($message = null, $register = "messages", $count = false) { +function system_messages($message = null, $register = "success", $count = false) { if (!isset($_SESSION['msg'])) { $_SESSION['msg'] = array(); } @@ -665,10 +665,10 @@ function count_messages($register = "") { * * @param string|array $message Message or messages to add * - * @return Bool + * @return bool */ function system_message($message) { - return system_messages($message, "messages"); + return system_messages($message, "success"); } /** @@ -678,10 +678,10 @@ function system_message($message) { * * @param string|array $error Error or errors to add * - * @return true|false Success response + * @return bool */ function register_error($error) { - return system_messages($error, "errors"); + return system_messages($error, "error"); } /** diff --git a/engine/lib/views.php b/engine/lib/views.php index d2e63d1a5..17b93926c 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -563,10 +563,10 @@ function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) if (count_messages()) { // get messages - try for errors first - $sysmessages = system_messages(NULL, "errors"); - if (count($sysmessages["errors"]) == 0) { + $messages = system_messages(NULL, "error"); + if (count($messages["error"]) == 0) { // no errors so grab rest of messages - $sysmessages = system_messages(null, ""); + $messages = system_messages(null, ""); } else { // we have errors - clear out remaining messages system_messages(null, ""); @@ -575,7 +575,7 @@ function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) $vars['title'] = $title; $vars['body'] = $body; - $vars['sysmessages'] = $sysmessages; + $vars['sysmessages'] = $messages; // Draw the page $output = elgg_view("page_shells/$page_shell", $vars); |