drupal_set_message
includes/bootstrap.inc, line 722
- 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 which reflects the status of the performed operation.
If the function is called with no arguments, this function returns all set messages without clearing them.
Parameters
$message The message should begin with a capital letter and always ends with a period '.'.
$type The type of the message. One of the following values are possible:
- 'status'
- 'error'
▾ 106 functions call drupal_set_message()
- aggregator_form_category_submit in modules/aggregator.module
- Process aggregator_form_category form submissions. @todo Add delete confirmation dialog.
- aggregator_form_feed_submit in modules/aggregator.module
- Process aggregator_form_feed form submissions. @todo Add delete confirmation dialog.
- aggregator_page_list_submit 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_configure_submit in modules/block.module
- block_admin_display_submit in modules/block.module
- Process main block administration form submission.
- block_box_add_submit in modules/block.module
- block_box_delete_confirm_submit in modules/block.module
- Deletion of custom blocks.
- book_admin_edit_submit in modules/book.module
- book_export in modules/book.module
- Menu callback; Generates various representation of a book page with all descendants and prints the requested representation to output.
- book_nodeapi in modules/book.module
- Implementation of hook_nodeapi().
- book_outline_submit in modules/book.module
- Handles book outline form submissions.
- comment_admin_overview_submit in modules/comment.module
- Execute the chosen 'Update option' on the selected comments, such as publishing, unpublishing or deleting.
- comment_confirm_delete_submit in modules/comment.module
- comment_delete in modules/comment.module
- Menu callback; delete a comment.
- comment_multiple_delete_confirm in modules/comment.module
- List the selected comments and verify that the admin really wants to delete them.
- comment_multiple_delete_confirm_submit in modules/comment.module
- Perform the actual comment deletion.
- comment_reply in modules/comment.module
- comment_save in modules/comment.module
- Accepts a submission of new or changed comment content.
- contact_admin_delete in modules/contact.module
- Category delete page.
- contact_admin_delete_submit in modules/contact.module
- Process category delete form submission.
- contact_admin_edit_submit in modules/contact.module
- Process the contact category edit page form submission.
- contact_mail_page_submit in modules/contact.module
- Process the site-wide contact page form submission.
- contact_mail_user_submit in modules/contact.module
- Process the personal contact page form submission.
- db_check_setup in includes/database.pgsql.inc
- Verify if the database is set up correctly.
- drupal_auth in modules/drupal.module
- Implementation of hook_auth().
- drupal_get_messages in includes/bootstrap.inc
- Return all messages that have been set.
- error_handler in includes/common.inc
- Log errors as defined by administrator Error levels: 0 = Log errors to database. 1 = Log errors to database and to screen.
- file_check_directory in includes/file.inc
- Check that the directory exists and is writable. Directories need to have execute permissions to be considered a directory by FTP servers, etc.
- file_check_upload in includes/file.inc
- 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.
- filter_admin_delete in modules/filter.module
- Menu callback; confirm deletion of a format.
- filter_admin_delete_submit in modules/filter.module
- Process filter delete form submission.
- filter_admin_format_form_submit in modules/filter.module
- Process filter format form submissions.
- filter_admin_order_submit in modules/filter.module
- Process filter order configuration form submission.
- filter_admin_overview_submit in modules/filter.module
- form_set_error in includes/form.inc
- File an error against a form element. If the name of the element is edit[foo][bar] then you may pass either foo or foo][bar as $name foo will set an error for all its children.
- forum_confirm_delete_submit in modules/forum.module
- Implementation of forms api _submit call. Deletes a forum after confirmation.
- forum_form_submit in modules/forum.module
- Process forum form and container form submissions.
- forum_page in modules/forum.module
- Menu callback; prints a forum listing.
- hook_nodeapi in developer/hooks/core.php
- Act on nodes defined by other modules.
- locale_admin_manage_delete_form in modules/locale.module
- User interface for the language deletion confirmation screen.
- locale_admin_manage_delete_form_submit in modules/locale.module
- Process language deletion submissions.
- menu_confirm_delete_form_submit in modules/menu.module
- Process menu delete form submissions.
- menu_disable_confirm_submit in modules/menu.module
- menu_edit_item_save in modules/menu.module
- Save changes to a menu item into the database.
- menu_reset_item_form_submit in modules/menu.module
- Process menu reset item form submissions.
- node_admin_nodes_submit in modules/node.module
- Generate the content administration overview.
- node_delete in modules/node.module
- Delete a node.
- node_form_submit in modules/node.module
- node_multiple_delete_confirm_submit in modules/node.module
- node_revision_delete in modules/node.module
- Delete the revision with specified revision number. A "delete revision" nodeapi event is invoked when a revision is deleted.
- node_revision_delete_confirm_submit in modules/node.module
- node_revision_revert in modules/node.module
- Revert to the revision with the specified revision number. A node and nodeapi "update" event is triggered (via the node_save() call) when a revision is reverted.
- node_revision_revert_confirm_submit in modules/node.module
- page_get_cache in includes/bootstrap.inc
- Retrieve the current page from the cache.
- path_admin_delete in modules/path.module
- Post-confirmation; delete an URL alias.
- path_form_submit in modules/path.module
- Save URL alias to the database.
- poll_vote in modules/poll.module
- Callback for processing a vote
- profile_field_delete_submit in modules/profile.module
- Process a field delete form submission.
- profile_field_form_submit in modules/profile.module
- Process profile_field_form submissions.
- search_settings_form_validate in modules/search.module
- Implementation of hook_validate().
- search_wipe_confirm_submit in modules/search.module
- Handler for wipe confirmation
- system_modules_submit in modules/system.module
- system_settings_form in modules/system.module
- system_settings_form_submit in modules/system.module
- Execute the system_settings_form.
- system_themes_submit in modules/system.module
- system_theme_settings_submit in modules/system.module
- system_update_169 in database/updates.inc
- system_update_173 in database/updates.inc
- taxonomy_form_term_submit in modules/taxonomy.module
- Accept the form submission for a taxonomy term and save the result.
- taxonomy_form_vocabulary_submit in modules/taxonomy.module
- Accept the form submission for a vocabulary and save the results.
- taxonomy_term_confirm_delete_submit in modules/taxonomy.module
- taxonomy_vocabulary_confirm_delete_submit in modules/taxonomy.module
- theme_node_preview in modules/node.module
- Display a node preview for display during node creation and editing.
- update_do_update_page in ./update.php
- Perform updates for the JS version and return progress.
- 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_submit in modules/user.module
- user_admin_access_delete_confirm_submit in modules/user.module
- user_admin_access_edit in modules/user.module
- Menu callback: edit an access rule
- user_admin_edit_role_submit in modules/user.module
- user_admin_new_role_submit in modules/user.module
- user_admin_perm_submit in modules/user.module
- user_confirm_delete_submit in modules/user.module
- user_edit in modules/user.module
- user_edit_submit in modules/user.module
- user_pass_reset in modules/user.module
- Menu callback; process one time login link and redirects to the user page on success.
- user_pass_submit in modules/user.module
- user_register_submit in modules/user.module
- watchdog_overview in modules/watchdog.module
- Menu callback; displays a listing of log messages.
- _locale_add_language in includes/locale.inc
- Helper function to add a language
- _locale_admin_import_submit in includes/locale.inc
- Process the locale import form submission.
- _locale_admin_manage_screen_submit in includes/locale.inc
- Process locale admin manager form submissions.
- _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
- Delete a language string.
- _locale_string_edit in includes/locale.inc
- User interface for string editing.
- _locale_string_edit_submit in includes/locale.inc
- Process string editing form submissions. Saves all translations of one string submitted from a form.
- _menu_site_is_offline in includes/menu.inc
- Returns TRUE if the site is off-line for maintenance.
- _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 ($message) {
if (!isset($_SESSION['messages'])) {
$_SESSION['messages'] = array();
}
if (!isset($_SESSION['messages'][$type])) {
$_SESSION['messages'][$type] = array();
}
$_SESSION['messages'][$type][] = $message;
}
// messages not set when DB connection fails
return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
}
?> 