From cdb68b251321cfabf1faf31fba17f141faeeb0d3 Mon Sep 17 00:00:00 2001 From: "Shamiso.Jaravaza" <33659194+ssj365@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:32:51 -0600 Subject: [PATCH] MOOD-45: Rename flexurl to bnurl (#14) --- README.md | 14 +-- ...> backup_bbbext_bnurl_subplugin.class.php} | 8 +- ... restore_bbbext_bnurl_subplugin.class.php} | 10 +- classes/bigbluebuttonbn/action_url_addons.php | 16 +-- classes/bigbluebuttonbn/mod_form_addons.php | 100 +++++++++--------- .../bigbluebuttonbn/mod_instance_helper.php | 26 ++--- classes/utils.php | 18 ++-- db/install.xml | 4 +- .../{bbbext_flexurl.php => bbbext_bnurl.php} | 4 +- settings.php | 10 +- .../bigbluebutton/action_url_addons_tests.php | 14 +-- tests/utils_test.php | 14 +-- version.php | 4 +- 13 files changed, 121 insertions(+), 121 deletions(-) rename backup/moodle2/{backup_bbbext_flexurl_subplugin.class.php => backup_bbbext_bnurl_subplugin.class.php} (92%) rename backup/moodle2/{restore_bbbext_flexurl_subplugin.class.php => restore_bbbext_bnurl_subplugin.class.php} (85%) rename lang/en/{bbbext_flexurl.php => bbbext_bnurl.php} (96%) diff --git a/README.md b/README.md index ed675d2..db1247c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -BigBlueButton Extension - FlexURL +BigBlueButton Extension - BN URL ======================= * Copyright: Blindside Networks Inc * License: GNU GENERAL PUBLIC LICENSE Version 3 Overview =========== -The FlexURL subplugin enhances the BigBlueButtonBN module by passing additional parameters when a BigBlueButtonBN session is created, joined or both. The parameters can be custom defined, or information from user, course and activity module. +The BN URL subplugin enhances the BigBlueButtonBN module by passing additional parameters when a BigBlueButtonBN session is created, joined or both. The parameters can be custom defined, or information from user, course and activity module. Features =========== @@ -22,15 +22,15 @@ Git installation ------------ 1. Clone the repository: -`git clone https://github.com/blindsidenetworks-ps/moodle-bbbext_flexurl.git` +`git clone https://github.com/blindsidenetworks-ps/moodle-bbbext_bnurl.git` 2. Rename the downloaded directory: -`mv moodle-bbbext_flexurl flexurl` +`mv moodle-bbbext_bnurl bnurl` 3. Move the folder to the Moodle BigBlueButtonBN extensions directory: -`mv flexurl /var/www/html/moodle/mod/bigbluebuttonbn/extension/` +`mv bnurl /var/www/html/moodle/mod/bigbluebuttonbn/extension/` 4. Run the Moodle upgrade script: @@ -40,7 +40,7 @@ Manual installation ------------ 1. Download the sub plugin zip file and extract it. 2. Place the extracted folder into `mod/bigbluebuttonbn/extension/` -3. Rename the folder `flexurl` +3. Rename the folder `bnurl` 4. Access Moodle's Admin UI at `Site administration > Plugins > Install plugins` to complete the installation. Configuration @@ -86,4 +86,4 @@ Requirements ============ Requires BigBlueButtonBN module version > 2022112802 -For more detailed updates and support, visit the [FlexURL Subplugin GitHub Repository](https://github.com/blindsidenetworks-ps/moodle-bbbext_flexurl) \ No newline at end of file +For more detailed updates and support, visit the [BN URL Subplugin GitHub Repository](https://github.com/blindsidenetworks-ps/moodle-bbbext_bnurl) \ No newline at end of file diff --git a/backup/moodle2/backup_bbbext_flexurl_subplugin.class.php b/backup/moodle2/backup_bbbext_bnurl_subplugin.class.php similarity index 92% rename from backup/moodle2/backup_bbbext_flexurl_subplugin.class.php rename to backup/moodle2/backup_bbbext_bnurl_subplugin.class.php index ad3add8..b40775e 100644 --- a/backup/moodle2/backup_bbbext_flexurl_subplugin.class.php +++ b/backup/moodle2/backup_bbbext_bnurl_subplugin.class.php @@ -17,12 +17,12 @@ /** * Provides the information for backup. * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) */ -class backup_bbbext_flexurl_subplugin extends backup_subplugin { +class backup_bbbext_bnurl_subplugin extends backup_subplugin { /** * Returns the subplugin information to attach the BigBlueButton instance. @@ -35,7 +35,7 @@ protected function define_bigbluebuttonbn_subplugin_structure() { $subplugin = $this->get_subplugin_element(); $subpluginwrapper = new backup_nested_element($this->get_recommended_name()); $subpluginelement = new backup_nested_element( - 'bbbext_flexurl', + 'bbbext_bnurl', null, ['eventtype', 'paramname', 'paramvalue'] ); @@ -46,7 +46,7 @@ protected function define_bigbluebuttonbn_subplugin_structure() { // Set source to populate the data. $subpluginelement->set_source_table( - 'bbbext_flexurl', + 'bbbext_bnurl', ['bigbluebuttonbnid' => backup::VAR_PARENTID] ); diff --git a/backup/moodle2/restore_bbbext_flexurl_subplugin.class.php b/backup/moodle2/restore_bbbext_bnurl_subplugin.class.php similarity index 85% rename from backup/moodle2/restore_bbbext_flexurl_subplugin.class.php rename to backup/moodle2/restore_bbbext_bnurl_subplugin.class.php index 7155444..d187a2c 100644 --- a/backup/moodle2/restore_bbbext_flexurl_subplugin.class.php +++ b/backup/moodle2/restore_bbbext_bnurl_subplugin.class.php @@ -18,12 +18,12 @@ * Provides the information for restore. * * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) */ -class restore_bbbext_flexurl_subplugin extends restore_subplugin { +class restore_bbbext_bnurl_subplugin extends restore_subplugin { /** * Returns the paths to be handled by the subplugin. * @@ -34,7 +34,7 @@ protected function define_bigbluebuttonbn_subplugin_structure() { $elename = $this->get_namefor('bigbluebuttonbn'); // We used get_recommended_name() so this works. - $elepath = $this->get_pathfor('/bbbext_flexurl'); + $elepath = $this->get_pathfor('/bbbext_bnurl'); $paths[] = new restore_path_element($elename, $elepath); return $paths; @@ -45,11 +45,11 @@ protected function define_bigbluebuttonbn_subplugin_structure() { * * @param mixed $data */ - public function process_bbbext_flexurl_bigbluebuttonbn($data) { + public function process_bbbext_bnurl_bigbluebuttonbn($data) { global $DB; $data = (object) $data; $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn'); - $DB->insert_record('bbbext_flexurl', $data); + $DB->insert_record('bbbext_bnurl', $data); } } diff --git a/classes/bigbluebuttonbn/action_url_addons.php b/classes/bigbluebuttonbn/action_url_addons.php index 75d4b4c..c8e5efa 100644 --- a/classes/bigbluebuttonbn/action_url_addons.php +++ b/classes/bigbluebuttonbn/action_url_addons.php @@ -14,16 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl\bigbluebuttonbn; +namespace bbbext_bnurl\bigbluebuttonbn; -use bbbext_flexurl\utils; +use bbbext_bnurl\utils; use core_form\util; use mod_bigbluebuttonbn\instance; /** * A single action class to mutate the action URL. * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -44,16 +44,16 @@ public function execute(string $action = '', array $data = [], array $metadata = global $DB; if ($instanceid) { $instance = instance::get_from_instanceid($instanceid); - $flexurlrecords = $DB->get_records(mod_instance_helper::SUBPLUGIN_TABLE, [ + $bnurlrecords = $DB->get_records(mod_instance_helper::SUBPLUGIN_TABLE, [ 'bigbluebuttonbnid' => $instanceid, ]); $eventtypes = array_flip(utils::ACTION_CODES); - foreach ($flexurlrecords as $flexurlrecord) { - if ($flexurlrecord->eventtype != utils::ACTION_CODES['all'] && - $eventtypes[$flexurlrecord->eventtype] != $action) { + foreach ($bnurlrecords as $bnurlrecord) { + if ($bnurlrecord->eventtype != utils::ACTION_CODES['all'] && + $eventtypes[$bnurlrecord->eventtype] != $action) { continue; } - $data[$flexurlrecord->paramname] = utils::get_real_value($flexurlrecord->paramvalue, $instance); + $data[$bnurlrecord->paramname] = utils::get_real_value($bnurlrecord->paramvalue, $instance); } } diff --git a/classes/bigbluebuttonbn/mod_form_addons.php b/classes/bigbluebuttonbn/mod_form_addons.php index 13114c4..303f6a1 100644 --- a/classes/bigbluebuttonbn/mod_form_addons.php +++ b/classes/bigbluebuttonbn/mod_form_addons.php @@ -14,15 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl\bigbluebuttonbn; +namespace bbbext_bnurl\bigbluebuttonbn; -use bbbext_flexurl\utils; +use bbbext_bnurl\utils; use stdClass; /** * A class for the main mod form extension * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -42,7 +42,7 @@ public function __construct(\MoodleQuickForm &$mform, ?stdClass $bigbluebuttonbn if (!empty($bigbluebuttonbndata->id)) { $data = $this->retrieve_additional_data($bigbluebuttonbndata->id); $this->bigbluebuttonbndata = (object) array_merge((array) $this->bigbluebuttonbndata, $data); - $this->bigbluebuttonbndata->flexurl_paramcount = count($data["flexurl_".array_key_first(utils::PARAM_TYPES)] ?? []); + $this->bigbluebuttonbndata->bnurl_paramcount = count($data["bnurl_".array_key_first(utils::PARAM_TYPES)] ?? []); } } @@ -55,17 +55,17 @@ public function __construct(\MoodleQuickForm &$mform, ?stdClass $bigbluebuttonbn private function retrieve_additional_data(int $id): array { global $DB; $data = []; - $flexurlrecords = $DB->get_records(mod_instance_helper::SUBPLUGIN_TABLE, [ + $bnurlrecords = $DB->get_records(mod_instance_helper::SUBPLUGIN_TABLE, [ 'bigbluebuttonbnid' => $id, ]); - if ($flexurlrecords) { - $flexurlrecords = array_values($flexurlrecords); - foreach ($flexurlrecords as $flexurlrecord) { + if ($bnurlrecords) { + $bnurlrecords = array_values($bnurlrecords); + foreach ($bnurlrecords as $bnurlrecord) { foreach (utils::PARAM_TYPES as $paramtype => $paramtypevalue) { - if (!isset($data["flexurl_{$paramtype}"])) { - $data["flexurl_{$paramtype}"] = []; + if (!isset($data["bnurl_{$paramtype}"])) { + $data["bnurl_{$paramtype}"] = []; } - $data["flexurl_{$paramtype}"][] = $flexurlrecord->{$paramtype} ?? ''; + $data["bnurl_{$paramtype}"][] = $bnurlrecord->{$paramtype} ?? ''; } } } @@ -92,7 +92,7 @@ public function data_postprocessing(\stdClass &$data): void { * @param array|null $defaultvalues */ public function data_preprocessing(?array &$defaultvalues): void { - // This is where we can add the data from the flexurl table to the data provided. + // This is where we can add the data from the bnurl table to the data provided. if (!empty($defaultvalues['id'])) { $data = $this->retrieve_additional_data(intval($defaultvalues['id'])); $defaultvalues = (object) array_merge($defaultvalues, $data); @@ -132,30 +132,30 @@ public function completion_rule_enabled(array $data): bool { */ public function definition_after_data() { // After data. - $isdeleting = optional_param_array('flexurl_paramdelete', [], PARAM_RAW); + $isdeleting = optional_param_array('bnurl_paramdelete', [], PARAM_RAW); // Get the index of the delete button that was pressed. if (!empty($isdeleting)) { $firstindex = array_key_first($isdeleting); // Then reassign values from the deleted group to the previous group. - $paramcount = optional_param('flexurl_paramcount', 0, PARAM_INT); + $paramcount = optional_param('bnurl_paramcount', 0, PARAM_INT); for ($index = $firstindex; $index < $paramcount; $index++) { $nextindex = $index + 1; - if ($this->mform->elementExists("flexurl_paramgroup[{$nextindex}]")) { - $nextgroupelement = $this->mform->getElement("flexurl_paramgroup[{$nextindex}]"); + if ($this->mform->elementExists("bnurl_paramgroup[{$nextindex}]")) { + $nextgroupelement = $this->mform->getElement("bnurl_paramgroup[{$nextindex}]"); if (!empty($nextgroupelement)) { $nextgroupvalue = $nextgroupelement->getValue(); - $currentgroupelement = $this->mform->getElement("flexurl_paramgroup[{$index}]"); + $currentgroupelement = $this->mform->getElement("bnurl_paramgroup[{$index}]"); $value = [ - "flexurl_paramname[{$index}]" => $nextgroupvalue["flexurl_paramname[{$nextindex}]"], - "flexurl_paramvalue[{$index}]" => $nextgroupvalue["flexurl_paramvalue[{$nextindex}]"], + "bnurl_paramname[{$index}]" => $nextgroupvalue["bnurl_paramname[{$nextindex}]"], + "bnurl_paramvalue[{$index}]" => $nextgroupvalue["bnurl_paramvalue[{$nextindex}]"], ]; $currentgroupelement->setValue($value); } } } $newparamcount = $paramcount - 1; - $this->mform->removeElement("flexurl_paramgroup[{$newparamcount}]"); - $this->mform->getElement('flexurl_paramcount')->setValue($newparamcount); + $this->mform->removeElement("bnurl_paramgroup[{$newparamcount}]"); + $this->mform->getElement('bnurl_paramcount')->setValue($newparamcount); } } @@ -163,26 +163,26 @@ public function definition_after_data() { * Add new form field definition */ public function add_fields(): void { - $this->mform->addElement('header', 'flexurl', get_string('formname', 'bbbext_flexurl')); - $this->mform->addHelpButton('flexurl', 'formname', 'bbbext_flexurl'); - $paramcount = optional_param('flexurl_paramcount', $this->bigbluebuttonbndata->flexurl_paramcount ?? 0, PARAM_RAW); - $paramcount += optional_param('flexurl_addparamgroup', 0, PARAM_RAW) ? 1 : 0; - $isdeleting = optional_param_array('flexurl_paramdelete', [], PARAM_RAW); + $this->mform->addElement('header', 'bnurl', get_string('formname', 'bbbext_bnurl')); + $this->mform->addHelpButton('bnurl', 'formname', 'bbbext_bnurl'); + $paramcount = optional_param('bnurl_paramcount', $this->bigbluebuttonbndata->bnurl_paramcount ?? 0, PARAM_RAW); + $paramcount += optional_param('bnurl_addparamgroup', 0, PARAM_RAW) ? 1 : 0; + $isdeleting = optional_param_array('bnurl_paramdelete', [], PARAM_RAW); foreach ($isdeleting as $index => $value) { // This prevents the last delete button from submitting the form. - $this->mform->registerNoSubmitButton("flexurl_paramdelete[$index]"); + $this->mform->registerNoSubmitButton("bnurl_paramdelete[$index]"); } for ($index = 0; $index < $paramcount; $index++) { $paramname = $this->mform->createElement( 'text', - "flexurl_paramname[$index]", - get_string('param_name', 'bbbext_flexurl'), + "bnurl_paramname[$index]", + get_string('param_name', 'bbbext_bnurl'), ['size' => '6'] ); $paramvalue = $this->mform->createElement( 'autocomplete', - "flexurl_paramvalue[$index]", - get_string('param_value', 'bbbext_flexurl'), + "bnurl_paramvalue[$index]", + get_string('param_value', 'bbbext_bnurl'), utils::get_options_for_parameters(), [ 'tags' => true, @@ -191,13 +191,13 @@ public function add_fields(): void { $paramvalue->setValue(''); $paramtype = $this->mform->createElement( 'select', - "flexurl_eventtype[$index]", - get_string('param_eventtype', 'bbbext_flexurl'), + "bnurl_eventtype[$index]", + get_string('param_eventtype', 'bbbext_bnurl'), utils::get_option_for_eventtype(), ); $paramdelete = $this->mform->createElement( 'submit', - "flexurl_paramdelete[$index]", + "bnurl_paramdelete[$index]", get_string('delete'), [], false, @@ -208,26 +208,26 @@ public function add_fields(): void { [ $paramname, $paramvalue, $paramtype, $paramdelete, ], - "flexurl_paramgroup[$index]", - get_string('paramgroup', 'bbbext_flexurl'), + "bnurl_paramgroup[$index]", + get_string('paramgroup', 'bbbext_bnurl'), [' '], false ); - $this->mform->setType("flexurl_paramname[$index]", utils::PARAM_TYPES['paramname']); - $this->mform->setType("flexurl_paramvalue[$index]", utils::PARAM_TYPES['paramvalue']); - $this->mform->setType("flexurl_eventtype[$index]", utils::PARAM_TYPES['eventtype']); - $this->mform->setType("flexurl_paramdelete[$index]", PARAM_RAW); + $this->mform->setType("bnurl_paramname[$index]", utils::PARAM_TYPES['paramname']); + $this->mform->setType("bnurl_paramvalue[$index]", utils::PARAM_TYPES['paramvalue']); + $this->mform->setType("bnurl_eventtype[$index]", utils::PARAM_TYPES['eventtype']); + $this->mform->setType("bnurl_paramdelete[$index]", PARAM_RAW); - $this->mform->registerNoSubmitButton("flexurl_paramdelete[$index]"); + $this->mform->registerNoSubmitButton("bnurl_paramdelete[$index]"); } // Add a button to add new param groups. - $this->mform->addElement('submit', 'flexurl_addparamgroup', get_string('addparamgroup', 'bbbext_flexurl')); - $this->mform->setType('flexurl_addparamgroup', PARAM_TEXT); - $this->mform->registerNoSubmitButton('flexurl_addparamgroup'); - $this->mform->addElement('hidden', 'flexurl_paramcount'); - $this->mform->setType('flexurl_paramcount', PARAM_INT); - $this->mform->setConstants(['flexurl_paramcount' => $paramcount]); + $this->mform->addElement('submit', 'bnurl_addparamgroup', get_string('addparamgroup', 'bbbext_bnurl')); + $this->mform->setType('bnurl_addparamgroup', PARAM_TEXT); + $this->mform->registerNoSubmitButton('bnurl_addparamgroup'); + $this->mform->addElement('hidden', 'bnurl_paramcount'); + $this->mform->setType('bnurl_paramcount', PARAM_INT); + $this->mform->setConstants(['bnurl_paramcount' => $paramcount]); } /** @@ -240,9 +240,9 @@ public function add_fields(): void { public function validation(array $data, array $files): array { $errors = []; foreach (utils::PARAM_TYPES as $paramtype => $paramtypevalue) { - if (!empty($data['flexurl_' . $paramtype]) - && clean_param_array($data['flexurl_' . $paramtype], $paramtypevalue, true) === false) { - $errors["flexurl_{$paramtype}"] = get_string('invalidvalue', 'bbbext_flexurl'); + if (!empty($data['bnurl_' . $paramtype]) + && clean_param_array($data['bnurl_' . $paramtype], $paramtypevalue, true) === false) { + $errors["bnurl_{$paramtype}"] = get_string('invalidvalue', 'bbbext_bnurl'); } } return $errors; diff --git a/classes/bigbluebuttonbn/mod_instance_helper.php b/classes/bigbluebuttonbn/mod_instance_helper.php index 90bfb38..7288a8a 100644 --- a/classes/bigbluebuttonbn/mod_instance_helper.php +++ b/classes/bigbluebuttonbn/mod_instance_helper.php @@ -14,15 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl\bigbluebuttonbn; +namespace bbbext_bnurl\bigbluebuttonbn; -use bbbext_flexurl\utils; +use bbbext_bnurl\utils; use stdClass; /** * Class defining a way to deal with instance save/update/delete in extension * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -31,7 +31,7 @@ class mod_instance_helper extends \mod_bigbluebuttonbn\local\extension\mod_insta /** * This is the name of the table that will be used to store additional data for the instance. */ - const SUBPLUGIN_TABLE = 'bbbext_flexurl'; + const SUBPLUGIN_TABLE = 'bbbext_bnurl'; /** * Runs any processes that must run before a bigbluebuttonbn insert/update. @@ -43,7 +43,7 @@ public function add_instance(stdClass $bigbluebuttonbn) { } /** - * Make sure that the bbbext_flexurl has the right parameters (and not more) + * Make sure that the bbbext_bnurl has the right parameters (and not more) * * @param stdClass $bigbluebuttonbn * @return void @@ -53,22 +53,22 @@ private function sync_additional_params(stdClass $bigbluebuttonbn): void { // Retrieve existing parameters from the database. $existingparams = $DB->get_records(self::SUBPLUGIN_TABLE, ['bigbluebuttonbnid' => $bigbluebuttonbn->id]); // Checks first. - $count = $bigbluebuttonbn->flexurl_paramcount ?? 0; + $count = $bigbluebuttonbn->bnurl_paramcount ?? 0; foreach (utils::PARAM_TYPES as $type => $paramtype) { - if (!isset($bigbluebuttonbn->{'flexurl_' . $type})) { + if (!isset($bigbluebuttonbn->{'bnurl_' . $type})) { // If the parameters were deleted, the deletion must be synced in the DB. if (!empty($existingparams)) { continue; } return; } - if ($count != count($bigbluebuttonbn->{'flexurl_' . $type})) { - debugging('FlexURL : The number of ' . $type . ' does not match the number of parameters.'); + if ($count != count($bigbluebuttonbn->{'bnurl_' . $type})) { + debugging('BN URL : The number of ' . $type . ' does not match the number of parameters.'); return; } - if (clean_param_array($bigbluebuttonbn->{'flexurl_' . $type}, $paramtype, true) != - $bigbluebuttonbn->{'flexurl_' . $type}) { - debugging('FlexURL : The ' . $type . ' contains invalid value.'); + if (clean_param_array($bigbluebuttonbn->{'bnurl_' . $type}, $paramtype, true) != + $bigbluebuttonbn->{'bnurl_' . $type}) { + debugging('BN URL : The ' . $type . ' contains invalid value.'); return; } } @@ -79,7 +79,7 @@ private function sync_additional_params(stdClass $bigbluebuttonbn): void { for ($index = 0; $index < $count; $index++) { $queryfields = []; foreach (array_keys(utils::PARAM_TYPES) as $type) { - $queryfields[$type] = $bigbluebuttonbn->{'flexurl_' . $type}[$index]; + $queryfields[$type] = $bigbluebuttonbn->{'bnurl_' . $type}[$index]; } $queryfields['bigbluebuttonbnid'] = $bigbluebuttonbn->id; $DB->insert_record(self::SUBPLUGIN_TABLE, (object) $queryfields); diff --git a/classes/utils.php b/classes/utils.php index de5ccc9..1f67846 100644 --- a/classes/utils.php +++ b/classes/utils.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl; +namespace bbbext_bnurl; use core_course\external\course_module_summary_exporter; use core_course\external\course_summary_exporter; @@ -23,7 +23,7 @@ /** * Utility class * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -54,7 +54,7 @@ class utils { public static function get_options_for_parameters(): array { $parametertypes = self::get_parameter_types(); $options = []; - $selectedptypes = explode(',', get_config('bbbext_flexurl', 'available_info')); + $selectedptypes = explode(',', get_config('bbbext_bnurl', 'available_info')); $selectedptypes = array_map('trim', $selectedptypes); foreach ($parametertypes as $key => $value) { if (in_array($key, $selectedptypes)) { @@ -77,9 +77,9 @@ public static function get_options_for_parameters(): array { */ public static function get_parameter_types(): array { return [ - 'activityinfo' => get_string('activity_info', 'bbbext_flexurl'), - 'courseinfo' => get_string('course_info', 'bbbext_flexurl'), - 'user' => get_string('user_info', 'bbbext_flexurl'), + 'activityinfo' => get_string('activity_info', 'bbbext_bnurl'), + 'courseinfo' => get_string('course_info', 'bbbext_bnurl'), + 'user' => get_string('user_info', 'bbbext_bnurl'), ]; } @@ -239,9 +239,9 @@ function($field) { */ public static function get_option_for_eventtype() { return [ - self::ACTION_CODES['create'] => get_string('event_create', 'bbbext_flexurl'), - self::ACTION_CODES['join'] => get_string('event_join', 'bbbext_flexurl'), - self::ACTION_CODES['all'] => get_string('event_all', 'bbbext_flexurl'), + self::ACTION_CODES['create'] => get_string('event_create', 'bbbext_bnurl'), + self::ACTION_CODES['join'] => get_string('event_join', 'bbbext_bnurl'), + self::ACTION_CODES['all'] => get_string('event_all', 'bbbext_bnurl'), ]; } } diff --git a/db/install.xml b/db/install.xml index 9b37145..27fcca3 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,10 +1,10 @@ - - +
diff --git a/lang/en/bbbext_flexurl.php b/lang/en/bbbext_bnurl.php similarity index 96% rename from lang/en/bbbext_flexurl.php rename to lang/en/bbbext_bnurl.php index 1caeb63..0259aa8 100644 --- a/lang/en/bbbext_flexurl.php +++ b/lang/en/bbbext_bnurl.php @@ -17,7 +17,7 @@ /** * Language File. * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -39,7 +39,7 @@ $string['param_name'] = 'Parameter name'; $string['param_value'] = 'Parameter value'; $string['paramgroup'] = 'Parameter'; -$string['pluginname'] = 'BigBlueButton FlexURL'; +$string['pluginname'] = 'BigBlueButton BN URL'; $string['user_info'] = 'Basic user info (USER)'; diff --git a/settings.php b/settings.php index c06db67..63673da 100644 --- a/settings.php +++ b/settings.php @@ -17,7 +17,7 @@ /** * This file defines the admin settings for this plugin * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -25,11 +25,11 @@ defined('MOODLE_INTERNAL') || die; $availableinfosetting = new admin_setting_configmultiselect( - 'bbbext_flexurl/available_info', - new lang_string('available_info', 'bbbext_flexurl'), - new lang_string('available_info_desc', 'bbbext_flexurl'), + 'bbbext_bnurl/available_info', + new lang_string('available_info', 'bbbext_bnurl'), + new lang_string('available_info_desc', 'bbbext_bnurl'), [], - \bbbext_flexurl\utils::get_parameter_types() + \bbbext_bnurl\utils::get_parameter_types() ); $settings->add($availableinfosetting); diff --git a/tests/bigbluebutton/action_url_addons_tests.php b/tests/bigbluebutton/action_url_addons_tests.php index fed14d7..dd6ee96 100644 --- a/tests/bigbluebutton/action_url_addons_tests.php +++ b/tests/bigbluebutton/action_url_addons_tests.php @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl\bigbluebuttonbn; +namespace bbbext_bnurl\bigbluebuttonbn; -use bbbext_flexurl\utils; +use bbbext_bnurl\utils; use mod_bigbluebuttonbn\extension; use mod_bigbluebuttonbn\external\get_join_url; use mod_bigbluebuttonbn\instance; @@ -24,7 +24,7 @@ /** * Action URL addons tests * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) @@ -55,15 +55,15 @@ public function setUp(): void { 'email' => 'bbb@blindsidenetworks.com', ]); $bbbgenerator = $datagenerator->get_plugin_generator('mod_bigbluebuttonbn'); $this->bbb = $bbbgenerator->create_instance(['name' => 'BBB Activity', 'course' => $this->course->id]); - set_config('available_info', 'user, courseinfo, activityinfo', 'bbbext_flexurl'); + set_config('available_info', 'user, courseinfo, activityinfo', 'bbbext_bnurl'); $datagenerator->enrol_user($this->user->id, $this->course->id); - $DB->insert_record('bbbext_flexurl', + $DB->insert_record('bbbext_bnurl', ['bigbluebuttonbnid' => $this->bbb->id, 'eventtype' => utils::ACTION_CODES['create'], 'paramname' => 'firstname', 'paramvalue' => 'user.firstname', ]); - $DB->insert_record('bbbext_flexurl', + $DB->insert_record('bbbext_bnurl', ['bigbluebuttonbnid' => $this->bbb->id, 'eventtype' => utils::ACTION_CODES['join'], 'paramname' => 'lastname', 'paramvalue' => 'user.lastname', ]); - $DB->insert_record('bbbext_flexurl', + $DB->insert_record('bbbext_bnurl', ['bigbluebuttonbnid' => $this->bbb->id, 'eventtype' => utils::ACTION_CODES['all'], 'paramname' => 'coursename', 'paramvalue' => 'courseinfo.fullname', ]); } diff --git a/tests/utils_test.php b/tests/utils_test.php index 0e219ce..b2cb145 100644 --- a/tests/utils_test.php +++ b/tests/utils_test.php @@ -14,18 +14,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace bbbext_flexurl; +namespace bbbext_bnurl; use mod_bigbluebuttonbn\instance; /** * BBB Utils tests class. * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent@call-learning.fr) - * @coversDefaultClass \bbbext_flexurl\utils + * @coversDefaultClass \bbbext_bnurl\utils */ final class utils_test extends \advanced_testcase { /** @@ -101,14 +101,14 @@ public function setUp(): void { 'email' => 'bbb@blindsidenetworks.com', ]); $bbbgenerator = $datagenerator->get_plugin_generator('mod_bigbluebuttonbn'); $this->bbb = $bbbgenerator->create_instance(['name' => 'BBB Activity', 'course' => $this->course->id]); - set_config('available_info', 'user, courseinfo, activityinfo', 'bbbext_flexurl'); + set_config('available_info', 'user, courseinfo, activityinfo', 'bbbext_bnurl'); $datagenerator->enrol_user($this->user->id, $this->course->id); } /** * Test get_options_for_parameters * - * @covers \bbbext_flexurl\utils::get_options_for_parameters + * @covers \bbbext_bnurl\utils::get_options_for_parameters */ public function test_get_options_for_parameters(): void { $this->setAdminUser(); // To get the email. @@ -159,7 +159,7 @@ public function test_get_options_for_parameters(): void { * @param string $paramtype * @param array $expected * - * @covers \bbbext_flexurl\utils::get_fields_for_parameter + * @covers \bbbext_bnurl\utils::get_fields_for_parameter * @dataProvider provider_get_fields_for_parameter */ public function test_get_fields_for_parameter(string $paramtype, array $expected): void { @@ -173,7 +173,7 @@ public function test_get_fields_for_parameter(string $paramtype, array $expected * Test get_value_for_field * * @param array $expected - * @covers \bbbext_flexurl\utils::get_value_for_field + * @covers \bbbext_bnurl\utils::get_value_for_field * @dataProvider provider_get_value_for_fields */ public function test_get_value_for_field(array $expected): void { diff --git a/version.php b/version.php index 01911c0..19605f4 100644 --- a/version.php +++ b/version.php @@ -17,7 +17,7 @@ /** * This file contains the version information for the sample bigbluebuttonbn subplugin * - * @package bbbext_flexurl + * @package bbbext_bnurl * @copyright 2023 onwards, Blindside Networks Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Laurent David (laurent [at] call-learning [dt] fr) @@ -26,4 +26,4 @@ $plugin->version = 2023020800; $plugin->requires = 2022112800; -$plugin->component = 'bbbext_flexurl'; +$plugin->component = 'bbbext_bnurl';