Two things are in this checkin:

1) Support for the new "label" module has been added.  It's unfortunate
   about having to make these exceptions but this was the overall cleanest
   way I could think of.

2) All local calculation of pixpath and modpixpath has been removed and
   replaced with a single calculation which is done in setup.php and
   stored in $CFG->pixpath and #CFG->modpixpath.  All graphics should
   use these variables so that themes can easily override them.
This commit is contained in:
moodler 2003-09-14 12:25:16 +00:00
parent c7ce6d80a3
commit c9f6251ea8
10 changed files with 135 additions and 168 deletions

View File

@ -13,7 +13,7 @@
<td width="<?php echo $leftwidth?>" valign="top">
<?php
$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=\"\">";
$modicon[]="<img src=\"$CFG->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) {
@ -21,7 +21,7 @@
} else {
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);

View File

@ -54,14 +54,14 @@
/// Links to people
$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=\"\">";
$modicon[]="<img src=\"$CFG->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>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@ -71,7 +71,7 @@
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$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=\"\">";
$modicon[] = "<img src=\"$CFG->modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_side_block($stractivities, "", $moddata, $modicon);
@ -122,7 +122,7 @@
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img src=\"$pixpath/t/edit.gif\" ".
"href=\"editsection.php?id=$thissection->id\"><img src=\"$CFG->pixpath/t/edit.gif\" ".
"height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
}
@ -211,7 +211,7 @@
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
"<img src=\"$pixpath/t/edit.gif\" border=0 height=11 width=11></a>";
"<img src=\"$CFG->pixpath/t/edit.gif\" border=0 height=11 width=11></a>";
}
echo text_to_html($thissection->summary);
@ -232,38 +232,38 @@
if ($displaysection == $section) { // Show the zoom boxes
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 />";
"<img src=\"$CFG->pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlytopic = get_string("showonlytopic", "", $section);
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 />";
"<img src=\"$CFG->pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id)) {
if ($course->marker == $section) { // Show the "light globe" on/off
echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
"<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
"<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($section > 1) { // Add a arrow to move section up
echo "<a href=\"view.php?id=$course->id&section=$section&move=-1\" title=\"$strmoveup\">".
"<img src=\"$pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo "<a href=\"view.php?id=$course->id&section=$section&move=1\" title=\"$strmovedown\">".
"<img src=\"$pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
}

View File

@ -42,14 +42,14 @@
/// Links to people
$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=\"\">";
$modicon[]="<img src=\"$CFG->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>";
}
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$modicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
@ -58,8 +58,10 @@
$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=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
if ($modname != "label") {
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$CFG->modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
}
print_side_block($stractivities, "", $moddata, $modicon);
@ -109,7 +111,7 @@
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$pixpath/t/edit.gif\" ".
"href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$CFG->pixpath/t/edit.gif\" ".
"border=0 alt=\"$streditsummary\"></a></p>";
}
@ -201,7 +203,7 @@
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=\"editsection.php?id=$thissection->id\">".
"<img src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a></p>";
"<img src=\"$CFG->pixpath/t/edit.gif\" height=11 width=11 border=0></a></p>";
}
echo text_to_html($thissection->summary);
@ -222,30 +224,30 @@
if ($displaysection == $section) {
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><br />";
"<img src=\"$CFG->pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $section);
echo "<a href=\"view.php?id=$course->id&week=$section\" title=\"$strshowonlyweek\">".
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id)) {
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strweekhide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strweekshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
"<img src=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($section > 1) { // Add a arrow to move section up
echo "<a href=\"view.php?id=$course->id&section=$section&move=-1\" title=\"$strmoveup\">".
"<img src=\"$pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo "<a href=\"view.php?id=$course->id&section=$section&move=1\" title=\"$strmovedown\">".
"<img src=\"$pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
"<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
}

View File

@ -261,6 +261,11 @@ function print_recent_activity($course) {
if ($logs) {
foreach ($logs as $key => $log) {
$info = split(" ", $log->info);
if ($info[0] == "label") { // Labels are special activities
continue;
}
$modname = get_field($info[0], "name", "id", $info[1]);
//Create a temp valid module structure (course,id)
$tempmod->course = $log->course;
@ -386,6 +391,11 @@ function get_array_of_activities($courseid) {
}
}
}
if ($mod[$seq]->mod == "label") {
if ($label = get_record("label", "id", $rawmods[$seq]->instance)) {
$mod[$seq]->extra = urlencode($label->content);
}
}
}
}
}
@ -512,12 +522,7 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
$strmovefull = get_string("movefull", "", "'$USER->activitycopyname'");
$stractivityclipboard = $USER->activitycopyname;
$strcancel= get_string("cancel");
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
$modicon[] = "&nbsp;<img align=bottom src=\"$pixpath/t/move.gif\" height=\"11\" width=\"11\">";
$modicon[] = "&nbsp;<img align=bottom src=\"$CFG->pixpath/t/move.gif\" height=\"11\" width=\"11\">";
$moddata[] = "$USER->activitycopyname&nbsp;(<a href=\"$CFG->wwwroot/course/mod.php?cancelcopy=true\">$strcancel</a>)";
}
@ -548,11 +553,16 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
$extra = "";
}
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\"".
" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
$moddata[] = "<a title=\"$mod->modfullname\" $linkcss $extra".
"href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a>".
"$editbuttons";
if ($mod->modname == "label") {
$modicon[] = "";
$moddata[] = format_text($extra, FORMAT_HTML).$editbuttons;
} else {
$modicon[] = "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\"".
" height=\"16\" width=\"16\" alt=\"$mod->modfullname\">";
$moddata[] = "<a title=\"$mod->modfullname\" $linkcss $extra".
"href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a>".
"$editbuttons";
}
}
}
}
@ -599,7 +609,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$modinfo = unserialize($course->modinfo);
echo "<table width=\"$width\"><tr><td>\n";
echo "<table width=\"$width\" cellpadding=3 cellspacing=0>\n";
if (!empty($section->sequence)) {
$sectionmods = explode(",", $section->sequence);
@ -609,7 +619,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
continue;
}
$mod = $mods[$modnumber];
if ($mod->visible or $isteacher) {
echo "<tr><td class=\"activity$mod->modname\">";
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
@ -618,31 +630,38 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
" href=\"mod.php?moveto=$mod->id\">$strmovehere</a></font><br />\n";
}
$instancename = urldecode($modinfo[$modnumber]->name);
if (!empty($modinfo[$modnumber]->extra)) {
$extra = urldecode($modinfo[$modnumber]->extra);
} else {
$extra = "";
}
$linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
echo "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\"".
" height=16 width=16 alt=\"$mod->modfullname\">".
" <font size=2><a title=\"$mod->modfullname\" $linkcss $extra".
" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a></font>";
}
if (isediting($course->id)) {
echo "&nbsp;&nbsp;";
echo make_editing_buttons($mod->id, $absolute, $mod->visible);
}
if ($mod->visible or $isteacher) {
echo "<br />\n";
if ($mod->modname == "label") {
echo format_text($extra, FORMAT_HTML);
} else { // Normal activity
$linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
echo "<img src=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\"".
" height=16 width=16 alt=\"$mod->modfullname\">".
" <font size=2><a title=\"$mod->modfullname\" $linkcss $extra".
" href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</a></font>";
}
echo "</td>";
if ($isediting) {
echo "<td align=\"right\" valign=\"top\" nowrap=\"nowrap\" class=\"activityeditbuttons\">";
echo make_editing_buttons($mod->id, $absolute, $mod->visible);
echo " </td>";
}
echo "</tr>";
}
}
}
if ($ismoving) {
echo "<font size=\"2\"> -> <a title=\"$strmovefull\"".
" href=\"mod.php?movetosection=$section->id\">$strmovehere</a></font><br />\n";
echo "<tr><td><font size=\"2\"> -> <a title=\"$strmovefull\"".
" href=\"mod.php?movetosection=$section->id\">$strmovehere</a></font></td></tr>\n";
}
echo "</td></tr></table><br />\n\n";
echo "</table>\n\n";
}
@ -734,37 +753,31 @@ function print_side_block_end() {
function print_admin_links ($siteid, $width=180) {
global $CFG, $THEME;
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
if (isadmin()) {
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">".get_string("configuration")."</a>...";
$modicon[]="<img src=\"$pixpath/i/admin.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/admin.gif\" height=16 width=16 alt=\"\" />";
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/users.php\">".get_string("users")."</a>...";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\" />";
}
if (iscreator()) {
$moddata[]="<a href=\"$CFG->wwwroot/course/index.php?edit=on\">".get_string("courses")."</a>";
$modicon[]="<img src=\"$pixpath/i/course.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/course.gif\" height=16 width=16 alt=\"\" />";
$fulladmin = "";
}
if (isadmin()) {
$moddata[]="<a href=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("logs")."</a>";
$modicon[]="<img src=\"$pixpath/i/log.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/log.gif\" height=16 width=16 alt=\"\" />";
$moddata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$siteid\">".get_string("sitefiles")."</a>";
$modicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/files.gif\" height=16 width=16 alt=\"\" />";
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".
get_string("managedatabase")."</a>";
$modicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\" />";
$modicon[]="<img src=\"$CFG->pixpath/i/settings.gif\" height=16 width=16 alt=\"\" />";
}
$fulladmin = "<p><a href=\"$CFG->wwwroot/$CFG->admin/\">".get_string("admin")."</a>...";
}
@ -780,30 +793,23 @@ function print_course_admin_links($course, $width=180) {
if (isguest()) {
return true;
}
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)) {
if (isteacheredit($course->id)) {
$adminicon[]="<img src=\"$pixpath/i/edit.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->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>";
} else {
$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=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
if (iscreator() or !empty($CFG->teacherassignteachers)) {
if (!$course->teachers) {
$course->teachers = get_string("defaultcourseteachers");
}
$admindata[]="<a href=\"teacher.php?id=$course->id\">$course->teachers...</a>";
$adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
}
}
@ -811,47 +817,47 @@ function print_course_admin_links($course, $width=180) {
$course->students = get_string("defaultcoursestudents");
}
$admindata[]="<a href=\"student.php?id=$course->id\">$course->students...</a>";
$adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
if (isteacheredit($course->id)) {
$admindata[]="<a href=\"$CFG->wwwroot/backup/backup.php?id=$course->id\">".get_string("backup")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/backup.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/backup.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id&wdir=/backupdata\">".get_string("restore")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/restore.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/restore.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"scales.php?id=$course->id\">".get_string("scales")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/scales.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/scales.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=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/grades.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=\"\">";
$adminicon[]="<img src=\"$CFG->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=\"\">";
$adminicon[]="<img src=\"$CFG->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=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->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\">$teacherforum->name</a>";
$adminicon[]="<img src=\"$modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
}
} else if (!isguest()) { // Students menu
if ($course->showgrades) {
$admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
}
if ($CFG->auth == "email" or $CFG->auth == "none" or $CFG->auth == "manual") {
$admindata[]="<a href=\"$CFG->wwwroot/login/change_password.php?id=$course->id\">".
get_string("changepassword")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
} else if ($CFG->changepassword) {
$admindata[]="<a href=\"$CFG->changepassword\">".get_string("changepassword")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
$adminicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
}
}
@ -941,15 +947,10 @@ function print_category_info($category, $depth) {
$strsummary = get_string("summary");
}
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
$catlinkcss = $category->visible ? "" : " class=\"dimmed\" ";
if ($CFG->frontpage == FRONTPAGECOURSELIST) {
$catimage = "<img src=\"$pixpath/i/course.gif\" width=16 height=16 border=0>";
$catimage = "<img src=\"$CFG->pixpath/i/course.gif\" width=16 height=16 border=0>";
} else {
$catimage = "&nbsp";
}
@ -985,22 +986,22 @@ function print_category_info($category, $depth) {
echo "</td>\n<td align=\"right\" valign=\"top\" nowrap class=\"coursename\">";
if ($course->guest ) {
echo "<a title=\"$strallowguests\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img hspace=1 alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/user.gif\"></a>";
echo "<img hspace=1 alt=\"\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/user.gif\"></a>";
} else {
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$pixpath/spacer.gif\">";
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$CFG->pixpath/spacer.gif\">";
}
if ($course->password) {
echo "<a title=\"$strrequireskey\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">";
echo "<img hspace=1 alt=\"\" height=16 width=16 border=0 src=\"$pixpath/i/key.gif\"></a>";
echo "<img hspace=1 alt=\"\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/key.gif\"></a>";
} else {
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$pixpath/spacer.gif\">";
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$CFG->pixpath/spacer.gif\">";
}
if ($course->summary) {
link_to_popup_window ("/course/info.php?id=$course->id", "courseinfo",
"<img hspace=1 alt=\"info\" height=16 width=16 border=0 src=\"$pixpath/i/info.gif\">",
"<img hspace=1 alt=\"info\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/info.gif\">",
400, 500, $strsummary);
} else {
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$pixpath/spacer.gif\">";
echo "<img alt=\"\" height=16 width=18 border=0 src=\"$CFG->pixpath/spacer.gif\">";
}
echo "</td></tr>\n";
}
@ -1120,12 +1121,6 @@ function print_course($course, $width="100%") {
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", "$width");
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
@ -1150,12 +1145,12 @@ function print_course($course, $width="100%") {
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=\"$pixpath/i/user.gif\"></a>&nbsp;&nbsp;";
echo "<img vspace=4 alt=\"$strallowguests\" height=16 width=16 border=0 src=\"$CFG->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=\"$pixpath/i/key.gif\"></a>";
echo "<img vspace=4 alt=\"$strrequireskey\" height=16 width=16 border=0 src=\"$CFG->pixpath/i/key.gif\"></a>";
}

View File

@ -433,7 +433,9 @@
if (file_exists($modform)) {
print_heading_with_help($pageheading, "mods", $module->name);
$icon = "<img align=absmiddle height=16 width=16 src=\"$CFG->modpixpath/$module->name/icon.gif\">&nbsp;";
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start("center", "", "$THEME->cellheading");
include_once($modform);
print_simple_box_end();

View File

@ -15,14 +15,6 @@
add_to_log($course->id, "course", "recent", "recent.php?id=$course->id", "$course->id");
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$strrecentactivity = get_string("recentactivity");
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
@ -78,7 +70,7 @@
require_once($libfile);
$print_recent_instance_activity = $mod->modname."_print_recent_instance_activity";
if (function_exists($print_recent_instance_activity)) {
$image = "<img src=\"$modpixpath/$mod->modname/icon.gif\" ".
$image = "<img src=\"$CFG->modpixpath/$mod->modname/icon.gif\" ".
"height=16 width=16 alt=\"$mod->modfullname\">";
echo "<h4>$image $mod->modfullname: ".
"<a href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".

View File

@ -23,12 +23,6 @@
$site = get_site();
if (empty($THEME->custompix)) {
$pixpath = "$CFG->wwwroot/pix";
} else {
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
}
$displaylist = array();
$parentlist = array();
make_categories_list($displaylist, $parentlist, "");

View File

@ -60,14 +60,6 @@
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");
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";

View File

@ -116,6 +116,14 @@
$CFG->header = "$CFG->dirroot/theme/$CFG->theme/header.html";
$CFG->footer = "$CFG->dirroot/theme/$CFG->theme/footer.html";
if (empty($THEME->custompix)) {
$CFG->pixpath = "$CFG->wwwroot/pix";
$CFG->modpixpath = "$CFG->wwwroot/mod";
} else {
$CFG->pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
$CFG->modpixpath = "$CFG->wwwroot/theme/$CFG->theme/pix/mod";
}
/// A hack to get around magic_quotes_gpc being turned off

View File

@ -581,7 +581,7 @@ function replace_smilies(&$text) {
if ($runonce == false){
foreach ($emoticons as $emoticon => $image){
$e[] = $emoticon;
$img[] = "<img alt=\"$emoticon\" width=15 height=15 src=\"$CFG->wwwroot/pix/s/$image\">";
$img[] = "<img alt=\"$emoticon\" width=15 height=15 src=\"$CFG->pixpath/s/$image\">";
}
$runonce = true;
}
@ -871,9 +871,10 @@ function print_heading($text, $align="center", $size=3) {
echo "<p align=\"$align\"><font size=\"$size\"><b>".stripslashes_safe($text)."</b></font></p>";
}
function print_heading_with_help($text, $helppage, $module="moodle") {
function print_heading_with_help($text, $helppage, $module="moodle", $icon="") {
// Centered heading with attached help button (same title text)
echo "<p align=\"center\"><font size=\"3\"><b>".stripslashes_safe($text);
// and optional icon attached
echo "<p align=\"center\"><font size=\"3\">$icon<b>".stripslashes_safe($text);
helpbutton($helppage, $text, $module);
echo "</b></font></p>";
}
@ -985,14 +986,8 @@ function print_user_picture($userid, $courseid, $picture, $large=false, $returns
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}
} else { // Print default user pictures (use theme version if available)
if (empty($THEME->custompix)) {
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/pix/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
} else {
$output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/theme/$CFG->theme/pix/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}
$output .= "<img align=\"absmiddle\" src=\"$CFG->pixpath/u/$file.png\"".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}
if ($link) {
$output .= "</a>";
@ -1399,7 +1394,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true) {
/// Prints a grade menu (as part of an existing form) with help
/// Showing all possible numerical grades and scales
global $CFG, $THEME;
global $CFG;
$strscale = get_string("scale");
$strscales = get_string("scales");
@ -1416,11 +1411,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true) {
}
choose_from_menu($grades, "$name", "$current", "");
if (empty($THEME->custompix)) {
$helpicon = "$CFG->wwwroot/pix/help.gif";
} else {
$helpicon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif";
}
$helpicon = "$CFG->pixpath/help.gif";
$linkobject = "<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"$strscales\" src=\"$helpicon\">";
link_to_popup_window ("/course/scales.php?id=$courseid&list=true", "ratingscales",
$linkobject, 400, 500, $strscales);
@ -1430,15 +1421,11 @@ function print_scale_menu($courseid, $name, $current) {
/// Prints a scale menu (as part of an existing form) including help button
/// Just like print_grade_menu but without the numerical grades
global $CFG, $THEME;
global $CFG;
$strscales = get_string("scales");
choose_from_menu(get_scales_menu($courseid), "$name", $current, "");
if (empty($THEME->custompix)) {
$helpicon = "$CFG->wwwroot/pix/help.gif";
} else {
$helpicon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif";
}
$helpicon = "$CFG->pixpath/help.gif";
$linkobject = "<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"$strscales\" src=\"$helpicon\">";
link_to_popup_window ("/course/scales.php?id=$courseid&list=true", "ratingscales",
$linkobject, 400, 500, $strscales);
@ -1449,14 +1436,10 @@ function print_scale_menu_helpbutton($courseid, $scale) {
/// Prints a help button about a scale
/// scale is an object
global $CFG, $THEME;
global $CFG;
$strscales = get_string("scales");
if (empty($THEME->custompix)) {
$helpicon = "$CFG->wwwroot/pix/help.gif";
} else {
$helpicon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif";
}
$helpicon = "$CFG->pixpath/help.gif";
$linkobject = "<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"$scale->name\" src=\"$helpicon\">";
link_to_popup_window ("/course/scales.php?id=$courseid&list=true&scale=$scale->id", "ratingscale",
$linkobject, 400, 500, $scale->name);
@ -1496,13 +1479,8 @@ function helpbutton ($page, $title="", $module="moodle", $image=true, $linktext=
$module = "moodle";
}
if (empty($THEME->custompix)) {
$icon = "$CFG->wwwroot/pix/help.gif";
} else {
$icon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif";
}
if ($image) {
$icon = "$CFG->pixpath/help.gif";
if ($linktext) {
$linkobject = "$title<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"\" src=\"$icon\">";
} else {
@ -1526,7 +1504,11 @@ function emoticonhelpbutton($form, $field) {
$SESSION->inserttextform = $form;
$SESSION->inserttextfield = $field;
helpbutton("emoticons", get_string("helpemoticons"), "moodle", false, true);
echo "&nbsp;<img src=\"$CFG->wwwroot/pix/s/smiley.gif\" align=\"absmiddle\" width=15 height=15></a>";
echo "&nbsp;";
link_to_popup_window ("/help.php?module=moodle&file=emoticons.html", "popup",
"<img src=\"$CFG->pixpath/s/smiley.gif\" border=0 align=\"absmiddle\" width=15 height=15>",
400, 500, get_string("helpemoticons"));
echo "<br />";
}
function notice ($message, $link="") {