From: W. Trevor King Date: Tue, 22 Jun 2010 01:20:45 +0000 (-0400) Subject: Merged 'no entry' fix to printSectionDocs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=538ceece1757357aca404fb92ead11963fdb10bd;p=course.git Merged 'no entry' fix to printSectionDocs --- diff --git a/html/php/section_docs.php b/html/php/section_docs.php index ab20df1..92d8395 100644 --- a/html/php/section_docs.php +++ b/html/php/section_docs.php @@ -7,7 +7,7 @@ * printSectionDocs('Recitation', 'doc/rec', 'rec', 20); */ function printSectionDocs($title, $directory, $startswith, $maxnum){ - $i = 1; + $count = 0; for ($i=$maxnum; $i>=0; $i-=1) { $front = "$directory/$startswith".$i."_"; $frontlen = strlen($front); @@ -20,6 +20,7 @@ function printSectionDocs($title, $directory, $startswith, $maxnum){ } } if ($num_readable > 0 or is_readable($comment_file)) { + $count += 1; echo "

$title $i

\n"; } // 's' b/c id attributes must begin with a letter, not a digit. if (is_readable($comment_file)) { @@ -40,5 +41,8 @@ function printSectionDocs($title, $directory, $startswith, $maxnum){ echo "\n"; } } + if ($count == 0) { + echo "

No entries yet

\n"; + } } ?>