From 5932b3aa6d57aa406970e0f53938128f2172dc99 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 14 Jun 2003 11:59:23 +0000 Subject: [PATCH] Slightly nicer trimming of section summaries --- course/format/topics.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/course/format/topics.php b/course/format/topics.php index b56182117b..97a036ca7f 100644 --- a/course/format/topics.php +++ b/course/format/topics.php @@ -136,9 +136,14 @@ 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++; -- 2.39.5