diff --git a/course/lib.php b/course/lib.php index 5a4f6778692e9..5316579e732e7 100644 --- a/course/lib.php +++ b/course/lib.php @@ -175,7 +175,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") { } echo "".userdate($log->time, "%a").""; echo "".userdate($log->time, $strftimedatetime).""; - echo ""; + echo ""; link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700); echo ""; echo "userid&course=$log->course\">$log->firstname $log->lastname"; @@ -190,7 +190,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") { function print_all_courses($category="all", $style="full", $maxcount=999, $width=180) { - global $CFG, $USER; + global $CFG, $THEME, $USER; if ($category == "all") { $courses = get_courses(); @@ -212,16 +212,20 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width if ($style == "minimal") { $count = 0; - $icon = "\"".get_string("course")."\""; + if (empty($THEME->custompix)) { + $icon = "wwwroot/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">"; + } else { + $icon = "wwwroot/theme/$CFG->theme/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">"; + } if ($courses) { foreach ($courses as $course) { - $moddata[]="shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname"; + $moddata[]="shortname\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname"; $modicon[]=$icon; if ($count++ >= $maxcount) { break; } } - $fulllist = "

wwwroot/course/\">".get_string("fulllistofcourses")."..."; + $fulllist = "

wwwroot/course/\">".get_string("fulllistofcourses")."..."; } else { $moddata = array(); $modicon = array(); @@ -232,23 +236,29 @@ function print_all_courses($category="all", $style="full", $maxcount=999, $width } else if ($courses) { foreach ($courses as $course) { print_course($course); - echo "
\n"; + echo "
\n"; } } else { - echo "

".get_string("nocoursesyet")."

"; + echo "

".get_string("nocoursesyet")."

"; } } function print_course($course) { - global $CFG; + global $CFG, $THEME; if (! $site = get_site()) { error("Could not find a site!"); } + if (empty($THEME->custompix)) { + $pixpath = "$CFG->wwwroot/pix"; + } else { + $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix"; + } + print_simple_box_start("CENTER", "100%"); echo ""; @@ -271,12 +281,12 @@ function print_course($course) { if ($course->guest) { $strallowguests = get_string("allowguests"); echo "wwwroot/course/view.php?id=$course->id\">"; - echo "\"$strallowguests\"wwwroot/user/user.gif\">  "; + echo "\"$strallowguests\"  "; } if ($course->password) { $strrequireskey = get_string("requireskey"); echo "wwwroot/course/view.php?id=$course->id\">"; - echo "\"$strrequireskey\"wwwroot/pix/i/key.gif\">"; + echo "\"$strrequireskey\""; } @@ -644,9 +654,14 @@ function print_side_block_end() { function print_admin_links ($siteid, $width=180) { - global $CFG; + global $CFG, $THEME; - $icon = "wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + if (empty($THEME->custompix)) { + $icon = "wwwroot/pix/i/settings.gif\" height=16 width=16 alt=\"\">"; + } else { + $icon = "wwwroot/theme/$CFG->theme/pix/i/settings.gif\" height=16 width=16 alt=\"\">"; + } + if (isadmin()) { $moddata[]="wwwroot/$CFG->admin/config.php\">".get_string("configvariables").""; $modicon[]=$icon; @@ -696,45 +711,53 @@ function print_admin_links ($siteid, $width=180) { print_side_block(get_string("administration"), "", $moddata, $modicon, $fulladmin, $width); - echo "wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1>
"; + echo "wwwroot/pix/spacer.gif\" width=\"$width\" height=1>
"; } function print_course_admin_links($course, $width=180) { - global $USER, $CFG; + global $USER, $CFG, $THEME; + if (empty($THEME->custompix)) { + $pixpath = "$CFG->wwwroot/pix"; + $modpixpath = "$CFG->wwwroot/mod"; + } else { + $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix"; + $modpixpath = "$CFG->wwwroot/theme/$CFG->theme/pix/mod"; + } if (isteacher($course->id)) { - $adminicon[]="wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $adminicon[]="\"\""; if (isediting($course->id)) { - $admindata[]="id&edit=off\">".get_string("turneditingoff").""; + $admindata[]="id&edit=off\">".get_string("turneditingoff").""; } else { - $admindata[]="id&edit=on\">".get_string("turneditingon").""; + $admindata[]="id&edit=on\">".get_string("turneditingon").""; } - $admindata[]="id\">".get_string("settings")."..."; - $adminicon[]="wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="id\">".get_string("settings")."..."; + $adminicon[]="\"\""; if (!$course->teachers) { $course->teachers = get_string("defaultcourseteachers"); } - $admindata[]="id\">$course->teachers..."; - $adminicon[]="wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="id\">$course->teachers..."; + $adminicon[]="\"\""; - $admindata[]="id\">".get_string("grades")."..."; - $adminicon[]="wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="id\">".get_string("grades")."..."; + $adminicon[]="\"\""; - $admindata[]="id\">".get_string("logs")."..."; - $adminicon[]="wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; - $admindata[]="wwwroot/files/index.php?id=$course->id\">".get_string("files")."..."; - $adminicon[]="wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="id\">".get_string("logs")."..."; + $adminicon[]="\"\""; + + $admindata[]="wwwroot/files/index.php?id=$course->id\">".get_string("files")."..."; + $adminicon[]="\"\""; - $admindata[]="wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."..."; - $adminicon[]="wwwroot/mod/resource/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."..."; + $adminicon[]="\"\""; if ($teacherforum = forum_get_course_forum($course->id, "teacher")) { - $admindata[]="wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum").""; - $adminicon[]="wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum").""; + $adminicon[]="\"\""; } } else { - $admindata[]="id\">".get_string("grades")."..."; - $adminicon[]="wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">"; + $admindata[]="id\">".get_string("grades")."..."; + $adminicon[]="\"\""; } print_side_block(get_string("administration"), "", $admindata, $adminicon, "", $width); @@ -746,53 +769,59 @@ function print_course_categories($categories, $selected="none", $width=180) { $strallowguests = get_string("allowguests"); $strrequireskey = get_string("requireskey"); + if (empty($THEME->custompix)) { + $pixpath = "$CFG->wwwroot/pix"; + } else { + $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix"; + } + if ($selected == "index") { // Print comprehensive index of categories with courses if ($courses = get_courses()) { if (isset($USER->id) and !isadmin()) { print_simple_box_start("CENTER", "100%", $THEME->cellheading); - print_heading("".get_string("mycourses")."", "LEFT"); + print_heading("".get_string("mycourses")."", "left"); $some = false; - echo ""; print_simple_box_end(); print_spacer(8,1); } foreach ($categories as $category) { print_simple_box_start("CENTER", "100%"); - print_heading("id\">$category->name", "LEFT"); + print_heading("id\">$category->name", "left"); $some = false; - echo ""; print_simple_box_end(); print_spacer(8,1); } @@ -800,17 +829,17 @@ function print_course_categories($categories, $selected="none", $width=180) { } else { // Print short list of categories only foreach ($categories as $cat) { - $caticon[]="wwwroot/pix/i/course.gif\" HEIGHT=16 WIDTH=16>"; + $caticon[]=""; if ($cat->id == $selected) { $catdata[]="$cat->name"; } else { - $catdata[]="wwwroot/course/index.php?category=$cat->id\">$cat->name"; + $catdata[]="wwwroot/course/index.php?category=$cat->id\">$cat->name"; } } - $catdata[] = "wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses").""; + $catdata[] = "wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses").""; $caticon[] = ""; if (isset($USER->id)) { - $catdata[] = "wwwroot/course/index.php?category=my\">".get_string("mycourses").""; + $catdata[] = "wwwroot/course/index.php?category=my\">".get_string("mycourses").""; $caticon[] = ""; } print_side_block(get_string("categories"), "", $catdata, $caticon, "", $width); @@ -1019,7 +1048,7 @@ function move_module($cm, $move) { } function make_editing_buttons($moduleid, $absolute=false, $visible=true, $str=NULL) { - global $CFG; + global $CFG, $THEME; if (empty($str)) { $str->delete = get_string("delete"); @@ -1031,27 +1060,33 @@ function make_editing_buttons($moduleid, $absolute=false, $visible=true, $str=NU } if ($absolute) { - $path = "$CFG->wwwroot/course/"; + $path = "$CFG->wwwroot/course"; + } else { + $path = "."; + } + + if (empty($THEME->custompix)) { + $pixpath = "$path/../pix"; } else { - $path = ""; + $pixpath = "$path/../theme/$CFG->theme/pix"; } if ($visible) { - $hideshow = " hide\" HREF=\"".$path."mod.php?hide=$moduleid\">"; + $hideshow = " hide\" href=\"$path/mod.php?hide=$moduleid\">"; } else { - $hideshow = " show\" HREF=\"".$path."mod.php?show=$moduleid\">"; + $hideshow = " show\" href=\"$path/mod.php?show=$moduleid\">"; } - return "delete\" HREF=\"".$path."mod.php?delete=$moduleid\"> - moveup\" HREF=\"".$path."mod.php?id=$moduleid&move=-1\"> - movedown\" HREF=\"".$path."mod.php?id=$moduleid&move=1\"> - update\" HREF=\"".$path."mod.php?update=$moduleid\"> $hideshow"; + return "delete\" href=\"$path/mod.php?delete=$moduleid\"> + moveup\" href=\"$path/mod.php?id=$moduleid&move=-1\"> + movedown\" href=\"$path/mod.php?id=$moduleid&move=1\"> + update\" href=\"$path/mod.php?update=$moduleid\"> $hideshow"; } ?> diff --git a/course/social.php b/course/social.php index 3371135532c08..aae3dce78c6cd 100644 --- a/course/social.php +++ b/course/social.php @@ -42,24 +42,24 @@ /// Print a form to search forums $searchform = forum_print_search_form($course, "", true); - $searchform = "
$searchform
"; + $searchform = "
$searchform
"; print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth); /// Admin links and controls print_course_admin_links($course); - echo ""; + echo ""; - echo "
"; + echo ""; if ($social = forum_get_course_forum($course->id, "social")) { if (forum_is_subscribed($USER->id, $social->id)) { $subtext = get_string("unsubscribe", "forum"); } else { $subtext = get_string("subscribe", "forum"); } - $headertext = "
".get_string("socialheadline")."id\">$subtext
"; + $headertext = "
".get_string("socialheadline")."id\">$subtext
"; print_heading_block($headertext); - echo "\"\"
"; + echo "\"\"
"; forum_print_latest_discussions($social->id, 10, "plain", "", false); diff --git a/course/topics.php b/course/topics.php index 94b7e4a35f189..4035aff102f0b 100644 --- a/course/topics.php +++ b/course/topics.php @@ -33,22 +33,22 @@ /// Layout the whole page as three big columns. - echo ""; + echo "
"; /// The left column ... - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; } @@ -139,12 +139,12 @@ $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\""; } - echo ""; - echo ""; + echo ""; + echo ""; - echo ""; - echo ""; + echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; $section++; } - echo "
"; + echo "
"; /// Links to people - $moddata[]="id\">".get_string("participants").""; - $modicon[]="\"\""; - $editmyprofile = "firstname $USER->lastname\" HREF=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile").""; + $moddata[]="id\">".get_string("participants").""; + $modicon[]="\"\""; + $editmyprofile = "firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile").""; if ($USER->description) { $moddata[]= $editmyprofile; } else { - $moddata[]= $editmyprofile." *"; + $moddata[]= $editmyprofile." *"; } - $modicon[]="\"\""; + $modicon[]="\"\""; print_side_block(get_string("people"), "", $moddata, $modicon); @@ -57,22 +57,22 @@ $modicon = array(); if ($modnamesused) { foreach ($modnamesused as $modname => $modfullname) { - $moddata[] = "id\">".$modnamesplural[$modname].""; - $modicon[] = "\"\""; + $moddata[] = "id\">".$modnamesplural[$modname].""; + $modicon[] = "\"\""; } } print_side_block($stractivities, "", $moddata, $modicon); /// Print a form to search forums $searchform = forum_print_search_form($course, "", true); - $searchform = "
$searchform
"; + $searchform = "
$searchform
"; print_side_block(get_string("search","forum"), $searchform); /// Admin links and controls print_course_admin_links($course); /// Start main column - echo "
"; + echo ""; print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock"); print_spacer(8, 1, true); @@ -85,14 +85,14 @@ $thistopic = $sections[$topic]; if ($thistopic->summary or $thistopic->sequence or isediting($course->id)) { - echo "
cellheading\" class=\"topicsoutlineside\" VALIGN=top WIDTH=20> cellcontent\" class=\"topicsoutlinecontent\" WIDTH=\"100%\">"; + echo "
cellheading\" class=\"topicsoutlineside\" valign=top width=20> cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">"; if (isediting($course->id)) { - $thistopic->summary .= " id\">\"$streditsummary\"

"; + $thistopic->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thistopic->summary); @@ -100,17 +100,17 @@ print_section($course, $thistopic, $mods, $modnamesused); if (isediting($course->id)) { - echo "
"; + echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$topic&add=", $modnames, "section$topic", "", "$stradd...", "mods", $stractivities); - echo "
"; + echo "
"; } - echo "
cellheading\" class=\"topicsoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10> "; - echo "
cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10> "; + echo "
"; - echo "

$section

"; - echo "
"; + echo "

$section

"; + echo "
"; + echo ""; if (!empty($sections[$section])) { $thissection = $sections[$section]; @@ -160,7 +160,7 @@ } if (isediting($course->id)) { - $thissection->summary .= " id>\"$streditsummary\""; + $thissection->summary .= " id>\"$streditsummary\""; } echo text_to_html($thissection->summary); @@ -168,45 +168,45 @@ print_section($course, $thissection, $mods, $modnamesused); if (isediting($course->id)) { - echo "
"; + echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=", $modnames, "section$section", "", "$stradd...", "mods", $stractivities); - echo "
"; + echo "
"; } - echo "
"; - echo ""; + echo ""; + echo ""; if (isset($USER->topic)) { $strshowalltopics = get_string("showalltopics"); - echo "id&topic=all\" TITLE=\"$strshowalltopics\">

"; + echo "id&topic=all\" title=\"$strshowalltopics\">

"; } else { $strshowonlytopic = get_string("showonlytopic", "", $section); - echo "id&topic=$section\" TITLE=\"$strshowonlytopic\">

"; + echo "id&topic=$section\" title=\"$strshowonlytopic\">

"; } if (isediting($course->id) and $course->marker != $section) { $strmarkthistopic = get_string("markthistopic"); - echo "id&marker=$section\" TITLE=\"$strmarkthistopic\">

"; + echo "id&marker=$section\" title=\"$strmarkthistopic\">

"; } - echo "
"; + echo "
"; if ($news or $course->showrecent) { - echo ""; + echo ""; /// Print all the news items. if ($news) { print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews"); - echo ""; + echo ""; forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false); - echo ""; + echo ""; print_side_block_end(); } @@ -220,6 +220,6 @@ print_spacer(1, 120, true); } - echo "\n"; + echo "\n"; ?> diff --git a/course/view.php b/course/view.php index fa5b47db4157c..75808f865ee46 100644 --- a/course/view.php +++ b/course/view.php @@ -50,6 +50,13 @@ redirect("$CFG->wwwroot/"); } + if (empty($THEME->custompix)) { + $pixpath = "../pix"; + $modpixpath = "../mod"; + } else { + $pixpath = "../theme/$CFG->theme/pix"; + $modpixpath = "../theme/$CFG->theme/pix/mod"; + } $courseword = get_string("course"); diff --git a/course/weeks.php b/course/weeks.php index 9c8bc360823b0..5a2c34c255d97 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -23,22 +23,22 @@ /// Layout the whole page as three big columns. - echo ""; + echo "
"; /// The left column ... - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; @@ -139,13 +139,13 @@ $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\""; } - echo ""; - echo ""; + echo ""; + echo ""; - echo ""; - echo ""; + echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; $week++; $weekdate = $nextweekdate; } - echo "
"; + echo "
"; /// Links to people - $moddata[]="id\">".get_string("participants").""; - $modicon[]="\"\""; - $editmyprofile = "firstname $USER->lastname\" HREF=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile").""; + $moddata[]="id\">".get_string("participants").""; + $modicon[]="\"\""; + $editmyprofile = "firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile").""; if ($USER->description) { $moddata[]= $editmyprofile; } else { - $moddata[]= $editmyprofile." *"; + $moddata[]= $editmyprofile." *"; } - $modicon[]="\"\""; + $modicon[]="\"\""; print_side_block(get_string("people"), "", $moddata, $modicon); @@ -47,8 +47,8 @@ $modicon = array(); if ($modnamesused) { foreach ($modnamesused as $modname => $modfullname) { - $moddata[] = "id\">".$modnamesplural[$modname].""; - $modicon[] = "\"\""; + $moddata[] = "id\">".$modnamesplural[$modname].""; + $modicon[] = "\"\""; } } print_side_block($stractivities, "", $moddata, $modicon); @@ -76,14 +76,14 @@ $thisweek = $sections[$week]; if ($thisweek->summary or $thisweek->sequence or isediting($course->id)) { - echo "
cellheading\" class=\"weeklyoutlineside\" VALIGN=top WIDTH=20> cellcontent\" class=\"weeklyoutlinecontent\" WIDTH=\"100%\">"; + echo "
cellheading\" class=\"weeklyoutlineside\" valign=top width=20> cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">"; if (isediting($course->id)) { - $thisweek->summary .= " id\">\"$streditsummary\"

"; + $thisweek->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thisweek->summary); @@ -91,10 +91,10 @@ print_section($course, $thisweek, $mods, $modnamesused); if (isediting($course->id)) { - echo "
"; + echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=", $modnames, "section$week", "", "$stradd...", "mods", $stractivities); - echo "
"; + echo "
"; } echo "
"; - echo "

$week

"; - echo "
"; + echo "

$week

"; + echo "
"; - echo "

cellheading2\">$weekday - $endweekday

"; + echo "
"; + echo "

cellheading2\">$weekday - $endweekday

"; if (!empty($sections[$week])) { $thisweek = $sections[$week]; @@ -160,7 +160,7 @@ } if (isediting($course->id)) { - $thisweek->summary .= " id\">\"$streditsummary\"

"; + $thisweek->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thisweek->summary); @@ -168,41 +168,41 @@ print_section($course, $thisweek, $mods, $modnamesused); if (isediting($course->id)) { - echo "
"; + echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=", $modnames, "section$week", "", "$stradd..."); - echo "
"; + echo "
"; } - echo "
"; - echo ""; + echo ""; + echo ""; if (isset($USER->section)) { $strshowallweeks = get_string("showallweeks"); - echo "id&week=all\" TITLE=\"$strshowallweeks\">"; + echo "id&week=all\" title=\"$strshowallweeks\">"; } else { $strshowonlyweek = get_string("showonlyweek", "", $week); - echo "id&week=$week\" TITLE=\"$strshowonlyweek\">"; + echo "id&week=$week\" title=\"$strshowonlyweek\">"; } - echo "
"; + echo ""; if (!empty($news) or !empty($course->showrecent)) { - echo ""; + echo ""; // Print all the news items. if (!empty($news)) { print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews"); - echo ""; + echo ""; forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false); - echo ""; + echo ""; print_side_block_end(); } @@ -216,6 +216,6 @@ print_spacer(1, 120, true); } - echo "\n"; + echo "\n"; ?> diff --git a/files/pix/folder.gif b/files/pix/folder.gif index 4e183891f2e69..e75b283b47cee 100755 Binary files a/files/pix/folder.gif and b/files/pix/folder.gif differ diff --git a/lib/weblib.php b/lib/weblib.php index 73a44bf8c118f..f0bddcb9a6ad4 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1108,17 +1108,23 @@ function helpbutton ($page, $title="", $module="moodle", $image=true, $linktext= // $image = use a help image for the link? (true/false/"both") // $text = if defined then this text is used in the page, and // the $page variable is ignored. - global $CFG; + global $CFG, $THEME; if ($module == "") { $module = "moodle"; } + if (empty($THEME->custompix)) { + $icon = "$CFG->wwwroot/pix/help.gif"; + } else { + $icon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif"; + } + if ($image) { if ($linktext) { - $linkobject = "$title\"\"wwwroot/pix/help.gif\">"; + $linkobject = "$title\"\""; } else { - $linkobject = "\"$title\"wwwroot/pix/help.gif\">"; + $linkobject = "\"$title\""; } } else { $linkobject = $title; diff --git a/files/pix/files.gif b/pix/i/files.gif similarity index 100% rename from files/pix/files.gif rename to pix/i/files.gif diff --git a/pix/t/search.gif b/pix/i/search.gif similarity index 100% rename from pix/t/search.gif rename to pix/i/search.gif diff --git a/pix/t/delete.gif b/pix/t/delete.gif index fef6b39e7085e..83fd604c59209 100644 Binary files a/pix/t/delete.gif and b/pix/t/delete.gif differ diff --git a/pix/t/down.gif b/pix/t/down.gif index 693c3749f6dc4..f270157d1cf91 100644 Binary files a/pix/t/down.gif and b/pix/t/down.gif differ diff --git a/pix/t/edit.gif b/pix/t/edit.gif index e19239533dcb7..af71778efea08 100644 Binary files a/pix/t/edit.gif and b/pix/t/edit.gif differ diff --git a/pix/t/hide.gif b/pix/t/hide.gif index f2092f26832c5..fa4b4facdd112 100644 Binary files a/pix/t/hide.gif and b/pix/t/hide.gif differ diff --git a/pix/t/left.gif b/pix/t/left.gif index 9772fb29e34ed..08201d453f75d 100755 Binary files a/pix/t/left.gif and b/pix/t/left.gif differ diff --git a/pix/t/right.gif b/pix/t/right.gif index 55cdd1f4f7796..52e52c2e10fa6 100755 Binary files a/pix/t/right.gif and b/pix/t/right.gif differ diff --git a/pix/t/show.gif b/pix/t/show.gif index 8a2e50b24f44c..bb598399b3450 100644 Binary files a/pix/t/show.gif and b/pix/t/show.gif differ diff --git a/pix/t/up.gif b/pix/t/up.gif index 6de0cf15c07a8..2056b6e6ac0a0 100644 Binary files a/pix/t/up.gif and b/pix/t/up.gif differ diff --git a/user/index.php b/user/index.php index eda612a762c4e..b92f058b654f3 100644 --- a/user/index.php +++ b/user/index.php @@ -62,10 +62,16 @@ $dsort = "u.$sort"; } - if ($students = get_course_students($course->id, "$dsort $dir")) { + if (!$showall) { + $limit = "LIMIT ".USER_LARGE_CLASS; + } else { + $limit = ""; + } + + if ($students = get_course_students($course->id, "$dsort $dir $limit")) { $numstudents = count($students); echo "

$numstudents $course->students

"; - if ($numstudents < $USER_SMALL_CLASS) { + if ($numstudents < USER_SMALL_CLASS) { foreach ($students as $student) { print_user($student, $course, $string); } @@ -109,19 +115,15 @@ $table->cellpadding = 2; $table->cellspacing = 0; - $count = 0; foreach ($students as $student) { - $count++; - if (!$showall and $count > $USER_LARGE_CLASS) { - break; - } + if ($student->lastaccess) { $lastaccess = format_time(time() - $student->lastaccess, $string); } else { $lastaccess = $string->never; } - if ($showall and $numstudents > $USER_LARGE_CLASS) { // Don't show pictures + if ($showall and $numstudents > USER_LARGE_CLASS) { // Don't show pictures $picture = ""; } else { $picture = print_user_picture($student->id, $course->id, $student->picture, false, true); @@ -135,8 +137,9 @@ } print_table($table); - if ($numstudents > $USER_LARGE_CLASS and !$showall) { - $moreinfo->count = $USER_LARGE_CLASS; + if ($numstudents == USER_LARGE_CLASS and !$showall) { + $numstudents = count_records("user_students", "course", $course->id); + $moreinfo->count = USER_LARGE_CLASS; $moreinfo->things = strtolower($course->students); echo "

".get_string("displayingfirst", "", $moreinfo); echo " (id&sort=$sort&dir=$dir&showall=1\">".get_string("showall", "", $numstudents).")"; diff --git a/user/lib.php b/user/lib.php index 4f25cc7c2635c..4f54d4b4af09f 100644 --- a/user/lib.php +++ b/user/lib.php @@ -1,8 +1,7 @@