Skip to content
Snippets Groups Projects
Commit 056bc64e authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Petit embellissement.

parent cba9f6ee
No related branches found
No related tags found
No related merge requests found
...@@ -44,10 +44,16 @@ class UserCurrent extends UserAbstract ...@@ -44,10 +44,16 @@ class UserCurrent extends UserAbstract
public function __toString() public function __toString()
{ {
try { try {
if ($this->getIdentity()) {
$id = 'user-current-info'; $id = 'user-current-info';
$status = $this->getView()->userStatus(false); $status = $this->getView()->userStatus(false);
if ($this->getIdentity()) {
$content = $this->getView()->userProfile() . $this->getView()->userInfo($this->getAffectationFineSiDispo()); $content = $this->getView()->userProfile() . $this->getView()->userInfo($this->getAffectationFineSiDispo());
}
else {
$content = "Aucun";
}
$content = preg_replace('/\r\n|\n|\r/', '', $content); $content = preg_replace('/\r\n|\n|\r/', '', $content);
$out = <<<EOS $out = <<<EOS
<a class="navbar-link" id="$id" title="Utilisateur connecté" data-placement="bottom" data-toggle="popover" data-content="$content" href="#">$status</a> <a class="navbar-link" id="$id" title="Utilisateur connecté" data-placement="bottom" data-toggle="popover" data-content="$content" href="#">$status</a>
...@@ -60,16 +66,11 @@ EOS; ...@@ -60,16 +66,11 @@ EOS;
</script> </script>
EOS; EOS;
} }
else {
$out = "" . $this->getView()->userStatus(false);
}
}
catch (\Exception $e) { catch (\Exception $e) {
var_dump($e); var_dump($e);
$out = '<p>' . $e->getMessage() . '</p><p>' . $e->getTraceAsString() . '</p>'; $out = '<p>' . $e->getMessage() . '</p><p>' . $e->getTraceAsString() . '</p>';
} }
return $out; return $out;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment