Skip to content

Commit 020d94f

Browse files
committed
MDL-84577 badges: Reorganise badge creation form
1 parent 77a7d81 commit 020d94f

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

badges/classes/form/badge.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ public function definition() {
6262

6363
$mform->addElement('text', 'version', get_string('version', 'badges'), ['size' => '70']);
6464
$mform->setType('version', PARAM_TEXT);
65-
$mform->addHelpButton('version', 'version', 'badges');
6665

6766
$languages = get_string_manager()->get_list_of_languages();
6867
$mform->addElement('select', 'language', get_string('language'), $languages);
69-
$mform->addHelpButton('language', 'language', 'badges');
7068

7169
$mform->addElement('textarea', 'description', get_string('description', 'badges'), 'wrap="virtual" rows="8" cols="70"');
7270
$mform->setType('description', PARAM_NOTAGS);
7371
$mform->addRule('description', null, 'required');
72+
$mform->addElement('static', 'descriptioninfo', null, get_string('descriptioninfo', 'badges'));
7473

7574
$str = $action == 'new' ? get_string('badgeimage', 'badges') : get_string('newimage', 'badges');
7675
$imageoptions = ['maxbytes' => 262144, 'accepted_types' => ['optimised_image']];
@@ -82,10 +81,11 @@ public function definition() {
8281
$currentimage = $mform->createElement('static', 'currentimage', get_string('currentimage', 'badges'));
8382
$mform->insertElementBefore($currentimage, 'image');
8483
}
85-
$mform->addHelpButton('image', 'badgeimage', 'badges');
84+
$mform->addElement('static', 'imageinfo', null, get_string('badgeimageinfo', 'badges'));
85+
8686
$mform->addElement('text', 'imagecaption', get_string('imagecaption', 'badges'), ['size' => '70']);
8787
$mform->setType('imagecaption', PARAM_TEXT);
88-
$mform->addHelpButton('imagecaption', 'imagecaption', 'badges');
88+
8989
$mform->addElement('tags', 'tags', get_string('tags', 'badges'), ['itemtype' => 'badge', 'component' => 'core_badges']);
9090

9191
$mform->addElement('header', 'issuerdetails', get_string('issuerdetails', 'badges'));
@@ -96,15 +96,14 @@ public function definition() {
9696
$site = get_site();
9797
$issuername = $CFG->badges_defaultissuername ?: $site->fullname;
9898
$mform->setDefault('issuername', $issuername);
99-
$mform->addHelpButton('issuername', 'issuername', 'badges');
10099

101100
$mform->addElement('text', 'issuercontact', get_string('contact', 'badges'), ['size' => '70']);
102101
if (isset($CFG->badges_defaultissuercontact)) {
103102
$mform->setDefault('issuercontact', $CFG->badges_defaultissuercontact);
104103
}
105104
$mform->setType('issuercontact', PARAM_RAW);
106105
$mform->addRule('issuercontact', null, 'email');
107-
$mform->addHelpButton('issuercontact', 'contact', 'badges');
106+
108107
// Set issuer URL.
109108
// Have to parse URL because badge issuer origin cannot be a subfolder in wwwroot.
110109
$url = parse_url($CFG->wwwroot);
@@ -124,7 +123,6 @@ public function definition() {
124123
$issuancedetails[] = $mform->createElement('static', 'expiryperiods_break', null, get_string('after', 'badges'));
125124

126125
$mform->addGroup($issuancedetails, 'expirydategr', get_string('expirydate', 'badges'), [' '], false);
127-
$mform->addHelpButton('expirydategr', 'expirydate', 'badges');
128126
$mform->setDefault('expiry', 0);
129127
$mform->setDefault('expiredate', strtotime('+1 year'));
130128
$mform->disabledIf('expiredate[day]', 'expiry', 'neq', 1);

lang/en/badges.php

+15-14
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
$string['badges'] = 'Badges';
147147
$string['badgedetails'] = 'Badge details';
148148
$string['badgeimage'] = 'Image';
149-
$string['badgeimage_help'] = 'The image should be at least 300 x 300 pixels in size. It will be displayed as 300 x 300 pixels on the badge page and 100 x 100 pixels on the user\'s profile page.';
149+
$string['badgeimageinfo'] = 'For best results, upload a square image with a minimum size of 300 x 300 pixels.';
150150
$string['badgeissued'] = 'Badge issued';
151151
$string['badgeprivacysetting'] = 'Badge privacy settings';
152152
$string['badgeprivacysetting_help'] = 'Badges you earn can be displayed on your account profile page. This setting allows you to automatically set the visibility of the newly earned badges.
@@ -179,7 +179,6 @@
179179
$string['balignment'] = 'Alignments ({$a})';
180180
$string['bydate'] = ' complete by';
181181
$string['imagecaption'] = 'Image caption';
182-
$string['imagecaption_help'] = 'If specified, an image caption is displayed on the badge page.';
183182
$string['claim'] = 'Claim';
184183
$string['claimcomment'] = 'Endorsement comment';
185184
$string['claimid'] = 'Claim URL';
@@ -191,8 +190,7 @@
191190
$string['connect'] = 'Connect';
192191
$string['connected'] = 'Connected';
193192
$string['connecting'] = 'Connecting...';
194-
$string['contact'] = 'Issuer contact';
195-
$string['contact_help'] = 'An email address associated with the badge issuer.';
193+
$string['contact'] = 'Email';
196194
$string['copy'] = 'Copy';
197195
$string['copyof'] = 'Copy of {$a}';
198196
$string['course'] = 'Course: {$a}';
@@ -288,6 +286,7 @@
288286
$string['delcritconfirm'] = 'Are you sure that you want to delete this criterion?';
289287
$string['delparamconfirm'] = 'Are you sure that you want to delete this parameter?';
290288
$string['description'] = 'Description';
289+
$string['descriptioninfo'] = 'What does this badge represent?';
291290
$string['disconnect'] = 'Disconnect';
292291
$string['donotaward'] = 'Currently, this badge is not active, so it cannot be awarded to users. If you would like to award this badge, please set its status to active.';
293292
$string['enablebadges'] = 'Enable badges';
@@ -310,7 +309,6 @@
310309
$string['error:noactivities'] = 'There are no activities with completion criteria enabled in this course.';
311310
$string['error:nobadges'] = 'There are currently no badges with access enabled to be added as criteria. A site badge can only have other site badges as criteria. A course badge can have other course badges or site badges as criteria.';
312311
$string['error:invalidparamcohort'] = 'Cohort does not exist. ';
313-
$string['error:noactivities'] = 'There are no activities with completion criteria enabled in this course.';
314312
$string['error:nocohorts'] = 'No cohorts';
315313
$string['error:nocourses'] = 'Course completion is not enabled for any of the courses in this site, so none can be displayed. Course completion may be enabled in the course settings.';
316314
$string['error:nogroupssummary'] = '<p>There are no public collections of badges available in your backpack. </p>';
@@ -355,14 +353,13 @@
355353
$string['expireperiodm'] = 'This badge expires {$a} minute(s) after being issued.';
356354
$string['expireperiods'] = 'This badge expires {$a} second(s) after being issued.';
357355
$string['expirydate'] = 'Expiry date';
358-
$string['expirydate_help'] = 'Optionally, badges can expire on a specific date, or the date can be calculated based on the date when the badge was issued to a user. ';
359356
$string['existsinbackpack'] = 'Badge already exists in backpack';
360357
$string['externalconnectto'] = 'To display external badges you need to <a href="{$a}">connect to a backpack</a>.';
361358
$string['externalbackpack_required'] = 'Backpack provider can\'t be blank';
362359
$string['externalbadges'] = 'My badges from other web sites';
363360
$string['externalbadgesp'] = 'Badges from other web sites:';
364361
$string['externalbadges_help'] = 'This area displays badges from your external backpack.';
365-
$string['fixed'] = 'Fixed date';
362+
$string['fixed'] = 'Fixed date: this badge expires on the following date:';
366363
$string['hidden'] = 'Hidden';
367364
$string['hiddenbadge'] = 'Unfortunately, the badge owner has not made this information available.';
368365
$string['hostedurl'] = 'External URL';
@@ -375,14 +372,12 @@
375372
$string['issuerdetails'] = 'Issuer details';
376373
$string['issueremail'] = 'Email';
377374
$string['issueremail_help'] = 'A contact email address of the organisation issuing the endorsement.';
378-
$string['issuername'] = 'Issuer name';
379-
$string['issuername_help'] = 'Name of the issuing agent or authority.';
375+
$string['issuername'] = 'Name';
380376
$string['issuername_endorsement'] = 'Endorser name';
381377
$string['issuername_endorsement_help'] = 'The name of the endorser.';
382-
$string['issuerurl'] = 'Issuer URL';
378+
$string['issuerurl'] = 'URL';
383379
$string['issuerurl_help'] = 'The website of the organisation issuing the endorsement. The URL should have a prefix http:// or https://.';
384380
$string['language'] = 'Language';
385-
$string['language_help'] = 'The language used on the badge page.';
386381
$string['listbackpacks'] = 'List of backpacks';
387382
$string['localconnectto'] = 'To share these badges outside this web site you need to <a href="{$a}">connect to a backpack</a>.';
388383
$string['localbadges'] = 'My badges from {$a} web site';
@@ -410,7 +405,7 @@
410405
$string['mybadges'] = 'My badges';
411406
$string['mybackpack'] = 'My backpack settings';
412407
$string['namewithlink'] = 'Name with link';
413-
$string['never'] = 'Never';
408+
$string['never'] = 'Never: this badge does not expire.';
414409
$string['newbackpack'] = 'Add a new backpack';
415410
$string['newbadge'] = 'Add a new badge';
416411
$string['newbadgedeprecated'] = 'You have been redirected from badges/newbadge.php. Please note that badges/newbadge.php will be removed in the near future.
@@ -504,7 +499,7 @@
504499
$string['recipient'] = 'Badge recipient';
505500
$string['recipients'] = 'Badge recipients';
506501
$string['recipientvalidationproblem'] = 'This user cannot be verified as a recipient of this badge.';
507-
$string['relative'] = 'Relative date';
502+
$string['relative'] = 'Relative date: this badge expires after a period of time:';
508503
$string['relatedbages'] = 'Related badges';
509504
$string['revoke'] = 'Revoke badge';
510505
$string['requiredcohort'] = 'At least one cohort should be added to the cohort criterion.';
@@ -582,7 +577,6 @@
582577
$string['viewbadge'] = 'View issued badge';
583578
$string['visible'] = 'Visible';
584579
$string['version'] = 'Version';
585-
$string['version_help'] = 'The version field may be used to keep track of the badge\'s development. If specified, the version is displayed on the badge page.';
586580
$string['warnexpired'] = ' (This badge has expired!)';
587581
$string['year'] = 'Year(s)';
588582
$string['includeauthdetails'] = "Include authentication details with the backpack";
@@ -603,3 +597,10 @@
603597
$string['imageauthorname_help'] = 'If specified, the name of the badge image author is displayed on the badge page.';
604598
$string['imageauthorurl'] = 'Image author\'s URL';
605599
$string['imageauthorurl_help'] = 'If specified, a link to the badge image author\'s website is displayed on the badge page. The URL should have a prefix http:// or https://.';
600+
$string['version_help'] = 'The version field may be used to keep track of the badge\'s development. If specified, the version is displayed on the badge page.';
601+
$string['language_help'] = 'The language used on the badge page.';
602+
$string['badgeimage_help'] = 'The image should be at least 300 x 300 pixels in size. It will be displayed as 300 x 300 pixels on the badge page and 100 x 100 pixels on the user\'s profile page.';
603+
$string['imagecaption_help'] = 'If specified, an image caption is displayed on the badge page.';
604+
$string['issuername_help'] = 'Name of the issuing agent or authority.';
605+
$string['contact_help'] = 'An email address associated with the badge issuer.';
606+
$string['expirydate_help'] = 'Optionally, badges can expire on a specific date, or the date can be calculated based on the date when the badge was issued to a user. ';

lang/en/deprecated.txt

+7
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,10 @@ imageauthorname,core_badges
156156
imageauthorname_help,core_badges
157157
imageauthorurl,core_badges
158158
imageauthorurl_help,core_badges
159+
version_help,core_badges
160+
language_help,core_badges
161+
badgeimage_help,core_badges
162+
imagecaption_help,core_badges
163+
issuername_help,core_badges
164+
contact_help,core_badges
165+
expirydate_help,core_badges

0 commit comments

Comments
 (0)