Browse Source

Option to not render breadcrumbs.

pull/589/head
Jordan Dukart 10 years ago
parent
commit
b7816b33b2
  1. 6
      includes/admin.form.inc
  2. 11
      includes/breadcrumb.inc
  3. 7
      islandora.install

6
includes/admin.form.inc

@ -74,6 +74,12 @@ function islandora_repository_admin(array $form, array &$form_state) {
'#description' => t('Displays an extra print tab, allowing an object to be printed'), '#description' => t('Displays an extra print tab, allowing an object to be printed'),
'#default_value' => variable_get('islandora_show_print_option', FALSE), '#default_value' => variable_get('islandora_show_print_option', FALSE),
), ),
'islandora_render_drupal_breadcrumbs' => array(
'#type' => 'checkbox',
'#title' => t('Render Drupal breadcrumbs'),
'#description' => t('Larger sites may experience a notable performance improvement when disabled due to how breadcrumbs are constructed.'),
'#default_value' => variable_get('islandora_render_drupal_breadcrumbs', TRUE),
),
), ),
'islandora_namespace' => array( 'islandora_namespace' => array(
'#type' => 'fieldset', '#type' => 'fieldset',

11
includes/breadcrumb.inc

@ -25,10 +25,13 @@
* drupal_set_breadcrumb(). * drupal_set_breadcrumb().
*/ */
function islandora_get_breadcrumbs($object) { function islandora_get_breadcrumbs($object) {
$breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository); $breadcrumbs = array();
array_pop($breadcrumbs); if (variable_get('islandora_render_drupal_breadcrumbs', TRUE)) {
$context = 'islandora'; $breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository);
drupal_alter('islandora_breadcrumbs', $breadcrumbs, $context, $object); array_pop($breadcrumbs);
$context = 'islandora';
drupal_alter('islandora_breadcrumbs', $breadcrumbs, $context, $object);
}
return $breadcrumbs; return $breadcrumbs;
} }

7
islandora.install

@ -47,6 +47,13 @@ function islandora_uninstall() {
$variables = array( $variables = array(
'islandora_ds_replace_exclude_enforced', 'islandora_ds_replace_exclude_enforced',
'islandora_defer_derivatives_on_ingest', 'islandora_defer_derivatives_on_ingest',
'islandora_base_url',
'islandora_repository_pid',
'islandora_use_datastream_cache_headers',
'islandora_show_print_option',
'islandora_render_drupal_breadcrumbs',
'islandora_namespace_restriction_enforced',
'islandora_pids_allowed',
); );
array_walk($variables, 'variable_del'); array_walk($variables, 'variable_del');
} }

Loading…
Cancel
Save