<?php
$isAdmin = in_array('sys', $this->currentUser()->role()->privileges());
$isDb = $this->settings('auth-method') == 'db';
if (!$this->isXhr) :
    $title = 'Profile';
    $this->headTitle($title);
?>
<div class="page-header">
	<h1>Profile</h1>
</div>
<?php else : ?>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">Profile</h4>
</div>
<div class="modal-body">
<?php endif; ?>
    
<?php if ($isDb) : ?>
<ul class="nav nav-pills">
    <li class="active"><a data-toggle="tab" href="<?php echo $this->url('profile/manage', array('action' => 'main')); ?>">Main</a></li>
    <li><a data-toggle="tab" href="<?php echo $this->url('profile/manage', array('action' => 'change-password')); ?>">Change Password</a></li>
</ul>
<?php endif; ?>

<div id="profile-canvas">
    <?php echo $this->partial('aev-users/profile/main.phtml', array('user' => $user)); ?>
</div>

<?php if ($this->isXhr) : ?>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
</div>
<?php endif;