mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
community block MDL-23040 display licence on course listing
This commit is contained in:
parent
e1d4da0507
commit
437c2b858c
@ -29,7 +29,7 @@ $string['add'] = 'Add';
|
||||
$string['addtocommunityblock'] = 'Add to community block';
|
||||
$string['addcommunitycourse'] = 'Add community course';
|
||||
$string['additionalcoursedesc'] = '{$a->lang} Creator: {$a->creatorname} - Publisher: {$a->publishername} - Subject: {$a->subject}
|
||||
- Audience: {$a->audience} - Educational level: {$a->educationallevel}';
|
||||
- Audience: {$a->audience} - Educational level: {$a->educationallevel} - License: {$a->license}';
|
||||
$string['addcourse'] = 'Search';
|
||||
$string['audience'] = 'Designed for';
|
||||
$string['audience_help'] = 'What kind of course are you looking for? As well as traditional courses intended for students, you might search for communities of Educators or Moodle Administrators';
|
||||
|
@ -126,16 +126,27 @@ class block_community_renderer extends plugin_renderer_base {
|
||||
$additionaldesc .= ' - ';
|
||||
}
|
||||
//retrieve language string
|
||||
//construct languages array
|
||||
|
||||
if (!empty($course->language)) {
|
||||
$languages = get_string_manager()->get_list_of_languages();
|
||||
$course->lang = get_string('langdesc', 'block_community', $languages[$course->language]);
|
||||
} else {
|
||||
$course->lang = '';
|
||||
}
|
||||
|
||||
//licence
|
||||
require_once($CFG->dirroot . "/lib/licenselib.php");
|
||||
$licensemanager = new license_manager();
|
||||
$licenses = $licensemanager->get_licenses();
|
||||
foreach ($licenses as $license) {
|
||||
if ($license->shortname == $course->licenceshortname) {
|
||||
$course->license = $license->fullname;
|
||||
}
|
||||
}
|
||||
|
||||
$additionaldesc .= get_string('additionalcoursedesc', 'block_community', $course);
|
||||
|
||||
|
||||
|
||||
$deschtml .= html_writer::tag('span', $additionaldesc, array('class' => 'additionaldesc'));
|
||||
//add content to the course description
|
||||
if (!empty($course->contents)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user