Skip to content

Commit

Permalink
Allow hide the certificate export link to students - refs BT#9237
Browse files Browse the repository at this point in the history
Conflicts:
	main/gradebook/lib/be/category.class.php
  • Loading branch information
AngelFQC committed Apr 9, 2015
1 parent 2d368bf commit 44f2b22
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions certificates/index.php
Expand Up @@ -18,6 +18,13 @@

switch ($action) {
case 'export':
if (
api_is_student() &&
api_get_configuration_value('hide_certificate_export_link_students')
) {
api_not_allowed(true);
}

$certificate->generate(array('hide_print_button' => true));

if ($certificate->html_file_is_generated()) {
Expand Down
7 changes: 7 additions & 0 deletions main/gradebook/lib/be/category.class.php
Expand Up @@ -1859,6 +1859,13 @@ public static function register_user_certificate($category_id, $user_id)
"$url&action=export"
);

if (
api_is_student() &&
api_get_configuration_value('hide_certificate_export_link_students')
) {
$exportToPDF = null;
}

$html = array(
'certificate_link' => $certificates,
'pdf_link' => $exportToPDF
Expand Down
3 changes: 2 additions & 1 deletion main/install/configuration.dist.php
Expand Up @@ -326,4 +326,5 @@
//$_configuration['limit_session_admin_role'] = false;
// Show session description
//$_configuration['show_session_description'] = false;

// Hide only for students the link to export certificates to PDF
//$_configuration['hide_certificate_export_link_students'] = false;

0 comments on commit 44f2b22

Please sign in to comment.