From: martin Date: Thu, 19 Sep 2002 14:51:49 +0000 (+0000) Subject: Improved interface for course/teachers.php ... instead of typing numbers X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=08056730fa9e294cf2107609f0eb4dfee89541a2;p=moodle.git Improved interface for course/teachers.php ... instead of typing numbers into a box there is now a menu for each user. Much better! --- diff --git a/course/teachers.php b/course/teachers.php index c2e8af832e..d81f863411 100644 --- a/course/teachers.php +++ b/course/teachers.php @@ -61,17 +61,23 @@ $table->align = array ("RIGHT", "LEFT", "CENTER", "CENTER"); $table->size = array ("35", "", "", ""); + $option[0] = get_string("hide"); + for ($i=1; $i<=8; $i++) { + $option[$i] = $i; + } + echo "
"; foreach ($teachers as $teacher) { $picture = print_user_picture($teacher->id, $course->id, $teacher->picture, false, true); + $authority = choose_from_menu ($option, "a$teacher->id", $teacher->authority, "", "", "", true); + if (!$teacher->role) { $teacher->role = $course->teacher; } - $table->data[] = array ($picture, "$teacher->firstname $teacher->lastname", - "id\" VALUE=\"$teacher->authority\" SIZE=2>", + $table->data[] = array ($picture, "$teacher->firstname $teacher->lastname", $authority, "id\" VALUE=\"$teacher->role\" SIZE=30>"); } print_table($table); diff --git a/lang/en/help/teachers.html b/lang/en/help/teachers.html index 0d0767e65f..0a482c970f 100644 --- a/lang/en/help/teachers.html +++ b/lang/en/help/teachers.html @@ -11,12 +11,12 @@ (the one you set in the Course Settings page).

You can also order this list (to put the main teacher at the - top, for example). Simply put a numbers in each box such - as 1, 2, 3 etc. After pressing "Save changes" you will + top, for example). Simply select numbers from the menus + in the "Order" column. After pressing "Save changes" you will see the new order. -

NOTE: A special case occurs if you use the number - 0 (zero) for a teacher. In this case, the teacher will +

NOTE: A special case occurs if you use select "Hide" + for a teacher. In this case, the teacher will NOT BE SHOWN on the course listings or the list of - participants. They will be "invisible" to students + participants. They will be "hidden" from students (unless they post messages to the forums etc) diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 496d780612..f0cf27c98b 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -189,6 +189,7 @@ $string[helphtml] = "How to write html"; $string[helppicture] = "How to upload a picture"; $string[helptext] = "How to write text"; $string[helpquestions] = "How to ask questions"; +$string[hide] = "Hide"; $string[home] = "Home"; $string[htmlformat] = "Pretty HTML format"; $string[icqnumber] = "ICQ number"; diff --git a/lib/weblib.php b/lib/weblib.php index 0329cd4b93..b460e0aab7 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -145,7 +145,7 @@ function close_window_button() { } -function choose_from_menu ($options, $name, $selected="", $nothing="choose", $script="", $nothingvalue="0") { +function choose_from_menu ($options, $name, $selected="", $nothing="choose", $script="", $nothingvalue="0", $return=false) { // $options["value"]["label"] if ($nothing == "choose") { @@ -155,26 +155,32 @@ function choose_from_menu ($options, $name, $selected="", $nothing="choose", $sc if ($script) { $javascript = "onChange=\"$script\""; } - echo "\n"; if ($nothing) { - echo " \n"; + $output .= ">$nothing\n"; } foreach ($options as $value => $label) { - echo " \n"; + $output .= ">$label\n"; } else { - echo ">$value\n"; + $output .= ">$value\n"; } } - echo "\n"; + $output .= "\n"; + + if ($return) { + return $output; + } else { + echo $output; + } } function popup_form ($common, $options, $formname, $selected="", $nothing="choose") {