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 @@ +. + +$plugin->version = 2009072901; +