Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
89b97390
Commit
89b97390
authored
Mar 01, 2016
by
Simey Lameze
Committed by
Eloy Lafuente
Mar 08, 2016
Browse files
MDL-51167 tool_monitor: check course visibility and user
parent
19075785
Changes
1
Hide whitespace changes
Inline
Side-by-side
admin/tool/monitor/classes/output/managesubs/rules.php
View file @
89b97390
...
...
@@ -219,10 +219,13 @@ class rules extends \table_sql implements \renderable {
if
(
has_capability
(
'tool/monitor:subscribe'
,
\
context_system
::
instance
()))
{
$options
[
0
]
=
get_string
(
'site'
);
}
if
(
$courses
=
get_user_capability_course
(
'tool/monitor:subscribe'
,
null
,
true
,
'fullname'
,
$orderby
))
{
if
(
$courses
=
get_user_capability_course
(
'tool/monitor:subscribe'
,
null
,
true
,
'fullname
, visible
'
,
$orderby
))
{
foreach
(
$courses
as
$course
)
{
$options
[
$course
->
id
]
=
format_string
(
$course
->
fullname
,
true
,
array
(
'context'
=>
\
context_course
::
instance
(
$course
->
id
)));
$coursecontext
=
\
context_course
::
instance
(
$course
->
id
);
if
(
$course
->
visible
==
true
||
has_capability
(
'moodle/course:viewhiddencourses'
,
$coursecontext
))
{
$options
[
$course
->
id
]
=
format_string
(
$course
->
fullname
,
true
,
array
(
'context'
=>
$coursecontext
));
}
}
}
$url
=
new
\
moodle_url
(
'/admin/tool/monitor/index.php'
);
...
...
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