MDL-29005 display enrollable courses total and downloadable courses total instead...
authorJerome Mouneyrac <jerome@moodle.com>
Wed, 24 Aug 2011 06:40:15 +0000 (14:40 +0800)
committerJerome Mouneyrac <jerome@moodle.com>
Wed, 24 Aug 2011 06:40:15 +0000 (14:40 +0800)
blocks/community/forms.php
blocks/community/lang/en/block_community.php

index c4abd1e..6cb92e6 100644 (file)
@@ -155,10 +155,12 @@ class community_hub_search_form extends moodleform {
                                     array('class' => 'hubscreenshot'));
                     $hubdescriptiontext = html_writer::tag('span', format_text($hub['description'], FORMAT_PLAIN),
                                     array('class' => 'hubdescription'));
-                    $additionaldesc = get_string('sites', 'block_community') . ': ' . $hub['sites'] . ' - ' .
-                            get_string('courses', 'block_community') . ': ' . $hub['courses'];
-                    $hubdescriptiontext .= html_writer::tag('span', $additionaldesc,
-                                    array('class' => 'hubadditionaldesc'));
+                    if (isset($hub['enrollablecourses'])) { //needed for Moodle version < 2011081700
+                        $additionaldesc = get_string('enrollablecourses', 'block_community') . ': ' . $hub['enrollablecourses'] . ' - ' .
+                                get_string('downloadablecourses', 'block_community') . ': ' . $hub['downloadablecourses'];
+                        $hubdescriptiontext .= html_writer::tag('span', $additionaldesc,
+                                        array('class' => 'hubadditionaldesc'));
+                    }
                     if ($hub['trusted']) {
                     $hubtrusted =  get_string('hubtrusted', 'block_community');
                     $hubdescriptiontext .= html_writer::tag('span',
index 0505aeb..6885090 100644 (file)
@@ -49,6 +49,7 @@ $string['donotrestore'] = 'No';
 $string['dorestore'] = 'Yes';
 $string['download'] = 'Download';
 $string['downloadable'] = 'courses I can download';
+$string['downloadablecourses'] = 'Downloadable courses';
 $string['downloadconfirmed'] = 'The backup has been saved in your private files {$a}';
 $string['downloaded'] = '...finished.';
 $string['downloadingcourse'] = 'Downloading course';
@@ -61,6 +62,7 @@ $string['enroldownload_help'] = 'Some courses listed in the selected hub are bei
 
 Others are course templates provided for you to download and use on your own Moodle site.';
 $string['enrollable'] = 'courses I can enrol in';
+$string['enrollablecourses'] = 'Enrollable courses';
 $string['errorcourselisting'] = 'An error occured when retrieving the course listing from the selected hub, please try again later. ({$a})';
 $string['errorhublisting'] = 'An error occured when retrieving the hub listing from Moodle.org, please try again later. ({$a})';
 $string['fileinfo'] = 'Language: {$a->lang} - License: {$a->license} -  Time updated: {$a->timeupdated}';