Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Participants menu course and module pages with show / hide setting in…
Browse files Browse the repository at this point in the history
… the header settings.
  • Loading branch information
gjb2048 committed Dec 20, 2018
1 parent c10faf2 commit fce94ad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
New in 3.5.1.4
==============
- FIX: Participants menu only on course and module pages.
- NEW: Show / hide the participants menu with the 'participantsmenu' setting in the 'Header' settings.

New in 3.5.1.3
==============
Expand Down
5 changes: 4 additions & 1 deletion classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,10 @@ public function custom_menu_activitystream() {
*/
public function custom_menu_participants() {
$output = '';
if (!isguestuser()) {
if ((!isguestuser()) &&
((\theme_essential\toolbox::get_setting('participantsmenu')) &&
(($this->page->pagelayout == 'course') || ($this->page->pagelayout == 'incourse')))
) {
$users = $this->get_enrolled_users();
if (!empty($users)) {
/* Not using a custom menu so to make use of the user picture rendering code, otherwise a lot of work to do and
Expand Down
2 changes: 2 additions & 0 deletions lang/en/theme_essential.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@

// Participants menu.
$string['gotopeople'] = 'Go to people';
$string['participantsmenu'] = 'Participants menu';
$string['participantsmenudesc'] = 'Show the participants menu in the course and module pages.';

// User menu.
$string['usermenu'] = 'User menu';
Expand Down
8 changes: 8 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,14 @@
$setting->set_updatedcallback('theme_reset_all_caches');
$essentialsettingsheader->add($setting);

// Participants menu.
$name = 'theme_essential/participantsmenu';
$title = get_string('participantsmenu', 'theme_essential');
$description = get_string('participantsmenudesc', 'theme_essential');
$default = true;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$essentialsettingsheader->add($setting);

// Choose breadcrumbstyle.
$name = 'theme_essential/breadcrumbstyle';
$title = get_string('breadcrumbstyle', 'theme_essential');
Expand Down

0 comments on commit fce94ad

Please sign in to comment.