Permalink
Browse files

moodle--eduforge--1.3.3--patch-201 - optimized calls to get_courses()…

… to retrieve only required fields (martinlanghoff)
  • Loading branch information...
mjollnir_
mjollnir_ committed Nov 17, 2004
1 parent b0e5543 commit dcb043ddd32c6f6b746683e34517deb3207c7b9e
Showing with 6 additions and 6 deletions.
  1. +1 −1 course/category.php
  2. +1 −1 course/index.php
  3. +4 −4 course/lib.php
View
@@ -168,7 +168,7 @@
$movecourse = NULL;
$swapcourse = NULL;
- $courses = get_courses($category->id);
+ $courses = get_courses($category->id,'c.sortorder ASC', 'c.id,c.sortorder');
if (isset($moveup)) {
if ($movecourse = get_record("course", "id", $moveup)) {
View
@@ -237,7 +237,7 @@
}
/// Find any orphan courses that don't yet have a valid category and set to default
- if ($courses = get_courses()) {
+ if ($courses = get_courses(NULL,NULL,'c.category,c.id,c.sortorder')) {
foreach ($courses as $course) {
if ($course->category and !isset($categories[$course->category])) {
set_field("course", "category", $default, "id", $course->id);
View
@@ -1139,7 +1139,7 @@ function print_category_info($category, $depth) {
echo "\n\n<table border=0 cellpadding=3 cellspacing=0 width=\"100%\"><tr>";
if ($CFG->frontpage == FRONTPAGECOURSELIST) {
- $courses = get_courses($category->id);
+ $courses = get_courses($category->id, NULL, 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary');
echo "<tr>";
@@ -1214,14 +1214,14 @@ function print_courses($category, $width="100%") {
$categories = get_categories(0); // Parent = 0 ie top-level categories only
if (count($categories) == 1) {
$category = array_shift($categories);
- $courses = get_courses($category->id);
+ $courses = get_courses($category->id, NULL, 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary');
} else {
- $courses = get_courses("all");
+ $courses = get_courses("all", NULL, 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary');
}
unset($categories);
} else {
$categories = get_categories($category->id); // sub categories
- $courses = get_courses($category->id);
+ $courses = get_courses($category->id, NULL, 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary');
}
if ($courses) {

0 comments on commit dcb043d

Please sign in to comment.