mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-26401 group: add delimiter and encoding fields to import
This commit is contained in:
parent
a7d9b53e72
commit
8668a5a536
2 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,7 @@ if (!defined('MOODLE_INTERNAL')) {
|
|||
}
|
||||
|
||||
require_once($CFG->libdir.'/formslib.php');
|
||||
require_once($CFG->libdir . '/csvlib.class.php');
|
||||
|
||||
/**
|
||||
* Groups import form class
|
||||
|
@ -56,6 +57,19 @@ class groups_import_form extends moodleform {
|
|||
$mform->addElement('hidden', 'id');
|
||||
$mform->setType('id', PARAM_INT);
|
||||
|
||||
$choices = csv_import_reader::get_delimiter_list();
|
||||
$mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'group'), $choices);
|
||||
if (array_key_exists('cfg', $choices)) {
|
||||
$mform->setDefault('delimiter_name', 'cfg');
|
||||
} else if (get_string('listsep', 'langconfig') == ';') {
|
||||
$mform->setDefault('delimiter_name', 'semicolon');
|
||||
} else {
|
||||
$mform->setDefault('delimiter_name', 'comma');
|
||||
}
|
||||
|
||||
$choices = core_text::get_encodings();
|
||||
$mform->addElement('select', 'encoding', get_string('encoding', 'group'), $choices);
|
||||
$mform->setDefault('encoding', 'UTF-8');
|
||||
$this->add_action_buttons(true, get_string('importgroups', 'core_group'));
|
||||
|
||||
$this->set_data($data);
|
||||
|
|
|
@ -43,6 +43,7 @@ $string['creategrouping'] = 'Create grouping';
|
|||
$string['creategroupinselectedgrouping'] = 'Create group in grouping';
|
||||
$string['createingrouping'] = 'Grouping of auto-created groups';
|
||||
$string['createorphangroup'] = 'Create orphan group';
|
||||
$string['csvdelimiter'] = 'CSV delimiter';
|
||||
$string['databaseupgradegroups'] = 'Groups version is now {$a}';
|
||||
$string['defaultgrouping'] = 'Default grouping';
|
||||
$string['defaultgroupingname'] = 'Grouping';
|
||||
|
@ -59,6 +60,7 @@ $string['editgroupsettings'] = 'Edit group settings';
|
|||
$string['editusersgroupsa'] = 'Edit groups for "{$a}"';
|
||||
$string['enablemessaging'] = 'Group messaging';
|
||||
$string['enablemessaging_help'] = 'If enabled, group members can send messages to the others in their group via the messaging drawer.';
|
||||
$string['encoding'] = 'Encoding';
|
||||
$string['enrolmentkey'] = 'Enrolment key';
|
||||
$string['enrolmentkey_help'] = 'An enrolment key enables access to the course to be restricted to only those who know the key. If a group enrolment key is specified, then not only will entering that key let the user into the course, but it will also automatically make them a member of this group.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue