drupal_set_message

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'
  • 'warning'
  • 'error'

$repeat If this is FALSE and the message is already set, then the message won't be repeated.

▾ 218 functions call drupal_set_message()

aggregator_aggregator_fetch in modules/aggregator/aggregator.fetcher.inc
Implement hook_aggregator_fetch().
aggregator_aggregator_remove in modules/aggregator/aggregator.processor.inc
Implement hook_aggregator_remove().
aggregator_categorize_items_submit in modules/aggregator/aggregator.pages.inc
Process aggregator_categorize_items() form submissions.
aggregator_form_category_submit in modules/aggregator/aggregator.admin.inc
Process aggregator_form_category form submissions.
aggregator_form_feed_submit in modules/aggregator/aggregator.admin.inc
Process aggregator_form_feed() form submissions.
aggregator_form_opml_submit in modules/aggregator/aggregator.admin.inc
Process aggregator_form_opml form submissions.
aggregator_parse_feed in modules/aggregator/aggregator.parser.inc
Parse a feed and store its items.
aggregator_refresh in modules/aggregator/aggregator.module
Checks a news feed for new items.
authorize_filetransfer_form in includes/authorize.inc
Build the form for choosing a FileTransfer type and supplying credentials.
batch_example_finished in developer/examples/batch_example.module
Batch 'finished' callback used by both batch 1 and batch 2
batch_example_multistep_form_submit in developer/examples/batch_example.module
block_add_block_form_submit in modules/block/block.admin.inc
Save the new custom block.
block_admin_configure_submit in modules/block/block.admin.inc
block_admin_display_form_submit in modules/block/block.admin.inc
Process main blocks administration form submissions.
block_custom_block_delete_submit in modules/block/block.admin.inc
Deletion of custom blocks.
blog_page_last in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of all users.
blog_page_user in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of a given user.
book_admin_edit_submit in modules/book/book.admin.inc
Handle submission of the book administrative page form.
book_export in modules/book/book.pages.inc
Menu callback; Generates various representation of a book page and its children.
book_outline_form_submit in modules/book/book.pages.inc
Handles book outline form submissions from the outline tab.
book_remove_form_submit in modules/book/book.pages.inc
Confirm form submit function to remove a node from the book.
color_scheme_form_submit in modules/color/color.module
Submit handler for color change form.
comment_admin_overview_submit in modules/comment/comment.admin.inc
Process comment_admin_overview form submissions.
comment_approve in modules/comment/comment.pages.inc
Menu callback; publish specified comment.
comment_confirm_delete_submit in modules/comment/comment.admin.inc
Process comment_confirm_delete form submissions.
comment_form_submit in modules/comment/comment.module
Process comment form submissions; prepare the comment, store it, and set a redirection target.
comment_multiple_delete_confirm in modules/comment/comment.admin.inc
List the selected comments and verify that the admin wants to delete them.
comment_multiple_delete_confirm_submit in modules/comment/comment.admin.inc
Process comment_multiple_delete_confirm form submissions.
comment_reply in modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
contact_category_delete_form_submit in modules/contact/contact.admin.inc
Submit handler for the confirm delete category form.
contact_category_edit_form_submit in modules/contact/contact.admin.inc
Process the contact category edit page form submission.
contact_personal_form in modules/contact/contact.pages.inc
Form builder; the personal contact form.
contact_personal_form_submit in modules/contact/contact.pages.inc
Form submission handler for contact_personal_form().
contact_site_form in modules/contact/contact.pages.inc
Form builder; the site-wide contact form.
contact_site_form_submit in modules/contact/contact.pages.inc
Form submission handler for contact_site_form().
dblog_clear_log_submit in modules/dblog/dblog.admin.inc
Submit callback: clear database with log messages.
drupal_check_module in includes/install.inc
Check a module's requirements.
drupal_get_messages in includes/bootstrap.inc
Return all messages that have been set.
drupal_mail in includes/mail.inc
Compose and optionally send an e-mail message.
field_test_entity_form_submit in modules/field/tests/field_test.entity.inc
Submit handler for field_test_entity_form().
field_ui_display_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents a listing of fields display settings for a content type.
field_ui_display_overview_form_submit in modules/field_ui/field_ui.admin.inc
Submit handler for the display overview form.
field_ui_field_delete_form_submit in modules/field_ui/field_ui.admin.inc
Remove a field from a content type.
field_ui_field_edit_form_submit in modules/field_ui/field_ui.admin.inc
Save instance settings after editing.
field_ui_field_overview_form_submit in modules/field_ui/field_ui.admin.inc
Submit handler for the field overview form.
field_ui_field_settings_form_submit in modules/field_ui/field_ui.admin.inc
Save a field's settings after editing.
field_ui_inactive_message in modules/field_ui/field_ui.admin.inc
Helper function to display a message about inactive fields.
field_ui_widget_type_form_submit in modules/field_ui/field_ui.admin.inc
Submit the change in widget type.
file_ajax_upload in modules/file/file.module
Menu callback; Shared AJAX callback for file uploads and deletions.
file_munge_filename in includes/file.inc
Modify a filename as needed for security purposes.
file_save_upload in includes/file.inc
Saves a file upload to a new location.
file_unmanaged_copy in includes/file.inc
Copy a file to a new location without calling any hooks or making any changes to the database.
file_unmanaged_save_data in includes/file.inc
Save a string to the specified destination without calling any hooks or making any changes to the database.
file_validate_image_resolution in includes/file.inc
If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions.
filter_admin_configure_submit in modules/filter/filter.admin.inc
Form submit handler for text format filter configuration form.
filter_admin_delete_submit in modules/filter/filter.admin.inc
Process filter delete form submission.
filter_admin_format_form_submit in modules/filter/filter.admin.inc
Process text format form submissions.
filter_admin_order_submit in modules/filter/filter.admin.inc
Process filter order configuration form submission.
filter_admin_overview_submit in modules/filter/filter.admin.inc
filter_test_filter_format_delete in modules/simpletest/tests/filter_test.module
Implement hook_filter_format_delete().
filter_test_filter_format_insert in modules/simpletest/tests/filter_test.module
Implement hook_filter_format_insert().
filter_test_filter_format_update in modules/simpletest/tests/filter_test.module
Implement hook_filter_format_update().
filter_update_7005 in modules/filter/filter.install
Integrate text formats with the user permissions system.
form_set_error in includes/form.inc
File an error against a form element.
form_storage_test_form_submit in modules/simpletest/tests/form_test.module
Multistep form submit callback.
forum_confirm_delete_submit in modules/forum/forum.admin.inc
Implement forms api _submit call. Deletes a forum after confirmation.
forum_form_submit in modules/forum/forum.admin.inc
Process forum form and container form submissions.
hook_comment_delete in modules/comment/comment.api.php
The comment is being deleted by the moderator.
hook_comment_publish in modules/comment/comment.api.php
The comment is being published by the moderator.
hook_comment_unpublish in modules/comment/comment.api.php
The comment is being unpublished by the moderator.
hook_modules_enabled in modules/system/system.api.php
Perform necessary actions after modules are enabled.
hook_user_login in modules/user/user.api.php
The user just logged in.
image_effect_delete_form_submit in modules/image/image.admin.inc
Submit handler to delete an image effect.
image_effect_form_submit in modules/image/image.admin.inc
Submit handler for updating an image effect.
image_style_add_form_submit in modules/image/image.admin.inc
Submit handler for adding a new image style.
image_style_delete_form_submit in modules/image/image.admin.inc
Submit handler to delete an image style.
image_style_form in modules/image/image.admin.inc
Form builder; Edit an image style name and effects order.
image_style_form_add_submit in modules/image/image.admin.inc
Submit handler for adding a new image effect to an image style.
image_style_form_override_submit in modules/image/image.admin.inc
Submit handler for overriding a module-defined style.
image_style_form_submit in modules/image/image.admin.inc
Submit handler for saving an image style.
image_style_revert_form_submit in modules/image/image.admin.inc
Submit handler to convert an overridden style to its default.
install_configure_form in ./install.php
Installation task; configure settings for the new site.
install_finished in ./install.php
Installation task; perform final steps and display a 'finished' page.
locale_date_format_form_submit in modules/locale/locale.module
Submit handler for configuring localized date formats on the locale_date_format_form.
locale_languages_configure_form_submit in includes/locale.inc
Submit handler for language negotiation settings.
locale_languages_delete_form in includes/locale.inc
User interface for the language deletion confirmation screen.
locale_languages_delete_form_submit in includes/locale.inc
Process language deletion submissions.
locale_languages_overview_form_submit in includes/locale.inc
Process language overview form submissions, updating existing languages.
locale_languages_predefined_form_submit in includes/locale.inc
Process the language addition form submission.
locale_translate_delete_form_submit in includes/locale.inc
Process string deletion submissions.
locale_translate_edit_form in includes/locale.inc
User interface for string editing.
locale_translate_edit_form_submit in includes/locale.inc
Process string editing form submissions.
locale_translate_import_form_submit in includes/locale.inc
Process the locale import form submission.
menu_delete_menu_confirm_submit in modules/menu/menu.admin.inc
Delete a custom menu and all links in it.
menu_edit_item_submit in modules/menu/menu.admin.inc
Process menu and menu item add/edit form submissions.
menu_edit_item_validate in modules/menu/menu.admin.inc
Validate form values for a menu link being added or edited.
menu_item_delete_form_submit in modules/menu/menu.admin.inc
Process menu delete form submissions.
menu_node_save in modules/menu/menu.module
Helper for hook_node_insert() and hook_node_update().
menu_reset_item_confirm_submit in modules/menu/menu.admin.inc
Process menu reset item form submissions.
node_access_rebuild in modules/node/node.module
Rebuild the node access database. This is occasionally needed by modules that make system-wide changes to access levels.
node_delete_confirm_submit in modules/node/node.pages.inc
Execute node deletion
node_form_submit in modules/node/node.pages.inc
node_help in modules/node/node.module
Implement hook_help().
node_mass_update in modules/node/node.admin.inc
Make mass update of nodes, changing all nodes in the $nodes array to update them with the field values in $updates.
node_multiple_delete_confirm_submit in modules/node/node.admin.inc
node_node_type_insert in modules/node/content_types.inc
Implement hook_node_type_insert().
node_node_type_update in modules/node/content_types.inc
Implement hook_node_type_update().
node_revision_delete_confirm_submit in modules/node/node.pages.inc
node_revision_revert_confirm_submit in modules/node/node.pages.inc
node_type_delete_confirm_submit in modules/node/content_types.inc
Process content type delete confirm submissions.
node_type_form_submit in modules/node/content_types.inc
Implement hook_form_submit().
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_authentication_page in modules/openid/openid.pages.inc
Menu callback; Process an OpenID authentication.
openid_user_delete_form_submit in modules/openid/openid.pages.inc
openid_user_identities in modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
openid_user_insert in modules/openid/openid.module
Implement hook_user_insert().
path_admin_form_submit in modules/path/path.admin.inc
Save a URL alias to the database.
php_disable in modules/php/php.install
Implement hook_disable().
php_install in modules/php/php.install
Implement hook_install().
poll_cancel in modules/poll/poll.module
Submit callback for poll_cancel_form().
poll_vote in modules/poll/poll.module
Submit handler for processing a vote.
profile_admin_overview_submit in modules/profile/profile.admin.inc
Submit handler to update changed profile field weights and categories.
profile_field_delete_submit in modules/profile/profile.admin.inc
Process a field delete form submission.
profile_field_form_submit in modules/profile/profile.admin.inc
Process profile_field_form submissions.
scaffolding_example_delete_confirm_submit in developer/examples/scaffolding_example/scaffolding_example.admin.inc
scaffolding_example_page in developer/examples/scaffolding_example/scaffolding_example.pages.inc
Build a simple listing page for records.
search_admin_settings_submit in modules/search/search.admin.inc
Submit callback.
search_reindex_confirm_submit in modules/search/search.admin.inc
Handler for wipe confirmation
shortcut_link_add_inline in modules/shortcut/shortcut.admin.inc
Menu callback; Creates a new link in the provided shortcut set
shortcut_link_add_submit in modules/shortcut/shortcut.admin.inc
Submit handler for the form that adds shortcut links.
shortcut_link_delete_submit in modules/shortcut/shortcut.admin.inc
Submit handler for the shortcut link deletion form.
shortcut_link_edit_submit in modules/shortcut/shortcut.admin.inc
Submit handler for the shortcut link editing form.
shortcut_set_customize_submit in modules/shortcut/shortcut.admin.inc
Submit handler for the shortcut set customization form.
shortcut_set_switch_submit in modules/shortcut/shortcut.admin.inc
Submit handler for the form that switches shortcut sets.
simpletest_clean_database in modules/simpletest/simpletest.module
Removed prefixed tables from the database that are left over from crashed tests.
simpletest_clean_environment in modules/simpletest/simpletest.module
Remove all temporary database tables and directories.
simpletest_clean_temporary_directories in modules/simpletest/simpletest.module
Find all leftover temporary directories and remove them.
simpletest_install in modules/simpletest/simpletest.install
Implement hook_install().
simpletest_result_form in modules/simpletest/simpletest.pages.inc
Test results form for $test_id.
simpletest_test_form_submit in modules/simpletest/simpletest.pages.inc
Run selected tests.
system_actions_configure_submit in modules/system/system.admin.inc
Process system_actions_configure() form submissions.
system_actions_delete_form_submit in modules/system/system.admin.inc
Process system_actions_delete form submissions.
system_action_delete_orphans_post in modules/system/system.admin.inc
Post-deletion operations for deleting action orphans.
system_add_date_formats_form_submit in modules/system/system.admin.inc
Process new date format string submission.
system_add_date_format_type_form_submit in modules/system/system.admin.inc
Process system_add_date_format_type form submissions.
system_admin_config_page in modules/system/system.admin.inc
Menu callback; Provide the administration overview page.
system_clear_cache_submit in modules/system/system.admin.inc
Submit callback; clear system caches.
system_date_delete_format_form_submit in modules/system/system.admin.inc
Delete a configured date format.
system_delete_date_format_type_form_submit in modules/system/system.admin.inc
Delete a configured date type.
system_ip_blocking_delete_submit in modules/system/system.admin.inc
Process system_ip_blocking_delete form submissions.
system_ip_blocking_form_submit in modules/system/system.admin.inc
system_main_admin_page in modules/system/system.admin.inc
Menu callback; Provide the administration overview page.
system_message_action in modules/system/system.module
A configurable Drupal action. Sends a message to the current user's screen.
system_modules_submit in modules/system/system.admin.inc
Submit callback; handles modules form submission.
system_modules_uninstall_submit in modules/system/system.admin.inc
Processes the submitted uninstall form.
system_modules_uninstall_validate in modules/system/system.admin.inc
Validates the submitted uninstall form.
system_retrieve_file in modules/system/system.module
Attempts to get a file using drupal_http_request and to store it locally.
system_run_cron in modules/system/system.admin.inc
Menu callback: run cron manually.
system_settings_form in modules/system/system.module
Add default buttons to a form and set its prefix.
system_settings_form_submit in modules/system/system.module
Execute the system_settings_form.
system_test_init in modules/simpletest/tests/system_test.module
Implement hook_init().
system_test_modules_disabled in modules/simpletest/tests/system_test.module
Implement hook_modules_disabled().
system_test_modules_enabled in modules/simpletest/tests/system_test.module
Implement hook_modules_enabled().
system_test_modules_installed in modules/simpletest/tests/system_test.module
Implement hook_modules_installed().
system_test_modules_uninstalled in modules/simpletest/tests/system_test.module
Implement hook_modules_uninstalled().
system_themes_form_submit in modules/system/system.admin.inc
Process system_themes_form form submissions.
system_theme_settings in modules/system/system.admin.inc
Form builder; display theme configuration for entire site and individual themes.
system_theme_settings_submit in modules/system/system.admin.inc
Process system_theme_settings form submissions.
system_update_6051 in modules/system/system.install
Create a signature_format column.
system_update_7003 in modules/system/system.install
Update {blocked_ips} with valid IP addresses from {access}.
system_update_7013 in modules/system/system.install
Convert default time zone offset to default time zone name.
system_update_7021 in modules/system/system.install
Add new blocks to new regions, migrate custom variables to blocks.
system_user_login in modules/system/system.module
Implement hook_user_login().
taxonomy_form_term_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to insert or update a term.
taxonomy_form_vocabulary_submit in modules/taxonomy/taxonomy.admin.inc
Accept the form submission for a vocabulary and save the results.
taxonomy_term_confirm_delete_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to delete a term after confirmation.
taxonomy_vocabulary_confirm_delete_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to delete a vocabulary after confirmation.
taxonomy_vocabulary_confirm_reset_alphabetical_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to reset a vocabulary to alphabetical order after confirmation.
theme_install_page in includes/theme.maintenance.inc
Generate a themed installation page.
theme_node_preview in modules/node/node.pages.inc
Display a node preview for display during node creation and editing.
theme_update_page in includes/theme.maintenance.inc
Generate a themed update page.
translation_node_prepare in modules/translation/translation.module
Implement hook_node_prepare().
trigger_assign_form_submit in modules/trigger/trigger.admin.inc
Submit function for trigger_assign_form().
trigger_unassign_submit in modules/trigger/trigger.admin.inc
Submit callback for trigger_unassign() form.
update_fetch_data_finished in modules/update/update.fetch.inc
Batch API callback when all fetch tasks have been completed.
update_help in modules/update/update.module
Implement hook_help().
update_manager_download_batch_finished in modules/update/update.manager.inc
Batch callback invoked when the download batch is completed.
update_script_selection_form in ./update.php
user_admin_account_submit in modules/user/user.admin.inc
Submit the user administration update form.
user_admin_permissions_submit in modules/user/user.admin.inc
Save permissions selected on the administer permissions page.
user_admin_role_submit in modules/user/user.admin.inc
user_cancel in modules/user/user.module
Cancel a user account.
user_cancel_confirm in modules/user/user.pages.inc
Menu callback; Cancel a user account via e-mail confirmation link.
user_cancel_confirm_form_submit in modules/user/user.pages.inc
Submit handler for the account cancellation confirm form.
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either logs in or registers the current user, based on username. Either way, the global $user object is populated and login tasks are performed.
user_pass_reset in modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.
user_pass_submit in modules/user/user.pages.inc
user_profile_form_submit in modules/user/user.pages.inc
Submit function for the user account and profile editing form.
user_register_submit in modules/user/user.module
Submit handler for the user registration form.
user_update_7002 in modules/user/user.install
Convert user time zones from time zone offsets to time zone names.
_batch_do in includes/batch.inc
Do one pass of execution in JavaScript-mode and return progress to the browser.
_batch_page in includes/batch.inc
State-based dispatcher for the batch processing page.
_block_rehash in modules/block/block.module
Update the 'block' DB table with the blocks currently exported by modules.
_drupal_log_error in includes/common.inc
Log a PHP error or exception, display an error page in fatal cases.
_file_test_form_submit in modules/simpletest/tests/file_test.module
Process the upload.
_form_test_tableselect_multiple_false_form_submit in modules/simpletest/tests/form_test.module
Process the tableselect #multiple = FALSE submitted values.
_form_test_tableselect_multiple_true_form_submit in modules/simpletest/tests/form_test.module
Process the tableselect #multiple = TRUE submitted values.
_locale_batch_language_finished in includes/locale.inc
Finished callback of language addition locale import batch. Inform the user of translation files imported.
_locale_batch_system_finished in includes/locale.inc
Finished callback of system page locale import batch. Inform the user of translation files imported.
_locale_import_message in includes/locale.inc
Sets an error message occurred during locale file parsing.
_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
_menu_site_is_offline in includes/menu.inc
Checks whether the site is in maintenance mode.
_node_access_rebuild_batch_finished in modules/node/node.module
Post-processing for node_access_rebuild_batch.
_node_mass_update_batch_finished in modules/node/node.admin.inc
Node Mass Update Batch 'finished' callback.
_session_test_set_message in modules/simpletest/tests/session_test.module
Menu callback, sets a message to me displayed on the following page.
_simpletest_batch_finished in modules/simpletest/simpletest.module
_user_cancel in modules/user/user.module
Last batch processing step for cancelling a user account.

Code

includes/bootstrap.inc, line 1334

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

    if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
      $_SESSION['messages'][$type][] = $message;
    }

    // Mark this page has being not cacheable.
    drupal_page_is_cacheable(FALSE);
  }

  // Messages not set when DB connection fails.
  return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
}
?>
Login or register to post comments
 
 

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.