changed AuthLink format.
This commit is contained in:
parent
d862842caf
commit
44d528d0d3
1 changed files with 18 additions and 3 deletions
|
|
@ -14,16 +14,31 @@ class Fiktiv_View_Helper_AuthLink extends Zend_View_Helper_Abstract
|
|||
$prefix = '';
|
||||
|
||||
if ($auth->hasIdentity()) {
|
||||
$identity = $auth->getIdentity();
|
||||
$options['action'] = 'logout';
|
||||
$display = 'u:logout';
|
||||
|
||||
$prefix = '<a href="'.$this->view->url(array('controller' => 'profile'), 'default').'">';
|
||||
|
||||
$prefix = $auth->getIdentity()->firstName.' (<a href="'.$this->view->url(array('controller' => 'profile'), 'default').'">Profile</a>) ';
|
||||
if (strlen($identity->firstName)) {
|
||||
$prefix .= $identity->firstName;
|
||||
|
||||
if (strlen($identity->lastName)) {
|
||||
$prefix .= ' ' . $identity->lastName[0];
|
||||
}
|
||||
} else {
|
||||
$prefix .= $this->view->translate('Unknown');
|
||||
}
|
||||
|
||||
$prefix .= '</a> | ';
|
||||
} else {
|
||||
$options['action'] = 'login';
|
||||
$display = 'u:login';
|
||||
}
|
||||
|
||||
return $prefix.'<a href="' . $this->view->url($options, 'auth') . '">' . $this->view->translate($display) . '</a>';
|
||||
return $prefix
|
||||
. '<a href="' . $this->view->url($options, 'auth') . '">'
|
||||
. $this->view->translate($display)
|
||||
. '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue