From 6b93bb9300d25003eb9827e2cd05f3604aa4b738 Mon Sep 17 00:00:00 2001 From: ixiongtii <113456240+ixiongtii@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:32:52 -0600 Subject: [PATCH] move deprecated external methods as internal methods (#689) --- lib.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib.php b/lib.php index 58f49336..05463278 100755 --- a/lib.php +++ b/lib.php @@ -220,13 +220,10 @@ public function is_plugin_configured() { /** * Save the form data associated with the plugin * - * TODO: This code needs to be moved for 4.3 as the method will be completely removed from core. - * See https://tracker.moodle.org/browse/MDL-67526 - * * @global type $DB * @param object $data the form data to save */ - public function save_form_elements($data) { + public function save_form_data($data) { global $DB; $moduletiienabled = $this->get_config_settings('mod_'.$data->modulename); @@ -264,24 +261,13 @@ public function save_form_elements($data) { /** * Add the Turnitin settings form to an add/edit activity page * - * TODO: This code needs to be moved for 4.3 as the method will be completely removed from core. - * See https://tracker.moodle.org/browse/MDL-67526 - * * @param object $mform * @param object $context * @return type */ - public function get_form_elements_module($mform, $context, $modulename = "") { + public function add_settings_form_to_activity_page($mform, $context, $modulename = "") { global $DB, $PAGE, $COURSE; - // This is a bit of a hack and untidy way to ensure the form elements aren't displayed - // twice. This won't be needed once this method goes away. - // TODO: Remove once this method goes away. - static $settingsdisplayed; - if ($settingsdisplayed) { - return; - } - if (has_capability('plagiarism/turnitin:enable', $context)) { // Get Course module id and values. $cmid = optional_param('update', null, PARAM_INT); @@ -2914,7 +2900,7 @@ function plagiarism_turnitin_coursemodule_standard_elements($formwrapper, $mform $context = context_course::instance($formwrapper->get_course()->id); - $pluginturnitin->get_form_elements_module( + $pluginturnitin->add_settings_form_to_activity_page( $mform, $context, isset($formwrapper->get_current()->modulename) ? 'mod_'.$formwrapper->get_current()->modulename : ''); @@ -2929,7 +2915,7 @@ function plagiarism_turnitin_coursemodule_standard_elements($formwrapper, $mform function plagiarism_turnitin_coursemodule_edit_post_actions($data, $course) { $pluginturnitin = new plagiarism_plugin_turnitin(); - $pluginturnitin->save_form_elements($data); + $pluginturnitin->save_form_data($data); return $data; }