You are here

function __taxonomy_menu_admin_submit in Taxonomy menu 5

Admin area. Configure the module, setting which vocabularies will be converted into menus items

File

./taxonomy_menu.module, line 31
taxonomy_menu.module @author Jonathan Chaffer <jchaffer@structureinteractive.com> @author Bruno Massa <http://drupal.org/user/67164> It Generates menu links for all taxonomy terms

Code

function __taxonomy_menu_admin_submit(&$form_id, &$form) {

  // Save these options
  variable_set('taxonomy_menu_display_page', $form['taxonomy_menu_display_page']);
  variable_set('taxonomy_menu_hide_module_page', $form['taxonomy_menu_hide_module_page']);
  variable_set('taxonomy_menu_display_num', $form['taxonomy_menu_display_num']);
  variable_set('taxonomy_menu_hide_empty', $form['taxonomy_menu_hide_empty']);
  variable_set('taxonomy_menu_display_descendants', $form['taxonomy_menu_display_descendants']);
  variable_set('taxonomy_menu_display_context', $form['taxonomy_menu_display_context']);

  // Save which category should be displayed on menu
  foreach (taxonomy_get_vocabularies() as $vocab) {
    variable_set('taxonomy_menu_show_' . $vocab->vid, $form['taxonomy_menu_show_' . $vocab->vid]);
    if (module_exists('views')) {
      variable_set('taxonomy_menu_show_views_' . $vocab->vid, $form['taxonomy_menu_show_view_' . $vocab->vid]);
    }
  }

  // Rebuild the menu to include these features
  variable_set('menu_rebuild_needed', TRUE);
}