Skip to content

Commit 4fb383d

Browse files
Admin: Add configuration setting 'hide_my_progress_tab' to hide the 'My Progress' tab - refs #5191
1 parent aa3f62c commit 4fb383d

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

main/inc/lib/banner.lib.php

+15-12
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,22 @@ function get_tabs($courseId = null)
8989
$navigation['session_my_space']['key'] = 'my-space';
9090
$navigation['session_my_space']['icon'] = 'my-space.png';
9191
} else {
92-
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH);
93-
// Link to my progress
94-
switch (api_get_setting('gamification_mode')) {
95-
case 1:
96-
$navigation['session_my_progress']['url'] .= 'gamification/my_progress.php';
97-
break;
98-
default:
99-
$navigation['session_my_progress']['url'] .= 'auth/my_progress.php';
100-
}
92+
$hideMyProgressTab = api_get_configuration_value('hide_my_progress_tab');
93+
if (true !== $hideMyProgressTab) {
94+
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH);
95+
// Link to my progress
96+
switch (api_get_setting('gamification_mode')) {
97+
case 1:
98+
$navigation['session_my_progress']['url'] .= 'gamification/my_progress.php';
99+
break;
100+
default:
101+
$navigation['session_my_progress']['url'] .= 'auth/my_progress.php';
102+
}
101103

102-
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
103-
$navigation['session_my_progress']['key'] = 'my-progress';
104-
$navigation['session_my_progress']['icon'] = 'my-progress.png';
104+
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
105+
$navigation['session_my_progress']['key'] = 'my-progress';
106+
$navigation['session_my_progress']['icon'] = 'my-progress.png';
107+
}
105108
}
106109
}
107110

main/install/configuration.dist.php

+3
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,9 @@
990990
// Block access to any user to "my progress" page
991991
//$_configuration['block_my_progress_page'] = false;
992992

993+
// Hides the "my progress" tab from the navigation menu
994+
//$_configuration['hide_my_progress_tab'] = false;
995+
993996
// Add user extra fields in report: main/mySpace/exercise_category_report.php
994997
//$_configuration['exercise_category_report_user_extra_fields'] = ['fields' => ['skype', 'rssfeeds']];
995998

0 commit comments

Comments
 (0)