You are here

function advanced_menu_submenu_menu_link_alter in Advanced Menu 7

Implements hook_menu_link_alter().

File

submenu/advanced_menu_submenu.module, line 150
Provides advanced menu submenus.

Code

function advanced_menu_submenu_menu_link_alter(&$item) {
  $original_path = explode('/', $item['link_path']);
  $alter_path = array_pop($original_path);
  $original_path = implode('/', $original_path);
  if ($original_path == 'advanced-menus/sub-menus') {
    $query = db_select('menu_custom', 'm')
      ->fields('m', array(
      'title',
    ))
      ->condition('menu_name', $alter_path)
      ->execute()
      ->fetchAssoc();
    $item['link_title'] = 'Submenu : ' . $query['title'];
  }
}