Replaced plugin name and some logic

This commit is contained in:
Kumi 2021-11-24 08:29:43 +01:00
parent 311e243ca5
commit 967571cd14
208 changed files with 5193 additions and 14416 deletions

View file

@ -17,12 +17,12 @@
/**
* The report that displays the certificates the user has throughout the site.
*
* @package mod_customcert
* @copyright 2016 Mark Nelson <markn@moodle.com>
* @package mod_htmlcert
* @copyright 2016 Mark Nelson <markn@moodle.com>, 2021 Klaus-Uwe Mitterer <kumitterer@kumi.systems>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_customcert;
namespace mod_htmlcert;
defined('MOODLE_INTERNAL') || die;
@ -33,7 +33,7 @@ require_once($CFG->libdir . '/tablelib.php');
/**
* Class for the report that displays the certificates the user has throughout the site.
*
* @package mod_customcert
* @package mod_htmlcert
* @copyright 2016 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@ -51,7 +51,7 @@ class my_certificates_table extends \table_sql {
* @param string|null $download The file type, null if we are not downloading
*/
public function __construct($userid, $download = null) {
parent::__construct('mod_customcert_report_table');
parent::__construct('mod_htmlcert_report_table');
$columns = array(
'name',
@ -62,13 +62,13 @@ class my_certificates_table extends \table_sql {
$headers = array(
get_string('name'),
get_string('course'),
get_string('receiveddate', 'customcert'),
get_string('code', 'customcert')
get_string('receiveddate', 'htmlcert'),
get_string('code', 'htmlcert')
);
// Check if we were passed a filename, which means we want to download it.
if ($download) {
$this->is_downloading($download, 'customcert-report');
$this->is_downloading($download, 'htmlcert-report');
}
if (!$this->is_downloading()) {
@ -94,7 +94,7 @@ class my_certificates_table extends \table_sql {
* @return string
*/
public function col_name($certificate) {
$cm = get_coursemodule_from_instance('customcert', $certificate->id);
$cm = get_coursemodule_from_instance('htmlcert', $certificate->id);
$context = \context_module::instance($cm->id);
return format_string($certificate->name, true, ['context' => $context]);
@ -107,7 +107,7 @@ class my_certificates_table extends \table_sql {
* @return string
*/
public function col_coursename($certificate) {
$cm = get_coursemodule_from_instance('customcert', $certificate->id);
$cm = get_coursemodule_from_instance('htmlcert', $certificate->id);
$context = \context_module::instance($cm->id);
return format_string($certificate->coursename, true, ['context' => $context]);
@ -142,8 +142,8 @@ class my_certificates_table extends \table_sql {
public function col_download($certificate) {
global $OUTPUT;
$icon = new \pix_icon('download', get_string('download'), 'customcert');
$link = new \moodle_url('/mod/customcert/my_certificates.php',
$icon = new \pix_icon('download', get_string('download'), 'htmlcert');
$link = new \moodle_url('/mod/htmlcert/my_certificates.php',
array('userid' => $this->userid,
'certificateid' => $certificate->id,
'downloadcert' => '1'));