Tidying up the way pix images are used.

It's now also possible to override the standard pix with a set of new ones
in a theme.
This commit is contained in:
moodler 2003-04-28 04:32:55 +00:00
parent 2b83b7f98b
commit dc0dc7d5dd
21 changed files with 222 additions and 172 deletions

View File

@ -175,7 +175,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
}
echo "<td nowrap align=right><font size=2>".userdate($log->time, "%a")."</td>";
echo "<td nowrap><font size=2>".userdate($log->time, $strftimedatetime)."</td>";
echo "<TD NOWRAP><FONT SIZE=2>";
echo "<td nowrap><font size=2>";
link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
echo "</td>";
echo "<td nowrap><font size=2><a href=\"../user/view.php?id=$log->userid&course=$log->course\"><b>$log->firstname $log->lastname</b></td>";
@ -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 = "<IMG SRC=\"pix/i/course.gif\" HEIGHT=16 WIDTH=16 ALT=\"".get_string("course")."\">";
if (empty($THEME->custompix)) {
$icon = "<img src=\"$CFG->wwwroot/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
} else {
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/course.gif\" height=16 width=16 alt=\"".get_string("course")."\">";
}
if ($courses) {
foreach ($courses as $course) {
$moddata[]="<A TITLE=\"$course->shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
$moddata[]="<a title=\"$course->shortname\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
$modicon[]=$icon;
if ($count++ >= $maxcount) {
break;
}
}
$fulllist = "<P><A HREF=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</A>...";
$fulllist = "<p><a href=\"$CFG->wwwroot/course/\">".get_string("fulllistofcourses")."</a>...";
} 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 "<BR>\n";
echo "<br />\n";
}
} else {
echo "<P>".get_string("nocoursesyet")."</P>";
echo "<p>".get_string("nocoursesyet")."</p>";
}
}
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 "<TABLE WIDTH=100%>";
@ -271,12 +281,12 @@ function print_course($course) {
if ($course->guest) {
$strallowguests = get_string("allowguests");
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A>&nbsp;&nbsp;";
echo "<IMG VSPACE=4 ALT=\"$strallowguests\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/user.gif\"></A>&nbsp;&nbsp;";
}
if ($course->password) {
$strrequireskey = get_string("requireskey");
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
echo "<IMG VSPACE=4 ALT=\"$strrequireskey\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$pixpath/i/key.gif\"></A>";
}
@ -644,9 +654,14 @@ function print_side_block_end() {
function print_admin_links ($siteid, $width=180) {
global $CFG;
global $CFG, $THEME;
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
if (empty($THEME->custompix)) {
$icon = "<img src=\"$CFG->wwwroot/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
} else {
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/settings.gif\" height=16 width=16 alt=\"\">";
}
if (isadmin()) {
$moddata[]="<A HREF=\"$CFG->wwwroot/$CFG->admin/config.php\">".get_string("configvariables")."</A>";
$modicon[]=$icon;
@ -696,45 +711,53 @@ function print_admin_links ($siteid, $width=180) {
print_side_block(get_string("administration"), "", $moddata, $modicon, $fulladmin, $width);
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1><BR>";
echo "<img src=\"$CFG->wwwroot/pix/spacer.gif\" width=\"$width\" height=1><br>";
}
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[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$adminicon[]="<img src=\"$pixpath/i/edit.gif\" height=16 width=16 alt=\"\">";
if (isediting($course->id)) {
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
$admindata[]="<a href=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</a>";
} else {
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
$admindata[]="<a href=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</a>";
}
$admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"edit.php?id=$course->id\">".get_string("settings")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
if (!$course->teachers) {
$course->teachers = get_string("defaultcourseteachers");
}
$admindata[]="<A HREF=\"teachers.php?id=$course->id\">$course->teachers...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"teachers.php?id=$course->id\">$course->teachers...</a>";
$adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"grades.php?id=$course->id\">".get_string("grades")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"grades.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"log.php?id=$course->id\">".get_string("logs")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/log.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/resource/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</a>";
$adminicon[]="<img src=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";
if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
$admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</a>";
$adminicon[]="<img src=\"$modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
}
} else {
$admindata[]="<A HREF=\"grade.php?id=$course->id\">".get_string("grades")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/grades.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
}
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("<A HREF=\"course/index.php?category=my\">".get_string("mycourses")."</A>", "LEFT");
print_heading("<a href=\"course/index.php?category=my\">".get_string("mycourses")."</a>", "left");
$some = false;
echo "<UL>";
echo "<ul>";
foreach ($courses as $key => $course) {
if (isteacher($course->id) or isstudent($course->id)) {
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
echo "<BR>";
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
echo "<br />";
$some = true;
}
}
if (!$some) {
print_string("nocoursesyet");
}
echo "</UL>";
echo "</ul>";
print_simple_box_end();
print_spacer(8,1);
}
foreach ($categories as $category) {
print_simple_box_start("CENTER", "100%");
print_heading("<A HREF=\"course/index.php?category=$category->id\">$category->name</A>", "LEFT");
print_heading("<a href=\"course/index.php?category=$category->id\">$category->name</a>", "left");
$some = false;
echo "<UL>";
echo "<ul>";
foreach ($courses as $key => $course) {
if ($course->category == $category->id) {
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
echo "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a>";
echo "&nbsp;&nbsp;";
unset($courses[$key]);
if ($course->guest ) {
echo "<A TITLE=\"$strallowguests\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/user/user.gif\"></A>";
echo "<a title=\"$strallowguests\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
}
if ($course->password) {
echo "<A TITLE=\"$strrequireskey\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<IMG ALT=\"\" HEIGHT=16 WIDTH=16 BORDER=0 SRC=\"$CFG->wwwroot/pix/i/key.gif\"></A>";
echo "<a title=\"$strrequireskey\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
}
echo "<BR>";
echo "<br />";
$some = true;
}
}
if (!$some) {
print_string("nocoursesyet");
}
echo "</UL>";
echo "</ul>";
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[]="<IMG SRC=\"$CFG->wwwroot/pix/i/course.gif\" HEIGHT=16 WIDTH=16>";
$caticon[]="<img src=\"$pixpath/i/course.gif\" height=16 width=16>";
if ($cat->id == $selected) {
$catdata[]="$cat->name";
} else {
$catdata[]="<A HREF=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</A>";
$catdata[]="<a href=\"$CFG->wwwroot/course/index.php?category=$cat->id\">$cat->name</a>";
}
}
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</A>";
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=all\">".get_string("fulllistofcourses")."</a>";
$caticon[] = "";
if (isset($USER->id)) {
$catdata[] = "<A HREF=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</A>";
$catdata[] = "<a href=\"$CFG->wwwroot/course/index.php?category=my\">".get_string("mycourses")."</a>";
$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 = "";
$path = ".";
}
if (empty($THEME->custompix)) {
$pixpath = "$path/../pix";
} else {
$pixpath = "$path/../theme/$CFG->theme/pix";
}
if ($visible) {
$hideshow = " <A TITLE=\"$str->hide\" HREF=\"".$path."mod.php?hide=$moduleid\"><IMG
SRC=".$path."../pix/t/hide.gif BORDER=0></A>";
$hideshow = " <a title=\"$str->hide\" href=\"$path/mod.php?hide=$moduleid\"><img
src=\"$pixpath/t/hide.gif\" height=11 width=11 border=0></a>";
} else {
$hideshow = " <A TITLE=\"$str->show\" HREF=\"".$path."mod.php?show=$moduleid\"><IMG
SRC=".$path."../pix/t/show.gif BORDER=0></A>";
$hideshow = " <a title=\"$str->show\" href=\"$path/mod.php?show=$moduleid\"><img
src=\"$pixpath/t/show.gif\" height=11 width=11 border=0></a>";
}
return "<A TITLE=\"$str->delete\" HREF=\"".$path."mod.php?delete=$moduleid\"><IMG
SRC=".$path."../pix/t/delete.gif BORDER=0></A>
<A TITLE=\"$str->moveup\" HREF=\"".$path."mod.php?id=$moduleid&move=-1\"><IMG
SRC=".$path."../pix/t/up.gif BORDER=0></A>
<A TITLE=\"$str->movedown\" HREF=\"".$path."mod.php?id=$moduleid&move=1\"><IMG
SRC=".$path."../pix/t/down.gif BORDER=0></A>
<A TITLE=\"$str->update\" HREF=\"".$path."mod.php?update=$moduleid\"><IMG
SRC=".$path."../pix/t/edit.gif BORDER=0></A> $hideshow";
return "<a title=\"$str->delete\" href=\"$path/mod.php?delete=$moduleid\"><img
src=\"$pixpath/t/delete.gif\" height=11 width=11 border=0></a>
<a title=\"$str->moveup\" href=\"$path/mod.php?id=$moduleid&move=-1\"><img
src=\"$pixpath/t/up.gif\" height=11 width=11 border=0></a>
<a title=\"$str->movedown\" href=\"$path/mod.php?id=$moduleid&move=1\"><img
src=\"$pixpath/t/down.gif\" height=11 width=11 border=0></a>
<a title=\"$str->update\" href=\"$path/mod.php?update=$moduleid\"><img
src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a> $hideshow";
}
?>

View File

@ -42,24 +42,24 @@
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
/// Admin links and controls
print_course_admin_links($course);
echo "</TD>";
echo "</td>";
echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
echo "<td width=\"*\" valign=\"top\">";
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 = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".get_string("socialheadline")."</td><td align=right><font size=1><a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td></tr></table>";
print_heading_block($headertext);
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
echo "<img alt=\"\" height=7 src=\"../pix/spacer.gif\"><br>";
forum_print_latest_discussions($social->id, 10, "plain", "", false);

View File

@ -33,22 +33,22 @@
/// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
echo "<tr valign=top><td valign=top width=180>";
/// Links to people
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@ -57,22 +57,22 @@
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_side_block($stractivities, "", $moddata, $modicon);
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform);
/// Admin links and controls
print_course_admin_links($course);
/// Start main column
echo "</TD><TD WIDTH=\"*\">";
echo "</td><td width=\"*\">";
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 "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top WIDTH=20>&nbsp;</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" WIDTH=\"100%\">";
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thistopic->summary .= "&nbsp;<A TITLE=\"$streditsummary\" ".
"HREF=\"editsection.php?id=$thistopic->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
$thistopic->summary .= "&nbsp;<a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thistopic->id\"><img src=\"$pixpath/t/edit.gif\" ".
"height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thistopic->summary);
@ -100,17 +100,17 @@
print_section($course, $thistopic, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$topic&add=",
$modnames, "section$topic", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
echo "</div>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"topicsoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10>&nbsp;";
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>&nbsp;";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
@ -139,12 +139,12 @@
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\"";
}
echo "<TR>";
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$section</B></FONT></P>";
echo "</TD>";
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";
echo "<TD VALIGN=top $colormain WIDTH=\"100%\">";
echo "<td valign=top $colormain width=\"100%\">";
if (!empty($sections[$section])) {
$thissection = $sections[$section];
@ -160,7 +160,7 @@
}
if (isediting($course->id)) {
$thissection->summary .= "&nbsp;<A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A>";
$thissection->summary .= "&nbsp;<a href=editsection.php?id=$thissection->id><img src=\"$pixpath/t/edit.gif\" border=0 height=11 width=11 alt=\"$streditsummary\"></a>";
}
echo text_to_html($thissection->summary);
@ -168,45 +168,45 @@
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
echo "</div>";
}
echo "</TD>";
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
echo "</td>";
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
if (isset($USER->topic)) {
$strshowalltopics = get_string("showalltopics");
echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"$strshowalltopics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\"><img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br><br>";
} else {
$strshowonlytopic = get_string("showonlytopic", "", $section);
echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"$strshowonlytopic\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\"><img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br><br>";
}
if (isediting($course->id) and $course->marker != $section) {
$strmarkthistopic = get_string("markthistopic");
echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"$strmarkthistopic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\"><img src=\"$pixpath/i/marker.gif\" height=16 width=16 border=0></a><br><br>";
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
$section++;
}
echo "</TABLE>";
echo "</table>";
if ($news or $course->showrecent) {
echo "</TD><TD WIDTH=210>";
echo "</td><td width=210>";
/// Print all the news items.
if ($news) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<FONT SIZE=\"-2\">";
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</FONT>";
echo "</font>";
print_side_block_end();
}
@ -220,6 +220,6 @@
print_spacer(1, 120, true);
}
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>

View File

@ -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");

View File

@ -23,22 +23,22 @@
/// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
echo "<tr valign=top><td valign=top width=180>";
/// Links to people
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@ -47,8 +47,8 @@
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_side_block($stractivities, "", $moddata, $modicon);
@ -76,14 +76,14 @@
$thisweek = $sections[$week];
if ($thisweek->summary or $thisweek->sequence or isediting($course->id)) {
echo "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$THEME->cellheading\" class=\"weeklyoutlineside\" VALIGN=top WIDTH=20>&nbsp;</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" WIDTH=\"100%\">";
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" ".
"HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" ".
"BORDER=0 ALT=\"$streditsummary\"></A></P>";
$thisweek->summary .= "&nbsp;<a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thisweek->id\"><img height=11 width=11 src=\"$pixpath/t/edit.gif\" ".
"border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thisweek->summary);
@ -91,10 +91,10 @@
print_section($course, $thisweek, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$week&add=",
$modnames, "section$week", "", "$stradd...", "mods", $stractivities);
echo "</DIV>";
echo "</div>";
}
echo "</TD>";
@ -139,13 +139,13 @@
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\"";
}
echo "<TR>";
echo "<TD NOWRAP $colorsides VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$week</B></FONT></P>";
echo "</TD>";
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$week</b></font></p>";
echo "</td>";
echo "<TD $colormain VALIGN=top WIDTH=\"100%\">";
echo "<P><FONT SIZE=3 COLOR=\"$THEME->cellheading2\">$weekday - $endweekday</FONT></P>";
echo "<td $colormain valign=top width=\"100%\">";
echo "<p><font size=3 color=\"$THEME->cellheading2\">$weekday - $endweekday</font></p>";
if (!empty($sections[$week])) {
$thisweek = $sections[$week];
@ -160,7 +160,7 @@
}
if (isediting($course->id)) {
$thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
$thisweek->summary .= "&nbsp;<a title=\"$streditsummary\" href=\"editsection.php?id=$thisweek->id\"><img src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thisweek->summary);
@ -168,41 +168,41 @@
print_section($course, $thisweek, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$week&add=",
$modnames, "section$week", "", "$stradd...");
echo "</DIV>";
echo "</div>";
}
echo "</TD>";
echo "<TD NOWRAP $colorsides VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
echo "</td>";
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
if (isset($USER->section)) {
$strshowallweeks = get_string("showallweeks");
echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"$strshowallweeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
echo "<a href=\"view.php?id=$course->id&week=all\" title=\"$strshowallweeks\"><img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a></font>";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $week);
echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"$strshowonlyweek\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
echo "<a href=\"view.php?id=$course->id&week=$week\" title=\"$strshowonlyweek\"><img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a></font>";
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
$week++;
$weekdate = $nextweekdate;
}
echo "</TABLE>";
echo "</table>";
if (!empty($news) or !empty($course->showrecent)) {
echo "</TD><TD WIDTH=210>";
echo "</td><td width=210>";
// Print all the news items.
if (!empty($news)) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<FONT SIZE=\"-2\">";
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</FONT>";
echo "</font>";
print_side_block_end();
}
@ -216,6 +216,6 @@
print_spacer(1, 120, true);
}
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 159 B

View File

@ -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<IMG align=\"absmiddle\" BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
$linkobject = "$title<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"\" src=\"$icon\">";
} else {
$linkobject = "<IMG align=\"absmiddle\" BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"$title\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
$linkobject = "<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"$title\" src=\"$icon\">";
}
} else {
$linkobject = $title;

View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 B

After

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 129 B

View File

@ -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 "<h2 align=center>$numstudents $course->students</h2>";
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 "<center><p>".get_string("displayingfirst", "", $moreinfo);
echo " (<a href=\"index.php?id=$course->id&sort=$sort&dir=$dir&showall=1\">".get_string("showall", "", $numstudents)."</a>)";

View File

@ -1,8 +1,7 @@
<?PHP // $Id$
$USER_SMALL_CLASS = 20; // Below this is considered small
$USER_LARGE_CLASS = 200; // Above this is considered large
$USER_HUGE_CLASS = 500; // Above this is considered too many to display
define('USER_SMALL_CLASS', 20); // Below this is considered small
define('USER_LARGE_CLASS', 200); // Above this is considered large
/// FUNCTIONS ///////////////////////////////////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B