From 55c26207849785ba5bb1358e14c61b76c258771f Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 15 Oct 2002 16:47:43 +0000 Subject: [PATCH] Got rid of the wimpy icons in the top-right corner of pages and put some manly buttons there. ;-) I think this will be much clearer for novices, as well as being a bigger target for experts! --- lib/moodlelib.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index fbcfaba56b..8ab9db854d 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -190,6 +190,7 @@ function print_file_picture($path, $courseid=0, $height="", $width="", $link="") } if (substr(strtolower($path), 0, 7) == "http://") { echo ""; + } else if ($courseid) { echo "slasharguments) { // Use this method if possible for better caching @@ -314,6 +315,10 @@ function print_editing_switch($courseid) { } } +function format_float($num, $places=0) { + return sprintf("%.$places"."f", $num); +} + function print_textarea($richedit, $rows, $cols, $width, $height, $name, $value="") { global $CFG, $THEME; @@ -341,26 +346,33 @@ function print_richedit_javascript($form, $name, $source="no") { function update_course_icon($courseid) { +// Used to be an icon, but it's now a simple form button global $CFG, $USER; if (isteacher($courseid)) { if ($USER->editing) { - return "wwwroot/course/view.php?id=$courseid&edit=off\" - TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; + $string = get_string("turneditingoff"); + $edit = "off"; } else { - return "wwwroot/course/view.php?id=$courseid&edit=on\" - TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; + $string = get_string("turneditingon"); + $edit = "on"; } + return "
wwwroot/course/view.php\"> + + +
"; } } function update_module_icon($moduleid, $courseid) { +// Used to be an icon, but it's now a simple form button global $CFG; if (isteacher($courseid)) { - return "wwwroot/course/mod.php?update=$moduleid&return=true\" TARGET=_top>wwwroot/pix/i/edit.gif\" ALIGN=right BORDER=0>"; + return "
wwwroot/course/mod.php\"> + + +
"; } } @@ -1612,7 +1624,6 @@ function get_max_upload_file_size() { return get_real_size($filesize); } - function get_directory_list($rootdir, $excludefile="", $descend=true) { // Returns an array with all the filenames in // all subdirectories, relative to the given rootdir. -- 2.39.5