From 749d404e04112fec9c90c933508a2d0506cbfaeb Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 24 Oct 2017 15:48:47 -0400 Subject: [PATCH] Switch to short array syntax. --- themes/bootprint3/theme.config.php | 4 +-- .../Auth/AbstractBase/newpassword.phtml | 2 +- .../templates/Auth/Database/create.phtml | 2 +- .../AbstractBase/previewdata.phtml | 2 +- .../AbstractBase/previewlink.phtml | 2 +- .../RecordDriver/EDS/result-list.phtml | 2 +- .../RecordDriver/Pazpar2/result-list.phtml | 6 ++-- .../SolrDefault/data-childRecords.phtml | 2 +- .../RecordDriver/SolrDefault/data-tags.phtml | 2 +- .../RecordDriver/SolrDefault/list-entry.phtml | 14 +++++----- .../SolrDefault/result-grid.phtml | 2 +- .../SolrDefault/result-list.phtml | 14 +++++----- .../RecordDriver/SolrWeb/result-list.phtml | 2 +- .../templates/admin/config/home.phtml | 2 +- .../templates/admin/maintenance/home.phtml | 6 ++-- .../templates/admin/tags/list.phtml | 8 +++--- .../templates/admin/tags/manage.phtml | 4 +-- .../templates/admin/tags/menu.phtml | 4 +-- themes/bootstrap3/templates/header.phtml | 2 +- .../templates/search/advanced/eds.phtml | 6 ++-- .../templates/search/advanced/solr.phtml | 2 +- .../templates/search/advanced/summon.phtml | 2 +- .../templates/search/controls/sort.phtml | 2 +- themes/bootstrap3/theme.config.php | 28 +++++++++---------- themes/local_theme_example/theme.config.php | 4 +-- .../templates/Email/recover-password.phtml | 4 +-- .../AbstractBase/export-bibtex.phtml | 2 +- .../AbstractBase/export-endnote.phtml | 2 +- .../AbstractBase/export-endnoteweb.phtml | 2 +- .../AbstractBase/export-refworks.phtml | 2 +- .../AbstractBase/export-ris.phtml | 2 +- themes/root/templates/error/index.phtml | 6 ++-- themes/root/theme.config.php | 16 +++++------ themes/sandal/theme.config.php | 4 +-- 34 files changed, 83 insertions(+), 83 deletions(-) diff --git a/themes/bootprint3/theme.config.php b/themes/bootprint3/theme.config.php index 018a473aeb6..2f5a8373cd1 100644 --- a/themes/bootprint3/theme.config.php +++ b/themes/bootprint3/theme.config.php @@ -1,4 +1,4 @@ <?php -return array( +return [ 'extends' => 'bootstrap3' -); +]; diff --git a/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml b/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml index 934bd49360e..532e00b0c2e 100644 --- a/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml +++ b/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml @@ -26,7 +26,7 @@ <div class="form-group"> <label class="control-label"><?=$this->transEsc('new_password') ?>:</label> <input type="password" id="password" name="password" class="form-control" required aria-required="true" - <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', array('%%minlength%%' => $this->passwordPolicy['minLength']))) . '"' : '' ?> + <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : '' ?> <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : '' ?> <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?> /> diff --git a/themes/bootstrap3/templates/Auth/Database/create.phtml b/themes/bootstrap3/templates/Auth/Database/create.phtml index 4fe5955feb5..8a5fbc4e9f6 100644 --- a/themes/bootstrap3/templates/Auth/Database/create.phtml +++ b/themes/bootstrap3/templates/Auth/Database/create.phtml @@ -31,7 +31,7 @@ <div class="form-group"> <label class="control-label" for="account_password"><?=$this->transEsc('Password')?>:</label> <input id="account_password" type="password" name="password" required aria-required="true" class="form-control" - <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', array('%%minlength%%' => $this->passwordPolicy['minLength']))) . '"' : ''?> + <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : ''?> <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : ''?> <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?> /> diff --git a/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewdata.phtml b/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewdata.phtml index 6b9cb54ea1f..e28ab77d162 100644 --- a/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewdata.phtml +++ b/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewdata.phtml @@ -1,6 +1,6 @@ <? $previews = isset($this->config->Content->previews) - ? explode(',', $this->config->Content->previews) : array(); + ? explode(',', $this->config->Content->previews) : []; if (!empty($previews)) { $idClasses = $this->record($this->driver)->getPreviewIds(); diff --git a/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewlink.phtml b/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewlink.phtml index cdc2f821901..f1fdf1e62cc 100644 --- a/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewlink.phtml +++ b/themes/bootstrap3/templates/RecordDriver/AbstractBase/previewlink.phtml @@ -1,6 +1,6 @@ <? $previews = isset($this->config->Content->previews) - ? explode(',', $this->config->Content->previews) : array(); + ? explode(',', $this->config->Content->previews) : []; if (!empty($previews)) { $idClasses = $this->record($this->driver)->getPreviewIds(); // If we found at least one identifier, we can build the placeholder HTML: diff --git a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml index 88a64ebb8db..c04806ad629 100644 --- a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml +++ b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml @@ -93,7 +93,7 @@ <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?> <? // Add JS Variables for QrCode - $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show')); + $this->jsTranslations()->addStrings(['qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show']); ?> <span class="hidden-xs"> <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> diff --git a/themes/bootstrap3/templates/RecordDriver/Pazpar2/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/Pazpar2/result-list.phtml index c11935a4fca..5d5ca176904 100644 --- a/themes/bootstrap3/templates/RecordDriver/Pazpar2/result-list.phtml +++ b/themes/bootstrap3/templates/RecordDriver/Pazpar2/result-list.phtml @@ -35,7 +35,7 @@ <? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); ?> <? if (!empty($journalTitle)): ?> <?=!empty($summAuthor) ? '<br />' : ''?> - <?=/* TODO: handle highlighting more elegantly here */ $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> + <?=/* TODO: handle highlighting more elegantly here */ $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(['{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'], '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?> <? elseif (!empty($summDate)): ?> <?=!empty($summAuthor) ? '<br />' : ''?> @@ -46,7 +46,7 @@ <? foreach ($summInCollection as $collId => $collText): ?> <div> <b><?=$this->transEsc("in_collection_label")?></b> - <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> + <a class="collectionLinkText" href="<?=$this->url('collection', ['id' => $collId])?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> <?=$this->escapeHtml($collText)?> </a> </div> @@ -86,7 +86,7 @@ <br/> <?=$openUrl->renderTemplate()?> <? endif; ?> - <? if (!is_array($urls)) $urls = array(); + <? if (!is_array($urls)) $urls = []; if(!$this->driver->isCollection()): 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'])?></a><br/> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-childRecords.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-childRecords.phtml index cb6ad882fa2..af4d6b1fd60 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-childRecords.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-childRecords.phtml @@ -1 +1 @@ -<a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $data))?></a> +<a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', ['%%count%%' => $data])?></a> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-tags.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-tags.phtml index e469c99e773..2c4718c2eb1 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-tags.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/data-tags.phtml @@ -11,5 +11,5 @@ <a class="tag-record btn btn-link pull-right flip" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> </a> - <?=$this->context($this)->renderInContext('record/taglist', array('tagList' => $tagList, 'loggedin' => $loggedin)) ?> + <?=$this->context($this)->renderInContext('record/taglist', ['tagList' => $tagList, 'loggedin' => $loggedin]) ?> <? endif; ?> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/list-entry.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/list-entry.phtml index 78ac3b19149..7129820258f 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/list-entry.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/list-entry.phtml @@ -41,7 +41,7 @@ <div class="resultItemLine2"> <? if($this->driver->isCollection()): ?> - <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?> + <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?> <? else: ?> <? $summAuthors = $this->driver->getPrimaryAuthors(); if (!empty($summAuthors)): ?> <?=$this->transEsc('by')?> @@ -53,7 +53,7 @@ <? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); ?> <? if (!empty($journalTitle)): ?> <?=!empty($summAuthor) ? '<br/>' : ''?> - <?=/* TODO: handle highlighting more elegantly here */ $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> + <?=/* TODO: handle highlighting more elegantly here */ $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(['{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'], '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?> <? elseif (!empty($summDate)): ?> <?=!empty($summAuthor) ? '<br/>' : ''?> @@ -63,7 +63,7 @@ <? foreach ($summInCollection as $collId => $collText): ?> <div> <b><?=$this->transEsc("in_collection_label")?></b> - <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> + <a class="collectionLinkText" href="<?=$this->url('collection', ['id' => $collId])?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> <?=$this->escapeHtml($collText)?> </a> </div> @@ -87,7 +87,7 @@ <? $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags( null === $list_id ? true : $list_id, // get tags for all lists if no single list is selected $user_id, 'tag' - ) : array(); + ) : []; ?> <? if (count($listTags) > 0): ?> <strong><?=$this->transEsc('Your Tags')?>:</strong> @@ -108,7 +108,7 @@ <? if (count($this->lists) > 0): ?> <strong><?=$this->transEsc('Saved in')?>:</strong> <? $i = 0;foreach($this->lists as $current): ?> - <a href="<?=$this->url('userList', array('id' => $current->id))?>"><?=$this->escapeHtml($current->title)?></a><? if($i++ < count($this->lists) - 1): ?>,<? endif; ?> + <a href="<?=$this->url('userList', ['id' => $current->id])?>"><?=$this->escapeHtml($current->title)?></a><? if($i++ < count($this->lists) - 1): ?>,<? endif; ?> <? endforeach; ?> <br/> <? endif; ?> @@ -147,7 +147,7 @@ <?=$openUrl->renderTemplate()?> <? endif;?> - <? if (!is_array($urls)) { $urls = array(); } + <? if (!is_array($urls)) { $urls = []; } if(!$this->driver->isCollection()): 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'])?></a> @@ -171,7 +171,7 @@ <? /* Use a different delete URL if we're removing from a specific list or the overall favorites: */ $deleteUrl = null === $list_id ? $this->url('myresearch-favorites') - : $this->url('userList', array('id' => $list_id)); + : $this->url('userList', ['id' => $list_id]); $deleteUrlGet = $deleteUrl . '?delete=' . urlencode($id) . '&source=' . urlencode($source); $dLabel = 'delete-label-' . preg_replace('[\W]', '-', $id); diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-grid.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-grid.phtml index 2cbe7bb326a..4b3774ae79f 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-grid.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-grid.phtml @@ -34,7 +34,7 @@ $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); <? if ($openUrlActive): ?> <?=$openUrl->renderTemplate()?><br /> <? endif; ?> - <? if (!is_array($urls)) $urls = array(); foreach ($urls as $current): ?> + <? if (!is_array($urls)) $urls = []; 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'])?></a> <br/> <? endforeach; ?> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-list.phtml index a28191deb95..d2a8d52860c 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-list.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/result-list.phtml @@ -27,7 +27,7 @@ <div> <? if($this->driver->isCollection()): ?> - <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?> + <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?> <? else: ?> <? $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting(); if (!empty($summAuthors)): ?> <?=$this->transEsc('by')?> @@ -43,7 +43,7 @@ <? $containerSource = $this->driver->getSourceIdentifier(); ?> <? $containerID = $this->driver->getContainerRecordID(); ?> <? /* TODO: handle highlighting more elegantly here: */?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a> + <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(['{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'], '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a> <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?> <? elseif (!empty($summDate)): ?> <?=!empty($summAuthor) ? '<br />' : ''?> @@ -53,7 +53,7 @@ <? foreach ($summInCollection as $collId => $collText): ?> <div> <b><?=$this->transEsc("in_collection_label")?></b> - <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> + <a class="collectionLinkText" href="<?=$this->url('collection', ['id' => $collId])?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> <?=$this->escapeHtml($collText)?> </a> </div> @@ -81,14 +81,14 @@ $i = 0; foreach ($dedupData as $source => $current) { if (++$i == 1) { - ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><? + ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", [], $source)?></a></span><? } else { if ($i == 2) { ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <? } else { ?>, <? } - ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><? + ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", [], $source)?></a><? } } if ($i > 1) { @@ -129,7 +129,7 @@ <br/> <?=$openUrl->renderTemplate()?> <? endif; ?> - <? if (!is_array($urls)) $urls = array(); + <? if (!is_array($urls)) $urls = []; if(!$this->driver->isCollection()): 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'])?></a><br/> @@ -156,7 +156,7 @@ <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?> <? // Add JS Variables for QrCode - $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show')); + $this->jsTranslations()->addStrings(['qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show']); ?> <span class="hidden-xs"> <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrWeb/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/SolrWeb/result-list.phtml index 3cf9f42b6fc..4f8c227262b 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrWeb/result-list.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrWeb/result-list.phtml @@ -22,7 +22,7 @@ <div class="resultItemLine3"> <?=$this->escapeHtml($url)?> <? $lastMod = $this->driver->getLastModified(); if (!empty($lastMod)): ?> - <br /><?=$this->transEsc('Last Modified')?>: <?=$this->escapeHtml(trim(str_replace(array('T', 'Z'), ' ', $lastMod)))?> + <br /><?=$this->transEsc('Last Modified')?>: <?=$this->escapeHtml(trim(str_replace(['T', 'Z'], ' ', $lastMod)))?> <? endif; ?> </div> </div> diff --git a/themes/bootstrap3/templates/admin/config/home.phtml b/themes/bootstrap3/templates/admin/config/home.phtml index 8a97b35c69e..2284a17be9a 100644 --- a/themes/bootstrap3/templates/admin/config/home.phtml +++ b/themes/bootstrap3/templates/admin/config/home.phtml @@ -9,7 +9,7 @@ <p>Some basic settings can also be adjusted through the auto-configuration tool.</p> <? if (!$this->showInstallLink): ?> <p><?=$this->transEsc('Auto configuration is currently disabled') ?>.</p> - <p><a href="<?=$this->url('admin/config', array('action' => 'EnableAutoConfig'))?>"><?=$this->transEsc('Enable Auto Config')?></a></p> + <p><a href="<?=$this->url('admin/config', ['action' => 'EnableAutoConfig'])?>"><?=$this->transEsc('Enable Auto Config')?></a></p> <? else: ?> <p><a href="<?=$this->url('install-home')?>"><?=$this->transEsc('auto_configure_title')?></a></p> <? endif; ?> diff --git a/themes/bootstrap3/templates/admin/maintenance/home.phtml b/themes/bootstrap3/templates/admin/maintenance/home.phtml index e5c98577a04..04c30463e95 100644 --- a/themes/bootstrap3/templates/admin/maintenance/home.phtml +++ b/themes/bootstrap3/templates/admin/maintenance/home.phtml @@ -7,19 +7,19 @@ <h3>Utilities</h3> <?=$this->flashmessages()?> - <form class="form-admin-maintenance expired-searches" method="get" action="<?=$this->url('admin/maintenance', array('action' => 'DeleteExpiredSearches'))?>"> + <form class="form-admin-maintenance expired-searches" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'DeleteExpiredSearches'])?>"> <label for="del_daysOld">Delete unsaved user search histories older than</label> <input id="del_daysOld" type="number" name="daysOld" size="5" value="2" class="form-control"/> days. <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="btn btn-danger"/> </form> <hr /> - <form class="form-admin-maintenance expired-sessions" method="get" action="<?=$this->url('admin/maintenance', array('action' => 'DeleteExpiredSessions'))?>"> + <form class="form-admin-maintenance expired-sessions" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'DeleteExpiredSessions'])?>"> <label for="delsess_daysOld">Delete user sessions older than</label> <input id="delsess_daysOld" type="number" name="daysOld" size="5" value="2" class="form-control"/> days. <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="btn btn-danger"/> </form> <hr /> - <form class="form-admin-maintenance clear-cache" method="get" action="<?=$this->url('admin/maintenance', array('action' => 'ClearCache'))?>"> + <form class="form-admin-maintenance clear-cache" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'ClearCache'])?>"> Clear cache(s): <? foreach ($caches as $cache): ?> <label> diff --git a/themes/bootstrap3/templates/admin/tags/list.phtml b/themes/bootstrap3/templates/admin/tags/list.phtml index edf5daabbef..138bcb5c7e5 100644 --- a/themes/bootstrap3/templates/admin/tags/list.phtml +++ b/themes/bootstrap3/templates/admin/tags/list.phtml @@ -11,7 +11,7 @@ <?=$this->flashmessages()?> - <form class="form-tags-list" action="<?= $this->url('admin/tags', array('action' => 'List'))?>" method="get"> + <form class="form-tags-list" action="<?= $this->url('admin/tags', ['action' => 'List'])?>" method="get"> <h3><?=$this->translate('filter_tags')?></h3> <div class="tag-controls"> <label for="user_id"> @@ -50,14 +50,14 @@ <label for="taglistsubmit"> <input type="submit" id="taglistsubmit" value="<?=$this->transEsc('Filter')?>" class="btn btn-primary"> <? if((isset($this->params['user_id']) && !is_null($this->params['user_id'])) || (isset($this->params['tag_id']) && !is_null($this->params['tag_id'])) || (isset($this->params['resource_id']) && !is_null($this->params['resource_id']))):?> - <a href="<?= $this->url('admin/tags', array('action' => 'List')); ?>"><?=$this->translate('clear_tag_filter')?></a> + <a href="<?= $this->url('admin/tags', ['action' => 'List']); ?>"><?=$this->translate('clear_tag_filter')?></a> <? endif;?> </label> </div> </form> <? if(count($this->results) > 0):?> - <form action="<?= $this->url('admin/tags', array('action' => 'Delete'))?>" method="post"> + <form action="<?= $this->url('admin/tags', ['action' => 'Delete'])?>" method="post"> <input type="hidden" name="user_id" value="<?=isset($this->params['user_id']) ? $this->params['user_id'] : '' ?>" /> <input type="hidden" name="tag_id" value="<?=isset($this->params['tag_id']) ? $this->params['tag_id'] : '' ?>" /> <input type="hidden" name="resource_id" value="<?=isset($this->params['resource_id']) ? $this->params['resource_id'] : '' ?>" /> @@ -90,7 +90,7 @@ <input type="submit" name="deleteFilter" value="<?=$this->transEsc('delete_all')?>" class="btn btn-danger"> </form> - <?=$this->paginationControl($this->results, 'Sliding', 'Helpers/pagination.phtml', array('params' => $this->params))?> + <?=$this->paginationControl($this->results, 'Sliding', 'Helpers/pagination.phtml', ['params' => $this->params])?> <? else:?> <p><?=$this->translate('tag_filter_empty')?></p> <? endif;?> diff --git a/themes/bootstrap3/templates/admin/tags/manage.phtml b/themes/bootstrap3/templates/admin/tags/manage.phtml index 426b2d51398..fb143e0451d 100644 --- a/themes/bootstrap3/templates/admin/tags/manage.phtml +++ b/themes/bootstrap3/templates/admin/tags/manage.phtml @@ -11,7 +11,7 @@ <?=$this->flashmessages()?> - <form class="form-tags-manage" action="<?= $this->url('admin/tags', array('action' => 'Manage'));?>" method="post" role="form"> + <form class="form-tags-manage" action="<?= $this->url('admin/tags', ['action' => 'Manage']);?>" method="post" role="form"> <div class="form-group"> <label for="type" class="control-label"><?=$this->translate('delete_tags_by')?>:</label> <select id="type" name="type" class="form-control"> @@ -24,7 +24,7 @@ </form> <? if(false !== $this->type):?> - <form class="form-tags-manage" action="<?= $this->url('admin/tags', array('action' => 'Delete'))?>" method="post"> + <form class="form-tags-manage" action="<?= $this->url('admin/tags', ['action' => 'Delete'])?>" method="post"> <input type="hidden" name="origin" value="manage" /> <input type="hidden" name="type" value="<?= $this->type; ?>" /> <? if("user" == $type):?> diff --git a/themes/bootstrap3/templates/admin/tags/menu.phtml b/themes/bootstrap3/templates/admin/tags/menu.phtml index ad57f45fa96..c1f4c4eb517 100644 --- a/themes/bootstrap3/templates/admin/tags/menu.phtml +++ b/themes/bootstrap3/templates/admin/tags/menu.phtml @@ -1,6 +1,6 @@ <div class="nav navbar"> <ul class="nav nav-pills"> - <li<?=strtolower($this->active) == "list" ? ' class="active"' : ''?>><a href="<?=$this->url('admin/tags', array('action' => 'List'))?>"><?=$this->transEsc('List Tags')?></a></li> - <li<?=strtolower($this->active) == "manage" ? ' class="active"' : ''?>><a href="<?=$this->url('admin/tags', array('action' => 'Manage'))?>"><?=$this->transEsc('Manage Tags')?></a></li> + <li<?=strtolower($this->active) == "list" ? ' class="active"' : ''?>><a href="<?=$this->url('admin/tags', ['action' => 'List'])?>"><?=$this->transEsc('List Tags')?></a></li> + <li<?=strtolower($this->active) == "manage" ? ' class="active"' : ''?>><a href="<?=$this->url('admin/tags', ['action' => 'Manage'])?>"><?=$this->transEsc('Manage Tags')?></a></li> </ul> </div> diff --git a/themes/bootstrap3/templates/header.phtml b/themes/bootstrap3/templates/header.phtml index 457b6b07bad..3d7fcf1bfb7 100644 --- a/themes/bootstrap3/templates/header.phtml +++ b/themes/bootstrap3/templates/header.phtml @@ -26,7 +26,7 @@ <? endif; ?> <? if (is_object($account) && $account->loginEnabled()): // hide login/logout if unavailable ?> <li class="logoutOptions<? if(!$account->isLoggedIn()): ?> hidden<? endif ?>"> - <a href="<?=$this->url('myresearch-home', array(), array('query' => array('redirect' => 0)))?>"><i class="fa fa-home" aria-hidden="true"></i> <?=$this->transEsc("Your Account")?></a> + <a href="<?=$this->url('myresearch-home', [], ['query' => ['redirect' => 0]])?>"><i class="fa fa-home" aria-hidden="true"></i> <?=$this->transEsc("Your Account")?></a> </li> <li class="logoutOptions<? if(!$account->isLoggedIn()): ?> hidden<? endif ?>"> <a href="<?=$this->url('myresearch-logout')?>" class="logout"><i class="fa fa-sign-out" aria-hidden="true"></i> <?=$this->transEsc("Log Out")?></a> diff --git a/themes/bootstrap3/templates/search/advanced/eds.phtml b/themes/bootstrap3/templates/search/advanced/eds.phtml index 353146d3026..7ce6f0f61fa 100644 --- a/themes/bootstrap3/templates/search/advanced/eds.phtml +++ b/themes/bootstrap3/templates/search/advanced/eds.phtml @@ -6,7 +6,7 @@ <div class="checkbox"> <label for="expand_<?=$this->escapeHtmlAttr(str_replace(' ', '+', $field))?>"> <input id="expand_<?=$this->escapeHtmlAttr(str_replace(' ', '+', $field))?>" type="checkbox" <?=(isset($expander['selected']) && $expander['selected'])?'checked="checked"':''?> name="filter[]" value="EXPAND:<?=$this->escapeHtmlAttr($value)?>"> - <?=$this->transEsc('eds_expander_' . $value, array(), $expander['Label'])?> + <?=$this->transEsc('eds_expander_' . $value, [], $expander['Label'])?> </label> </div> <? endforeach; ?> @@ -16,7 +16,7 @@ <? foreach ($this->searchModes as $field => $searchMode): $value = $searchMode['Value'] ?> <option <?=(isset($searchMode['selected']) && $searchMode['selected'])?'selected="selected"':''?> value="SEARCHMODE:<?=$this->escapeHtmlAttr($value)?>"> - <?= /* 'Label' comes from API and is always in English; try to translate structured value before using it: */ $this->transEsc('eds_mode_' . $value, array(), $searchMode['Label']) ?> + <?= /* 'Label' comes from API and is always in English; try to translate structured value before using it: */ $this->transEsc('eds_mode_' . $value, [], $searchMode['Label']) ?> </option> <? endforeach; ?> </select> @@ -43,7 +43,7 @@ <div class="checkbox"> <label for="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '+', $field))?>"> <input id="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '+', $field))?>" type="checkbox" <?=(isset($facet['LimiterValues'][0]['selected']) && $facet['LimiterValues'][0]['selected'])?'checked="checked"':''?> name="filter[]" value="<?=$this->escapeHtmlAttr('LIMIT|'.$field . ':' . $value)?>"> - <?=$this->transEsc('eds_limiter_' . $field, array(), $facet['Label'])?> + <?=$this->transEsc('eds_limiter_' . $field, [], $facet['Label'])?> </label> </div> <? break; diff --git a/themes/bootstrap3/templates/search/advanced/solr.phtml b/themes/bootstrap3/templates/search/advanced/solr.phtml index d6bd4fe422b..9e9362877a5 100644 --- a/themes/bootstrap3/templates/search/advanced/solr.phtml +++ b/themes/bootstrap3/templates/search/advanced/solr.phtml @@ -19,7 +19,7 @@ // Sort the current facet list alphabetically; we'll use this data // along with the foreach below to display facet options in the // correct order. - $sorted = array(); + $sorted = []; foreach ($list['list'] as $i => $value) { if (!empty($value['displayText'])) { $sorted[$i] = $value['displayText']; diff --git a/themes/bootstrap3/templates/search/advanced/summon.phtml b/themes/bootstrap3/templates/search/advanced/summon.phtml index 7851ce9d99f..9d8a6ec3e07 100644 --- a/themes/bootstrap3/templates/search/advanced/summon.phtml +++ b/themes/bootstrap3/templates/search/advanced/summon.phtml @@ -12,7 +12,7 @@ // Sort the current facet list alphabetically; we'll use this data // along with the foreach below to display facet options in the // correct order. - $sorted = array(); + $sorted = []; foreach ($list['list'] as $i => $value) { $sorted[$i] = $value['displayText']; } diff --git a/themes/bootstrap3/templates/search/controls/sort.phtml b/themes/bootstrap3/templates/search/controls/sort.phtml index 790b56fe92f..e2dcc77937f 100644 --- a/themes/bootstrap3/templates/search/controls/sort.phtml +++ b/themes/bootstrap3/templates/search/controls/sort.phtml @@ -1,6 +1,6 @@ <? $list = $this->params->getSortList(); if (!empty($list)): ?> <form class="search-sort" action="<?=$this->currentPath()?>" method="get" name="sort"> - <?=$this->results->getUrlQuery()->asHiddenFields(array('sort' => '/.*/'));?> + <?=$this->results->getUrlQuery()->asHiddenFields(['sort' => '/.*/']);?> <label for="sort_options_1"><?=$this->transEsc('Sort')?></label> <select id="sort_options_1" name="sort" class="jumpMenu form-control"> <? foreach ($list as $sortType => $sortData): ?> diff --git a/themes/bootstrap3/theme.config.php b/themes/bootstrap3/theme.config.php index 9712fcbd8b6..c2a266cbba5 100644 --- a/themes/bootstrap3/theme.config.php +++ b/themes/bootstrap3/theme.config.php @@ -1,7 +1,7 @@ <?php -return array( +return [ 'extends' => 'root', - 'css' => array( + 'css' => [ //'vendor/bootstrap.min.css', //'vendor/bootstrap-accessibility.css', //'vendor/font-awesome.min.css', @@ -9,8 +9,8 @@ return array( 'compiled.css', 'print.css:print', 'flex-fallback.css::lt IE 10', // flex polyfill - ), - 'js' => array( + ], + 'js' => [ 'vendor/base64.js:lt IE 10', // btoa polyfill 'vendor/jquery.min.js', 'vendor/bootstrap.min.js', @@ -20,21 +20,21 @@ return array( 'lib/autocomplete.js', 'common.js', 'lightbox.js', - ), - 'less' => array( + ], + 'less' => [ 'active' => false, 'compiled.less' - ), + ], 'favicon' => 'vufind-favicon.ico', - 'helpers' => array( - 'factories' => array( + 'helpers' => [ + 'factories' => [ 'flashmessages' => 'VuFind\View\Helper\Bootstrap3\Factory::getFlashmessages', 'layoutclass' => 'VuFind\View\Helper\Bootstrap3\Factory::getLayoutClass', 'recaptcha' => 'VuFind\View\Helper\Bootstrap3\Factory::getRecaptcha', - ), - 'invokables' => array( + ], + 'invokables' => [ 'highlight' => 'VuFind\View\Helper\Bootstrap3\Highlight', 'search' => 'VuFind\View\Helper\Bootstrap3\Search' - ) - ) -); + ] + ] +]; diff --git a/themes/local_theme_example/theme.config.php b/themes/local_theme_example/theme.config.php index 018a473aeb6..2f5a8373cd1 100644 --- a/themes/local_theme_example/theme.config.php +++ b/themes/local_theme_example/theme.config.php @@ -1,4 +1,4 @@ <?php -return array( +return [ 'extends' => 'bootstrap3' -); +]; diff --git a/themes/root/templates/Email/recover-password.phtml b/themes/root/templates/Email/recover-password.phtml index dd84e2ecc3c..e391ac2a7b5 100644 --- a/themes/root/templates/Email/recover-password.phtml +++ b/themes/root/templates/Email/recover-password.phtml @@ -1,3 +1,3 @@ -<?=$this->translate('recovery_email_notification', array('%%library%%' => $this->library)) ?> +<?=$this->translate('recovery_email_notification', ['%%library%%' => $this->library]) ?> -<?=$this->translate('recovery_email_url_pretext', array('%%url%%' => $this->url)) ?> +<?=$this->translate('recovery_email_url_pretext', ['%%url%%' => $this->url]) ?> diff --git a/themes/root/templates/RecordDriver/AbstractBase/export-bibtex.phtml b/themes/root/templates/RecordDriver/AbstractBase/export-bibtex.phtml index 68179304bec..9f0463c7f1c 100644 --- a/themes/root/templates/RecordDriver/AbstractBase/export-bibtex.phtml +++ b/themes/root/templates/RecordDriver/AbstractBase/export-bibtex.phtml @@ -83,7 +83,7 @@ if (is_array($pubPlaces) && is_array($pubDates) && is_array($pubNames)) { } for ($i = 0; $i < $total; $i++) { if (isset($pubPlaces[$i])) { - echo "address = {" . rtrim(str_replace(array('[', ']'), '', $pubPlaces[$i]), ': ') . "},\n"; + echo "address = {" . rtrim(str_replace(['[', ']'], '', $pubPlaces[$i]), ': ') . "},\n"; } if (isset($pubNames[$i])) { echo "publisher = {" . rtrim($pubNames[$i], ", ") . "},\n"; diff --git a/themes/root/templates/RecordDriver/AbstractBase/export-endnote.phtml b/themes/root/templates/RecordDriver/AbstractBase/export-endnote.phtml index d0838ee50cf..155d855b6c9 100644 --- a/themes/root/templates/RecordDriver/AbstractBase/export-endnote.phtml +++ b/themes/root/templates/RecordDriver/AbstractBase/export-endnote.phtml @@ -43,7 +43,7 @@ if (is_array($pubPlaces) && is_array($pubDates) && is_array($pubNames)) { echo "%D $date\n"; } if (isset($pubPlaces[$i])) { - echo "%C " . rtrim(str_replace(array('[', ']'), '', $pubPlaces[$i]), ': '). "\n"; + echo "%C " . rtrim(str_replace(['[', ']'], '', $pubPlaces[$i]), ': '). "\n"; } } } diff --git a/themes/root/templates/RecordDriver/AbstractBase/export-endnoteweb.phtml b/themes/root/templates/RecordDriver/AbstractBase/export-endnoteweb.phtml index 19dba053e10..31fd0d1592c 100644 --- a/themes/root/templates/RecordDriver/AbstractBase/export-endnoteweb.phtml +++ b/themes/root/templates/RecordDriver/AbstractBase/export-endnoteweb.phtml @@ -84,7 +84,7 @@ if (is_array($pubPlaces) && is_array($pubDates) && is_array($pubNames)) { } for ($i = 0; $i < $total; $i++) { if (isset($pubPlaces[$i])) { - echo "PP - " . rtrim(str_replace(array('[', ']'), '', $pubPlaces[$i]), ': '). "\n"; + echo "PP - " . rtrim(str_replace(['[', ']'], '', $pubPlaces[$i]), ': '). "\n"; } if (isset($pubNames[$i])) { echo "PB - " . rtrim($pubNames[$i], ", ") . "\n"; diff --git a/themes/root/templates/RecordDriver/AbstractBase/export-refworks.phtml b/themes/root/templates/RecordDriver/AbstractBase/export-refworks.phtml index 223d7a8dce7..54187639d22 100644 --- a/themes/root/templates/RecordDriver/AbstractBase/export-refworks.phtml +++ b/themes/root/templates/RecordDriver/AbstractBase/export-refworks.phtml @@ -68,7 +68,7 @@ if (is_array($pubPlaces) && is_array($pubDates) && is_array($pubNames)) { } for ($i = 0; $i < $total; $i++) { if (isset($pubPlaces[$i])) { - echo "PP " . rtrim(str_replace(array('[', ']'), '', $pubPlaces[$i]), ': '). "\n"; + echo "PP " . rtrim(str_replace(['[', ']'], '', $pubPlaces[$i]), ': '). "\n"; } if (isset($pubNames[$i])) { echo "PB " . rtrim($pubNames[$i], ", ") . "\n"; diff --git a/themes/root/templates/RecordDriver/AbstractBase/export-ris.phtml b/themes/root/templates/RecordDriver/AbstractBase/export-ris.phtml index 21273f60f5f..3ec5e9f2001 100644 --- a/themes/root/templates/RecordDriver/AbstractBase/export-ris.phtml +++ b/themes/root/templates/RecordDriver/AbstractBase/export-ris.phtml @@ -86,7 +86,7 @@ if (is_array($pubPlaces) && is_array($pubDates) && is_array($pubNames)) { } for ($i = 0; $i < $total; $i++) { if (isset($pubPlaces[$i])) { - echo "CY - " . rtrim(str_replace(array('[', ']'), '', $pubPlaces[$i]), ': '). "\r\n"; + echo "CY - " . rtrim(str_replace(['[', ']'], '', $pubPlaces[$i]), ': '). "\r\n"; } if (isset($pubNames[$i])) { echo "PB - " . rtrim($pubNames[$i], ", ") . "\r\n"; diff --git a/themes/root/templates/error/index.phtml b/themes/root/templates/error/index.phtml index 4e4bb612df9..f0c8be45409 100644 --- a/themes/root/templates/error/index.phtml +++ b/themes/root/templates/error/index.phtml @@ -2,10 +2,10 @@ <h2><?=$this->transEsc($this->message)?></h2> <? if ($this->showInstallLink): ?> - <h3><a href="<?=$this->url('install-home')?>"><?=$this->transEsc('auto_configure_title', array(), 'Auto Configure')?></a></h3> - <?=$this->transEsc('auto_configure_description', array(), 'If this is a new installation, you may be able to fix the error using VuFind\'s Auto Configure tool.')?> + <h3><a href="<?=$this->url('install-home')?>"><?=$this->transEsc('auto_configure_title', [], 'Auto Configure')?></a></h3> + <?=$this->transEsc('auto_configure_description', [], 'If this is a new installation, you may be able to fix the error using VuFind\'s Auto Configure tool.')?> <h3><a href="<?=$this->url('upgrade-home')?>"><?=$this->transEsc('Upgrade VuFind')?></a></h3> - <?=$this->transEsc('upgrade_description', array(), 'If you are upgrading a previous VuFind version, you can load your old settings with this tool.')?> + <?=$this->transEsc('upgrade_description', [], 'If you are upgrading a previous VuFind version, you can load your old settings with this tool.')?> <? endif; ?> <? if (isset($this->display_exceptions) && $this->display_exceptions): ?> diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php index 79082aaddbf..485cfadda9c 100644 --- a/themes/root/theme.config.php +++ b/themes/root/theme.config.php @@ -1,8 +1,8 @@ <?php -return array( +return [ 'extends' => false, - 'helpers' => array( - 'factories' => array( + 'helpers' => [ + 'factories' => [ 'accountcapabilities' => 'VuFind\View\Helper\Root\Factory::getAccountCapabilities', 'addthis' => 'VuFind\View\Helper\Root\Factory::getAddThis', 'alphabrowse' => 'VuFind\View\Helper\Root\Factory::getAlphaBrowse', @@ -41,8 +41,8 @@ return array( 'systememail' => 'VuFind\View\Helper\Root\Factory::getSystemEmail', 'userlist' => 'VuFind\View\Helper\Root\Factory::getUserList', 'usertags' => 'VuFind\View\Helper\Root\Factory::getUserTags', - ), - 'invokables' => array( + ], + 'invokables' => [ 'addellipsis' => 'VuFind\View\Helper\Root\AddEllipsis', 'browse' => 'VuFind\View\Helper\Root\Browse', 'context' => 'VuFind\View\Helper\Root\Context', @@ -59,6 +59,6 @@ return array( 'transesc' => 'VuFind\View\Helper\Root\TransEsc', 'translate' => 'VuFind\View\Helper\Root\Translate', 'truncate' => 'VuFind\View\Helper\Root\Truncate', - ) - ), -); + ] + ], +]; diff --git a/themes/sandal/theme.config.php b/themes/sandal/theme.config.php index 2bb286a457e..9dd3b6e4e4c 100644 --- a/themes/sandal/theme.config.php +++ b/themes/sandal/theme.config.php @@ -1,4 +1,4 @@ <?php -return array( +return [ 'extends' => 'bootstrap3', -); +]; -- GitLab