Skip to content
Snippets Groups Projects
Commit 72b56969 authored by Robert Lange's avatar Robert Lange Committed by Dorian Merz
Browse files

refs #18044 [master] fix casting error in admin module

parent ea29a496
No related merge requests found
<!-- finc: admin/home -->
<?php
/** @deprecated since v6.1
* #18044 template needed to FIX bootstrap casting error in uptime display with '(int)' instead of '(string)'
*/
// Set page title.
$this->headTitle($this->translate('VuFind Administration - Home'));
// Set up map of core name => label
$coreLabels = [
'biblio' => $this->translate('Bibliographic Index'),
'authority' => $this->translate('Authority Index'),
];
?>
<div class="<?=$this->layoutClass('mainbody')?>">
<h2><?=$this->transEsc('VuFind Administration')?></h2>
<?php $cores = is_object($this->xml) ? $this->xml->xpath('/response/lst[@name="status"]/lst') : []; ?>
<?php foreach ($cores as $core): ?>
<?php $coreName = (string)$core['name']; ?>
<?php $coreLabel = $coreLabels[$coreName] ?? ucwords($coreName) . ' Index'; ?>
<h3><?=$this->transEsc($coreLabel)?></h3>
<table class="table table-striped">
<tr>
<th><?=$this->transEsc('Record Count')?>: </th>
<?php $recordCount = $core->xpath('//lst[@name="' . $coreName . '"]/lst/int[@name="numDocs"]') ?>
<td><?=$this->escapeHtml((string)array_pop($recordCount))?></td>
</tr>
<tr>
<th><?=$this->transEsc('Start Time')?>: </th>
<?php $startTime = $core->xpath('//lst[@name="' . $coreName . '"]/date[@name="startTime"]') ?>
<td><?=$this->escapeHtml(strftime("%b %d, %Y %l:%M:%S%p", strtotime((string)array_pop($startTime))))?></td>
</tr>
<tr>
<th><?=$this->transEsc('Last Modified')?>: </th>
<?php $lastModified = $core->xpath('//lst[@name="' . $coreName . '"]/lst/date[@name="lastModified"]') ?>
<td><?=$this->escapeHtml(strftime("%b %d, %Y %l:%M:%S%p", strtotime((string)array_pop($lastModified))))?></td>
</tr>
<tr>
<th><?=$this->transEsc('Uptime')?>: </th>
<?php $uptime = $core->xpath('//lst[@name="' . $coreName . '"]/long[@name="uptime"]') ?>
<?php /* #18044 fix casting error in uptime display - solved in Vufind 6 */ ?>
<td><?=$this->printms((int)array_pop($uptime))?></td>
</tr>
</table>
<?php endforeach; ?>
</div>
<div class="<?=$this->layoutClass('sidebar')?>">
<?=$this->render("admin/menu.phtml")?>
</div>
<!-- finc: admin/home - END -->
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