Index: taxonomy_menu.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_menu/taxonomy_menu.module,v retrieving revision 1.19.2.2.2.59 diff -u -p -r1.19.2.2.2.59 taxonomy_menu.module --- taxonomy_menu.module 6 Jun 2010 16:47:46 -0000 1.19.2.2.2.59 +++ taxonomy_menu.module 11 Jun 2010 17:07:49 -0000 @@ -493,6 +493,13 @@ function taxonomy_menu_handler($op, $arg * 'mlid' => if this is filled in then the mlid will be updated */ function _taxonomy_menu_save($item) { + // Get options. + $options = array( + 'vocab_parent' => variable_get('taxonomy_menu_vocab_parent_'. $item['vid'], NULL), + 'use_term_description' => variable_get('taxonomy_menu_use_term_description_'. $item['vid'], TRUE), + 'expanded' => variable_get('taxonomy_menu_expanded_'. $item['vid'], TRUE), + ); + $insert = TRUE; //create the path. //use url to create he inital path @@ -504,7 +511,7 @@ function _taxonomy_menu_save($item) { // - the menu parent setting for this vocab $plid = _taxonomy_menu_get_mlid($item['ptid'], $item['vid']); if (!$plid) { - $plid = variable_get('taxonomy_menu_vocab_parent_'. $item['vid'], NULL); + $plid = $options['vocab_parent']; } // Make sure the path has less then 256 characters @@ -517,26 +524,32 @@ function _taxonomy_menu_save($item) { 'link_title' => check_plain($item['name']), 'menu_name' => $item['menu_name'], 'plid' => $plid, - 'options' => array('attributes' => array('title' => trim($item['description']) - ? check_plain($item['description']) : check_plain($item['name']))), 'weight' => $item['weight'], 'module' => 'taxonomy_menu', - 'expanded' => variable_get('taxonomy_menu_expanded_'. $item['vid'], TRUE), + 'expanded' => $options['expanded'], 'link_path' => $path, ); + + if ($options['use_term_description']) { + $link['options'] = array( + 'attributes' => array( + 'title' => check_plain(strip_tags($item['description'])), + ), + ); + } //Add setup the query paramater in the URL correctly if (strpos($path, '?') !== FALSE) { - $split = explode('?', $path); - if (strpos($split[1], '?') !== FALSE) { - // the query split didn't work, too many question marks - // error? - } else { - $link['options']['query'] = $split[1]; - $link['link_path'] = $split[0]; - } - } - + $split = explode('?', $path); + if (strpos($split[1], '?') !== FALSE) { + // the query split didn't work, too many question marks + // error? + } + else { + $link['options']['query'] = $split[1]; + $link['link_path'] = $split[0]; + } + } //if passed a mlid then add it if ($item['mlid']) { @@ -946,6 +959,12 @@ function taxonomy_menu_taxonomy_menu_opt '#description' => t('Changes the default path to taxonomy/term/tid+tid+tid for all terms thave have child terms.'), 'default' => FALSE, ); + + $options['use_term_description'] = array( + '#title' => t('Use term description as menu item description'), + '#description' => t('Use each taxonomy term’s description as the title attribute for its corresponding menu item.'), + 'default' => TRUE, + ); $options['end_all'] = array( '#title' => t("Use 'all' at the end of URL"),