menu_block.api.php 1.46 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php
/**
 * @file
 * Hooks provided by the Menu Block module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
JohnAlbin's avatar
JohnAlbin committed
13
 * Alter the menu tree and its configuration before the tree is rendered.
14 15
 *
 * @param $tree
JohnAlbin's avatar
JohnAlbin committed
16
 *   An array containing the unrendered menu tree.
17
 * @param $config
JohnAlbin's avatar
JohnAlbin committed
18
 *   An array containing the configuration of the tree.
19 20 21 22 23 24 25 26 27 28 29
 */
function hook_menu_block_tree_alter(&$tree, &$config) {
}

/**
 * Return a list of menus to use with the menu_block module.
 *
 * @return
 *   An array containing the menus' machine names as keys with their menu titles
 *   as values.
 */
30
function hook_menu_block_get_menus() {
31 32 33 34 35 36 37
  $menus = array();
  // For each menu, add the following information:
  $menus['menu_name'] = 'menu title';

  return $menus;
}

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
/**
 * Return a list of menus to use on menu block's settings form.
 *
 * Menu block's settings page sorts menus for use with its "the menu selected by
 * the page" option.
 *
 * @return
 *   An array containing the menus' machine names as keys with their menu titles
 *   as values. The key may optionally be a regular expression to match several
 *   menus at a time; see book_menu_block_get_sort_menus() for an example.
 */
function hook_menu_block_get_sort_menus() {
  $menus = array();
  // For each menu, add the following information:
  $menus['menu_name'] = 'menu title';
  // Optionally, add a regular expression to match several menus at once.
  $menus['/^my\-menus\-.+/'] = t('My menus');

  return $menus;
}

59 60 61
/**
 * @} End of "addtogroup hooks".
 */