Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
18434c57
Commit
18434c57
authored
Jul 10, 2013
by
Bertrand Gauthier
Browse files
Légère modif pour testabilité.
parent
a8dad842
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/View/Helper/UserCurrent.php
View file @
18434c57
...
...
@@ -37,31 +37,30 @@ class UserCurrent extends UserAbstract
*/
public
function
__toString
()
{
try
{
$id
=
'user-current-info'
;
$userStatusHelper
=
$this
->
getView
()
->
plugin
(
'userStatus'
);
/* @var $userStatusHelper \UnicaenAuth\View\Helper\UserStatus */
$status
=
$userStatusHelper
(
false
);
if
(
$this
->
getIdentity
())
{
$userProfileHelper
=
$this
->
getView
()
->
plugin
(
'userProfile'
);
/* @var $userProfileHelper \UnicaenAuth\View\Helper\UserProfile */
$userInfoHelper
=
$this
->
getView
()
->
plugin
(
'userInfo'
);
/* @var $userInfoHelper \UnicaenAuth\View\Helper\UserInfo */
$content
=
$userProfileHelper
.
$userInfoHelper
(
$this
->
getAffectationFineSiDispo
());
}
else
{
$content
=
_
(
"Aucun"
);
if
(
$this
->
getTranslator
())
{
$content
=
$this
->
getTranslator
()
->
translate
(
$content
,
$this
->
getTranslatorTextDomain
());
}
}
$content
=
preg_replace
(
'/\r\n|\n|\r/'
,
''
,
$content
);
$title
=
_
(
"Utilisateur connecté à l'application"
);
$id
=
'user-current-info'
;
$userStatusHelper
=
$this
->
getView
()
->
plugin
(
'userStatus'
);
/* @var $userStatusHelper \UnicaenAuth\View\Helper\UserStatus */
$status
=
$userStatusHelper
(
false
);
if
(
$this
->
getIdentity
())
{
$userProfileHelper
=
$this
->
getView
()
->
plugin
(
'userProfile'
);
/* @var $userProfileHelper \UnicaenAuth\View\Helper\UserProfile */
$userInfoHelper
=
$this
->
getView
()
->
plugin
(
'userInfo'
);
/* @var $userInfoHelper \UnicaenAuth\View\Helper\UserInfo */
$content
=
$userProfileHelper
.
$userInfoHelper
(
$this
->
getAffectationFineSiDispo
());
}
else
{
$content
=
_
(
"Aucun"
);
if
(
$this
->
getTranslator
())
{
$
title
=
$this
->
getTranslator
()
->
translate
(
$
title
,
$this
->
getTranslatorTextDomain
());
$
content
=
$this
->
getTranslator
()
->
translate
(
$
content
,
$this
->
getTranslatorTextDomain
());
}
$out
=
<<<EOS
}
$content
=
preg_replace
(
'/\r\n|\n|\r/'
,
''
,
$content
);
$title
=
_
(
"Utilisateur connecté à l'application"
);
if
(
$this
->
getTranslator
())
{
$title
=
$this
->
getTranslator
()
->
translate
(
$title
,
$this
->
getTranslatorTextDomain
());
}
$out
=
<<<EOS
<a class="navbar-link"
id="$id"
title="$title"
...
...
@@ -70,20 +69,15 @@ class UserCurrent extends UserAbstract
data-content="$content"
href="#">$status</a>
EOS;
$out
.
=
PHP_EOL
;
$out
.
=
<<<EOS
$out
.
=
PHP_EOL
;
$out
.
=
<<<EOS
<script type="text/javascript">
$(function() {
$("#$id").popover({ html: true, container: '#navbar' });
});
</script>
EOS;
$out
.
=
PHP_EOL
;
}
catch
(
\
Exception
$e
)
{
var_dump
(
$e
);
$out
=
'<p>'
.
$e
->
getMessage
()
.
'</p><p>'
.
$e
->
getTraceAsString
()
.
'</p>'
;
}
$out
.
=
PHP_EOL
;
return
$out
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment