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