Browse Source

Merge pull request #252 from nigelgbanks/7.x-set-title-for-view-objects

Automatically set the title to the object label when viewing objects.
pull/254/merge
Jonathan Green 12 years ago
parent
commit
965932fe49
  1. 5
      islandora.module
  2. 3
      theme/islandora-object-edit.tpl.php
  3. 4
      theme/islandora-object.tpl.php

5
islandora.module

@ -430,7 +430,10 @@ function islandora_object_manage_access_callback($perms, $object = NULL) {
* The HTML repersentation of the manage object page. * The HTML repersentation of the manage object page.
*/ */
function islandora_edit_object(FedoraObject $object) { function islandora_edit_object(FedoraObject $object) {
module_load_include('inc', 'islandora', 'includes/breadcrumb');
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
drupal_set_title($object->label);
drupal_set_breadcrumb(islandora_get_breadcrumbs($object));
$output = array(); $output = array();
foreach (islandora_build_hook_list(ISLANDORA_EDIT_HOOK, $object->models) as $hook) { foreach (islandora_build_hook_list(ISLANDORA_EDIT_HOOK, $object->models) as $hook) {
$temp = module_invoke_all($hook, $object); $temp = module_invoke_all($hook, $object);
@ -491,6 +494,7 @@ function islandora_view_default_object() {
function islandora_view_object(FedoraObject $object) { function islandora_view_object(FedoraObject $object) {
module_load_include('inc', 'islandora', 'includes/breadcrumb'); module_load_include('inc', 'islandora', 'includes/breadcrumb');
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
drupal_set_title($object->label);
drupal_set_breadcrumb(islandora_get_breadcrumbs($object)); drupal_set_breadcrumb(islandora_get_breadcrumbs($object));
// Optional pager parameters // Optional pager parameters
$page_number = (empty($_GET['page'])) ? '1' : $_GET['page']; $page_number = (empty($_GET['page'])) ? '1' : $_GET['page'];
@ -854,4 +858,3 @@ function islandora_entity_property_info() {
return $info; return $info;
} }

3
theme/islandora-object-edit.tpl.php

@ -20,7 +20,4 @@
* *
*/ */
?> ?>
<?php drupal_set_title($islandora_object->label); ?>
<?php print (theme_table($variables['datastream_table'])); ?> <?php print (theme_table($variables['datastream_table'])); ?>

4
theme/islandora-object.tpl.php

@ -58,10 +58,6 @@
* *
*/ */
?> ?>
<?php if (isset($islandora_object_label)): ?>
<?php drupal_set_title("$islandora_object_label"); ?>
<?php endif; ?>
<div class="islandora-object islandora"> <div class="islandora-object islandora">
<h2><?php print t('Details'); ?></h2> <h2><?php print t('Details'); ?></h2>
<dl class="islandora-object-tn"> <dl class="islandora-object-tn">

Loading…
Cancel
Save