Issue #1765918 by TravisCarden: Fix docs for drupal_get_messages function

merge-requests/26/head
Jennifer Hodgdon 2012-09-04 09:39:58 -07:00
parent f2aa3cc200
commit 89512a01cb
1 changed files with 21 additions and 10 deletions

View File

@ -1756,18 +1756,29 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
} }
/** /**
* Returns all messages that have been set. * Returns all messages that have been set with drupal_set_message().
* *
* @param $type * @param string $type
* (optional) Only return messages of this type. * (optional) Limit the messages returned by type. Defaults to NULL, meaning
* @param $clear_queue * all types. These values are supported:
* (optional) Set to FALSE if you do not want to clear the messages queue * - NULL
* - 'status'
* - 'warning'
* - 'error'
* @param bool $clear_queue
* (optional) If this is TRUE, the queue will be cleared of messages of the
* type specified in the $type parameter. Otherwise the queue will be left
* intact. Defaults to TRUE.
* *
* @return * @return array
* An associative array, the key is the message type, the value an array * A multidimensional array with keys corresponding to the set message types.
* of messages. If the $type parameter is passed, you get only that type, * The indexed array values of each contain the set messages for that type.
* or an empty array if there are no such messages. If $type is not passed, * The messages returned are limited to the type specified in the $type
* all message types are returned, or an empty array if none exist. * parameter. If there are no messages of the specified type, an empty array
* is returned.
*
* @see drupal_set_message()
* @see theme_status_messages()
*/ */
function drupal_get_messages($type = NULL, $clear_queue = TRUE) { function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
if ($messages = drupal_set_message()) { if ($messages = drupal_set_message()) {