| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2.1165 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 12 | public function loginState() |
|
| 16 | { |
||
| 17 | 12 | $result = '<div class="loginState">'; |
|
| 18 | |||
| 19 | 12 | $user = User::getCurrent(); |
|
| 20 | 12 | if ($user) { |
|
|
|
|||
| 21 | $result .= '<a href="' . $this->view->serverUrl() . $this->view->url( |
||
| 22 | ['controller' => 'user', 'action' => 'view', 'id' => $user->id], 'singleid', true) . '">' . $this->view->gravatar($user) . ' ' . $this->view->escape($user->nickname) . '</a> '; |
||
| 23 | |||
| 24 | $result .= '<a href="' . $this->view->serverUrl() . $this->view->url( |
||
| 25 | ['controller' => 'user', 'action' => 'logout'], 'default', true) . '">' . $this->view->translate('Logout') . '</a> '; |
||
| 26 | } else { |
||
| 27 | 12 | $result .= ' <a href="' . $this->view->serverUrl() . $this->view->url( |
|
| 28 | 12 | ['controller' => 'user', 'action' => 'new'], 'default', true) . '">' . $this->view->translate('Subscribe') . '</a> '; |
|
| 29 | |||
| 30 | 12 | $result .= '<a href="' . $this->view->serverUrl() . $this->view->url( |
|
| 31 | 12 | ['controller' => 'user', 'action' => 'login'], 'default', true) . '">' . $this->view->translate('Login') . '</a>'; |
|
| 32 | } |
||
| 33 | |||
| 34 | 12 | return $result . '</div>'; |
|
| 35 | } |
||
| 37 |