Skip to content
Snippets Groups Projects
Commit 53fb82c0 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Added capability theme/boost_campus:viewhintinhiddencourse for setting showhintcoursehidden.

parent 771fd2fe
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ Changes ...@@ -6,6 +6,7 @@ Changes
### Unreleased ### Unreleased
* 2020-08-19 - Added capability theme/boost_campus:viewhintinhiddencourse for setting showhintcoursehidden.
* 2020-08-14 - Reduced inflationary call to reset theme caches for the settings. * 2020-08-14 - Reduced inflationary call to reset theme caches for the settings.
* 2020-08-12 - Fixed undefined variables notices. * 2020-08-12 - Fixed undefined variables notices.
* 2020-08-11 - Added setting to be able to show a hint for a unrestricted self enrolment in a visible course. * 2020-08-11 - Added setting to be able to show a hint for a unrestricted self enrolment in a visible course.
......
...@@ -218,8 +218,11 @@ class core_renderer extends \core_renderer { ...@@ -218,8 +218,11 @@ class core_renderer extends \core_renderer {
// MODIFICATION START: // MODIFICATION START:
// If the setting showhintcoursehidden is set, the visibility of the course is hidden and // If the setting showhintcoursehidden is set, the visibility of the course is hidden and
// a hint for the visibility will be shown. // a hint for the visibility will be shown.
if (get_config('theme_boost_campus', 'showhintcoursehidden') == 'yes' && $COURSE->visible == false && if (get_config('theme_boost_campus', 'showhintcoursehidden') == 'yes'
$this->page->has_set_url() && $this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)) { && has_capability('theme/boost_campus:viewhintinhiddencourse', \context_course::instance($COURSE->id))
&& $this->page->has_set_url()
&& $this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)
&& $COURSE->visible == false) {
$html .= html_writer::start_tag('div', array('class' => 'course-hidden-infobox alert alert-warning')); $html .= html_writer::start_tag('div', array('class' => 'course-hidden-infobox alert alert-warning'));
$html .= html_writer::tag('i', null, array('class' => 'fa fa-exclamation-circle fa-3x fa-pull-left')); $html .= html_writer::tag('i', null, array('class' => 'fa fa-exclamation-circle fa-3x fa-pull-left'));
$html .= get_string('showhintcoursehiddengeneral', 'theme_boost_campus', $COURSE->id); $html .= get_string('showhintcoursehiddengeneral', 'theme_boost_campus', $COURSE->id);
......
...@@ -28,6 +28,15 @@ $capabilities = array( ...@@ -28,6 +28,15 @@ $capabilities = array(
// Ability to see a hint for unrestricted self enrolment in a visible course. // Ability to see a hint for unrestricted self enrolment in a visible course.
'theme/boost_campus:viewhintcourseselfenrol' => array( 'theme/boost_campus:viewhintcourseselfenrol' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW )
),
// Ability to see a hint in a hidden course.
'theme/boost_campus:viewhintinhiddencourse' => array(
'captype' => 'read', 'captype' => 'read',
'contextlevel' => CONTEXT_COURSE, 'contextlevel' => CONTEXT_COURSE,
'archetypes' => array( 'archetypes' => array(
......
...@@ -312,3 +312,4 @@ $string['privacy:metadata:request:infobanner_dismissed_no'] = 'Perpetual info ba ...@@ -312,3 +312,4 @@ $string['privacy:metadata:request:infobanner_dismissed_no'] = 'Perpetual info ba
// CAPABILITIES. // CAPABILITIES.
$string['boost_campus:viewhintcourseselfenrol'] = 'To be able to see a hint for unrestricted self enrolment in a visible course.'; $string['boost_campus:viewhintcourseselfenrol'] = 'To be able to see a hint for unrestricted self enrolment in a visible course.';
$string['boost_campus:viewhintinhiddencourse'] = 'To be able to see a hint in a hidden course.';
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->component = 'theme_boost_campus'; $plugin->component = 'theme_boost_campus';
$plugin->version = 2020081200; $plugin->version = 2020081201;
$plugin->release = 'v3.8-r2'; $plugin->release = 'v3.8-r2';
$plugin->requires = 2019111804; $plugin->requires = 2019111804;
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment