Allow modules to interact with the Drupal core.
Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.
To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and call that hook in all enabled modules that implement it.
The available hooks to implement are explained here in the Hooks section of the developer documentation. The string "hook" is used as a placeholder for the module name is the hook definitions. For example, if the module file is called example.module, then hook_help() as implemented by that module would be defined as example_help().
| Name | Beschreibung |
|---|---|
| custom_url_rewrite_inbound | custom_url_rewrite_inbound is not a hook, it's a function you can add to settings.php to alter incoming requests so they map to a Drupal path. This function is called before modules are loaded and the menu system is initialized and it changes… |
| custom_url_rewrite_outbound | custom_url_rewrite_outbound is not a hook, it's a function you can add to settings.php to alter all links generated by Drupal. This function is called from url(). This function is called very frequently (100+ times per page) so performance… |
| hook_access | Define access restrictions. |
| hook_actions_delete | Execute code after an action is deleted. |
| hook_action_info | Declare information about one or more Drupal actions. |
| hook_action_info_alter | Alter the actions declared by another module. |
| hook_aggregator_fetch | Implement this hook to create an alternative fetcher for aggregator module. |
| hook_aggregator_fetch_info | Implement this hook to expose the title and a short description of your fetcher. |
| hook_aggregator_parse | Implement this hook to create an alternative parser for aggregator module. |
| hook_aggregator_parse_info | Implement this hook to expose the title and a short description of your parser. |
| hook_aggregator_process | Implement this hook to create a processor for aggregator module. |
| hook_aggregator_process_info | Implement this hook to expose the title and a short description of your processor. |
| hook_aggregator_remove | Implement this hook to remove stored data if a feed is being deleted or a feed's items are being removed. |
| hook_block_configure | Configuration form for the block. |
| hook_block_list | List of all blocks defined by the module. |
| hook_block_save | Save the configuration options. |
| hook_block_view | Process the block when enabled in a region in order to view its contents. |
| hook_boot | Perform setup tasks. See also, hook_init. |
| hook_comment_delete | The comment is being deleted by the moderator. |
| hook_comment_insert | The comment is being inserted. |
| hook_comment_publish | The comment is being published by the moderator. |
| hook_comment_unpublish | The comment is being unpublished by the moderator. |
| hook_comment_update | The comment is being updated. |
| hook_comment_validate | The user has just finished editing the comment and is trying to preview or submit it. This hook can be used to check or even modify the comment. Errors should be set with form_set_error(). |
| hook_comment_view | The comment is being viewed. This hook can be used to add additional data to the comment before theming. |
| hook_cron | Perform periodic actions. |
| hook_db_rewrite_sql | Rewrite database queries, usually for access control. |
| hook_delete | Respond to node deletion. |
| hook_disable | Perform necessary actions before module is disabled. |
| hook_elements | Allows modules to declare their own Forms API element types and specify their default values. |
| hook_enable | Perform necessary actions after module is enabled. |
| hook_exit | Perform cleanup tasks. |
| hook_file_copy | Respond to a file that has been copied. |
| hook_file_delete | Respond to a file being deleted. |
| hook_file_download | Control access to private file downloads and specify HTTP headers. |
| hook_file_insert | Respond to a file being added. |
| hook_file_load | Load additional information into file objects. |
| hook_file_move | Respond to a file that has been moved. |
| hook_file_references | Report the number of times a file is referenced by a module. |
| hook_file_update | Respond to a file being updated. |
| hook_file_validate | Check that files meet a given criteria. |
| hook_filter | Define content filters. |
| hook_filter_tips | Provide tips for using filters. |
| hook_flush_caches | Add a list of cache tables to be cleared. |
| hook_footer | Insert closing HTML. |
| hook_form | Display a node editing form. |
| hook_forms | Map form_ids to builder functions. |
| hook_form_alter | Perform alterations before a form is rendered. |
| hook_form_FORM_ID_alter | Provide a form-specific alteration instead of the global hook_form_alter(). |
| hook_help | Provide online user help. |
| hook_hook_info | Expose a list of triggers (events) that your module is allowing users to assign actions to. |
| hook_image_toolkits | Define image toolkits provided by this module. |
| hook_init | Perform setup tasks. See also, hook_boot. |
| hook_insert | Respond to node insertion. |
| hook_install | Install the current version of the database schema, and any other setup tasks. |
| hook_js_alter | Perform necessary alterations to the JavaScript before it is presented on the page. |
| hook_link | Define internal Drupal links. |
| hook_link_alter | Perform alterations before links on a comment are rendered. One popular use of this hook is to modify/remove links from other modules. If you want to add a link to the links section of a node, use hook_link instead. |
| hook_load | Load node-type-specific information. |
| hook_locale | Allows modules to define their own text groups that can be translated. |
| hook_mail | Prepare a message based on parameters. |
| hook_mail_alter | Alter any aspect of the emails sent by Drupal. You can use this hook to add a common site footer to all outgoing emails; add extra header fields and/or modify the mails sent out in any way. HTML-izing the outgoing mails is one possibility. See also… |
| hook_menu | Define menu items and page callbacks. |
| hook_menu_alter | Alter the data being saved to the {menu_router} table after hook_menu is invoked. |
| hook_menu_link_alter | Alter the data being saved to the {menu_links} table by menu_link_save(). |
| hook_modules_disabled | Perform necessary actions after modules are disabled. |
| hook_modules_enabled | Perform necessary actions after modules are enabled. |
| hook_modules_installed | Perform necessary actions after modules are installed. |
| hook_modules_uninstalled | Perform necessary actions after modules are uninstalled. |
| hook_node_access_records | Set permissions for a node to be written to the database. |
| hook_node_access_records_alter | Alter permissions for a node before it is written to the database. |
| hook_node_build_alter | The node content was built, the module may modify the structured content. |
| hook_node_delete | Act on node deletion. |
| hook_node_delete_revision | A revision of the node is deleted. |
| hook_node_grants | Inform the node access system what permissions the user has. |
| hook_node_grants_alter | Alter user access rules when trying to view, edit or delete a node. |
| hook_node_info | Define module-provided node types. |
| hook_node_insert | Respond to node insertion. |
| hook_node_load | Act on node objects when loaded. |
| hook_node_operations | Add mass node operations. |
| hook_node_prepare | The node is about to be shown on the add/edit form. |
| hook_node_prepare_translation | The node is being cloned for translation. |
| hook_node_presave | The node passed validation and is about to be saved. |
| hook_node_search_result | The node is being displayed as a search result. |
| hook_node_type | Act on node type changes. |
| hook_node_update | The node being updated. |
| hook_node_update_index | The node is being indexed. |
| hook_node_validate | The user has finished editing the node and is previewing or submitting it. |
| hook_node_view | The node content is being assembled before rendering. |
| hook_openid | Allow modules to modify the OpenID request parameters. |
| hook_page_alter | Perform alterations before a page is rendered. |
| hook_perm | Define user permissions. |
| hook_prepare | This is a hook used by node modules. It is called after load but before the node is shown on the add/edit form. |
| hook_profile_alter | Perform alterations profile items before they are rendered. You may omit/add/re-sort/re-categorize, etc. |
| hook_query_alter | Perform alterations to a structured query. |
| hook_query_TAG_alter | Perform alterations to a structured query for a given tag. |
| hook_requirements | Check installation requirements and do status reporting. |
| hook_schema | Define the current version of the database schema. |
| hook_schema_alter | Perform alterations to existing database schemas. |
| hook_search | Define a custom search routine. |
| hook_search_preprocess | Preprocess text for the search index. |
| hook_system_info_alter | Alter the information parsed from module and theme .info files |
| hook_taxonomy_term_delete | Respond to the deletion of taxonomy terms. |
| hook_taxonomy_term_insert | Act on taxonomy terms when inserted. |
| hook_taxonomy_term_load | Act on taxonomy terms when loaded. |
| hook_taxonomy_term_update | Act on taxonomy terms when updated. |
| hook_taxonomy_vocabulary_delete | Respond to the deletion of taxonomy vocabularies. |
| hook_taxonomy_vocabulary_insert | Act on taxonomy vocabularies when inserted. |
| hook_taxonomy_vocabulary_load | Act on taxonomy vocabularies when loaded. |
| hook_taxonomy_vocabulary_update | Act on taxonomy vocabularies when updated. |
| hook_test_finished | An individual test has finished. |
| hook_test_group_finished | A test group has finished. |
| hook_test_group_started | A test group has started. |
| hook_theme | Register a module (or theme's) theme implementations. |
| hook_theme_registry_alter | Alter the theme registry information returned from hook_theme(). |
| hook_translated_menu_link_alter | Alter a menu link after it's translated, but before it's rendered. |
| hook_translation_link_alter | Perform alterations on translation links. |
| hook_uninstall | Remove any information that the module sets. |
| hook_update | Respond to node updating. |
| hook_update_index | Update Drupal's full-text index for this module. |
| hook_update_last_removed | Return a number which is no longer available as hook_update_N(). |
| hook_update_N | Perform a single update. For each patch which requires a database change add a new hook_update_N() which will be called by update.php. |
| hook_update_status_alter | Alter the information about available updates for projects. |
| hook_user | Act on user account actions. |
| hook_user_cancel | Act on user account cancellations. |
| hook_user_cancel_methods_alter | Modify account cancellation methods. |
| hook_user_load | Act on user objects when loaded from the database. |
| hook_user_operations | Add mass user operations. |
| hook_validate | Verify a node editing form. |
| hook_view | Display a node. |
| hook_watchdog | Log an event message |
| hook_xmlrpc | Register XML-RPC callbacks. |
| module_hook | Determine whether a module implements a hook. |
| module_implements | Determine which modules are implementing a hook. |
| module_invoke | Invoke a hook in a particular module. |
| module_invoke_all | Invoke a hook in all enabled modules that implement it. |
| _module_implements_maintenance | This is the maintenance version of module_implements for internal use only. |
includes/
Kommentare
Kommentar hinzufügen