Skip to content

Commit

Permalink
Used the view plugin "translate" as function in views.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Aug 26, 2018
1 parent c93ab43 commit 03601b7
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions application/view/omeka/admin/job/browse.phtml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<?php
$this->htmlElement('body')->appendAttribute('class', 'jobs browse');
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'jobs browse');
$sortHeadings = [
[
'label' => $this->translate('ID'),
'label' => $translate('ID'),
'value' => 'id'
],
[
'label' => $this->translate('Class'),
'label' => $translate('Class'),
'value' => 'class'
],
[
'label' => $this->translate('Status'),
'label' => $translate('Status'),
'value' => 'status'
],
[
'label' => $this->translate('Owner'),
'label' => $translate('Owner'),
'value' => 'owner'
]
];
?>

<?php echo $this->pageTitle($this->translate('Jobs')); ?>
<?php echo $this->pageTitle($translate('Jobs')); ?>

<?php if (count($jobs)): ?>

Expand All @@ -33,11 +34,11 @@ $sortHeadings = [
<table class="tablesaw" data-tablesaw-mode="stack">
<thead>
<tr>
<th><?php echo $this->translate('Id / Params'); ?></th>
<th><?php echo $this->translate('Date'); ?></th>
<th><?php echo $this->translate('Class'); ?></th>
<th><?php echo $this->translate('Status / Log'); ?></th>
<th><?php echo $this->translate('Owner'); ?></th>
<th><?php echo $translate('Id / Params'); ?></th>
<th><?php echo $translate('Date'); ?></th>
<th><?php echo $translate('Class'); ?></th>
<th><?php echo $translate('Status / Log'); ?></th>
<th><?php echo $translate('Owner'); ?></th>
</tr>
</thead>
<tbody>
Expand All @@ -53,17 +54,17 @@ $sortHeadings = [
)
);
} else {
$ownerText = $this->translate('[no owner]');
$ownerText = $translate('[no owner]');
}
?>
<tr>
<td><?php echo $job->link($escape($job->id())); ?></td>
<td><?php echo $escape($this->i18n()->dateFormat($job->started(), null, \Omeka\View\Helper\i18n::DATE_FORMAT_SHORT)); ?></td>
<td><?php echo $escape($job->jobClass()); ?></td>
<td><?php if ($job->log()): ?>
<?php echo $this->hyperlink($this->translate($job->statusLabel()), $this->url('admin/id', ['controller' => 'job', 'action' => 'log', 'id' => $job->id()]), ['target' => '_blank']); ?>
<?php echo $this->hyperlink($translate($job->statusLabel()), $this->url('admin/id', ['controller' => 'job', 'action' => 'log', 'id' => $job->id()]), ['target' => '_blank']); ?>
<?php else: ?>
<?php echo $escape($this->translate($job->statusLabel())); ?>
<?php echo $escape($translate($job->statusLabel())); ?>
<?php endif; ?>
</td>
<td><?php echo $ownerText; ?></td>
Expand All @@ -79,7 +80,7 @@ $sortHeadings = [
<?php else: ?>

<div class="no-resources">
<p><?php echo $this->translate('Omeka could not find any jobs.'); ?></p>
<p><?php echo $translate('Omeka could not find any jobs.'); ?></p>
</div>

<?php endif; ?>
Expand Down

0 comments on commit 03601b7

Please sign in to comment.