function hook_menu_handle_replacement_pattern
Search API
This hook is called by the menu system. It allows each module the chance to replace string patterns in its menu items (defined in hook_menu).
It can also be used in the Title of the page or tab.
Replacement patterns must begin and end with %. Ex: %STUDENT_NAME%
See also
6 functions implement hook_menu_handle_replacement_pattern()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- admin_menu_handle_replacement_pattern in modules/
admin/ admin.module - This is an implementation of hook_menu_handle_replacement_pattern. It will search for and replace replacement patterns which we are aware of it in $str.
- alerts_menu_handle_replacement_pattern in modules/
alerts/ alerts.module - implements hook_menu_handle_replacement_pattern
- blank_degrees_menu_handle_replacement_pattern in modules/
blank_degrees/ blank_degrees.module - This is an implementation of hook_menu_handle_replacement_pattern. It will search for and replace replacement patterns which we are aware of it in $str.
- content_menu_handle_replacement_pattern in modules/
content/ content.module - This is an implementation of hook_menu_handle_replacement_pattern. It will search for and replace replacement patterns which we are aware of it in $str.
- course_search_menu_handle_replacement_pattern in modules/
course_search/ course_search.module - Implements hook
File
- includes/
hook.api.php, line 1156 - Lists all available hooks within FlightPath's core code.
Code
function hook_menu_handle_replacement_pattern($str) {
/*
* This example, from admin.module, will replace the pattern %DE_CATALOG_YEAR%
* with the actual current catalog year in the system.
*
* An example menu item which uses this replacement pattern would be this:
* $items["admin/config/urgent-message"] = array(
* "title" => "Edit urgent message",
* "page_callback" => "fp_render_form",
* "page_arguments" => array("admin_urgent_message_form", "system_settings"),
* "access_arguments" => array("can_edit_urgent_message"),
* "page_settings" => array(
*
*
* "page_hide_report_error" => TRUE,
* "menu_links" => array(
* 0 => array(
* "text" => "Back to main menu",
* "path" => "admin-tools/admin",
* "query" => "de_catalog_year=%DE_CATALOG_YEAR%", // RIGHT HERE!
* ),
* ),
* ),
* "type" => MENU_TYPE_NORMAL_ITEM,
* "tab_parent" => "admin-tools/admin",
* );
*
*/
if (strpos($str, "%DE_CATALOG_YEAR%") !== 0) {
// It contains this replacement pattern!
$str = str_replace("%DE_CATALOG_YEAR%", admin_get_de_catalog_year(), $str);
}
return $str;
}