Dru Documentation

Go to front page

Allows units to co-operate with kernel Drupal. The units used in Drupale, work by a principle (English hook - a hook, a trap). is PHP function, which has a title module_name_hook_name (), where module_name - a unit title (a filename module_name.module), and hook_name - a title most . Everyone has a certain gang of parametres and types of outcomes. For the extension of functionality of those or other parts of Drupala, it is necessary to realise corresponding . When Drupal wishes to co-operate with units, it defines what are submitiven by units and calls these for all units included on a site. Are more low enumerated which call supports Drupal. In definitions more low, the word "hook" should be substituted addressed to the appropriate unit in which this will be realised. For example, if there is example.module unit and in it is defined hook_help () in the unit implementation should be defined in the form of function example_help (). 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 parametres 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 (). Functions Name Exposition custom_url_rewrite_inbound developer/hooks/core.php custom_url_rewrite_inbound is not . It is function, which can be added in settings.php to readdress entering inquiries to paths Drupala. This function is called before loading of units and menu initialization. It changes $ _GET [' q ']. custom_url_rewrite_outbound developer/hooks/core.php custom_url_rewrite_outbound is not . It is function which can be added in settings.php and which can make modifications to all links created by Drupalom. hook_access developer/hooks/node.php Defines access limitations. hook_actions_delete developer/hooks/core.php It is fulfilled after operation removal (action). hook_action_info developer/hooks/core.php Informs triggers Drupala on new operations (actions). hook_action_info_alter developer/hooks/core.php Changes operations (action), declared by other unit. hook_block developer/hooks/core.php Defines the block or a gang of blocks. hook_boot developer/hooks/core.php Carries out of the task at system loading. hook_comment developer/hooks/core.php Fulfils operations over remarks. hook_cron developer/hooks/core.php Fulfils the planned operations under the schedule. hook_db_rewrite_sql developer/hooks/core.php Rewrites inquiries to a DB, usually for access control. hook_delete developer/hooks/node.php Works at removal . hook_disable developer/hooks/install.php Fulfils the necessary operations before the unit will be disconnected. hook_elements developer/hooks/core.php Allows units to define own types of units Forms API and to define their default values. hook_enable developer/hooks/install.php Fulfils necessary operations after the unit is included. hook_exit developer/hooks/core.php It is used for an erasure of the data after pagein. hook_file_download developer/hooks/core.php Inspects access to files at a private mode of loading. Besides, allows to specify HTTP headers for files. hook_filter developer/hooks/core.php Defines filters of user's input. hook_filter_tips developer/hooks/core.php Submitives advices on usage of filters of user's input. hook_flush_caches developer/hooks/core.php Allows adds the tables to the list of tables which will be cleared. hook_footer developer/hooks/core.php Inserts closing HTML. hook_form developer/hooks/node.php Shows the modification form . hook_forms developer/hooks/core.php Anchors identifiers of forms (form_ids) to functions of their construction. hook_form_alter developer/hooks/core.php Allows to make modifications to the form before its show. hook_form_FORM_ID_alter developer/hooks/core.php Submitives possibility to change the separate form, instead of global hook_form_alter (). hook_help developer/hooks/core.php Submitives context-sensitive help for users. hook_hook_info developer/hooks/core.php Shows the list of triggers (events) to which your unit allows users to assign operations. hook_init developer/hooks/core.php Carries out of the task on initialization. See also hook_boot (), hook_exit () hook_insert developer/hooks/node.php Is responsible for an insertion . hook_install developer/hooks/install.php ˸== the current version of a database diagramme also fulfils other operations on customisation. hook_link developer/hooks/core.php Defines interior links Drupal. hook_link_alter developer/hooks/core.php Makes modifications before links in are mapped. One of popular modes of usage of it - a modification/removal of links from other units. If you wish to add the reference in section of links , use instead hook_link (). hook_load developer/hooks/node.php Loads the information specific to type . hook_locale developer/hooks/core.php Allows units to define their characteristic groups of texts which can be translated. hook_mail developer/hooks/core.php Prepares the letter grounded on parametres. For particularses see also drupal_mail (). hook_mail_alter developer/hooks/core.php Changes any aspect email referred Drupal. You can use this to add common footer of a site for all outgoing letters; to add an additional header field and-or to change transmitted letters in any image. HtMl-izatsija outgoing letters - one of possibilities. hook_menu developer/hooks/core.php Defines choices and callbacks of pages. hook_menu_alter developer/hooks/core.php Makes modifications over the data saved in the table {menu_router} after it was fulfilled hook_menu (). hook_menu_link_alter developer/hooks/core.php The Modification of the data saved in {menu_links} to the table on menu_link_save (). hook_nodeapi developer/hooks/core.php Fulfils operations over . hook_node_access_records developer/hooks/core.php Installs permissions for to be written in a database. hook_node_grants developer/hooks/core.php Informs a control system of access to on the rights which the user has. hook_node_info developer/hooks/node.php Defines types submitted by the unit . hook_node_operations developer/hooks/core.php Adds mass operations over . hook_node_type developer/hooks/node.php Allows units to realise operations at a type modification . hook_perm developer/hooks/core.php Defines access rights of the user. hook_ping developer/hooks/core.php Transmits ping-inquiry about other server. hook_prepare developer/hooks/node.php This is used by units which work with . It is called after loading but before it will be mapped in the form of adding/editing. hook_profile_alter developer/hooks/core.php Makes modifications to profile units before they will be shown. You can =/=/==/= etc. hook_requirements developer/hooks/install.php Check installation requirements and do status reporting. hook_schema developer/hooks/install.php ˸== a database according to certain circuits. hook_schema_alter developer/hooks/core.php Makes modifications to existing database diagrammes. hook_search developer/hooks/core.php Defines a user's lookup function. hook_search_preprocess developer/hooks/core.php Pre-text processing before entering in retrieval an index. hook_system_info_alter developer/hooks/core.php Changes the information received from files.info of units and that. hook_taxonomy developer/hooks/core.php It is fulfilled at taxonomy modifications. hook_term_path developer/hooks/core.php Allows units to submitive alternative paths to terms of a taxonomy which the unit manages. hook_theme developer/hooks/core.php Registers the unit or a subject. hook_theme_registry_alter developer/hooks/core.php Changes the information in the register that, returned hook_theme (). hook_translated_menu_link_alter developer/hooks/core.php Allows to change already translated link of the menu before mapping. hook_translation_link_alter developer/hooks/core.php Perform alterations on translation links. hook_uninstall developer/hooks/install.php Is for removal of tables and unit variables. hook_update developer/hooks/node.php Is responsible for upgrade . hook_update_index developer/hooks/core.php Refreshes a full-text index of Drupala for the given unit. hook_update_last_removed developer/hooks/install.php Returns number of a last update of the unit not accessible more through hook_update_N (). hook_update_N developer/hooks/install.php Makes upgrade of tables of the DB, necessary for individual upgrade of the unit. hook_update_status_alter developer/hooks/core.php Changes the information on upgrades accessible to projects. hook_user developer/hooks/core.php Fulfils operations with accounts of users. hook_user_operations developer/hooks/core.php Adds mass operation over users. hook_validate developer/hooks/node.php Checks the editing form . hook_view developer/hooks/node.php Shows . hook_watchdog developer/hooks/core.php Writes in log of the message on events. hook_xmlrpc developer/hooks/core.php Registers handlers XML-RPC. module_hook includes/module.inc Defines, whether realises the unit given . module_implements includes/module.inc Defines, what units realise . module_invoke includes/module.inc Calls in the specified unit. module_invoke_all includes/module.inc Calls in all included units.