Skip to content
Snippets Groups Projects
Commit 62b2d979 authored by Alexander Purr's avatar Alexander Purr Committed by Robert Lange
Browse files

refs #20869 [de_105] refactor external link view helper

* add missing external link view helper for web site links
* encapsulate shorthand if correctly
parent 444e2eba
1 merge request!3refs #20945 [de_105] w3c validation - syntax fixes
...@@ -15,7 +15,7 @@ if (is_array($data['results']) && count($data['results']) > 0): ?> ...@@ -15,7 +15,7 @@ if (is_array($data['results']) && count($data['results']) > 0): ?>
</span> </span>
<?= $this->externalLink( <?= $this->externalLink(
$this->escapeHtmlAttr($result['url']), $this->escapeHtmlAttr($result['url']),
$this->escapeHtml($this->truncate($this->transEsc('Ebsco::'.$result['database']), 90)) $this->truncate($this->translate('Ebsco::'.$result['database']), 90)
) ?> ) ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
......
...@@ -165,8 +165,13 @@ if (isset($this->list) && is_object($this->list)) { ...@@ -165,8 +165,13 @@ if (isset($this->list) && is_object($this->list)) {
} }
if (!$this->driver->isCollection()): if (!$this->driver->isCollection()):
foreach ($urls as $current): ?> foreach ($urls as $current): ?>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><i class="fa fa-external-link" aria-hidden="true"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> <?= $this->externalLink(
</a> $this->escapeHtmlAttr($this->proxyUrl($current['url'])),
'<i class="fa fa-external-link" aria-hidden="true"></i>'
. ($current['url'] == $current['desc'] ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])),
['class' => 'fulltext'],
true
) ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
...@@ -184,10 +189,13 @@ if (isset($this->list) && is_object($this->list)) { ...@@ -184,10 +189,13 @@ if (isset($this->list) && is_object($this->list)) {
echo "<a class='format result-isCollection-links-toggle' data-toggle='collapse' href='#result-isCollection-links-" . $this->driver->getUniqueId() . "'>Online</a>"; echo "<a class='format result-isCollection-links-toggle' data-toggle='collapse' href='#result-isCollection-links-" . $this->driver->getUniqueId() . "'>Online</a>";
echo "<div id='result-isCollection-links-" . $this->driver->getUniqueId() . "' class='result-isCollection-links collapse'>"; echo "<div id='result-isCollection-links-" . $this->driver->getUniqueId() . "' class='result-isCollection-links collapse'>";
foreach ($urls as $current): ?> foreach ($urls as $current): ?>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"> <?= $this->externalLink(
<i class="fa fa-external-link" aria-hidden="true"></i> $this->escapeHtmlAttr($this->proxyUrl($current['url'])),
<?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> '<i class="fa fa-external-link" aria-hidden="true"></i>'
</a> . ($current['url'] == $current['desc'] ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])),
['class' => 'fulltext'],
true
) ?>
<br/> <br/>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo "</div>"; ?> <?php echo "</div>"; ?>
......
...@@ -159,10 +159,13 @@ $describedById = $driver->getSourceIdentifier() . '|' . $driver->getUniqueId(); ...@@ -159,10 +159,13 @@ $describedById = $driver->getSourceIdentifier() . '|' . $driver->getUniqueId();
echo "<ul id='result-isCollection-links-".$this->driver->getUniqueId()."' class='result-isCollection-links collapse'>"; echo "<ul id='result-isCollection-links-".$this->driver->getUniqueId()."' class='result-isCollection-links collapse'>";
foreach ($urls as $current): ?> foreach ($urls as $current): ?>
<li> <li>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"> <?= $this->externalLink(
<i class="fa fa-external-link" aria-hidden="true"></i> $this->escapeHtmlAttr($this->proxyUrl($current['url'])),
<?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> '<i class="fa fa-external-link" aria-hidden="true"></i>'
</a> . ($current['url'] == $current['desc'] ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])),
['class' => 'fulltext'],
true
) ?>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo "</ul>"; ?> <?php echo "</ul>"; ?>
......
...@@ -156,10 +156,13 @@ if ($cover): ...@@ -156,10 +156,13 @@ if ($cover):
echo "<a class='format result-isCollection-links-toggle' data-toggle='collapse' href='#result-isCollection-links-".$this->driver->getUniqueId()."'>Online</a>"; echo "<a class='format result-isCollection-links-toggle' data-toggle='collapse' href='#result-isCollection-links-".$this->driver->getUniqueId()."'>Online</a>";
echo "<div id='result-isCollection-links-".$this->driver->getUniqueId()."' class='result-isCollection-links collapse'>"; echo "<div id='result-isCollection-links-".$this->driver->getUniqueId()."' class='result-isCollection-links collapse'>";
foreach ($urls as $current): ?> foreach ($urls as $current): ?>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"> <?= $this->externalLink(
<i class="fa fa-external-link" aria-hidden="true"></i> $this->escapeHtmlAttr($this->proxyUrl($current['url'])),
<?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> '<i class="fa fa-external-link" aria-hidden="true"></i>'
</a> . ($current['url'] == $current['desc'] ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])),
['class' => 'fulltext'],
true
) ?>
<br/> <br/>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo "</div>"; ?> <?php echo "</div>"; ?>
......
...@@ -92,7 +92,7 @@ if (!empty($holdingTitleHold)): ?> ...@@ -92,7 +92,7 @@ if (!empty($holdingTitleHold)): ?>
<?php if (!empty($urls)): ?> <?php if (!empty($urls)): ?>
<?php foreach ($urls as $current): ?> <?php foreach ($urls as $current): ?>
<?php /* de_105: show url instead of desc #13980 - VE */ ?> <?php /* de_105: show url instead of desc #13980 - VE */ ?>
<?= $this->externalLink($this->escapeHtmlAttr($this->proxyUrl($current['url'])), $this->escapeHtml($current['url'])) ?><br/> <?= $this->externalLink($this->escapeHtmlAttr($this->proxyUrl($current['url'])), $current['url']) ?><br/>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<?php /* finc-specific snippet - #9274 - replaces if ($openUrlActive): - CK */ ?> <?php /* finc-specific snippet - #9274 - replaces if ($openUrlActive): - CK */ ?>
...@@ -103,7 +103,7 @@ if (!empty($holdingTitleHold)): ?> ...@@ -103,7 +103,7 @@ if (!empty($holdingTitleHold)): ?>
<span id="urlsHideable" style="display: none"> <span id="urlsHideable" style="display: none">
<?php foreach ($fallbackUrls as $current): ?> <?php foreach ($fallbackUrls as $current): ?>
<?php /* de_105: show url instead of desc #13980 - VE */ ?> <?php /* de_105: show url instead of desc #13980 - VE */ ?>
<?= $this->externalLink($this->escapeHtmlAttr($this->proxyUrl($current['url'])), $this->escapeHtml($current['url'])) ?><br/> <?= $this->externalLink($this->escapeHtmlAttr($this->proxyUrl($current['url'])), $current['url']) ?><br/>
<?php endforeach; ?> <?php endforeach; ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
...@@ -124,7 +124,7 @@ if (!empty($holdingTitleHold)): ?> ...@@ -124,7 +124,7 @@ if (!empty($holdingTitleHold)): ?>
<?php $holdingsEmpty = false; ?> <?php $holdingsEmpty = false; ?>
<?php /* this next line produces an empty h2 heading in some cases - should be solved more elegantly - Fixme - CK*/ ?> <?php /* this next line produces an empty h2 heading in some cases - should be solved more elegantly - Fixme - CK*/ ?>
<h2> <h2>
<?php $locationText = $this->transEsc('location_' . $holding['location'], [], $holding['location']); ?> <?php $locationText = $this->translate('location_' . $holding['location'], [], $holding['location']); ?>
<?php if (isset($holding['locationhref']) && $holding['locationhref']): ?> <?php if (isset($holding['locationhref']) && $holding['locationhref']): ?>
<?= $this->externalLink($holding['locationhref'], $locationText) ?> <?= $this->externalLink($holding['locationhref'], $locationText) ?>
<?php else: ?> <?php else: ?>
......
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
<li><?=$this->externalLink('https://tu-freiberg.de/ub/a-z', $this->transEsc('FAQs')) ?></li> <li><?=$this->externalLink('https://tu-freiberg.de/ub/a-z', $this->transEsc('FAQs')) ?></li>
</ul> </ul>
<ul class='de105-footer-socialmedia'> <ul class='de105-footer-socialmedia'>
<li><?=$this->externalLink('https://blogs.hrz.tu-freiberg.de/ub', '<i class="fa fa-fw fa-wordpress"></i>', ['title' => $this->translate('footer_ubblog')]) ?></li> <li><?=$this->externalLink('https://blogs.hrz.tu-freiberg.de/ub', '<i class="fa fa-fw fa-wordpress"></i>', ['title' => $this->translate('footer_ubblog')], true) ?></li>
<li><?=$this->externalLink('https://facebook.com/unibibfreiberg', '<i class="fa fa-fw fa-facebook"></i>', ['title' => $this->translate('footer_facebook')]) ?></li> <li><?=$this->externalLink('https://facebook.com/unibibfreiberg', '<i class="fa fa-fw fa-facebook"></i>', ['title' => $this->translate('footer_facebook')], true) ?></li>
<li><?=$this->externalLink('https://instagram.com/ubfreiberg', '<i class="fa fa-fw fa-instagram"></i>', ['title' => $this->translate('footer_instagram')]) ?></li> <li><?=$this->externalLink('https://instagram.com/ubfreiberg', '<i class="fa fa-fw fa-instagram"></i>', ['title' => $this->translate('footer_instagram')], true) ?></li>
<li><?=$this->externalLink('https://twitter.com/ubfreiberg', '<i class="fa fa-fw fa-twitter"></i>', ['title' => $this->translate('footer_twitter')]) ?></li> <li><?=$this->externalLink('https://twitter.com/ubfreiberg', '<i class="fa fa-fw fa-twitter"></i>', ['title' => $this->translate('footer_twitter')], true) ?></li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
<span> <span>
<?= $this->transEsc('Footer-Powered-By-Text') ?> <?= $this->transEsc('Footer-Powered-By-Text') ?>
</span> </span>
<?= $this->externalLink('https://vufind.org', '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')]) ?> <?= $this->externalLink('https://vufind.org', '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')], true) ?>
<?= $this->externalLink('https://finc.info/', '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title'), 'aria-hidden' => 'true']) ?> <?= $this->externalLink('https://finc.info/', '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title'), 'aria-hidden' => 'true'], true) ?>
</div> </div>
</div> </div>
</footer> </footer>
......
...@@ -115,12 +115,14 @@ $this->headScript()->appendFile("check_save_statuses.js"); ...@@ -115,12 +115,14 @@ $this->headScript()->appendFile("check_save_statuses.js");
</div> </div>
<p><strong><?=$this->translate('de105_noresults_moreoptions_headline'); ?></strong></p> <p><strong><?=$this->translate('de105_noresults_moreoptions_headline'); ?></strong></p>
<ul> <ul>
<li><?=$this->translate('de105_noresults_moreoptions_help'); ?>: <a target='_blank' href='<?=$this->url('help-home')?>?topic=search&_=1532679998'><?=$this->translate("de105_noresults_moreoptions_help_link"); ?></a></li> <li><?=$this->translate('de105_noresults_moreoptions_help'); ?>: <?=$this->externalLink($this->url('help-home').'?topic=search&_=1532679998', $this->translate("de105_noresults_moreoptions_help_link"))?></li>
<?php if ($this->de105ChatAvailability): ?><li><?=$this->translate('de105_noresults_moreoptions_chat'); ?>: <a target='_blank' href='https://tu-freiberg.de/ub'><?=$this->translate("de105_noresults_moreoptions_chat_link"); ?></a></li><?php endif; ?> <?php if ($this->de105ChatAvailability): ?>
<li><?=$this->translate('de105_noresults_moreoptions_etutorial'); ?>: <a target='_blank' href='https://tu-freiberg.de/ub/bmik'><?=$this->translate("de105_noresults_moreoptions_etutorial_link"); ?></a></li> <li><?=$this->translate('de105_noresults_moreoptions_chat'); ?>: <?=$this->externalLink('https://tu-freiberg.de/ub', $this->translate("de105_noresults_moreoptions_chat_link"))?></li>
<li><?=$this->translate('de105_noresults_moreoptions_informationliteracy'); ?>: <a target='_blank' href='https://tu-freiberg.de/ub/service/informationskompetenz'><?=$this->translate("de105_noresults_moreoptions_informationliteracy_link"); ?></a></li> <?php endif; ?>
<li><?=$this->translate('de105_noresults_moreoptions_moresearches'); ?>: <a target='_blank' href='<?=$this->url('help-home')?>?topic=search#OtherResources'><?=$this->translate("de105_noresults_moreoptions_moresearches_link"); ?></a></li> <li><?=$this->translate('de105_noresults_moreoptions_etutorial'); ?>: <?=$this->externalLink('https://tu-freiberg.de/ub/bmik', $this->translate("de105_noresults_moreoptions_etutorial_link"))?></li>
<li><?=$this->translate('de105_noresults_moreoptions_acquisition'); ?>: <a target='_blank' href='https://tu-freiberg.de/ub/service/anschaffungsvorschlag'><?=$this->translate("de105_noresults_moreoptions_acquisition_link"); ?></a></li> <li><?=$this->translate('de105_noresults_moreoptions_informationliteracy'); ?>: <?=$this->externalLink('https://tu-freiberg.de/ub/service/informationskompetenz', $this->translate("de105_noresults_moreoptions_informationliteracy_link"))?></li>
<li><?=$this->translate('de105_noresults_moreoptions_moresearches'); ?>: <?=$this->externalLink($this->url('help-home').'?topic=search#OtherResources', $this->translate("de105_noresults_moreoptions_moresearches_link"))?></li>
<li><?=$this->translate('de105_noresults_moreoptions_acquisition'); ?>: <?=$this->externalLink('https://tu-freiberg.de/ub/service/anschaffungsvorschlag', $this->translate("de105_noresults_moreoptions_acquisition_link"))?></li>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</p> </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