From 3cd9461e772b3a470765dae62b194e9b02b3bed8 Mon Sep 17 00:00:00 2001 From: Serge Gauthier Date: Fri, 29 Apr 2016 11:32:07 -0400 Subject: [PATCH] MDL-53877 competency: Help and better validation text for evidence URL --- admin/tool/lp/classes/form/user_evidence.php | 1 + admin/tool/lp/lang/en/tool_lp.php | 1 + lang/en/competency.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/tool/lp/classes/form/user_evidence.php b/admin/tool/lp/classes/form/user_evidence.php index 8faac4d57ad..28de24cb2cd 100644 --- a/admin/tool/lp/classes/form/user_evidence.php +++ b/admin/tool/lp/classes/form/user_evidence.php @@ -58,6 +58,7 @@ class user_evidence extends persistent { $mform->addElement('url', 'url', get_string('userevidenceurl', 'tool_lp'), array(), array('usefilepicker' => false)); $mform->setType('url', PARAM_RAW_TRIMMED); // Can not use PARAM_URL, it silently converts bad URLs to ''. + $mform->addHelpButton('url', 'userevidenceurl', 'tool_lp'); $mform->addElement('filemanager', 'files', get_string('userevidencefiles', 'tool_lp'), array(), $this->_customdata['fileareaoptions']); diff --git a/admin/tool/lp/lang/en/tool_lp.php b/admin/tool/lp/lang/en/tool_lp.php index 10fca872bab..aafd55752f3 100644 --- a/admin/tool/lp/lang/en/tool_lp.php +++ b/admin/tool/lp/lang/en/tool_lp.php @@ -277,6 +277,7 @@ $string['userevidencename'] = 'Name'; $string['userevidencesummary'] = 'Summary'; $string['userevidenceupdated'] = 'Evidence of prior learning updated'; $string['userevidenceurl'] = 'URL'; +$string['userevidenceurl_help'] = 'The URL must start with \'http://\' or \'https://\'.'; $string['viewdetails'] = 'View details'; $string['visible'] = 'Visible'; $string['visible_help'] = 'A competency framework can be hidden from teachers. This could be useful if a framework is still in the process of being developed.'; diff --git a/lang/en/competency.php b/lang/en/competency.php index cd8efd92a58..ea091b4a065 100644 --- a/lang/en/competency.php +++ b/lang/en/competency.php @@ -106,7 +106,7 @@ $string['invalidgrade'] = 'Invalid rating'; $string['invalidpersistent'] = 'Invalid persistent'; $string['invalidplan'] = 'Invalid learning plan'; $string['invalidtaxonomy'] = 'Invalid taxonomy: {$a}'; -$string['invalidurl'] = 'The URL is not valid.'; +$string['invalidurl'] = 'The URL is not valid. Make sure it starts with \'http://\' or \'https://\'.'; $string['planstatusactive'] = 'Active'; $string['planstatuscomplete'] = 'Complete'; $string['planstatusdraft'] = 'Draft';