Commit 35b3f50e authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-53728' of git://github.com/timhunt/moodle

parents 5ce14ec2 f06eacd9
......@@ -38,6 +38,8 @@ require_once($CFG->libdir . '/formslib.php');
class question_export_form extends moodleform {
protected function definition() {
global $OUTPUT;
$mform = $this->_form;
$defaultcategory = $this->_customdata['defaultcategory'];
......@@ -45,21 +47,24 @@ class question_export_form extends moodleform {
// Choice of format, with help.
$mform->addElement('header', 'fileformat', get_string('fileformat', 'question'));
$fileformatnames = get_import_export_formats('export');
$radioarray = array();
$i = 0 ;
$separators = array();
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$mform->addGroup($currentgrp1, "formathelp[{$i}]", '', array('<br />'), false);
$radioarray[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$separator = '';
if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
$mform->addHelpButton("formathelp[{$i}]", 'pluginname', 'qformat_' . $shortname);
$separator .= $OUTPUT->help_icon('pluginname', 'qformat_' . $shortname);
}
$i++ ;
$separator .= '<br>';
$separators[] = $separator;
}
$mform->addRule("formathelp[0]", null, 'required', null, 'client');
$radioarray[] = $mform->createElement('static', 'makelasthelpiconshowup', '');
$mform->addGroup($radioarray, "formatchoices", '', $separators, false);
$mform->addRule("formatchoices", null, 'required', null, 'client');
// Export options.
$mform->addElement('header', 'general', get_string('general', 'form'));
......
......@@ -38,7 +38,8 @@ require_once($CFG->libdir . '/formslib.php');
class question_import_form extends moodleform {
protected function definition() {
global $COURSE;
global $OUTPUT;
$mform = $this->_form;
$defaultcategory = $this->_customdata['defaultcategory'];
......@@ -49,19 +50,21 @@ class question_import_form extends moodleform {
$fileformatnames = get_import_export_formats('import');
$radioarray = array();
$i = 0 ;
$separators = array();
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$mform->addGroup($currentgrp1, "formathelp[{$i}]", '', array('<br />'), false);
$radioarray[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
$separator = '';
if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
$mform->addHelpButton("formathelp[{$i}]", 'pluginname', 'qformat_' . $shortname);
$separator .= $OUTPUT->help_icon('pluginname', 'qformat_' . $shortname);
}
$i++ ;
$separator .= '<br>';
$separators[] = $separator;
}
$mform->addRule("formathelp[0]", null, 'required', null, 'client');
$radioarray[] = $mform->createElement('static', 'makelasthelpiconshowup', '');
$mform->addGroup($radioarray, "formatchoices", '', $separators, false);
$mform->addRule("formatchoices", null, 'required', null, 'client');
// Import options.
$mform->addElement('header','general', get_string('general', 'form'));
......
Supports Markdown
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