diff --git a/db/subplugins.php b/db/subplugins.php
index 6365fae..bbc19a5 100644
--- a/db/subplugins.php
+++ b/db/subplugins.php
@@ -25,4 +25,4 @@
defined('MOODLE_INTERNAL') || die();
-$subplugins = array('customcertelements' => 'mod/customcert/elements');
+$subplugins = array('customcertelement' => 'mod/customcert/element');
diff --git a/edit.php b/edit.php
index 616764e..c1a2c6a 100644
--- a/edit.php
+++ b/edit.php
@@ -28,7 +28,7 @@ require_once($CFG->dirroot . '/mod/customcert/lib.php');
require_once($CFG->dirroot . '/mod/customcert/edit_form.php');
require_once($CFG->dirroot . '/mod/customcert/load_template_form.php');
require_once($CFG->dirroot . '/mod/customcert/save_template_form.php');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
$cmid = required_param('cmid', PARAM_INT);
$moveup = optional_param('moveup', 0, PARAM_INT);
diff --git a/edit_element.php b/edit_element.php
index 040383e..35733cd 100644
--- a/edit_element.php
+++ b/edit_element.php
@@ -25,7 +25,7 @@
require_once('../../config.php');
require_once($CFG->dirroot . '/mod/customcert/edit_element_form.php');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
$cmid = required_param('cmid', PARAM_INT);
$action = required_param('action', PARAM_ALPHA);
diff --git a/edit_element_form.php b/edit_element_form.php
index 6b7902b..9c37cfa 100644
--- a/edit_element_form.php
+++ b/edit_element_form.php
@@ -48,7 +48,7 @@ class mod_customcert_edit_element_form extends moodleform {
// Add the field for the name of the element, this is required for all elements.
$mform->addElement('text', 'name', get_string('elementname', 'customcert'));
$mform->setType('name', PARAM_TEXT);
- $mform->setDefault('name', get_string('pluginname', 'customcertelements_' . $element->element));
+ $mform->setDefault('name', get_string('pluginname', 'customcertelement_' . $element->element));
$mform->addRule('name', get_string('required'), 'required', null, 'client');
$mform->addHelpButton('name', 'elementname', 'customcert');
diff --git a/elements/code/lang/en/customcertelements_code.php b/element/code/lang/en/customcertelement_code.php
similarity index 89%
rename from elements/code/lang/en/customcertelements_code.php
rename to element/code/lang/en/customcertelement_code.php
index 3848f7b..6d57fb7 100644
--- a/elements/code/lang/en/customcertelements_code.php
+++ b/element/code/lang/en/customcertelement_code.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_code', language 'en'.
+ * Strings for component 'customcertelement_code', language 'en'.
*
- * @package customcertelements_code
+ * @package customcertelement_code
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/code/lib.php b/element/code/lib.php
similarity index 89%
rename from elements/code/lib.php
rename to element/code/lib.php
index 87286b4..fd99dc1 100644
--- a/elements/code/lib.php
+++ b/element/code/lib.php
@@ -17,16 +17,16 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
/**
* The customcert element code's core interaction API.
*
- * @package customcertelements_code
+ * @package customcertelement_code
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_code extends customcert_elements_base {
+class customcert_element_code extends customcert_element_base {
/**
* Handles rendering the element on the pdf.
diff --git a/elements/code/version.php b/element/code/version.php
similarity index 92%
rename from elements/code/version.php
rename to element/code/version.php
index 5612e28..7461983 100644
--- a/elements/code/version.php
+++ b/element/code/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the code plugin.
*
- * @package customcertelements_code
+ * @package customcertelement_code
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_code';
+$plugin->component = 'customcertelement_code';
diff --git a/elements/date/lang/en/customcertelements_date.php b/element/date/lang/en/customcertelement_date.php
similarity index 91%
rename from elements/date/lang/en/customcertelements_date.php
rename to element/date/lang/en/customcertelement_date.php
index dfcbdae..58c4427 100644
--- a/elements/date/lang/en/customcertelements_date.php
+++ b/element/date/lang/en/customcertelement_date.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_date', language 'en'.
+ * Strings for component 'customcertelement_date', language 'en'.
*
- * @package customcertelements_date
+ * @package customcertelement_date
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/date/lib.php b/element/date/lib.php
similarity index 87%
rename from elements/date/lib.php
rename to element/date/lib.php
index 20bd145..6eedfe4 100644
--- a/elements/date/lib.php
+++ b/element/date/lib.php
@@ -17,17 +17,17 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
-require_once($CFG->dirroot . '/mod/customcert/elements/grade/lib.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/grade/lib.php');
/**
* The customcert element date's core interaction API.
*
- * @package customcertelements_date
+ * @package customcertelement_date
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_date extends customcert_elements_base {
+class customcert_element_date extends customcert_element_base {
/**
* Constructor.
@@ -61,13 +61,13 @@ class customcert_elements_date extends customcert_elements_base {
$dateoptions = array();
$dateoptions['1'] = get_string('issueddate', 'certificate');
$dateoptions['2'] = get_string('completiondate', 'certificate');
- $dateoptions = $dateoptions + customcert_elements_grade::get_grade_items();
+ $dateoptions = $dateoptions + customcert_element_grade::get_grade_items();
- $mform->addElement('select', 'dateitem', get_string('dateitem', 'customcertelements_date'), $dateoptions);
- $mform->addHelpButton('dateitem', 'dateitem', 'customcertelements_date');
+ $mform->addElement('select', 'dateitem', get_string('dateitem', 'customcertelement_date'), $dateoptions);
+ $mform->addHelpButton('dateitem', 'dateitem', 'customcertelement_date');
- $mform->addElement('select', 'dateformat', get_string('dateformat', 'customcertelements_date'), self::get_date_formats());
- $mform->addHelpButton('dateformat', 'dateformat', 'customcertelements_date');
+ $mform->addElement('select', 'dateformat', get_string('dateformat', 'customcertelement_date'), self::get_date_formats());
+ $mform->addHelpButton('dateformat', 'dateformat', 'customcertelement_date');
parent::render_form_elements($mform);
}
diff --git a/elements/date/version.php b/element/date/version.php
similarity index 92%
rename from elements/date/version.php
rename to element/date/version.php
index 632b025..7ccba01 100644
--- a/elements/date/version.php
+++ b/element/date/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the date plugin.
*
- * @package customcertelements_date
+ * @package customcertelement_date
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_date';
+$plugin->component = 'customcertelement_date';
diff --git a/elements/element.class.php b/element/element.class.php
similarity index 95%
rename from elements/element.class.php
rename to element/element.class.php
index 11cdb9c..79d6cc6 100644
--- a/elements/element.class.php
+++ b/element/element.class.php
@@ -28,11 +28,11 @@ require_once($CFG->dirroot . '/mod/customcert/includes/tcpdf_colors.php');
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
/**
- * Class customcert_elements_base
+ * Class customcert_element_base
*
* All customercert element plugins are based on this class.
*/
-abstract class customcert_elements_base {
+abstract class customcert_element_base {
/**
* The data for the element we are adding.
@@ -56,9 +56,9 @@ abstract class customcert_elements_base {
*/
public function render_form_elements($mform) {
// Render the common elements.
- $this->render_form_elements_font($mform);
- $this->render_form_elements_colour($mform);
- $this->render_form_elements_position($mform);
+ $this->render_form_element_font($mform);
+ $this->render_form_element_colour($mform);
+ $this->render_form_element_position($mform);
}
/**
@@ -92,8 +92,8 @@ abstract class customcert_elements_base {
$errors = array();
// Common validation methods.
- $errors += $this->validate_form_elements_colour($data);
- $errors += $this->validate_form_elements_position($data);
+ $errors += $this->validate_form_element_colour($data);
+ $errors += $this->validate_form_element_position($data);
return $errors;
}
@@ -231,7 +231,7 @@ abstract class customcert_elements_base {
*
* @param mod_customcert_edit_element_form $mform the edit_form instance.
*/
- public function render_form_elements_font($mform) {
+ public function render_form_element_font($mform) {
$mform->addElement('select', 'font', get_string('font', 'customcert'), customcert_get_fonts());
$mform->setType('font', PARAM_TEXT);
$mform->setDefault('font', 'times');
@@ -248,7 +248,7 @@ abstract class customcert_elements_base {
*
* @param mod_customcert_edit_element_form $mform the edit_form instance.
*/
- public function render_form_elements_colour($mform) {
+ public function render_form_element_colour($mform) {
$mform->addElement('customcert_colourpicker', 'colour', get_string('fontcolour', 'customcert'));
$mform->setType('colour', PARAM_RAW); // Need to validate that this is a valid colour.
$mform->setDefault('colour', '#000000');
@@ -260,7 +260,7 @@ abstract class customcert_elements_base {
*
* @param mod_customcert_edit_element_form $mform the edit_form instance.
*/
- public function render_form_elements_position($mform) {
+ public function render_form_element_position($mform) {
$mform->addElement('text', 'posx', get_string('posx', 'customcert'), array('size' => 10));
$mform->setType('posx', PARAM_INT);
$mform->setDefault('posx', '0');
@@ -278,7 +278,7 @@ abstract class customcert_elements_base {
* @param array $data the submitted data
* @return array the validation errors
*/
- public function validate_form_elements_colour($data) {
+ public function validate_form_element_colour($data) {
$errors = array();
// Validate the colour.
@@ -295,7 +295,7 @@ abstract class customcert_elements_base {
* @param array $data the submitted data
* @return array the validation errors
*/
- public function validate_form_elements_position($data) {
+ public function validate_form_element_position($data) {
$errors = array();
// Check if posx is not set, or not numeric or less than 0.
diff --git a/elements/grade/lang/en/customcertelements_grade.php b/element/grade/lang/en/customcertelement_grade.php
similarity index 92%
rename from elements/grade/lang/en/customcertelements_grade.php
rename to element/grade/lang/en/customcertelement_grade.php
index 619574b..e099cdc 100644
--- a/elements/grade/lang/en/customcertelements_grade.php
+++ b/element/grade/lang/en/customcertelement_grade.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_grade', language 'en'.
+ * Strings for component 'customcertelement_grade', language 'en'.
*
- * @package customcertelements_grade
+ * @package customcertelement_grade
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/grade/lib.php b/element/grade/lib.php
similarity index 94%
rename from elements/grade/lib.php
rename to element/grade/lib.php
index 3f7d84e..19f55e5 100644
--- a/elements/grade/lib.php
+++ b/element/grade/lib.php
@@ -17,7 +17,7 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
require_once($CFG->libdir . '/grade/constants.php');
require_once($CFG->dirroot . '/grade/lib.php');
require_once($CFG->dirroot . '/grade/querylib.php');
@@ -30,11 +30,11 @@ define('CUSTOMCERT_GRADE_COURSE', '0');
/**
* The customcert element grade's core interaction API.
*
- * @package customcertelements_grade
+ * @package customcertelement_grade
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_grade extends customcert_elements_base {
+class customcert_element_grade extends customcert_element_base {
/**
* Constructor.
@@ -66,18 +66,18 @@ class customcert_elements_grade extends customcert_elements_base {
public function render_form_elements($mform) {
// Get the grade items we can display.
$gradeitems = array();
- $gradeitems[CUSTOMCERT_GRADE_COURSE] = get_string('coursegrade', 'customcertelements_grade');
+ $gradeitems[CUSTOMCERT_GRADE_COURSE] = get_string('coursegrade', 'customcertelement_grade');
$gradeitems = $gradeitems + self::get_grade_items();
// The grade items.
- $mform->addElement('select', 'gradeitem', get_string('gradeitem', 'customcertelements_grade'), $gradeitems);
+ $mform->addElement('select', 'gradeitem', get_string('gradeitem', 'customcertelement_grade'), $gradeitems);
$mform->setType('gradeitem', PARAM_INT);
- $mform->addHelpButton('gradeitem', 'gradeitem', 'customcertelements_grade');
+ $mform->addHelpButton('gradeitem', 'gradeitem', 'customcertelement_grade');
// The grade format.
- $mform->addElement('select', 'gradeformat', get_string('gradeformat', 'customcertelements_grade'), self::get_grade_format_options());
+ $mform->addElement('select', 'gradeformat', get_string('gradeformat', 'customcertelement_grade'), self::get_grade_format_options());
$mform->setType('gradeformat', PARAM_INT);
- $mform->addHelpButton('gradeformat', 'gradeformat', 'customcertelements_grade');
+ $mform->addHelpButton('gradeformat', 'gradeformat', 'customcertelement_grade');
parent::render_form_elements($mform);
}
@@ -190,9 +190,9 @@ class customcert_elements_grade extends customcert_elements_base {
*/
public static function get_grade_format_options() {
$gradeformat = array();
- $gradeformat[GRADE_DISPLAY_TYPE_REAL] = get_string('gradepoints', 'customcertelements_grade');
- $gradeformat[GRADE_DISPLAY_TYPE_PERCENTAGE] = get_string('gradepercent', 'customcertelements_grade');
- $gradeformat[GRADE_DISPLAY_TYPE_LETTER] = get_string('gradeletter', 'customcertelements_grade');
+ $gradeformat[GRADE_DISPLAY_TYPE_REAL] = get_string('gradepoints', 'customcertelement_grade');
+ $gradeformat[GRADE_DISPLAY_TYPE_PERCENTAGE] = get_string('gradepercent', 'customcertelement_grade');
+ $gradeformat[GRADE_DISPLAY_TYPE_LETTER] = get_string('gradeletter', 'customcertelement_grade');
return $gradeformat;
}
diff --git a/elements/grade/version.php b/element/grade/version.php
similarity index 92%
rename from elements/grade/version.php
rename to element/grade/version.php
index 5face0e..ad7f4e5 100644
--- a/elements/grade/version.php
+++ b/element/grade/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the grade plugin.
*
- * @package customcertelements_grade
+ * @package customcertelement_grade
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_grade';
+$plugin->component = 'customcertelement_grade';
diff --git a/elements/image/lang/en/customcertelements_image.php b/element/image/lang/en/customcertelement_image.php
similarity index 92%
rename from elements/image/lang/en/customcertelements_image.php
rename to element/image/lang/en/customcertelement_image.php
index 1d6def0..3072026 100644
--- a/elements/image/lang/en/customcertelements_image.php
+++ b/element/image/lang/en/customcertelement_image.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_image', language 'en'.
+ * Strings for component 'customcertelement_image', language 'en'.
*
- * @package customcertelements_image
+ * @package customcertelement_image
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/image/lib.php b/element/image/lib.php
similarity index 90%
rename from elements/image/lib.php
rename to element/image/lib.php
index 33df5b6..4673cf2 100644
--- a/elements/image/lib.php
+++ b/element/image/lib.php
@@ -17,16 +17,16 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
/**
* The customcert element image's core interaction API.
*
- * @package customcertelements_image
+ * @package customcertelement_image
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_image extends customcert_elements_base {
+class customcert_element_image extends customcert_element_base {
/**
* Constructor.
@@ -60,17 +60,17 @@ class customcert_elements_image extends customcert_elements_base {
* @param mod_customcert_edit_element_form $mform the edit_form instance
*/
public function render_form_elements($mform) {
- $mform->addElement('select', 'image', get_string('image', 'customcertelements_image'), self::get_images());
+ $mform->addElement('select', 'image', get_string('image', 'customcertelement_image'), self::get_images());
- $mform->addElement('text', 'width', get_string('width', 'customcertelements_image'), array('size' => 10));
+ $mform->addElement('text', 'width', get_string('width', 'customcertelement_image'), array('size' => 10));
$mform->setType('width', PARAM_INT);
- $mform->addHelpButton('width', 'width', 'customcertelements_image');
+ $mform->addHelpButton('width', 'width', 'customcertelement_image');
- $mform->addElement('text', 'height', get_string('height', 'customcertelements_image'), array('size' => 10));
+ $mform->addElement('text', 'height', get_string('height', 'customcertelement_image'), array('size' => 10));
$mform->setType('height', PARAM_INT);
- $mform->addHelpButton('height', 'height', 'customcertelements_image');
+ $mform->addHelpButton('height', 'height', 'customcertelement_image');
- parent::render_form_elements_position($mform);
+ parent::render_form_element_position($mform);
}
/**
@@ -86,16 +86,16 @@ class customcert_elements_image extends customcert_elements_base {
// Check if width is not set, or not numeric or less than 0.
if ((!isset($data['width'])) || (!is_numeric($data['width'])) || ($data['width'] < 0)) {
- $errors['width'] = get_string('invalidwidth', 'customcertelements_image');
+ $errors['width'] = get_string('invalidwidth', 'customcertelement_image');
}
// Check if height is not set, or not numeric or less than 0.
if ((!isset($data['height'])) || (!is_numeric($data['height'])) || ($data['height'] < 0)) {
- $errors['height'] = get_string('invalidheight', 'customcertelements_image');
+ $errors['height'] = get_string('invalidheight', 'customcertelement_image');
}
// Validate the position.
- $errors += $this->validate_form_elements_position($data);
+ $errors += $this->validate_form_element_position($data);
return $errors;
}
diff --git a/elements/image/version.php b/element/image/version.php
similarity index 92%
rename from elements/image/version.php
rename to element/image/version.php
index 0d1bf88..557eae9 100644
--- a/elements/image/version.php
+++ b/element/image/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the image plugin.
*
- * @package customcertelements_image
+ * @package customcertelement_image
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_image';
+$plugin->component = 'customcertelement_image';
diff --git a/elements/studentname/lang/en/customcertelements_studentname.php b/element/studentname/lang/en/customcertelement_studentname.php
similarity index 88%
rename from elements/studentname/lang/en/customcertelements_studentname.php
rename to element/studentname/lang/en/customcertelement_studentname.php
index dae62fb..539dafb 100644
--- a/elements/studentname/lang/en/customcertelements_studentname.php
+++ b/element/studentname/lang/en/customcertelement_studentname.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_studentname', language 'en'.
+ * Strings for component 'customcertelement_studentname', language 'en'.
*
- * @package customcertelements_studentname
+ * @package customcertelement_studentname
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/studentname/lib.php b/element/studentname/lib.php
similarity index 86%
rename from elements/studentname/lib.php
rename to element/studentname/lib.php
index af7a3a6..ae34d08 100644
--- a/elements/studentname/lib.php
+++ b/element/studentname/lib.php
@@ -17,16 +17,16 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
/**
* The customcert element studentname's core interaction API.
*
- * @package customcertelements_studentname
+ * @package customcertelement_studentname
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_studentname extends customcert_elements_base {
+class customcert_element_studentname extends customcert_element_base {
/**
* Handles rendering the element on the pdf.
diff --git a/elements/studentname/version.php b/element/studentname/version.php
similarity index 91%
rename from elements/studentname/version.php
rename to element/studentname/version.php
index c94a945..926038f 100644
--- a/elements/studentname/version.php
+++ b/element/studentname/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the studentname plugin.
*
- * @package customcertelements_studentname
+ * @package customcertelement_studentname
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_studentname';
+$plugin->component = 'customcertelement_studentname';
diff --git a/elements/text/lang/en/customcertelements_text.php b/element/text/lang/en/customcertelement_text.php
similarity index 90%
rename from elements/text/lang/en/customcertelements_text.php
rename to element/text/lang/en/customcertelement_text.php
index ed1c3ff..355e7d1 100644
--- a/elements/text/lang/en/customcertelements_text.php
+++ b/element/text/lang/en/customcertelement_text.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_text', language 'en'.
+ * Strings for component 'customcertelement_text', language 'en'.
*
- * @package customcertelements_text
+ * @package customcertelement_text
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/text/lib.php b/element/text/lib.php
similarity index 90%
rename from elements/text/lib.php
rename to element/text/lib.php
index 66d0b1a..baa0b61 100644
--- a/elements/text/lib.php
+++ b/element/text/lib.php
@@ -17,16 +17,16 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
/**
* The customcert element text's core interaction API.
*
- * @package customcertelements_text
+ * @package customcertelement_text
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_text extends customcert_elements_base {
+class customcert_element_text extends customcert_element_base {
/**
* Constructor.
@@ -45,9 +45,9 @@ class customcert_elements_text extends customcert_elements_base {
* @param mod_customcert_edit_element_form $mform the edit_form instance
*/
public function render_form_elements($mform) {
- $mform->addElement('textarea', 'text', get_string('text', 'customcertelements_text'));
+ $mform->addElement('textarea', 'text', get_string('text', 'customcertelement_text'));
$mform->setType('text', PARAM_RAW);
- $mform->addHelpButton('text', 'text', 'customcertelements_text');
+ $mform->addHelpButton('text', 'text', 'customcertelement_text');
parent::render_form_elements($mform);
}
diff --git a/elements/text/version.php b/element/text/version.php
similarity index 92%
rename from elements/text/version.php
rename to element/text/version.php
index 88c6df2..1cd620a 100644
--- a/elements/text/version.php
+++ b/element/text/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the text plugin.
*
- * @package customcertelements_text
+ * @package customcertelement_text
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061200;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_text';
+$plugin->component = 'customcertelement_text';
diff --git a/elements/userfield/lang/en/customcertelements_userfield.php b/element/userfield/lang/en/customcertelement_userfield.php
similarity index 89%
rename from elements/userfield/lang/en/customcertelements_userfield.php
rename to element/userfield/lang/en/customcertelement_userfield.php
index d833475..f8ae6bc 100644
--- a/elements/userfield/lang/en/customcertelements_userfield.php
+++ b/element/userfield/lang/en/customcertelement_userfield.php
@@ -16,9 +16,9 @@
// along with Moodle. If not, see .
/**
- * Strings for component 'customcertelements_userfield', language 'en'.
+ * Strings for component 'customcertelement_userfield', language 'en'.
*
- * @package customcertelements_userfield
+ * @package customcertelement_userfield
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/elements/userfield/lib.php b/element/userfield/lib.php
similarity index 91%
rename from elements/userfield/lib.php
rename to element/userfield/lib.php
index e07baac..a92b230 100644
--- a/elements/userfield/lib.php
+++ b/element/userfield/lib.php
@@ -17,16 +17,16 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-require_once($CFG->dirroot . '/mod/customcert/elements/element.class.php');
+require_once($CFG->dirroot . '/mod/customcert/element/element.class.php');
/**
* The customcert element userfield's core interaction API.
*
- * @package customcertelements_userfield
+ * @package customcertelement_userfield
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class customcert_elements_userfield extends customcert_elements_base {
+class customcert_element_userfield extends customcert_element_base {
/**
* Constructor.
@@ -50,9 +50,9 @@ class customcert_elements_userfield extends customcert_elements_base {
collatorlib::asort($userfields);
// Create the select box where the user field is selected.
- $mform->addElement('select', 'userfield', get_string('userfield', 'customcertelements_userfield'), $userfields);
+ $mform->addElement('select', 'userfield', get_string('userfield', 'customcertelement_userfield'), $userfields);
$mform->setType('userfield', PARAM_ALPHANUM);
- $mform->addHelpButton('userfield', 'userfield', 'customcertelements_userfield');
+ $mform->addHelpButton('userfield', 'userfield', 'customcertelement_userfield');
parent::render_form_elements($mform);
}
diff --git a/elements/userfield/version.php b/element/userfield/version.php
similarity index 91%
rename from elements/userfield/version.php
rename to element/userfield/version.php
index c165a02..e5a8e4b 100644
--- a/elements/userfield/version.php
+++ b/element/userfield/version.php
@@ -18,7 +18,7 @@
/**
* This file contains the version information for the userfield plugin.
*
- * @package customcertelements_userfield
+ * @package customcertelement_userfield
* @copyright Mark Nelson
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -27,4 +27,4 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2013061400;
$plugin->requires = 2013040500; // Requires this Moodle version.
-$plugin->component = 'customcertelements_userfield';
+$plugin->component = 'customcertelement_userfield';
diff --git a/lib.php b/lib.php
index b9144c0..f072b3b 100644
--- a/lib.php
+++ b/lib.php
@@ -375,7 +375,7 @@ function customcert_get_elements() {
$options = array();
// Check that the directory exists.
- $elementdir = "$CFG->dirroot/mod/customcert/elements";
+ $elementdir = "$CFG->dirroot/mod/customcert/element";
if (file_exists($elementdir)) {
// Get directory contents.
$elementfolders = new DirectoryIterator($elementdir);
@@ -392,13 +392,13 @@ function customcert_get_elements() {
if (file_exists($classfile)) {
// Need to require this file in case if we choose to add this element.
require_once($classfile);
- $component = "customcertelements_{$foldername}";
+ $component = "customcertelement_{$foldername}";
$options[$foldername] = get_string('pluginname', $component);
}
}
}
- asort($options);
+ collatorlib::asort($options);
return $options;
}
@@ -510,11 +510,11 @@ function customcert_save_page_data($data) {
function customcert_get_element_instance($element) {
global $CFG;
- $classfile = "$CFG->dirroot/mod/customcert/elements/{$element->element}/lib.php";
+ $classfile = "$CFG->dirroot/mod/customcert/element/{$element->element}/lib.php";
// Ensure this necessary file exists.
if (file_exists($classfile)) {
require_once($classfile);
- $classname = "customcert_elements_{$element->element}";
+ $classname = "customcert_element_{$element->element}";
return new $classname($element);
}