diff --git a/backup/moodle2/backup_customcert_activity_task.class.php b/backup/moodle2/backup_customcert_activity_task.class.php index a071cc3..a4f2ae6 100644 --- a/backup/moodle2/backup_customcert_activity_task.class.php +++ b/backup/moodle2/backup_customcert_activity_task.class.php @@ -56,7 +56,7 @@ class backup_customcert_activity_task extends backup_activity_task { * @param string $content * @return mixed|string */ - static public function encode_content_links($content) { + public static function encode_content_links($content) { global $CFG; $base = preg_quote($CFG->wwwroot, "/"); diff --git a/backup/moodle2/restore_customcert_activity_task.class.php b/backup/moodle2/restore_customcert_activity_task.class.php index 39e6657..d21228e 100644 --- a/backup/moodle2/restore_customcert_activity_task.class.php +++ b/backup/moodle2/restore_customcert_activity_task.class.php @@ -53,7 +53,7 @@ class restore_customcert_activity_task extends restore_activity_task { /** * Define the contents in the activity that must be processed by the link decoder. */ - static public function define_decode_contents() { + public static function define_decode_contents() { $contents = array(); $contents[] = new restore_decode_content('customcert', array('intro'), 'customcert'); @@ -64,7 +64,7 @@ class restore_customcert_activity_task extends restore_activity_task { /** * Define the decoding rules for links belonging to the activity to be executed by the link decoder. */ - static public function define_decode_rules() { + public static function define_decode_rules() { $rules = array(); $rules[] = new restore_decode_rule('CUSTOMCERTVIEWBYID', '/mod/customcert/view.php?id=$1', 'course_module'); @@ -80,7 +80,7 @@ class restore_customcert_activity_task extends restore_activity_task { * * @return array the restore log rules */ - static public function define_restore_log_rules() { + public static function define_restore_log_rules() { $rules = array(); $rules[] = new restore_log_rule('customcert', 'add', 'view.php?id={course_module}', '{customcert}'); diff --git a/classes/element.php b/classes/element.php index 4d1c8e0..b812639 100644 --- a/classes/element.php +++ b/classes/element.php @@ -377,7 +377,7 @@ abstract class element { * @param bool $preview true if it is a preview, false otherwise * @param \stdClass $user the user we are rendering this for */ - public abstract function render($pdf, $preview, $user); + abstract public function render($pdf, $preview, $user); /** * Render the element in html. @@ -389,7 +389,7 @@ abstract class element { * * @return string the html */ - public abstract function render_html(); + abstract public function render_html(); /** * Handles deleting any data this element may have introduced. diff --git a/my_certificates.php b/my_certificates.php index 5ac04ea..71332aa 100644 --- a/my_certificates.php +++ b/my_certificates.php @@ -49,7 +49,7 @@ $user = \core_user::get_user($userid, '*', MUST_EXIST); // If we are viewing certificates that are not for the currently logged in user then do a capability check. if (($userid != $USER->id) && !has_capability('mod/customcert:viewallcertificates', context_system::instance())) { - print_error('You are not allowed to view these certificates'); + throw new moodle_exception('You are not allowed to view these certificates'); } $PAGE->set_url($pageurl);