Skip to content
Snippets Groups Projects
Commit 06c79d5f authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Realign collection/view.phtml with record/view.phtml. (#1866)

parent 87e73a3f
Branches
Tags
No related merge requests found
......@@ -6,10 +6,14 @@
if ($this->syndeticsPlus()->isActive()) {
$this->headScript()->appendFile($this->syndeticsPlus()->getScript());
}
// Add any extra scripts the tabs require:
foreach ($this->tabsExtraScripts as $script) {
$this->headScript()->appendFile($script);
}
// Add RDF header link if applicable:
if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) {
$this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation');
$this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation');
}
// Set flag for special cases relating to full-width hierarchy tree tab:
......@@ -30,7 +34,7 @@
<?=$this->record($this->driver)->getToolbar()?>
<div class="record">
<div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>">
<div<?php if (!$tree): /* in tree mode, do not constrain width with a class */ ?> class="<?=$this->layoutClass('mainbody') ?> solo"<?php endif; ?>>
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" id="record_id" />
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource" />
......@@ -44,27 +48,30 @@
<?php foreach ($this->tabs as $tab => $obj): ?>
<?php // add current tab to breadcrumbs if applicable:
$desc = $obj->getDescription();
$tab_classes = [];
$tabName = preg_replace("/\W/", "-", strtolower($tab));
$tabClasses = [ 'record-tab', $tabName ];
if (0 === strcasecmp($this->activeTab, $tab)) {
if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) {
$tab_classes[] = 'active';
$tabClasses[] = 'active';
}
$tab_classes[] = 'initiallyActive';
$tabClasses[] = 'initiallyActive';
$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>';
$activeTabObj = $obj;
}
if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; }
if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; }
if (!$obj->isVisible()) { $tabClasses[] = 'hidden'; }
if (!$obj->supportsAjax()) { $tabClasses[] = 'noajax'; }
?>
<li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>>
<a class="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>><?=$this->transEsc($desc)?></a>
<li class="<?=implode(' ', $tabClasses)?>" data-tab="<?=$tabName?>"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>>
<a href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav" data-lightbox-ignore>
<?=$this->transEsc($desc)?>
</a>
</li>
<?php endforeach; ?>
</ul>
<div class="tab-content collectionDetails<?=$tree ? 'Tree' : ''?>">
<?php if (!$this->loadInitialTabWithAjax || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?>
<div class="tab-pane active <?=$this->activeTab ?>-tab">
<div class="tab-pane active <?=$this->escapeHtmlAttr($this->activeTab) ?>-tab">
<?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
</div>
<?php endif; ?>
......
......@@ -32,7 +32,7 @@
<?php $sidebarList = $this->related()->getList($this->driver); ?>
<div class="<?=$this->layoutClass('mainbody')?><?=count($sidebarList) < 1 ? ' solo' : '' ?>">
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" />
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier()) ?>" class="hiddenSource" />
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource" />
<?=$this->flashmessages()?>
<?=$this->record($this->driver)->getCoreMetadata()?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment