-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tenant-and-token-addition'
- Loading branch information
Showing
18 changed files
with
791 additions
and
248 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["^ ","~:classpath",["~#set",[]],"~:project-hash","","~:project-root","/var/www/html/moodle/mod/cmi5launch","~:kondo-config-hash","56f27dae6e4a876734bf42298a7d3dc91d05917f53c9d98543cfd410bd88afe0","~:dependency-scheme","jar","~:analysis",null,"~:analysis-checksums",["^ "],"~:project-analysis-type","~:project-and-full-dependencies","~:version",12,"~:stubs-generation-namespaces",["^1",[]]] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Form for cmi5 connection, namely basic info - player url, user name and password. | ||
* | ||
* @copyright 2023 Megan Bohland | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
// Moodleform is defined in formslib.php. | ||
require_once("$CFG->libdir/formslib.php"); | ||
|
||
class setup_cmi5 extends moodleform { | ||
// Add elements to form. | ||
public function definition() { | ||
// A reference to the form is stored in $this->form. | ||
// A common convention is to store it in a variable, such as `$mform`. | ||
$mform = $this->_form; // Don't forget the underscore! | ||
|
||
// Add elements to your form. Second arg is the name of element | ||
// Player url. | ||
$mform->addElement('text', 'cmi5url', get_string('cmi5launchplayerurl', 'cmi5launch')); | ||
// Set type of element. | ||
$mform->setType('cmi5url', PARAM_NOTAGS); | ||
// Default value. | ||
$mform->setDefault('cmi5url', get_string('cmi5launchplayerurl_default', 'cmi5launch')); // The second arg here is the default value and appears in the text box. | ||
// Add a rule to make this field required. | ||
$mform->addRule('cmi5url', 'This is needed to connect to player', 'required'); | ||
// Add a help button with a help message. | ||
$mform->addHelpButton('cmi5url', 'cmi5launchplayerurl', 'cmi5launch'); | ||
|
||
// User name. | ||
$mform->addElement('text', 'cmi5name', get_string('cmi5launchbasicname', 'cmi5launch')); | ||
// Set type of element. | ||
$mform->setType('cmi5name', PARAM_NOTAGS); | ||
// Default value. | ||
$mform->setDefault('cmi5name', get_string('cmi5launchbasicname_default', 'cmi5launch')); // The second arg here is the default value and appears in the text box. | ||
// Add a rule to make this field required. | ||
$mform->addRule('cmi5name', 'This is needed to connect to player', 'required'); | ||
// Add a help button with a help message. | ||
$mform->addHelpButton('cmi5name', 'cmi5launchbasicname', 'cmi5launch'); | ||
|
||
// Password. | ||
// Add elements to your form. Second arg is the name of element | ||
$mform->addElement('text', 'cmi5password', get_string('cmi5launchbasepass', 'cmi5launch')); | ||
// Set type of element. | ||
$mform->setType('cmi5password', PARAM_NOTAGS); | ||
// Default value. | ||
$mform->setDefault('cmi5password', get_string('cmi5launchbasepass_default', 'cmi5launch')); // The second arg here is the default value and appears in the text box. | ||
// Add a rule to make this field required. | ||
$mform->addRule('cmi5password', 'This is needed to connect to player', 'required'); | ||
// Below is the help button, it sucks you have to push it to see the help text, but it is there | ||
$mform->addHelpButton('cmi5password', 'cmi5launchbasepass', 'cmi5launch'); | ||
|
||
$this->add_action_buttons(); | ||
} | ||
|
||
// Custom validation should be added here. | ||
function validation($data, $files) { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Form for cmi5 connection, to enter tenant name. | ||
* | ||
* @copyright 2023 Megan Bohland | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
// moodleform is defined in formslib.php | ||
require_once("$CFG->libdir/formslib.php"); | ||
|
||
class setup_tenant extends moodleform { | ||
|
||
// Add elements to form. | ||
public function definition() { | ||
// A reference to the form is stored in $this->form. | ||
// A common convention is to store it in a variable, such as `$mform`. | ||
$mform = $this->_form; // Don't forget the underscore! | ||
|
||
// Add elements to your form. Second arg is the name of element | ||
$mform->addElement('text', 'cmi5tenant', get_string('cmi5launchtenantnamesetup', 'cmi5launch')); | ||
// Add a help button with a help message. | ||
$mform->addHelpButton('cmi5tenant', 'cmi5launchtenantnamesetup', 'cmi5launch'); | ||
|
||
// Set type of element. | ||
$mform->setType('cmi5tenant', PARAM_NOTAGS); | ||
// Default value. | ||
$mform->setDefault('cmi5tenant', get_string('cmi5launchtenantname_default', 'cmi5launch')); // The second arg here is the default value and appears in the text box. | ||
// Add a rule to make this field required. | ||
$mform->addRule('cmi5tenant', 'This is needed to connect to player', 'required'); | ||
|
||
// $mform->addElement('header', 'cmi5instructions', 'Please enter a tenant name. When submitted it will create a tenant in the cmi5 player and automatically retrieve and save a bearer token for it as well.'); | ||
$mform->addElement('html', '<p>Please enter a tenant name. When submitted it will create a tenant in the cmi5 player and automatically retrieve and save a bearer token for it as well</p>'); | ||
|
||
$this->add_action_buttons(); | ||
} | ||
|
||
// Custom validation should be added here. | ||
function validation($data, $files) { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Form for cmi5 connection, and tenant and token. | ||
* | ||
* @copyright 2023 Megan Bohland | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
// moodleform is defined in formslib.php | ||
require_once("$CFG->libdir/formslib.php"); | ||
|
||
|
||
class setup_token extends moodleform { | ||
// Add elements to form. | ||
public function definition() { | ||
// A reference to the form is stored in $this->form. | ||
// A common convention is to store it in a variable, such as `$mform`. | ||
$mform = $this->_form; // Don't forget the underscore! | ||
|
||
// Elements are diff inputs in form | ||
|
||
|
||
// Add elements to your form. Second arg is the name of element | ||
$mform->addElement('text', 'cmi5token', get_string('cmi5launchtenanttoken', 'cmi5launch')); | ||
// Set type of element. | ||
$mform->setType('cmi5token', PARAM_NOTAGS); | ||
// Default value. | ||
$mform->setDefault('cmi5token', get_string('cmi5launchtenanttoken_default', 'cmi5launch')); // The second arg here is the default value and appears in the text box. | ||
// These three go together for making one eleme | ||
// $mform->addElement('button', 'generatetoken', 'Generate Token'); | ||
// Add a rule to make this field required. | ||
$mform->addRule('cmi5token', 'This is needed to connect to player', 'required'); | ||
|
||
$this->add_action_buttons(); | ||
} | ||
|
||
// Custom validation should be added here. | ||
function validation($data, $files) { | ||
return []; | ||
} | ||
} |
Oops, something went wrong.