From f0b829277939f52b7a3d715df328af262f4403f0 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 21 May 2018 21:34:53 +0800 Subject: [PATCH] Changed icon for downloading certificate from reports This was done because the core 'import' icon was mapped to the Font Awesome icon 'fa-level-up' which did not look appropriate. --- classes/my_certificates_table.php | 2 +- classes/report_table.php | 2 +- lib.php | 9 +++++++++ pix/download.png | Bin 0 -> 207 bytes pix/download.svg | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pix/download.png create mode 100644 pix/download.svg diff --git a/classes/my_certificates_table.php b/classes/my_certificates_table.php index b0c0858..3810722 100644 --- a/classes/my_certificates_table.php +++ b/classes/my_certificates_table.php @@ -136,7 +136,7 @@ class my_certificates_table extends \table_sql { public function col_download($certificate) { global $OUTPUT; - $icon = new \pix_icon('i/import', get_string('download')); + $icon = new \pix_icon('download', get_string('download'), 'customcert'); $link = new \moodle_url('/mod/customcert/my_certificates.php', array('userid' => $this->userid, 'certificateid' => $certificate->id, diff --git a/classes/report_table.php b/classes/report_table.php index e34be5b..e554bb6 100644 --- a/classes/report_table.php +++ b/classes/report_table.php @@ -145,7 +145,7 @@ class report_table extends \table_sql { public function col_download($user) { global $OUTPUT; - $icon = new \pix_icon('i/import', get_string('download')); + $icon = new \pix_icon('download', get_string('download'), 'customcert'); $link = new \moodle_url('/mod/customcert/report.php', array('id' => $this->cm->id, 'downloadcert' => '1', diff --git a/lib.php b/lib.php index 491d91a..ff7c8db 100644 --- a/lib.php +++ b/lib.php @@ -418,3 +418,12 @@ function mod_customcert_inplace_editable($itemtype, $itemid, $newvalue) { $updateelement->name, $updateelement->name); } } + +/** + * Get icon mapping for font-awesome. + */ +function mod_customcert_get_fontawesome_icon_map() { + return [ + 'mod_customcert:download' => 'fa-download' + ]; +} diff --git a/pix/download.png b/pix/download.png new file mode 100644 index 0000000000000000000000000000000000000000..0f08f9761d0abbc8a659f55a6c3f68773a5e4c4a GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv3GfMV1=2GKflF!kL7KTsg8YIR z1PmJb=da&?{{DNXpue#|VSi5-$B+ufWCo_!XL$qy_R6w1Z!G?HZYGxl+wD9B4F;nK z2OjnbF<;)@jc&a1ignHIa`u9^NjLU3DpqMTf6o(WzR7Tkfk}i-L_uP;;uk#zDQEqj U4RL-7K%*HvUHx3vIVCg!08GeA?*IS* literal 0 HcmV?d00001 diff --git a/pix/download.svg b/pix/download.svg new file mode 100644 index 0000000..007cc99 --- /dev/null +++ b/pix/download.svg @@ -0,0 +1,3 @@ + +]> \ No newline at end of file