Changes so that an icon can be displayed in the header

This commit is contained in:
martin 2002-06-08 06:47:33 +00:00
parent 65adacc4ba
commit c7e3ac2ac2

View file

@ -11,12 +11,14 @@
/// STANDARD WEB PAGE PARTS ///////////////////////////////////////////////////
function print_header ($title="", $heading="", $navigation="", $focus="", $meta="",$cache=true) {
function print_header ($title="", $heading="", $navigation="", $focus="", $meta="", $cache=true, $button="") {
// $title - appears top of window
// $heading - appears top of page
// $navigation - premade navigation string
// $focus - indicates form element eg inputform.password
// $meta - meta tags in the header
// $cache - should this page be cacheable?
// $button - code for a button in the top-right
global $USER, $CFG, $THEME;
if (file_exists("$CFG->dirroot/theme/$CFG->theme/styles.css")) {
@ -168,7 +170,7 @@ function print_table($table) {
function print_editing_switch($courseid) {
global $CFG, $USER;
if (isadmin() || isteacher($courseid)) {
if (isteacher($courseid)) {
if ($USER->editing) {
echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=off\">Turn editing off</A>";
} else {
@ -177,6 +179,29 @@ function print_editing_switch($courseid) {
}
}
function update_course_icon($courseid) {
global $CFG, $USER;
if (isteacher($courseid)) {
if ($USER->editing) {
return "<A TITLE=\"Turn editing OFF\" HREF=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=off\"
TARGET=_top><IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0></A>";
} else {
return "<A TITLE=\"Turn editing ON\" HREF=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=on\"
TARGET=_top><IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0></A>";
}
}
}
function update_module_icon($moduleid) {
global $CFG;
if (isteacher($courseid)) {
return "<A TITLE=\"Edit this activity\" HREF=\"$CFG->wwwroot/course/mod.php?update=$moduleid\" TARGET=_top><IMG
SRC=\"$CFG->wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0></A>";
}
}
function userdate($date, $format="", $timezone=99) {
global $USER;
@ -875,13 +900,6 @@ function get_all_instances_in_course($modulename, $course, $sort="cw.week") {
}
function print_update_module_icon($moduleid) {
global $CFG;
echo "&nbsp; &nbsp;
<A HREF=\"$CFG->wwwroot/course/mod.php?update=$moduleid\" TARGET=_top><IMG
SRC=\"$CFG->wwwroot/pix/t/edit.gif\" ALIGN=right BORDER=0 ALT=\"Update this module\"></A>";
}