drupal_set_message

includes/bootstrap.inc, line 597

Versions
4.6 – 5
drupal_set_message($message = NULL, $type = 'status')
6 – 7
drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE)

Set a message for the user to see.

The message is stored in the session so that it can persist through a redirect.

If called with no arguments, this function returns all set messages without clearing them.

▾ 84 functions call drupal_set_message()

aggregator_admin_edit_category in modules/aggregator.module
Menu callback; displays the category edit form, or saves changes and redirects to the overview page.
aggregator_admin_edit_feed in modules/aggregator.module
Menu callback; displays the feed edit form.
aggregator_edit in modules/aggregator.module
aggregator_parse_feed in modules/aggregator.module
aggregator_refresh in modules/aggregator.module
Checks a news feed for new items.
aggregator_remove in modules/aggregator.module
block_admin in modules/block.module
Menu callback; displays the block overview page.
block_admin_configure in modules/block.module
Menu callback; displays the block configuration form.
block_box_add in modules/block.module
Menu callback; displays the block creation form.
block_box_delete in modules/block.module
Menu callback; confirm and delete custom blocks.
book_admin in modules/book.module
Menu callback; displays the book administration page.
book_nodeapi in modules/book.module
Implementation of hook_nodeapi().
book_outline in modules/book.module
Implementation of function book_outline() Handles all book outline operations.
comment_delete in modules/comment.module
Menu callback; delete a comment.
comment_matrix_settings in modules/comment.module
Menu callback; presents the moderation vote matrix.
comment_post in modules/comment.module
comment_reply in modules/comment.module
comment_role_settings in modules/comment.module
Menu callback; allows admin to set default scores for different roles.
comment_save in modules/comment.module
comment_threshold_settings in modules/comment.module
Menu callback; displays settings for thresholds at which comments are displayed.
comment_vote_settings in modules/comment.module
Menu callback; displays page for assigning names to vote values.
contact_mail_user in modules/contact.module
do_search in modules/search.module
Do a query on the full-text search index for a word or words.
drupal_auth in modules/drupal.module
Implementation of hook_auth().
drupal_check_token in includes/common.inc
Check the form token if there is POST data for an authenticated user to defend against cross site request forgeries.
drupal_get_messages in includes/bootstrap.inc
Return all messages that have been set.
file_check_directory in includes/file.inc
Check that directory exists and is writable.
file_copy in includes/file.inc
Copies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy). Checks if $source and $dest are valid and readable/writable. Performs a file copy if $source is not equal to $dest. If file...
file_move in includes/file.inc
Moves a file to a new location. Checks if $source and $dest are valid and readable/writable. Performs a file move if $source is not equal to $dest. If file already exists in $dest either the call will error out, replace the file or rename the file...
file_save_data in includes/file.inc
Save a string to the specified destination
file_save_upload in includes/file.inc
Saves a file upload to a new location. The source file is validated as a proper upload and handled as such.
filter_admin_add in modules/filter.module
Add a new input format.
filter_admin_delete in modules/filter.module
Menu callback; confirm deletion of a format.
filter_admin_filters_save in modules/filter.module
Save enabled/disabled status for filters in a format.
filter_admin_order_save in modules/filter.module
Save the weights of filters in a format.
filter_admin_save in modules/filter.module
Save input formats on the overview page.
form_set_error in includes/common.inc
File an error against the form element with the specified name.
locale_admin_import in modules/locale.module
Page handler for the translation import screen
locale_admin_manage_add in modules/locale.module
Page handler for the language addition screen
locale_admin_manage_delete_screen in modules/locale.module
User interface for the language deletion confirmation screen
menu_delete_item in modules/menu.module
Menu callback; delete a single custom item.
menu_disable_item in modules/menu.module
Menu callback; hide a menu item.
menu_edit_item_save in modules/menu.module
Save changes to a menu item into the database.
menu_reset in modules/menu.module
Menu callback; clear the database, resetting the menu to factory defaults.
menu_reset_item in modules/menu.module
Menu callback; reset a single modified item.
node_admin_nodes in modules/node.module
Generate the content administration overview.
node_page in modules/node.module
Menu callback; dispatches control to the appropriate operation handler.
node_revision_delete in modules/node.module
Delete the revision with specified revision number.
node_revision_rollback in modules/node.module
Roll back to the revision with the specified revision number.
node_submit in modules/node.module
Accepts a submission of new or changed node content.
page_get_cache in includes/bootstrap.inc
Retrieve the current page from the cache.
path_admin_delete in modules/path.module
Menu callback; handles deletion of an URL alias.
path_save in modules/path.module
Verify that a new URL alias is valid, and save it to the database.
poll_vote in modules/poll.module
Callback for processing a vote
profile_admin_add in modules/profile.module
Menu callback; adds a new field to all user profiles.
profile_admin_delete in modules/profile.module
Menu callback; deletes a field from all user profiles.
profile_admin_edit in modules/profile.module
Menu callback; displays the profile field editing form.
queue_nodeapi in modules/queue.module
Implementation of hook_nodeapi().
queue_vote in modules/queue.module
search_admin in modules/search.module
Menu callback; displays the search module settings page.
system_listing_save in modules/system.module
system_settings_save in modules/system.module
taxonomy_del_term in modules/taxonomy.module
taxonomy_save_term in modules/taxonomy.module
taxonomy_save_vocabulary in modules/taxonomy.module
upload_munge_filename in modules/upload.module
Munge the filename as needed for security purposes.
user_admin_access_add in modules/user.module
Menu callback: add an access rule
user_admin_access_check in modules/user.module
Menu callback: check an access rule
user_admin_access_delete in modules/user.module
Menu callback: delete an access rule
user_admin_access_edit in modules/user.module
Menu callback: edit an access rule
user_admin_create in modules/user.module
user_admin_perm in modules/user.module
Menu callback: administer permissions.
user_admin_role in modules/user.module
Menu callback: administer roles.
user_edit in modules/user.module
user_login in modules/user.module
user_pass in modules/user.module
_aggregator_page_list in modules/aggregator.module
Prints an aggregator page listing a number of feed items. Various menu callbacks use this function to print their feeds.
_locale_add_language in includes/locale.inc
Helper function to add a language
_locale_import_parse_plural_forms in includes/locale.inc
Parses a Plural-Forms entry from a Gettext Portable Object file header
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database
_locale_import_read_po in includes/locale.inc
Parses Gettext Portable Object file into an array
_locale_string_delete in includes/locale.inc
_locale_string_save in includes/locale.inc
Action handler for string editing
_upload_image in modules/upload.module
Check an upload, if it is an image, make sure it fits within the maximum dimensions allowed.

Code

<?php
function drupal_set_message($message = NULL, $type = 'status') {
  if (isset($message)) {
    if (!isset($_SESSION['messages'])) {
      $_SESSION['messages'] = array();
    }

    if (!isset($_SESSION['messages'][$type])) {
      $_SESSION['messages'][$type] = array();
    }

    $_SESSION['messages'][$type][] = $message;
  }

  return $_SESSION['messages'];
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.