The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 44d4b181 authored by Demian Katz's avatar Demian Katz
Browse files

Template simplification.

parent 6aee172e
No related merge requests found
......@@ -5,9 +5,6 @@
// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>';
// Only display home library form if we have multiple pickup locations:
$showHomeLibForm = (isset($this->pickup) && count($this->pickup) > 1);
// Template for use by the renderArray helper:
$arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>';
?>
......@@ -18,16 +15,14 @@
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->auth()->isLoggedIn()]); ?>
<table class="table table-striped">
<?php
echo $this->renderArray(
$arrTemplate, $this->profile,
[
$this->transEsc('First Name') => 'firstname',
$this->transEsc('Last Name') => 'lastname'
]
);
?>
<?php if ($showHomeLibForm): ?>
<?=$this->renderArray(
$arrTemplate, $this->profile,
[
$this->transEsc('First Name') => 'firstname',
$this->transEsc('Last Name') => 'lastname'
]
)?>
<?php if (count($this->pickup ?? []) > 1): // Skip form if only one location: ?>
<tr><th><?=$this->transEsc('Preferred Library')?>:</th>
<?php
$selected = (isset($this->profile['home_library']) && $this->profile['home_library'] != "")
......@@ -44,22 +39,20 @@
</form>
</td>
<?php endif; ?>
<?php
echo $this->renderArray(
$arrTemplate, $this->profile,
[
$this->transEsc('Address') . ' 1' => 'address1',
$this->transEsc('Address') . ' 2' => 'address2',
$this->transEsc('Zip') => 'zip',
$this->transEsc('City') => 'city',
$this->transEsc('Country') => 'country',
$this->transEsc('Phone Number') => 'phone',
$this->transEsc('Mobile Number') => 'mobile_phone',
$this->transEsc('Group') => 'group',
$this->transEsc('Expires') => 'expiration_date'
]
);
?>
<?=$this->renderArray(
$arrTemplate, $this->profile,
[
$this->transEsc('Address') . ' 1' => 'address1',
$this->transEsc('Address') . ' 2' => 'address2',
$this->transEsc('Zip') => 'zip',
$this->transEsc('City') => 'city',
$this->transEsc('Country') => 'country',
$this->transEsc('Phone Number') => 'phone',
$this->transEsc('Mobile Number') => 'mobile_phone',
$this->transEsc('Group') => 'group',
$this->transEsc('Expires') => 'expiration_date'
]
)?>
</table>
</div>
......
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