123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- function simplemenu_multi_menu_form_simplemenu_admin_settings_alter(&$form, $form_state) {
- $form['default_menu']['simplemenu_menus'] = $form['default_menu']['simplemenu_menu'];
- unset($form['default_menu']['simplemenu_menu']);
- $def = variable_get('simplemenu_menus', array(variable_get('simplemenu_menu', 'navigation:0')));
- $form['default_menu']['simplemenu_menus']['#multiple'] = TRUE;
- $form['default_menu']['simplemenu_menus']['#title'] = t('Menus');
- $form['default_menu']['simplemenu_menus']['#default_value'] = $def;
- $form['default_menu']['simplemenu_menus']['#description'] = t('Select one or more menus to show each one of them (use Ctrl or Shift to select multiple entries.) Please, avoid selecting a parent and a child from the same menu.');
- }
- function simplemenu_multi_menu_simplemenu_menus_alter($all_menus) {
- $all_menus = variable_get('simplemenu_menus', $all_menus);
- }
- function simplemenu_multi_menu_theme_registry_alter(&$theme_registry) {
- global $theme;
-
- $themes = variable_get('simplemenu_multi_menu_theme_function', array());
- $themes[$theme] = $theme_registry['menu_item_link']['function'];
- variable_set('simplemenu_multi_menu_theme_function', $themes);
-
- $theme_registry['menu_item_link']['function'] = 'simplemenu_multi_menu_theme_menu_item_link';
- }
- function simplemenu_multi_menu_theme_menu_item_link($link) {
- global $theme;
- static $cnt = 0;
-
- if (!empty($link['simplemenu_multi_menu_root']) && variable_get('simplemenu_running', FALSE)) {
- ++$cnt;
- return '<a name="menu-id-' . $cnt . '">' . $link['title'] . '</a>';
- }
-
- $themes = variable_get('simplemenu_multi_menu_theme_function', array());
- if (isset($themes[$theme])) {
- return $themes[$theme]($link);
- }
-
-
- return theme_menu_item_link($link);
- }
|