From bf9df1f0193eb2095dfd06cc04f9bb6c0a3f5d91 Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Wed, 5 Feb 2014 19:53:49 -0200 Subject: [PATCH] =?UTF-8?q?Bloco=20de=20verifica=C3=A7=C3=A3o=20de=20certi?= =?UTF-8?q?ficados=20para=20Moodle=202.1=20ou=20superior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++- block_verify_certificate.php | 35 ++++++++++++++++++ index.php | 46 ++++++++++++++++++++++++ lang/de/block_verify_certificate.php | 11 ++++++ lang/en/block_verify_certificate.php | 11 ++++++ lang/pt_br/block_verify_certificate.php | 11 ++++++ print.gif | Bin 0 -> 411 bytes printstyle.css | 21 +++++++++++ version.php | 19 ++++++++++ 9 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 block_verify_certificate.php create mode 100644 index.php create mode 100644 lang/de/block_verify_certificate.php create mode 100644 lang/en/block_verify_certificate.php create mode 100644 lang/pt_br/block_verify_certificate.php create mode 100644 print.gif create mode 100644 printstyle.css create mode 100644 version.php diff --git a/README.md b/README.md index 507c1cb..d92f8d9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ -moodle_block_verify_certificate +Moodle block Verify certificate =============================== + +This module was written by Jean-Michel Védrine and my only contribution was to add the Brazilian Portuguese localization file. diff --git a/block_verify_certificate.php b/block_verify_certificate.php new file mode 100644 index 0000000..ba99e4e --- /dev/null +++ b/block_verify_certificate.php @@ -0,0 +1,35 @@ +title = get_string('title', 'block_verify_certificate'); + } + + function applicable_formats() { + return array('all' => true); + } + function get_content() { + + if ($this->content !== NULL) { + return $this->content; + } + + $this->content = new stdClass; + $this->content->text = '

'.get_string('entercode', 'certificate').'

'; + $url = new moodle_url('/blocks/verify_certificate/index.php'); + $this->content->text .= '
'; + + $this->content->text .= ''; + $this->content->text .= '
'; + $this->content->text .= '
'; + $this->content->footer = ''; + + return $this->content; +} +function instance_allow_config() { + return false; +} + +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..156c861 --- /dev/null +++ b/index.php @@ -0,0 +1,46 @@ +set_pagelayout('standard'); + $strverify = get_string('verifycertificate', 'block_verify_certificate'); + $PAGE->set_url('/blocks/verify_certificate/index.php', array('certnumber' => $id)); + $context = get_context_instance(CONTEXT_SYSTEM); + $PAGE->set_context($context); + + /// Print the header + + $PAGE->navbar->add($strverify); + $PAGE->set_title($strverify); + $PAGE->set_heading($strverify); + $PAGE->requires->css('/blocks/verify_certificate/printstyle.css'); + echo $OUTPUT->header(); + $certificate = $DB->get_records_sql("SELECT s.* + FROM {certificate_issues} s + WHERE s.code = ?", array($id)); + if (! $certificate) { + echo $OUTPUT->box_start('generalbox boxaligncenter'); + echo get_string('notfound', 'block_verify_certificate'); + echo $OUTPUT->box_end(); + } else { + echo $OUTPUT->box_start('generalbox boxaligncenter'); + echo ""; + /// Print Section + foreach ($certificate as $certrecord) { + $certificatedate = userdate($certrecord->timecreated); + echo '

' . get_string('certificate', 'block_verify_certificate') . ' ' . $certrecord->code . '

'; + echo '

' . get_string('to', 'block_verify_certificate') . ': ' . $certrecord->studentname . '
'; + echo '

' . get_string('course', 'block_verify_certificate') . ': ' . $certrecord->classname . '
'; + echo '

' . get_string('date', 'block_verify_certificate') . ': ' . $certificatedate . '

'; + if ($certrecord->reportgrade != null) { + echo '

' . get_string('grade', 'block_verify_certificate') . ': ' . $certrecord->reportgrade . '

'; + } + } + echo $OUTPUT->box_end(); + } + echo $OUTPUT->footer(); \ No newline at end of file diff --git a/lang/de/block_verify_certificate.php b/lang/de/block_verify_certificate.php new file mode 100644 index 0000000..e863964 --- /dev/null +++ b/lang/de/block_verify_certificate.php @@ -0,0 +1,11 @@ +dWoB%}sY;0@~l=D+lUA4W|?e_g%d$xkV z;Y2zx-RARVf3L8xzFDHuD=jbJ+}{9j
Nn4`6fjFq*|>od6jPEJ!HAt_qJ|7K=p z|NsBR#l__A_>tZJ7#JL%zrfAY%9%qTpwS. + +$plugin->version = 2009072901; +