]> git.mjollnir.org Git - moodle.git/commitdiff
FIxed the wording of the unread post notices on the course page
authormoodler <moodler>
Sat, 29 Jan 2005 09:56:42 +0000 (09:56 +0000)
committermoodler <moodler>
Sat, 29 Jan 2005 09:56:42 +0000 (09:56 +0000)
course/lib.php
lang/en/forum.php

index 0b56e2e3735288470e5b21524b20aba21a7504f7..c3a4f3521260658aea1550893fd9cea4b7c056f0 100644 (file)
@@ -957,6 +957,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
     static $ismoving;
     static $strmovehere;
     static $strmovefull;
+    static $strunreadpostsone;
+    static $strunreadpostsnumber;
 
     $labelformatoptions = New stdClass;
 
@@ -970,6 +972,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
             $strmovehere = get_string("movehere");
             $strmovefull = strip_tags(get_string("movefull", "", "'$USER->activitycopyname'"));
         }
+        $strunreadpostsone    = get_string('unreadpostsone', 'forum');
+        $strunreadpostsnumber = get_string('unreadpostsnumber', 'forum');
     }
     $labelformatoptions->noclean = true;
 
@@ -1042,8 +1046,11 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                         get_current_group($course->id) : false;
                     $unread = forum_tp_count_forum_posts($mod->instance, $groupid) -
                         forum_tp_count_forum_read_records($USER->id, $mod->instance, $groupid);
-                    $cssclass = ($unread > 0) ? 'unread' : 'read';
-                    echo '<span class="'.$cssclass.'"> '.get_string('unreadpostsnumber', 'forum', $unread).'.</span>';
+                    if ($unread == 1) {
+                        echo '<span class="unread"> '.$strunreadpostsone.' </span>';
+                    } else if ($unread) {
+                        echo '<span class="unread"> '.$strunreadpostsnumber.' </span>';
+                    }
                 }
 
                 if ($isediting) {
index 115b635ff634b3425c23597c3662ef55537ead74..f2d25438c93696d1418e09d6ac007256ba50349a 100644 (file)
@@ -156,7 +156,8 @@ $string['subscription'] = 'Subscription';
 $string['subscriptions'] = 'Subscriptions';
 $string['unread'] = 'Unread';
 $string['unreadposts'] = 'Unread posts';
-$string['unreadpostsnumber'] = '$a posts unread';
+$string['unreadpostsnumber'] = '$a unread posts';
+$string['unreadpostsone'] = '1 unread post';
 $string['unsubscribe'] = 'Unsubscribe from this forum';
 $string['unsubscribed'] = 'Unsubscribed';
 $string['unsubscribeshort'] = 'Unsubscribe';