### Eclipse Workspace Patch 1.0 #P Drupal Index: sites/all/modules/faq/faq.module =================================================================== --- sites/all/modules/faq/faq.module (revision 1685) +++ sites/all/modules/faq/faq.module (working copy) @@ -1260,20 +1260,24 @@ * @param $term * The taxonomy term object. */ -function faq_set_breadcrumb($term = NULL) { - $breadcrumb = array(); - - if (module_exists("taxonomy") && $term) { - $breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq/'. $term->tid); - while ($parents = taxonomy_get_parents($term->tid)) { - $term = array_shift($parents); - $breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq/'. $term->tid); - } - } - $breadcrumb[] = l(variable_get('faq_title', 'Frequently Asked Questions'), 'faq'); - $breadcrumb[] = l(t('Home'), NULL); - $breadcrumb = array_reverse($breadcrumb); - return drupal_set_breadcrumb($breadcrumb); +function faq_set_breadcrumb($term = NULL) { + $breadcrumb = array(); + if (variable_get('faq_custom_breadcrumbs', TRUE)) { + if (module_exists("taxonomy") && $term) { + $breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq/'. $term->tid); + while ($parents = taxonomy_get_parents($term->tid)) { + $term = array_shift($parents); + $breadcrumb[] = l(faq_tt("taxonomy:term:$term->tid:name", $term->name), 'faq/'. $term->tid); + } + } + $breadcrumb[] = l(variable_get('faq_title', 'Frequently Asked Questions'), 'faq'); + $breadcrumb[] = l(t('Home'), NULL); + $breadcrumb = array_reverse($breadcrumb); + return drupal_set_breadcrumb($breadcrumb); + } + // This is also used to set the breadcrumbs in the faq_preprocess_page() + // so we need to return a valid trail. + return drupal_get_breadcrumb(); } /** Index: sites/all/modules/faq/faq.admin.inc =================================================================== --- sites/all/modules/faq/faq.admin.inc (revision 1670) +++ sites/all/modules/faq/faq.admin.inc (working copy) @@ -45,7 +45,12 @@ '#rows' => 5, ); $form['body_filter']['faq_description_format'] = filter_form(variable_get('faq_description_format', '')); - + $form['faq_custom_breadcrumbs'] = array( + '#type' => 'checkbox', + '#title' => t('Create custom breadcrumbs for the FAQ'), + '#description' => t('This option set the breadcrumb path to "%home > %faqtitle > category trail".', array('%home' => t('Home'), '%faqtitle' => variable_get('faq_title', 'Frequently Asked Questions'))), + '#default_value' => variable_get('faq_custom_breadcrumbs', TRUE), + ); $form['update'] = array( '#type' => 'submit', '#value' => t('Save configuration'), @@ -454,6 +459,7 @@ variable_set('faq_title', $form_state['values']['faq_title']); variable_set('faq_description', $form_state['values']['faq_description']); variable_set('faq_description_format', $form_state['values']['format']); + variable_set('faq_custom_breadcrumbs', $form_state['values']['faq_custom_breadcrumbs']); drupal_set_message(t('Configuration has been updated.')); } Index: sites/all/modules/faq/faq.install =================================================================== --- sites/all/modules/faq/faq.install (revision 1670) +++ sites/all/modules/faq/faq.install (working copy) @@ -80,6 +80,7 @@ variable_del('faq_enable_term_links'); variable_del('faq_disable_node_links'); variable_del('faq_default_sorting'); + variable_del('faq_custom_breadcrumbs'); // Remove all FAQ nodes. $result = db_query("SELECT nid FROM {node} WHERE type = 'faq'");