summaryrefslogtreecommitdiff
path: root/modules/menu/menu.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/menu/menu.module')
-rw-r--r--modules/menu/menu.module35
1 files changed, 6 insertions, 29 deletions
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 2dfda5984..8ba005110 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -125,35 +125,6 @@ function menu_menu() {
*/
}
-/**
- * Implementation of hook_menu_alter.
- */
-function menu_menu_alter(&$menu, $phase) {
- switch ($phase) {
- case MENU_ALTER_MODULE_DEFINED:
- foreach ($menu as $path => $item) {
- if (isset($item['_custom_item']) && $item['_custom_item'] && !$item['_external']) {
- list($ancestors, $placeholders) = menu_get_ancestors(explode('/', $path, 6));
- // Remove the item itself, custom items need to inherit from an existing item.
- array_shift($ancestors);
- array_shift($placeholders);
- $inherit_item = db_fetch_object(db_query_range('SELECT * FROM {menu} WHERE path IN ('. implode (',', $placeholders) .') ORDER BY fit DESC', $ancestors, 0, 1));
- drupal_set_message(var_export($inherit_item, TRUE));
- $menu[$path]['access callback'] = $inherit_item->access_callback;
- $menu[$path]['access arguments'] = unserialize($inherit_item->access_arguments);
- $menu[$path]['page callback'] = $inherit_item->page_callback;
- $menu[$path]['page arguments'] = unserialize($inherit_item->page_arguments);
- }
- }
- break;
- case MENU_ALTER_PREPROCESSED:
- $result = db_query('SELECT * FROM {menu_custom} me WHERE admin = 0');
- while ($item = db_fetch_array($result)) {
- $menu[$item['path']] = $item + $menu[$item['path']];
- }
- break;
- }
-}
/**
* Menu callback which displays every menu element accessible to the current
@@ -161,6 +132,8 @@ function menu_menu_alter(&$menu, $phase) {
*/
function menu_overview() {
$header = array(t('Menu item'), t('Expanded'), array('data' => t('Operations'), 'colspan' => '3'));
+
+
$result = db_query('SELECT m.*, me.disabled FROM {menu} m LEFT JOIN {menu_custom} me ON m.path = me.path WHERE visible = 1 OR (disabled = 1 AND admin = 0) ORDER BY mleft');
$map = arg();
$rows = array();
@@ -677,6 +650,10 @@ function _menu_form_alter(&$form, $form_id) {
}
}
+function menu_get_root_menus() {
+ return array();
+}
+
/**
* Menu callback; presents menu configuration options.
*/