mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Improved interface for course/teachers.php ... instead of typing numbers
into a box there is now a menu for each user. Much better!
This commit is contained in:
parent
ae7aafeb53
commit
08056730fa
4 changed files with 30 additions and 17 deletions
|
@ -61,17 +61,23 @@
|
||||||
$table->align = array ("RIGHT", "LEFT", "CENTER", "CENTER");
|
$table->align = array ("RIGHT", "LEFT", "CENTER", "CENTER");
|
||||||
$table->size = array ("35", "", "", "");
|
$table->size = array ("35", "", "", "");
|
||||||
|
|
||||||
|
$option[0] = get_string("hide");
|
||||||
|
for ($i=1; $i<=8; $i++) {
|
||||||
|
$option[$i] = $i;
|
||||||
|
}
|
||||||
|
|
||||||
echo "<FORM ACTION=teachers.php METHOD=post>";
|
echo "<FORM ACTION=teachers.php METHOD=post>";
|
||||||
foreach ($teachers as $teacher) {
|
foreach ($teachers as $teacher) {
|
||||||
|
|
||||||
$picture = print_user_picture($teacher->id, $course->id, $teacher->picture, false, true);
|
$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) {
|
if (!$teacher->role) {
|
||||||
$teacher->role = $course->teacher;
|
$teacher->role = $course->teacher;
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[] = array ($picture, "$teacher->firstname $teacher->lastname",
|
$table->data[] = array ($picture, "$teacher->firstname $teacher->lastname", $authority,
|
||||||
"<INPUT TYPE=text NAME=\"a$teacher->id\" VALUE=\"$teacher->authority\" SIZE=2>",
|
|
||||||
"<INPUT TYPE=text NAME=\"r$teacher->id\" VALUE=\"$teacher->role\" SIZE=30>");
|
"<INPUT TYPE=text NAME=\"r$teacher->id\" VALUE=\"$teacher->role\" SIZE=30>");
|
||||||
}
|
}
|
||||||
print_table($table);
|
print_table($table);
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
(the one you set in the Course Settings page).
|
(the one you set in the Course Settings page).
|
||||||
|
|
||||||
<P>You can also order this list (to put the main teacher at the
|
<P>You can also order this list (to put the main teacher at the
|
||||||
top, for example). Simply put a numbers in each box such
|
top, for example). Simply select numbers from the menus
|
||||||
as 1, 2, 3 etc. After pressing "Save changes" you will
|
in the "Order" column. After pressing "Save changes" you will
|
||||||
see the new order.
|
see the new order.
|
||||||
|
|
||||||
<P><B>NOTE:</B> A special case occurs if you use the number
|
<P><B>NOTE:</B> A special case occurs if you use select "Hide"
|
||||||
0 (zero) for a teacher. In this case, the teacher will
|
for a teacher. In this case, the teacher will
|
||||||
NOT BE SHOWN on the course listings or the list of
|
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)
|
(unless they post messages to the forums etc)
|
||||||
|
|
|
@ -189,6 +189,7 @@ $string[helphtml] = "How to write html";
|
||||||
$string[helppicture] = "How to upload a picture";
|
$string[helppicture] = "How to upload a picture";
|
||||||
$string[helptext] = "How to write text";
|
$string[helptext] = "How to write text";
|
||||||
$string[helpquestions] = "How to ask questions";
|
$string[helpquestions] = "How to ask questions";
|
||||||
|
$string[hide] = "Hide";
|
||||||
$string[home] = "Home";
|
$string[home] = "Home";
|
||||||
$string[htmlformat] = "Pretty HTML format";
|
$string[htmlformat] = "Pretty HTML format";
|
||||||
$string[icqnumber] = "ICQ number";
|
$string[icqnumber] = "ICQ number";
|
||||||
|
|
|
@ -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"]
|
// $options["value"]["label"]
|
||||||
|
|
||||||
if ($nothing == "choose") {
|
if ($nothing == "choose") {
|
||||||
|
@ -155,26 +155,32 @@ function choose_from_menu ($options, $name, $selected="", $nothing="choose", $sc
|
||||||
if ($script) {
|
if ($script) {
|
||||||
$javascript = "onChange=\"$script\"";
|
$javascript = "onChange=\"$script\"";
|
||||||
}
|
}
|
||||||
echo "<SELECT NAME=$name $javascript>\n";
|
$output = "<SELECT NAME=$name $javascript>\n";
|
||||||
if ($nothing) {
|
if ($nothing) {
|
||||||
echo " <OPTION VALUE=\"$nothingvalue\"\n";
|
$output .= " <OPTION VALUE=\"$nothingvalue\"\n";
|
||||||
if ($nothingvalue == $selected) {
|
if ($nothingvalue == $selected) {
|
||||||
echo " SELECTED";
|
$output .= " SELECTED";
|
||||||
}
|
}
|
||||||
echo ">$nothing</OPTION>\n";
|
$output .= ">$nothing</OPTION>\n";
|
||||||
}
|
}
|
||||||
foreach ($options as $value => $label) {
|
foreach ($options as $value => $label) {
|
||||||
echo " <OPTION VALUE=\"$value\"";
|
$output .= " <OPTION VALUE=\"$value\"";
|
||||||
if ($value == $selected) {
|
if ($value == $selected) {
|
||||||
echo " SELECTED";
|
$output .= " SELECTED";
|
||||||
}
|
}
|
||||||
if ($label) {
|
if ($label) {
|
||||||
echo ">$label</OPTION>\n";
|
$output .= ">$label</OPTION>\n";
|
||||||
} else {
|
} else {
|
||||||
echo ">$value</OPTION>\n";
|
$output .= ">$value</OPTION>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</SELECT>\n";
|
$output .= "</SELECT>\n";
|
||||||
|
|
||||||
|
if ($return) {
|
||||||
|
return $output;
|
||||||
|
} else {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function popup_form ($common, $options, $formname, $selected="", $nothing="choose") {
|
function popup_form ($common, $options, $formname, $selected="", $nothing="choose") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue