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
2adf38c8
Commit
2adf38c8
authored
7 years ago
by
Kathrin Osswald
Browse files
Options
Downloads
Patches
Plain Diff
Added check to prevent errors on sites with course context but withaout a courseadmin node.
parent
777eae3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
locallib.php
+28
-25
28 additions, 25 deletions
locallib.php
with
28 additions
and
25 deletions
locallib.php
+
28
−
25
View file @
2adf38c8
...
...
@@ -254,6 +254,8 @@ function theme_boost_campus_get_incourse_settings() {
if
(
$PAGE
->
context
->
contextlevel
==
CONTEXT_COURSE
||
$PAGE
->
context
->
contextlevel
==
CONTEXT_MODULE
)
{
// Get the courseadmin node for the current page.
$node
=
$PAGE
->
settingsnav
->
find
(
'courseadmin'
,
navigation_node
::
TYPE_COURSE
);
// Check if $node is not empty for other pages like for example the langauge customization page.
if
(
!
empty
(
$node
))
{
// If the setting 'incoursesettingsswitchtorole' is enabled add these to the $node.
if
(
get_config
(
'theme_boost_campus'
,
'incoursesettingsswitchtorole'
)
==
'yes'
&&
!
is_role_switched
(
$COURSE
->
id
))
{
// Build switch role link
...
...
@@ -284,5 +286,6 @@ function theme_boost_campus_get_incourse_settings() {
}
}
}
}
return
$node
;
}
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