Renamed the element directory name to a singular to conform to Moodle standards

This commit is contained in:
Mark Nelson 2013-06-21 17:35:14 +08:00
parent aed32cc843
commit 96e1d93024
27 changed files with 97 additions and 97 deletions

View file

@ -25,4 +25,4 @@
defined('MOODLE_INTERNAL') || die();
$subplugins = array('customcertelements' => 'mod/customcert/elements');
$subplugins = array('customcertelement' => 'mod/customcert/element');

View file

@ -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);

View file

@ -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);

View file

@ -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');

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_code', language 'en'.
* Strings for component 'customcertelement_code', language 'en'.
*
* @package customcertelements_code
* @package customcertelement_code
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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.

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the code plugin.
*
* @package customcertelements_code
* @package customcertelement_code
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_date', language 'en'.
* Strings for component 'customcertelement_date', language 'en'.
*
* @package customcertelements_date
* @package customcertelement_date
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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);
}

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the date plugin.
*
* @package customcertelements_date
* @package customcertelement_date
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -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.

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_grade', language 'en'.
* Strings for component 'customcertelement_grade', language 'en'.
*
* @package customcertelements_grade
* @package customcertelement_grade
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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;
}

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the grade plugin.
*
* @package customcertelements_grade
* @package customcertelement_grade
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_image', language 'en'.
* Strings for component 'customcertelement_image', language 'en'.
*
* @package customcertelements_image
* @package customcertelement_image
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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;
}

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the image plugin.
*
* @package customcertelements_image
* @package customcertelement_image
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_studentname', language 'en'.
* Strings for component 'customcertelement_studentname', language 'en'.
*
* @package customcertelements_studentname
* @package customcertelement_studentname
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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.

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the studentname plugin.
*
* @package customcertelements_studentname
* @package customcertelement_studentname
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_text', language 'en'.
* Strings for component 'customcertelement_text', language 'en'.
*
* @package customcertelements_text
* @package customcertelement_text
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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);
}

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the text plugin.
*
* @package customcertelements_text
* @package customcertelement_text
* @copyright Mark Nelson <markn@moodle.com>
* @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';

View file

@ -16,9 +16,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'customcertelements_userfield', language 'en'.
* Strings for component 'customcertelement_userfield', language 'en'.
*
* @package customcertelements_userfield
* @package customcertelement_userfield
* @copyright Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

View file

@ -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 <markn@moodle.com>
* @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);
}

View file

@ -18,7 +18,7 @@
/**
* This file contains the version information for the userfield plugin.
*
* @package customcertelements_userfield
* @package customcertelement_userfield
* @copyright Mark Nelson <markn@moodle.com>
* @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';

10
lib.php
View file

@ -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);
}