Commit c9ffd8fb authored by Francois Gannaz's avatar Francois Gannaz
Browse files

Draft of the activity main form

parent c8b13236
......@@ -28,8 +28,8 @@ defined('MOODLE_INTERNAL') || die();
$string['labnbook:edit'] = 'Edit labnbook';
$string['labnbook:view'] = 'View labnbook';
$string['missingidandcmid'] = 'Missing id and cmid';
$string['modulename'] = 'LabNbook';
$string['modulename_help'] = 'LabNbook Help';
$string['modulename'] = 'LabNbook Mission';
$string['modulename_help'] = "This Moodle activity will grant an access to a LabNbook mission. After selecting the mission, you will have to configure how the teams of students will be built.";
$string['modulenameplural'] = 'LabNbook activities';
$string['newmodulefieldset'] = 'LabNbook';
$string['newmodulename'] = 'New LabNbook activity';
......@@ -41,6 +41,8 @@ $string['pluginname'] = 'LabNbook';
$string['privacy:metadata'] = 'LabNbook does not store any personal data';
$string['view'] = 'View';
$string['instancename'] = "Header";
$string['instancename_help'] = "This text will appear in the course content.";
$string['mission'] = "Mission";
$string['labnbook_url'] = "LabNbook URL";
$string['labnbook_url_descr'] = "The URL to the root of labnbook, with a trailing slash. E.g. https://uga.labnbook.fr/";
......
......@@ -22,6 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use \mod_labnbook_session as session;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/course/moodleform_mod.php');
......@@ -43,11 +45,14 @@ class mod_labnbook_mod_form extends moodleform_mod {
$mform = $this->_form;
$mform->addElement('header', 'general', "LabNbook");
$mform->addElement('select', 'missionid', get_string('mission', 'mod_labnbook'), session::load()->getMissions());
// Adding the "general" fieldset, where all the common settings are showed.
$mform->addElement('header', 'general', get_string('general', 'form'));
// Adding the standard "name" field.
$mform->addElement('text', 'name', get_string('labnbookname', 'mod_labnbook'), array('size' => '64'));
$mform->addElement('text', 'name', get_string('instancename', 'mod_labnbook'), array('size' => '64'));
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
......@@ -57,7 +62,7 @@ class mod_labnbook_mod_form extends moodleform_mod {
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$mform->addHelpButton('name', 'labnbookname', 'mod_labnbook');
$mform->addHelpButton('name', 'instancename', 'mod_labnbook');
// Adding the standard "intro" and "introformat" fields.
if ($CFG->branch >= 29) {
......@@ -66,11 +71,6 @@ class mod_labnbook_mod_form extends moodleform_mod {
$this->add_intro_editor();
}
// Adding the rest of mod_labnbook settings, spreading all them into this fieldset
// ... or adding more fieldsets ('header' elements) if needed for better logic.
$mform->addElement('static', 'label1', 'labnbooksettings', get_string('labnbooksettings', 'mod_labnbook'));
$mform->addElement('header', 'labnbookfieldset', get_string('labnbookfieldset', 'mod_labnbook'));
// Add standard grading elements.
$this->standard_grading_coursemodule_elements();
......
......@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_labnbook';
$plugin->release = '0.1.3';
$plugin->release = '0.1.4';
$plugin->version = 2019020100;
$plugin->requires = 2016120500;
$plugin->maturity = MATURITY_ALPHA;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment