From 50505d81960e7a39a81cf07b1ef3045ba0f0676f Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 23 Jul 2013 18:39:58 +0800 Subject: [PATCH] Introduced the course name element --- .../lang/en/customcertelement_coursename.php | 25 +++++++++++ element/coursename/lib.php | 41 +++++++++++++++++++ element/coursename/version.php | 29 +++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 element/coursename/lang/en/customcertelement_coursename.php create mode 100644 element/coursename/lib.php create mode 100644 element/coursename/version.php diff --git a/element/coursename/lang/en/customcertelement_coursename.php b/element/coursename/lang/en/customcertelement_coursename.php new file mode 100644 index 0000000..85c3b4a --- /dev/null +++ b/element/coursename/lang/en/customcertelement_coursename.php @@ -0,0 +1,25 @@ +. + +/** + * Strings for component 'customcertelement_coursename', language 'en'. + * + * @package customcertelement_coursename + * @copyright 2013 Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'Course name'; diff --git a/element/coursename/lib.php b/element/coursename/lib.php new file mode 100644 index 0000000..1a16f89 --- /dev/null +++ b/element/coursename/lib.php @@ -0,0 +1,41 @@ +. + +defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); + +require_once($CFG->dirroot . '/mod/customcert/element/element.class.php'); + +/** + * The customcert element coursename's core interaction API. + * + * @package customcertelement_coursename + * @copyright 2013 Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class customcert_element_coursename extends customcert_element_base { + + /** + * Handles rendering the element on the pdf. + * + * @param pdf $pdf the pdf object + * @param bool $preview true if it is a preview, false otherwise + */ + public function render($pdf, $preview) { + global $COURSE; + + parent::render_content($pdf, $COURSE->fullname); + } +} diff --git a/element/coursename/version.php b/element/coursename/version.php new file mode 100644 index 0000000..e1f1155 --- /dev/null +++ b/element/coursename/version.php @@ -0,0 +1,29 @@ +. + +/** + * This file contains the version information for the coursename plugin. + * + * @package customcertelement_coursename + * @copyright 2013 Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); + +$plugin->version = 2013072301; +$plugin->requires = 2013040500; // Requires this Moodle version. +$plugin->component = 'customcertelement_coursename';