Commit 056bc64e authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Petit embellissement.

parent cba9f6ee
......@@ -44,31 +44,32 @@ class UserCurrent extends UserAbstract
public function __toString()
{
try {
$id = 'user-current-info';
$status = $this->getView()->userStatus(false);
if ($this->getIdentity()) {
$id = 'user-current-info';
$status = $this->getView()->userStatus(false);
$content = $this->getView()->userProfile() . $this->getView()->userInfo($this->getAffectationFineSiDispo());
$content = preg_replace('/\r\n|\n|\r/', '', $content);
$out = <<<EOS
}
else {
$content = "Aucun";
}
$content = preg_replace('/\r\n|\n|\r/', '', $content);
$out = <<<EOS
<a class="navbar-link" id="$id" title="Utilisateur connecté" data-placement="bottom" data-toggle="popover" data-content="$content" href="#">$status</a>
EOS;
$out .= <<<EOS
$out .= <<<EOS
<script type="text/javascript">
$(function() {
$("#$id").popover({ html: true, container: 'body' });
});
</script>
EOS;
}
else {
$out = "" . $this->getView()->userStatus(false);
}
}
catch (\Exception $e) {
var_dump($e);
$out = '<p>' . $e->getMessage() . '</p><p>' . $e->getTraceAsString() . '</p>';
}
return $out;
}
......
Markdown is supported
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