From c8a661098ee3899590b2e7dbfa6cb1c56fba4b08 Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Wed, 13 Nov 2013 16:34:43 +0800 Subject: [PATCH] MDL-40728 courseupload: add missing help icons --- admin/tool/uploadcourse/classes/base_form.php | 5 +++++ admin/tool/uploadcourse/classes/step1_form.php | 6 +++++- admin/tool/uploadcourse/classes/step2_form.php | 1 + admin/tool/uploadcourse/lang/en/tool_uploadcourse.php | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/admin/tool/uploadcourse/classes/base_form.php b/admin/tool/uploadcourse/classes/base_form.php index fc0ddf9a3db..868fe6a2477 100644 --- a/admin/tool/uploadcourse/classes/base_form.php +++ b/admin/tool/uploadcourse/classes/base_form.php @@ -61,6 +61,7 @@ class tool_uploadcourse_base_form extends moodleform { 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'), @@ -73,21 +74,25 @@ class tool_uploadcourse_base_form extends moodleform { $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'); } } diff --git a/admin/tool/uploadcourse/classes/step1_form.php b/admin/tool/uploadcourse/classes/step1_form.php index 189ff9eb68f..4d0543b8dc2 100644 --- a/admin/tool/uploadcourse/classes/step1_form.php +++ b/admin/tool/uploadcourse/classes/step1_form.php @@ -44,8 +44,9 @@ class tool_uploadcourse_step1_form extends tool_uploadcourse_base_form { $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); @@ -56,14 +57,17 @@ class tool_uploadcourse_step1_form extends tool_uploadcourse_base_form { } 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(); diff --git a/admin/tool/uploadcourse/classes/step2_form.php b/admin/tool/uploadcourse/classes/step2_form.php index 32886ef234c..24f9a9e1f54 100644 --- a/admin/tool/uploadcourse/classes/step2_form.php +++ b/admin/tool/uploadcourse/classes/step2_form.php @@ -74,6 +74,7 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form { $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')); diff --git a/admin/tool/uploadcourse/lang/en/tool_uploadcourse.php b/admin/tool/uploadcourse/lang/en/tool_uploadcourse.php index 999ca70792e..96b847c5320 100644 --- a/admin/tool/uploadcourse/lang/en/tool_uploadcourse.php +++ b/admin/tool/uploadcourse/lang/en/tool_uploadcourse.php @@ -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'; @@ -43,6 +46,8 @@ $string['coursedeleted'] = 'Course deleted'; $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'; @@ -65,10 +70,12 @@ $string['createall'] = 'Create all, increment shortname if needed'; $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'; @@ -87,13 +94,17 @@ $string['invalidshortname'] = 'Invalid shortname'; $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'; @@ -101,6 +112,7 @@ $string['templatefile_help'] = 'Select a file to use as a template for the creat $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'; @@ -111,6 +123,6 @@ $string['uploadcourses_help'] = 'Courses may be uploaded via text file. The form * 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'; -- 2.11.4.GIT