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

Simplify isset checks.

parent 55c83071
Branches
Tags
No related merge requests found
......@@ -57,7 +57,7 @@
<?php foreach ($holdings['holdings'] ?? [] as $holding): ?>
<h3>
<?php $locationText = $this->transEsc('location_' . $holding['location'], [], $holding['location']); ?>
<?php if (isset($holding['locationhref']) && $holding['locationhref']): ?>
<?php if ($holding['locationhref'] ?? false): ?>
<a href="<?=$holding['locationhref']?>" target="_blank"><?=$locationText?></a>
<?php else: ?>
<?=$locationText?>
......@@ -80,7 +80,7 @@
</td>
</tr>
<?php endif; ?>
<?php if (isset($holding['textfields'])): foreach ($holding['textfields'] as $textFieldName => $textFields): ?>
<?php foreach ($holding['textfields'] ?? [] as $textFieldName => $textFields): ?>
<tr>
<?php // Translation for summary is a special case for backwards-compatibility ?>
<th><?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>:</th>
......@@ -90,7 +90,7 @@
<?php endforeach; ?>
</td>
</tr>
<?php endforeach; endif; ?>
<?php endforeach; ?>
<?php foreach ($holding['items'] as $row): ?>
<?php
try {
......
......@@ -8,7 +8,7 @@
<?php if (count($reviews) > 0): ?>
<?php foreach ($reviews as $provider => $list): ?>
<?php foreach ($list as $review): ?>
<?php if (isset($review['Summary']) && !empty($review['Summary'])): ?>
<?php if (!empty($review['Summary'])): ?>
<p>
<?php if (isset($review['Rating'])): ?>
<img src="<?=$this->imageLink($review['Rating'] . '.gif')?>" alt="<?=$review['Rating']?>/5 Stars"/>
......@@ -19,7 +19,7 @@
<?php if (isset($review['Source'])): ?><strong><?=$this->transEsc('Review by')?> <?=$review['Source']?></strong><?php endif; ?>
<p class="summary">
<?=$review['Content'] ?? ''?>
<?php if ((!isset($review['Content']) || empty($review['Content'])) && isset($review['ReviewURL'])): ?>
<?php if (empty($review['Content']) && isset($review['ReviewURL'])): ?>
<a target="new" href="<?=$this->escapeHtmlAttr($review['ReviewURL'])?>"><?=$this->transEsc('Read the full review online...')?></a>
<?php endif; ?>
</p>
......
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