/// Print out all the courses
+ $courses = get_courses_page($category->id, "c.sortorder ASC", "c.*", $totalcount, $page*$perpage, $perpage);
+ $numcourses = count($courses);
- if (!$courses = get_courses_page($category->id, "c.sortorder ASC", "c.*", $totalcount, $page*$perpage, $perpage)) {
+ if ($numcourses == 0) {
print_heading(get_string("nocoursesyet"));
- } else {
+ } else if ($numcourses <= COURSE_MAX_SUMMARIES_PER_PAGE and !$creatorediting) {
+ print_courses($category, "80%");
+ } else {
print_paging_bar($totalcount, $page, $perpage, "category.php?id=$category->id&perpage=$perpage&");
$strcourses = get_string("courses");
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
-
echo "<form name=\"movecourses\" action=\"category.php\" method=\"post\">";
echo "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\"><tr>";
echo "<th>$strcourses</th>";
echo "</tr>";
- $numcourses = count($courses);
$count = 0;
$abletomovecourses = false; // for now
}
echo "</td>";
} else {
- echo "<td>";
- if ($course->summary) {
- link_to_popup_window ("/course/info.php?id=$course->id", "courseinfo",
- "<img alt=\"info\" height=16 width=16 border=0 src=\"$pixpath/i/info.gif\">",
- 400, 500, $strsummary);
- echo " ";
- }
+ echo "<td align=\"right\">";
if ($course->guest ) {
- echo "<a href=\"view.php?id=$course->id\"><img title=\"$strallowguests\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a> ";
+ echo "<a href=\"view.php?id=$course->id\"><img hspace=2 title=\"$strallowguests\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
}
if ($course->password) {
- echo "<a href=\"view.php?id=$course->id\"><img title=\"$strrequireskey\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
+ echo "<a href=\"view.php?id=$course->id\"><img hspace=2 title=\"$strrequireskey\" alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
+ }
+ if ($course->summary) {
+ link_to_popup_window ("/course/info.php?id=$course->id", "courseinfo",
+ "<img hspace=2 alt=\"info\" height=16 width=16 border=0 src=\"$pixpath/i/info.gif\">",
+ 400, 500, $strsummary);
}
echo "</td>";
}
return;
}
+define('COURSE_MAX_SUMMARIES_PER_PAGE', 8); // records
+
define('COURSE_MAX_LOG_DISPLAY', 150); // days
define('COURSE_MAX_LOGS_PER_PAGE', 1000); // records
$courses = get_courses($category->id);
}
- if ($categories) {
- print_simple_box_start("center");
- print_heading(get_string("subcategories"));
- foreach ($categories as $category) {
- $linkcss = $category->visible ? "" : " class=\"dimmed\" ";
- echo "<p align=\"center\"><a $linkcss".
- " href=\"$CFG->wwwroot/course/index.php?category=$category->id\">$category->name</a></p>";
- }
- print_simple_box_end();
- }
-
if ($courses) {
foreach ($courses as $course) {
print_course($course, $width);