drupal_set_message

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 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.

Übergabeparameter

$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.

▾ 188 functions call drupal_set_message()

aggregator_aggregator_fetch in modules/aggregator/aggregator.fetcher.inc
Implementation of hook_aggregator_fetch().
aggregator_aggregator_parse in modules/aggregator/aggregator.parser.inc
Implementation of hook_aggregator_parse().
aggregator_aggregator_remove in modules/aggregator/aggregator.processor.inc
Implementation of 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.
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_box_delete_submit in modules/block/block.admin.inc
Deletion of custom blocks.
blogapi_update_6000 in modules/blogapi/blogapi.install
Inform users about the new permission.
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_form_system_theme_settings_alter in modules/color/color.module
Implementation of hook_form_FORM_ID_alter().
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
Publish specified comment.
comment_confirm_delete_submit in modules/comment/comment.admin.inc
Process comment_confirm_delete form submissions.
comment_delete in modules/comment/comment.admin.inc
Menu callback; delete a comment.
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:
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
contact_admin_delete_submit in modules/contact/contact.admin.inc
Process category delete form submission.
contact_admin_edit_submit in modules/contact/contact.admin.inc
Process the contact category edit page form submission.
contact_personal_form_submit in modules/contact/contact.pages.inc
Form submission handler for contact_personal_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.
do_search in modules/search/search.module
Do a query on the full-text search index for a word or words.
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.
drupal_rewrite_settings in includes/install.inc
Replace values in settings.php with values in the submitted array.
field_test_entity_form_submit in modules/simpletest/tests/field_test.module
Submit handler for field_test_set_field_values().
file_destination in includes/file.inc
Determines the destination path for a file depending on how replacement of existing files should be handled.
file_munge_filename in includes/file.inc
Munge the 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_delete in modules/filter/filter.admin.inc
Menu callback; confirm deletion of a format.
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
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
Implementation of 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.
install_tasks in ./install.php
Tasks performed after the database is initialized.
locale_languages_configure_form_submit in includes/locale.inc
Submit function 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.
locale_update_6005 in modules/locale/locale.install
Change language setting variable of content types.
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_insert in modules/menu/menu.module
Implementation of hook_node_insert().
menu_node_update in modules/menu/menu.module
Implementation of 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
Implementation of 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 in modules/node/content_types.inc
Implementation of hook_node_type().
node_revision_delete_confirm_submit in modules/node/node.pages.inc
node_revision_revert_confirm_submit in modules/node/node.pages.inc
node_teaser_include_verify in modules/node/node.module
Ensure value of "teaser_include" checkbox is consistent with other form data.
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
Implementation of 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
Implementation of hook_user_insert().
path_admin_delete in modules/path/path.module
Post-confirmation; delete an URL alias.
path_admin_form_submit in modules/path/path.admin.inc
Save a new URL alias to the database.
php_disable in modules/php/php.install
Implementation of hook_disable().
php_install in modules/php/php.install
Implementation of hook_install().
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.
runTestQuery in includes/install.inc
search_admin_settings_validate in modules/search/search.admin.inc
Validate callback.
search_wipe_confirm_submit in modules/search/search.admin.inc
Handler for wipe confirmation
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 left over temporary directories and remove them.
simpletest_get_all_tests in modules/simpletest/simpletest.module
Get a list of all of the tests.
simpletest_install in modules/simpletest/simpletest.install
Implementation of 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.module
Process system_actions_configure form submissions.
system_actions_delete_form_submit in modules/system/system.module
Process system_actions_delete form submissions.
system_action_delete_orphans_post in modules/system/system.module
Post-deletion operations for deleting action orphans.
system_clear_cache_submit in modules/system/system.admin.inc
Submit callback; clear system caches.
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_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_site_information_settings_validate in modules/system/system.admin.inc
Validate the submitted site-information form.
system_test_init in modules/simpletest/tests/system_test.module
Implementation of hook_init().
system_test_modules_disabled in modules/simpletest/tests/system_test.module
Implementation of hook_modules_disabled().
system_test_modules_enabled in modules/simpletest/tests/system_test.module
Implementation of hook_modules_enabled().
system_test_modules_installed in modules/simpletest/tests/system_test.module
Implementation of hook_modules_installed().
system_test_modules_uninstalled in modules/simpletest/tests/system_test.module
Implementation of hook_modules_uninstalled().
system_themes_form_submit in modules/system/system.admin.inc
Process system_themes_form form submissions.
system_theme_settings_submit in modules/system/system.admin.inc
Process system_theme_settings form submissions.
system_update_6017 in modules/system/system.install
Rename settings related to user.module email notifications.
system_update_6026 in modules/system/system.install
Display warning about new Update status module.
system_update_6038 in modules/system/system.install
Ensure that "Account" is not used as a Profile category.
system_update_6045 in modules/system/system.install
Update blog, book and locale module permissions.
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
Implementation of 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.
testConnect in includes/install.inc
Check if we can connect to the database.
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
Implementation of 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
update_help in modules/update/update.module
Implementation of hook_help().
update_manual_status in modules/update/update.fetch.inc
Callback to manually check the update status without cron.
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_perm_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_edit_submit in modules/user/user.pages.inc
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either login in or registers the current user, based on username. Either way, the global $user object is populated based on $name.
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 offline for maintenance.
_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 1170

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

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

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

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

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen