community MDL-19314 display correct translated value for educational level and audience, do not display coverage and contributors if empty

This commit is contained in:
jerome mouneyrac 2010-05-06 05:43:00 +00:00
parent ae2fa74f95
commit db38fcb759
2 changed files with 10 additions and 1 deletions

View File

@ -25,9 +25,10 @@
*/
$string['addcommunitycourse'] = 'Add community course';
$string['additionalcoursedesc'] = 'Contributors: {$a->contributornames} - Coverage: {$a->coverage} - Creator: {$a->creatorname} - Publisher: {$a->publishername} - Subject: {$a->subject}
$string['additionalcoursedesc'] = '{$a->contributornames} {$a->coverage} - Creator: {$a->creatorname} - Publisher: {$a->publishername} - Subject: {$a->subject}
- Audience: {$a->audience} - Educational level: {$a->educationallevel}';
$string['addcourse'] = 'Search';
$string['contributors'] = ' - Contributors: {$a}';
$string['coursedesc'] = 'Description';
$string['courselang'] = 'Language';
$string['coursename'] = 'Name';

View File

@ -80,6 +80,14 @@ class block_community_renderer extends plugin_renderer_base {
//create description to display
$course->subject = get_string($course->subject, 'edufields');
$course->audience = get_string('audience'.$course->audience, 'hub');
$course->educationallevel = get_string('edulevel'.$course->educationallevel, 'hub');
if (!empty($course->contributornames)) {
$course->contributorname = get_string('contributors', 'block_community', $course->contributorname);
}
if (!empty($course->coverage)) {
$course->coverage = get_string('coverage', 'block_community', $course->coverage);
}
$deschtml = $course->description; //the description
/// courses and sites number display under the description, in smaller
$deschtml .= html_writer::empty_tag('br');