Skip to content

Commit

Permalink
Admin: Add configuration setting 'hide_my_progress_tab' to hide the '…
Browse files Browse the repository at this point in the history
…My Progress' tab - refs #5191
  • Loading branch information
juancp-contidosdixitais authored Oct 18, 2024
1 parent aa3f62c commit 4fb383d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
27 changes: 15 additions & 12 deletions main/inc/lib/banner.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,22 @@ function get_tabs($courseId = null)
$navigation['session_my_space']['key'] = 'my-space';
$navigation['session_my_space']['icon'] = 'my-space.png';
} else {
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH);
// Link to my progress
switch (api_get_setting('gamification_mode')) {
case 1:
$navigation['session_my_progress']['url'] .= 'gamification/my_progress.php';
break;
default:
$navigation['session_my_progress']['url'] .= 'auth/my_progress.php';
}
$hideMyProgressTab = api_get_configuration_value('hide_my_progress_tab');
if (true !== $hideMyProgressTab) {
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH);
// Link to my progress
switch (api_get_setting('gamification_mode')) {
case 1:
$navigation['session_my_progress']['url'] .= 'gamification/my_progress.php';
break;
default:
$navigation['session_my_progress']['url'] .= 'auth/my_progress.php';
}

$navigation['session_my_progress']['title'] = get_lang('MyProgress');
$navigation['session_my_progress']['key'] = 'my-progress';
$navigation['session_my_progress']['icon'] = 'my-progress.png';
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
$navigation['session_my_progress']['key'] = 'my-progress';
$navigation['session_my_progress']['icon'] = 'my-progress.png';
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions main/install/configuration.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@
// Block access to any user to "my progress" page
//$_configuration['block_my_progress_page'] = false;

// Hides the "my progress" tab from the navigation menu
//$_configuration['hide_my_progress_tab'] = false;

// Add user extra fields in report: main/mySpace/exercise_category_report.php
//$_configuration['exercise_category_report_user_extra_fields'] = ['fields' => ['skype', 'rssfeeds']];

Expand Down

0 comments on commit 4fb383d

Please sign in to comment.