Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AMOS Bot
moodle-install
Commits
c8398fb9
Commit
c8398fb9
authored
Sep 30, 2014
by
Sam Hemelryk
Browse files
MDL-45893 user: fixed user menu for guest
parent
2957fddd
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/outputrenderers.php
View file @
c8398fb9
...
...
@@ -2956,7 +2956,7 @@ EOD;
$usertextcontents
=
$opts
->
metadata
[
'userfullname'
];
// Other user.
if
(
$opts
->
metadata
[
'asotheruser'
])
{
if
(
!
empty
(
$opts
->
metadata
[
'asotheruser'
])
)
{
$avatarcontents
.
=
html_writer
::
span
(
$opts
->
metadata
[
'realuseravatar'
],
'avatar realuser'
...
...
@@ -2977,7 +2977,7 @@ EOD;
}
// Role.
if
(
$opts
->
metadata
[
'asotherrole'
])
{
if
(
!
empty
(
$opts
->
metadata
[
'asotherrole'
])
)
{
$role
=
core_text
::
strtolower
(
preg_replace
(
'#[ ]+#'
,
'-'
,
trim
(
$opts
->
metadata
[
'rolename'
])));
$usertextcontents
.
=
html_writer
::
span
(
get_string
(
...
...
@@ -2993,7 +2993,7 @@ EOD;
}
// MNet.
if
(
$opts
->
metadata
[
'asmnetuser'
])
{
if
(
!
empty
(
$opts
->
metadata
[
'asmnetuser'
])
)
{
$mnet
=
strtolower
(
preg_replace
(
'#[ ]+#'
,
'-'
,
trim
(
$opts
->
metadata
[
'mnetidprovidername'
])));
$usertextcontents
.
=
html_writer
::
span
(
get_string
(
...
...
@@ -3019,9 +3019,13 @@ EOD;
$am
->
set_alignment
(
action_menu
::
TR
,
action_menu
::
BR
);
if
(
$withlinks
)
{
foreach
(
$opts
->
navitems
as
$key
=>
$value
)
{
$pix
=
null
;
if
(
isset
(
$value
->
pix
))
{
$pix
=
new
pix_icon
(
$value
->
pix
,
$value
->
title
,
null
);
}
$al
=
new
action_menu_link_secondary
(
$value
->
url
,
new
pix_icon
(
$value
->
pix
,
$value
->
title
,
null
)
,
$pix
,
$value
->
title
,
array
(
'class'
=>
'icon'
)
);
...
...
user/lib.php
View file @
c8398fb9
...
...
@@ -683,8 +683,9 @@ function user_get_user_navigation_info($user, $page) {
// Build a list of items for a guest.
$login
=
new
stdClass
();
$login
->
url
=
get_login_url
();
$login
->
url
=
new
moodle_url
(
get_login_url
()
)
;
$login
->
title
=
get_string
(
'login'
);
// TODO MDL-47457: we should be setting a login icon here.
$returnobject
->
navitems
[]
=
$login
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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