mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
community block MDL-23040 display licence on course listing
This commit is contained in:
parent
e1d4da0507
commit
437c2b858c
2 changed files with 14 additions and 3 deletions
|
@ -29,7 +29,7 @@ $string['add'] = 'Add';
|
||||||
$string['addtocommunityblock'] = 'Add to community block';
|
$string['addtocommunityblock'] = 'Add to community block';
|
||||||
$string['addcommunitycourse'] = 'Add community course';
|
$string['addcommunitycourse'] = 'Add community course';
|
||||||
$string['additionalcoursedesc'] = '{$a->lang} Creator: {$a->creatorname} - Publisher: {$a->publishername} - Subject: {$a->subject}
|
$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['addcourse'] = 'Search';
|
||||||
$string['audience'] = 'Designed for';
|
$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';
|
$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 .= ' - ';
|
$additionaldesc .= ' - ';
|
||||||
}
|
}
|
||||||
//retrieve language string
|
//retrieve language string
|
||||||
//construct languages array
|
|
||||||
|
|
||||||
if (!empty($course->language)) {
|
if (!empty($course->language)) {
|
||||||
$languages = get_string_manager()->get_list_of_languages();
|
$languages = get_string_manager()->get_list_of_languages();
|
||||||
$course->lang = get_string('langdesc', 'block_community', $languages[$course->language]);
|
$course->lang = get_string('langdesc', 'block_community', $languages[$course->language]);
|
||||||
} else {
|
} else {
|
||||||
$course->lang = '';
|
$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);
|
$additionaldesc .= get_string('additionalcoursedesc', 'block_community', $course);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$deschtml .= html_writer::tag('span', $additionaldesc, array('class' => 'additionaldesc'));
|
$deschtml .= html_writer::tag('span', $additionaldesc, array('class' => 'additionaldesc'));
|
||||||
//add content to the course description
|
//add content to the course description
|
||||||
if (!empty($course->contents)) {
|
if (!empty($course->contents)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue