Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@@ -277,6 +277,8 @@
$ string ['sensitivedatareasons' ] = 'Sensitive personal data processing reasons' ;
$ string ['sensitivedatareasons_help' ] = 'Select one or more applicable reasons that exempts the prohibition of processing sensitive personal data tied to this purpose. For more information, please see <a href="https://gdpr-info.eu/art-9-gdpr/" target="_blank">GDPR Art. 9.2</a>' ;
$ string ['setdefaults' ] = 'Set defaults' ;
$ string ['showdataretentionsummary' ] = 'Show data retention summary' ;
$ string ['showdataretentionsummary_desc' ] = 'If enabled, a link to the data retention summary is shown in the page footer and in the user profile page.' ;
$ string ['statusapproved' ] = 'Approved' ;
$ string ['statusawaitingapproval' ] = 'Awaiting approval' ;
$ string ['statuscancelled' ] = 'Cancelled' ;
@@ -87,10 +87,19 @@ function tool_dataprivacy_myprofile_navigation(tree $tree, $user, $iscurrentuser
}
}
$ summaryurl = new moodle_url('/admin/tool/dataprivacy/summary.php' );
$ summarynode = new core_user\output\myprofile\node('privacyandpolicies' , 'retentionsummary' ,
// A returned 0 means that the setting was set and disabled, false means that there is no value for the provided setting.
$ showsummary = get_config ('tool_dataprivacy' , 'showdataretentionsummary' );
if ($ showsummary === false ) {
// This means that no value is stored in db. We use the default value in this case.
$ showsummary = true ;
}
if ($ showsummary ) {
$ summaryurl = new moodle_url('/admin/tool/dataprivacy/summary.php' );
$ summarynode = new core_user\output\myprofile\node('privacyandpolicies' , 'retentionsummary' ,
get_string ('dataretentionsummary' , 'tool_dataprivacy' ), null , $ summaryurl );
$ category ->add_node ($ summarynode );
$ category ->add_node ($ summarynode );
}
// Add the Privacy category to the tree if it's not empty and it doesn't exist.
$ nodes = $ category ->nodes ;
@@ -110,11 +119,20 @@ function tool_dataprivacy_myprofile_navigation(tree $tree, $user, $iscurrentuser
* @return string HTML footer content
*/
function tool_dataprivacy_standard_footer_html () {
$ output = '' ;
$ url = new moodle_url('/admin/tool/dataprivacy/summary.php' );
$ output = html_writer::link ($ url , get_string ('dataretentionsummary' , 'tool_dataprivacy' ));
$ output = html_writer::div ($ output , 'summaryfooter' );
// A returned 0 means that the setting was set and disabled, false means that there is no value for the provided setting.
$ showsummary = get_config ('tool_dataprivacy' , 'showdataretentionsummary' );
if ($ showsummary === false ) {
// This means that no value is stored in db. We use the default value in this case.
$ showsummary = true ;
}
if ($ showsummary ) {
$ url = new moodle_url('/admin/tool/dataprivacy/summary.php' );
$ output = html_writer::link ($ url , get_string ('dataretentionsummary' , 'tool_dataprivacy' ));
$ output = html_writer::div ($ output , 'tool_dataprivacy' );
}
return $ output ;
}
@@ -66,6 +66,12 @@
new lang_string('requireallenddatesforuserdeletion' , 'tool_dataprivacy' ),
new lang_string('requireallenddatesforuserdeletion_desc' , 'tool_dataprivacy' ),
1 ));
// Whether the data retention summary should be shown in the page footer and in the user profile page.
$ privacysettings ->add (new admin_setting_configcheckbox('tool_dataprivacy/showdataretentionsummary' ,
new lang_string('showdataretentionsummary' , 'tool_dataprivacy' ),
new lang_string('showdataretentionsummary_desc' , 'tool_dataprivacy' ),
1 ));
}
}
Toggle all file notes
Toggle all file annotations