function hook_menu_handle_replacement_pattern

This hook is called by the menu system. It allows each module the change to replace string patterns in its menu items (defined in hook_menu).

See also

hook_menu()

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

File

includes/hook.api.php, line 729
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_has_search" => FALSE,
   *     "page_banner_is_link" => TRUE,
   *     "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;
}