Created
February 13, 2015 17:00
-
-
Save PeloNZ/92c4e4bf99645f773ffd to your computer and use it in GitHub Desktop.
example diff for making easy to manage customisations to moodle / totara core code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit fbb65a025eacfc2842dc7a34d09b82c64d554041 | |
Author: Chris Wharton <[email protected]> | |
Date: Wed Dec 17 14:34:54 2014 +0000 | |
local/client: Hide evidence tab from Record of Learning | |
diff --git a/lang/en/local_client.php b/lang/en/local_client.php | |
index 2dc6804..8dc1fa6 100644 | |
--- a/lang/en/local_client.php | |
+++ b/lang/en/local_client.php | |
@@ -79,3 +79,10 @@ $string['nonenrolledsummaryredirect'] = 'Redirect to summary page for non enrolled users'; | |
+ // Record of learning | |
+ $string['hidetabevidence'] = 'Hide Evidence tab'; | |
+ $string['confighidetabevidence'] = 'Hide "Other Evidence" tab from the record of learning.'; | |
+ // Setting headings | |
+ $string['settingsrecordoflearning'] = 'Record of Learning settings'; | |
diff --git a/settings.php b/settings.php | |
index 15c6e76..9f4ff30 100644 | |
--- a/settings.php | |
+++ b/settings.php | |
@@ -26,7 +26,12 @@ defined('MOODLE_INTERNAL') || die; | |
$settings = new admin_settingpage('local_client', get_string('miscclientsettings', 'local_client')); | |
$ADMIN->add('localplugins', $settings); | |
+ // set visibility of totara record of learning tabs | |
+ $settings->add(new admin_setting_heading('local_client/settingsrecordoflearning', new lang_string('settingsrecordoflearning', 'local_client'), '')); | |
+ $settings->add(new admin_setting_configcheckbox('local_client/hidetabevidence', new lang_string('hidetabevidence', 'local_client'), new lang_string('confighidetabevidence', 'local_client'), 0)); | |
diff --git a/totara/plan/lib.php b/totara/plan/lib.php | |
index 22f48bc..7a3ed60 100644 | |
--- a/totara/plan/lib.php | |
+++ b/totara/plan/lib.php | |
@@ -392,7 +392,11 @@ function dp_get_rol_tabs_visible($userid) { | |
$visible[] = 'programs'; | |
} | |
- $visible[] = 'evidence'; | |
+ // client custom code begin - hide evidence tab. | |
+ if (get_config('local_client', 'hidetabevidence') === '0') { | |
+ $visible[] = 'evidence'; | |
+ } | |
+ // client custom code end. | |
$certification_progs = prog_get_certification_programs($userid, '', '', '', true, true); | |
$unassignedcertifications = $DB->record_exists('certif_completion_history', array('userid' => $userid, 'unassigned' => 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment