Permalink
Browse files

changed the options settings to be more compliant with the rest of the

modules.
Added help page links for many options.
Changed the style of the add multiple interface to match mod.php
  • Loading branch information...
jungwirr
jungwirr committed May 5, 2004
1 parent 3120f6f commit 311b524ac232ce4e9f61a230e6ffcd382132c10e
Showing with 81 additions and 18 deletions.
  1. +43 −7 mod/attendance/add.php
  2. +38 −11 mod/attendance/mod.html
View
@@ -142,6 +142,12 @@
unset($SESSION->modform); // Clear any old ones that may be hanging around.
+
+ $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");
+
/// Print the main part of the page
@@ -190,39 +196,68 @@
<input type="checkbox" name="fri" "checked">
<?php print_string("saturday","attendance"); echo ":"; ?>
<input type="checkbox" name="sat" >
+<?php helpbutton("choosedays", get_string("choosedays","attendance"), "attendance");?>
</TD>
</TR>
<tr valign=top>
<TD align="right"><P><B><?php print_string("dynamicsectionmulti", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="dynsection" <?php echo !empty($form->dynsection) ? 'checked' : '' ?> >
- </TD>
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "dynsection", "", "");
+ helpbutton("dynsection", get_string("dynamicsectionmulti","attendance"), "attendance");
+?>
+<!-- <input type="checkbox" name="dynsection" <?php echo !empty($form->dynsection) ? 'checked' : '' ?> > -->
+</TD>
</tr>
<tr valign=top>
<TD align="right"><P><B><?php print_string("autoattendmulti", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="autoattend" <?php echo !empty($form->autoattend) ? 'checked' : '' ?> >
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "autoattend", "", "");
+ helpbutton("autoattendmulti", get_string("autoattend","attendance"), "attendance");
+?>
+
+
+<!-- <input type="checkbox" name="autoattend" <?php echo !empty($form->autoattend) ? 'checked' : '' ?> > -->
</TD>
</tr>
<?php // starting with 2 to allow for the nothing value in choose_from_menu to be the default of 1
for ($i=2;$i<=24;$i++){ $opt[$i] = $i; } ?>
<TR valign=top>
<TD align=right><P><B><?php print_string("hoursineachclass", "attendance") ?>:</B></P></TD>
- <TD colspan="3" align="left"><?php choose_from_menu($opt, "hours", $form->hours, "1","","1") ?></td>
+ <TD colspan="3" align="left"><?php choose_from_menu($opt, "hours", $form->hours, "1","","1") ?>
+<?php helpbutton("hours", get_string("hoursinclass","attendance"), "attendance"); ?>
+</td>
</tr>
<tr valign=top>
<TD align="right"><P><B><?php print_string("gradevaluemulti", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="grade" <?php echo !empty($form->grade) ? 'checked' : '' ?> >
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "grade", "", "");
+ helpbutton("grade", get_string("gradevalue","attendance"), "attendance");
+?>
+
+<!-- <input type="checkbox" name="grade" <?php echo !empty($form->grade) ? 'checked' : '' ?> > -->
</TD>
</tr>
<?php // starting with 2 to allow for the nothing value in choose_from_menu to be the default of 1
for ($i=0;$i<=100;$i++){ $opt2[$i] = $i; } ?>
<TR valign=top>
<TD align=right><P><B><?php print_string("maxgradevalue", "attendance") ?>:</B></P></TD>
- <TD colspan="3" align="left"><?php choose_from_menu($opt2, "maxgrade", $form->maxgrade, "0","","0") ?></td>
+ <TD colspan="3" align="left"><?php choose_from_menu($opt2, "maxgrade", $form->maxgrade, "0","","0");
+ helpbutton("maxgrade", get_string("maxgradevalue","attendance"), "attendance");
+?></td>
</tr>
@@ -243,8 +278,9 @@
</FORM>
<?php
+ print_simple_box_end();
/// Finish the page
print_footer($course);
}
-?>
+?>
View
@@ -29,6 +29,12 @@
<!-- <TD align=right><P><B><? print_string("takeroll", "attendance") ?>:</B></P></TD> -->
<!-- <TD align=left><? choose_from_menu($options, "roll", $form->roll, "") ?></td> -->
<!-- </tr> -->
+<tr valign=top>
+ <td align=right><p><b><?php print_string("notes", "attendance") ?>:</b></p></td>
+ <td colspan="3">
+ <input type="text" name="notes" size=60 value="<?php p($form->notes)?>">
+ </td>
+</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("dayofroll", "attendance") ?>:</B></P></TD>
@@ -37,40 +43,61 @@
<tr valign=top>
<TD align="right"><P><B><?php print_string("dynamicsection", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="dynsection" <?php echo !empty($form->dynsection) ? 'checked' : '' ?> >
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "dynsection", "$form->dynsection", "");
+ helpbutton("dynsection", get_string("dynamicsection","attendance"), "attendance");
+?>
+<!-- <input type="checkbox" name="dynsection" <?php echo !empty($form->dynsection) ? 'checked' : '' ?> > -->
</TD>
</tr>
<tr valign=top>
<TD align="right"><P><B><?php print_string("autoattend", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="autoattend" <?php echo !empty($form->autoattend) ? 'checked' : '' ?> >
+
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "autoattend", "$form->autoattend", "");
+ helpbutton("autoattend", get_string("autoattend","attendance"), "attendance");
+?>
+
+<!-- <input type="checkbox" name="autoattend" <?php echo !empty($form->autoattend) ? 'checked' : '' ?> > -->
</TD>
</tr>
<?php // starting with 2 to allow for the nothing value in choose_from_menu to be the default of 1
for ($i=2;$i<=24;$i++){ $opt[$i] = $i; } ?>
<TR valign=top>
<TD align=right><P><B><?php print_string("hoursinclass", "attendance") ?>:</B></P></TD>
- <TD colspan="3" align="left"><?php choose_from_menu($opt, "hours", $form->hours, "1","","1") ?></td>
+ <TD colspan="3" align="left"><?php choose_from_menu($opt, "hours", $form->hours, "1","","1") ?>
+<?php helpbutton("hours", get_string("hoursinclass","attendance"), "hours"); ?>
+</td>
</tr>
<tr valign=top>
<TD align="right"><P><B><?php print_string("gradevalue", "attendance") ?>:</B></P></TD>
<TD align="left">
- <input type="checkbox" name="grade" <?php echo !empty($form->grade) ? 'checked' : '' ?> >
+<?php
+ $options = array();
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu($options, "grade", "$form->grade", "");
+ helpbutton("grade", get_string("gradevalue","attendance"), "attendance");
+?>
+<!-- <input type="checkbox" name="grade" <?php echo !empty($form->grade) ? 'checked' : '' ?> > -->
</TD>
</tr>
<?php // starting with 2 to allow for the nothing value in choose_from_menu to be the default of 1
for ($i=0;$i<=100;$i++){ $opt2[$i] = $i; } ?>
<TR valign=top>
<TD align=right><P><B><?php print_string("maxgradevalue", "attendance") ?>:</B></P></TD>
- <TD colspan="3" align="left"><?php choose_from_menu($opt2, "maxgrade", $form->maxgrade, "0","","0") ?></td>
+ <TD colspan="3" align="left"><?php choose_from_menu($opt2, "maxgrade", $form->maxgrade, "0","","0");
+ helpbutton("maxgrade", get_string("maxgradevalue","attendance"), "attendance");
+?></td>
</tr>
-<tr valign=top>
- <td align=right><p><b><?php print_string("notes", "attendance") ?>:</b></p></td>
- <td colspan="3">
- <input type="text" name="notes" size=60 value="<?php p($form->notes)?>">
- </td>
-</tr>
</TABLE>

0 comments on commit 311b524

Please sign in to comment.