'activemenu/js', 'title' => t('activemenu'), 'access' => user_access('access content'), 'type' => MENU_CALLBACK, 'callback' => 'activemenu_js' ); } else { activemenu_load(); } return $items; } /** * Load needed files. */ function activemenu_load() { $path = drupal_get_path('module', 'activemenu'); jstools_add_js($path . '/activemenu.js'); drupal_add_css($path .'/activemenu.css'); } function activemenu_js() { if (isset($_POST['path'])) { $path = $_POST['path']; if ($source = drupal_lookup_path('source', $path)) { $path = $source; } $menu = menu_get_menu(); $pid = $menu['path index'][$path]; print drupal_to_js(array('status' => TRUE, 'content' => theme('menu_tree', $pid))); } exit(); }