A module to have a drop down css/javascript menu for site navigation and admin navigation.
', array('!link' => l('admin/build/block', 'admin/build/block'))); break; } return $output; } /* * Settings form as implemented by hook_menu */ function yuimenu_admin_settings() { $form['yuimenu_root'] = array( '#type' => 'select', '#title' => t('Source Menu Tree'), '#description' => t('The menu tree from which to show a nice menu.'), '#default_value' => variable_get('yuimenu_root','1'), '#options' => menu_parent_options(0), ); $form['yuimenu_type'] = array( '#type' => 'select', '#title' => t('Menu Display type'), '#description' => t('Select the display type of the menu.'), '#default_value' => variable_get('yuimenu_type','tna'), '#options' => array('tns' =>'Website Top Nav With Submenus From JavaScript', 'tnm' =>'Website Top Nav With Submenus Built From Markup') ); $form['yuimenu_animate'] = array( '#type' => 'checkbox', '#title' => t('Animated Menu'), '#description' => t('To enable animation while opening menu check this.'), '#default_value' => variable_get('yuimenu_animate',0), ); return system_settings_form($form); } /** * Implemention of hook_menu(). */ function yuimenu_menu($may_cache) { if (!$may_cache) { drupal_set_html_head(' '); if (variable_get('yuimenu_animate',0)) { drupal_set_html_head(''); } switch (variable_get('yuimenu_type','tna')) { case 'tns': $script_body_to_html_head = get_yui_top_script(); break; case 'tnm': $script_body_to_html_head = get_yui_top_markup(); break; } drupal_set_html_head($script_body_to_html_head); drupal_add_js(drupal_get_path('module', 'yuimenu') .'/yuimenu.js'); } else { $items[] = array( 'path' => 'admin/settings/yuimenu', 'title' => t('YUI Menu Settings'), 'callback' => 'drupal_get_form', 'callback arguments' => 'yuimenu_admin_settings', 'access' => user_access('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); } return $items; } function get_yui_top_markup () { $scr = ' '; return ($scr); } function get_yui_top_script () { $scr = ''; return ($scr); } /* * when menu has a " or ' the script is fails. So replace them. */ function rep_char ($inStr) { $fromChar= array("\"","\\"); $toChar = array("'","-"); $outStr = str_replace($fromChar, $toChar, $inStr); return ($outStr); } function html_menu($pid = 1) { switch (variable_get('yuimenu_type','tna')) { case 'tns' : $output = get_html_menu_script($pid); break; case 'tnm' : $output = get_html_menu_markup($pid); break; } return $output; } function get_html_menu_script ($pid) { $menu = menu_get_menu(); $output .=' '; return $output; } function get_html_menu_markup ($pid) { $menu = menu_get_menu(); $output .='