Skip to content

Commit

Permalink
MDL-40728 courseupload: add missing help icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mouneyrac committed Nov 13, 2013
1 parent d214057 commit c8a6610
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions admin/tool/uploadcourse/classes/base_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function add_import_options() {
tool_uploadcourse_processor::MODE_UPDATE_ONLY => get_string('updateonly', 'tool_uploadcourse')
);
$mform->addElement('select', 'options[mode]', get_string('mode', 'tool_uploadcourse'), $choices);
$mform->addHelpButton('options[mode]', 'mode', 'tool_uploadcourse');

$choices = array(
tool_uploadcourse_processor::UPDATE_NOTHING => get_string('nochanges', 'tool_uploadcourse'),
Expand All @@ -73,21 +74,25 @@ public function add_import_options() {
$mform->setDefault('options[updatemode]', tool_uploadcourse_processor::UPDATE_NOTHING);
$mform->disabledIf('options[updatemode]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_NEW);
$mform->disabledIf('options[updatemode]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_ALL);
$mform->addHelpButton('options[updatemode]', 'updatemode', 'tool_uploadcourse');

$mform->addElement('selectyesno', 'options[allowdeletes]', get_string('allowdeletes', 'tool_uploadcourse'));
$mform->setDefault('options[allowdeletes]', 0);
$mform->disabledIf('options[allowdeletes]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_NEW);
$mform->disabledIf('options[allowdeletes]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_ALL);
$mform->addHelpButton('options[allowdeletes]', 'allowdeletes', 'tool_uploadcourse');

$mform->addElement('selectyesno', 'options[allowrenames]', get_string('allowrenames', 'tool_uploadcourse'));
$mform->setDefault('options[allowrenames]', 0);
$mform->disabledIf('options[allowrenames]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_NEW);
$mform->disabledIf('options[allowrenames]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_ALL);
$mform->addHelpButton('options[allowrenames]', 'allowrenames', 'tool_uploadcourse');

$mform->addElement('selectyesno', 'options[allowresets]', get_string('allowresets', 'tool_uploadcourse'));
$mform->setDefault('options[allowresets]', 0);
$mform->disabledIf('options[allowresets]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_NEW);
$mform->disabledIf('options[allowresets]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_ALL);
$mform->addHelpButton('options[allowresets]', 'allowresets', 'tool_uploadcourse');
}

}
6 changes: 5 additions & 1 deletion admin/tool/uploadcourse/classes/step1_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public function definition () {

$mform->addElement('header', 'generalhdr', get_string('general'));

$mform->addElement('filepicker', 'coursefile', get_string('file'));
$mform->addElement('filepicker', 'coursefile', get_string('coursefile', 'tool_uploadcourse'));
$mform->addRule('coursefile', null, 'required');
$mform->addHelpButton('coursefile', 'coursefile', 'tool_uploadcourse');

$choices = csv_import_reader::get_delimiter_list();
$mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploadcourse'), $choices);
Expand All @@ -56,14 +57,17 @@ public function definition () {
} else {
$mform->setDefault('delimiter_name', 'comma');
}
$mform->addHelpButton('delimiter_name', 'csvdelimiter', 'tool_uploadcourse');

$choices = core_text::get_encodings();
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploadcourse'), $choices);
$mform->setDefault('encoding', 'UTF-8');
$mform->addHelpButton('encoding', 'encoding', 'tool_uploadcourse');

$choices = array('10' => 10, '20' => 20, '100' => 100, '1000' => 1000, '100000' => 100000);
$mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'tool_uploadcourse'), $choices);
$mform->setType('previewrows', PARAM_INT);
$mform->addHelpButton('previewrows', 'rowpreviewnum', 'tool_uploadcourse');

$this->add_import_options();

Expand Down
1 change: 1 addition & 0 deletions admin/tool/uploadcourse/classes/step2_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function definition () {
$mform->disabledIf('options[reset]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_NEW);
$mform->disabledIf('options[reset]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_ALL);
$mform->disabledIf('options[reset]', 'options[allowresets]', 'eq', 0);
$mform->addHelpButton('options[reset]', 'reset', 'tool_uploadcourse');

// Default values.
$mform->addElement('header', 'defaultheader', get_string('defaultvalues', 'tool_uploadcourse'));
Expand Down
14 changes: 13 additions & 1 deletion admin/tool/uploadcourse/lang/en/tool_uploadcourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
*/

$string['allowdeletes'] = 'Allow deletes';
$string['allowdeletes_help'] = 'Whether the delete field is accepted or not.';
$string['allowrenames'] = 'Allow renames';
$string['allowrenames_help'] = 'Whether the rename field is accepted or not.';
$string['allowresets'] = 'Allow resets';
$string['allowresets_help'] = 'Whether the reset field is accepted or not.';
$string['cachedef_helper'] = 'Helper caching';
$string['cannotdeletecoursenotexist'] = 'Cannot delete a course that does not exist';
$string['cannotgenerateshortnameupdatemode'] = 'Cannot generate a shortname when updates are allowed';
Expand All @@ -43,6 +46,8 @@
$string['coursedeletionnotallowed'] = 'Course deletion is not allowed';
$string['coursedoesnotexistandcreatenotallowed'] = 'The course does not exist and creating course is not allowed';
$string['courseexistsanduploadnotallowed'] = 'The course exists and update is not allowed';
$string['coursefile'] = 'File';
$string['coursefile_help'] = 'This file must be a CSV file.';
$string['courseidnumberincremented'] = 'Course ID number incremented {$a->from} -> {$a->to}';
$string['courseprocess'] = 'Course process';
$string['courserenamed'] = 'Course renamed';
Expand All @@ -65,10 +70,12 @@
$string['createnew'] = 'Create new courses only, skip existing ones';
$string['createorupdate'] = 'Create new courses, or update existing ones';
$string['csvdelimiter'] = 'CSV delimiter';
$string['csvdelimiter_help'] = 'CSV delimiter of the CSV file.';
$string['csvfileerror'] = 'There is something wrong with the format of the CSV file. Please check the number of headings and columns match, and that the delimiter and file encoding are correct: {$a}';
$string['csvline'] = 'Line';
$string['defaultvalues'] = 'Default course values';
$string['encoding'] = 'Encoding';
$string['encoding_help'] = 'Encoding of the CSV file.';
$string['errorwhilerestoringcourse'] = 'Error while restoring the course';
$string['errorwhiledeletingcourse'] = 'Error while deleting the course';
$string['generatedshortnameinvalid'] = 'The generated shortname is invalid';
Expand All @@ -87,20 +94,25 @@
$string['missingmandatoryfields'] = 'Missing value for mandatory fields: {$a}';
$string['missingshortnamenotemplate'] = 'Missing shortname and shortname template not set';
$string['mode'] = 'Upload mode';
$string['mode_help'] = 'This allows you to specify if courses can be created and/or updated.';
$string['nochanges'] = 'No changes';
$string['pluginname'] = 'Course upload';
$string['preview'] = 'Preview';
$string['reset'] = 'Reset course after upload';
$string['reset_help'] = 'Whether to reset the course after creating/updating it.';
$string['result'] = 'Result';
$string['restoreafterimport'] = 'Restore after import';
$string['rowpreviewnum'] = 'Preview rows';
$string['rowpreviewnum_help'] = 'Number of rows from the CSV file that will be previewed in the next page. This option exists in
order to limit the next page size.';
$string['shortnametemplate'] = 'Template to generate a shortname';
$string['shortnametemplate_help'] = 'The short name of the course is displayed in the navigation. You may use template syntax here (%f = fullname, %i = idnumber), or enter an initial value that is incremented.';
$string['templatefile'] = 'Restore from this file after upload';
$string['templatefile_help'] = 'Select a file to use as a template for the creation of all courses.';
$string['unknownimportmode'] = 'Unknown import mode';
$string['updatemissing'] = 'Fill in missing items from CSV data and defaults';
$string['updatemode'] = 'Update mode';
$string['updatemode_help'] = 'If you allow courses to be updated, you also have to tell the tool what to update the courses with.';
$string['updatemodedoessettonothing'] = 'Update mode does not allow anything to be updated';
$string['updateonly'] = 'Only update existing courses';
$string['updatewithdataordefaults'] = 'Update with CSV data and defaults';
Expand All @@ -111,6 +123,6 @@
* Each line of the file contains one record
* Each record is a series of data separated by commas (or other delimiters)
* The first record contains a list of fieldnames defining the format of the rest of the file
* Required fieldnames are shortname, fullname, summary and category';
* Required fieldnames are shortname, fullname, and category';
$string['uploadcoursespreview'] = 'Upload courses preview';
$string['uploadcoursesresult'] = 'Upload courses results';

0 comments on commit c8a6610

Please sign in to comment.