]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly nicer trimming of section summaries
authormoodler <moodler>
Sat, 14 Jun 2003 11:59:23 +0000 (11:59 +0000)
committermoodler <moodler>
Sat, 14 Jun 2003 11:59:23 +0000 (11:59 +0000)
course/format/topics.php

index b56182117b457a9207d941d0e0bbfd754141c5f7..97a036ca7f791bfbd9bf6d66262e1d58b844ada3 100644 (file)
     while ($section <= $course->numsections) {
 
         if (!empty($displaysection) and $displaysection != $section) {
-            $strsummary= "";
             if (!empty($sections[$section])) {
-                $strsummary = " - ".substr($sections[$section]->summary, 0, 60);
+                if (strlen($sections[$section]->summary < 57)) {
+                    $strsummary = " - ".$sections[$section]->summary;
+                } else {
+                    $strsummary = " - ".substr($sections[$section]->summary, 0, 60)."...";
+                }
+            } else {
+                $strsummary = "";
             }
             $sectionmenu["topic=$section"] = "$section$strsummary";
             $section++;