Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-theme_boost_campus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-theme_boost_campus
Commits
46cfdb66
Commit
46cfdb66
authored
7 years ago
by
Alexander Bias
Committed by
Kathrin Osswald
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Check if user is logged in before showing the switched role information box.
parent
ec62b591
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES.md
+4
-0
4 additions, 0 deletions
CHANGES.md
classes/output/core_renderer.php
+27
-22
27 additions, 22 deletions
classes/output/core_renderer.php
with
31 additions
and
22 deletions
CHANGES.md
+
4
−
0
View file @
46cfdb66
...
...
@@ -4,6 +4,10 @@ moodle-theme_boost_campus
Changes
-------
### Unreleased
*
2017-09-22 - Check if user is logged in before showing the switched role information box.
### Release v3.2-r3
*
2017-09-19 - Changed naming of the former badgearea setting to imagearea to prevent mixing up with Moodle badges.
...
...
This diff is collapsed.
Click to expand it.
classes/output/core_renderer.php
+
27
−
22
View file @
46cfdb66
...
...
@@ -187,6 +187,10 @@ class core_renderer extends \theme_boost\output\core_renderer {
// MODIFICATION START.
// Only use this if setting 'showswitchedroleincourse' is active.
if
(
get_config
(
'theme_boost_campus'
,
'showswitchedroleincourse'
)
===
'yes'
)
{
// Check if user is logged in.
// If not, adding this section would make no sense and, even worse,
// user_get_user_navigation_info() will throw an exception due to the missing user object.
if
(
isloggedin
())
{
$opts
=
\user_get_user_navigation_info
(
$USER
,
$this
->
page
);
// Role is switched.
if
(
!
empty
(
$opts
->
metadata
[
'asotherrole'
]))
{
...
...
@@ -211,6 +215,7 @@ class core_renderer extends \theme_boost\output\core_renderer {
$html
.
=
html_writer
::
end_tag
(
'div'
);
}
}
}
// MODIFICATION END.
return
$html
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment