Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
897be0da
Commit
897be0da
authored
Jul 26, 2012
by
jhodgdon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1697750
by TravisCarden: Improve documentation of drupal_set_message function
parent
3f300231
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
core/includes/bootstrap.inc
core/includes/bootstrap.inc
+26
-11
No files found.
core/includes/bootstrap.inc
View file @
897be0da
...
...
@@ -1764,22 +1764,37 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
}
/**
* Sets a message
which reflects the status of the performed operation
.
* Sets a message
to display to the user
.
*
*
If the function is called with no arguments, this function returns all set
* messages
without clearing them
.
*
Messages are stored in a session variable and displayed in page.tpl.php via
*
the $
messages
theme variable
.
*
* @param $message
* The message to be displayed to the user. For consistency with other
* messages, it should begin with a capital letter and end with a period.
* @param $type
* The type of the message. One of the following values are possible:
* Example usage:
* @code
* drupal_set_message(t('An error occurred and processing did not complete.'), 'error');
* @endcode
*
* @param string $message
* (optional) The translated message to be displayed to the user. For
* consistency with other messages, it should begin with a capital letter and
* end with a period.
* @param string $type
* (optional) The message's type. Defaults to 'status'. These values are
* supported:
* - 'status'
* - 'warning'
* - 'error'
* @param $repeat
* If this is FALSE and the message is already set, then the message won't
* be repeated.
* @param bool $repeat
* (optional) If this is FALSE and the message is already set, then the
* message won't be repeated. Defaults to TRUE.
*
* @return array|null
* A multidimensional array with keys corresponding to the set message types.
* The indexed array values of each contain the set messages for that type.
* Or, if there are no messages set, the function returns NULL.
*
* @see drupal_get_messages()
* @see theme_status_messages()
*/
function
drupal_set_message
(
$message
=
NULL
,
$type
=
'status'
,
$repeat
=
TRUE
)
{
if
(
$message
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment