Merged in several display and bug fixes from MOODLE_18_STABLE

This commit is contained in:
mark-nielsen 2007-02-23 20:20:50 +00:00
parent 473d29ebcd
commit e15cc97f0f
8 changed files with 37 additions and 20 deletions

View File

@ -37,7 +37,7 @@
print_heading_with_help(get_string("addabranchtable", "lesson"), "overview", "lesson");
?>
<form id="form" method="post" action="lesson.php" class="addform">
<fieldset class="invisiblefieldset">
<fieldset class="invisiblefieldset fieldsetfix">
<input type="hidden" name="id" value="<?PHP echo $cm->id ?>" />
<input type="hidden" name="action" value="insertpage" />
<input type="hidden" name="pageid" value="<?PHP echo $pageid ?>" />
@ -45,13 +45,15 @@
<input type="hidden" name="sesskey" value="<?PHP echo $USER->sesskey ?>" />
<table class="generalbox boxaligncenter" cellpadding="5" border="1">
<tr valign="top">
<td><b><label for="title"><?php print_string("pagetitle", "lesson"); ?>:</label></b><br />
<td><strong><label for="title"><?php print_string("pagetitle", "lesson"); ?>:</label></strong><br />
<input type="text" id="title" name="title" size="80" value="" /></td></tr>
<?php
echo "<tr><td><strong>";
echo get_string("pagecontents", "lesson").":</strong><br />\n";
print_textarea($usehtmleditor, 25,70, 630, 400, "contents");
use_html_editor("contents");
print_textarea($usehtmleditor, 25,70, 0, 0, "contents");
if ($usehtmleditor) {
use_html_editor("contents");
}
echo "</td></tr>\n";
echo "<tr><td>\n";
echo "<div class=\"boxaligncenter addform\"><input name=\"layout\" type=\"checkbox\" value=\"1\" checked=\"checked\" />";
@ -62,10 +64,10 @@
echo "</td></tr>\n";
for ($i = 0; $i < $lesson->maxanswers; $i++) {
$iplus1 = $i + 1;
echo "<tr><td><b>".get_string("description", "lesson")." $iplus1:</b><br />\n";
echo "<tr><td><strong>".get_string("description", "lesson")." $iplus1:</strong><br />\n";
print_textarea(false, 10, 70, 630, 300, "answer[$i]"); // made the default set to off also removed use_html_editor(); line from down below, which made all textareas turn into html editors
echo "</td></tr>\n";
echo "<tr><td><b>".get_string("jump", "lesson")." $iplus1:</b> \n";
echo "<tr><td><strong>".get_string("jump", "lesson")." $iplus1:</strong> \n";
if ($i) {
// answers 2, 3, 4... jumpto this page
choose_from_menu($jump, "jumpto[$i]", 0, "");

View File

@ -47,7 +47,7 @@
print_heading_with_help(get_string("addaquestionpage", "lesson"), "overview", "lesson");
?>
<form id="form" method="post" action="lesson.php" class="addform">
<fieldset class="invisiblefieldset">
<fieldset class="invisiblefieldset fieldsetfix">
<input type="hidden" name="id" value="<?php echo $cm->id ?>" />
<input type="hidden" name="action" value="insertpage" />
<input type="hidden" name="pageid" value="<?php echo $pageid ?>" />
@ -78,7 +78,9 @@
echo "<tr><td><b>";
echo get_string("pagecontents", "lesson").":</b><br />\n";
print_textarea($usehtmleditor, 25,70, 630, 400, "contents");
use_html_editor("contents");
if ($usehtmleditor) {
use_html_editor("contents");
}
echo "</td></tr>\n";
switch ($qtype) {
case LESSON_TRUEFALSE :

View File

@ -772,7 +772,7 @@
lesson_set_message('('.get_string("maximumnumberofattemptsreached", "lesson").')');
}
lesson_print_header($cm, $course, $lesson, 'navigation');
lesson_print_header($cm, $course, $lesson, 'view');
include(dirname(__FILE__).'/continue.html');
?>

View File

@ -54,6 +54,7 @@
// give teacher a proforma
?>
<form id="editpage" method="post" action="lesson.php">
<fieldset class="invisiblefieldset fieldsetfix">
<input type="hidden" name="id" value="<?php echo $cm->id ?>" />
<input type="hidden" name="action" value="updatepage" />
<input type="hidden" name="pageid" value="<?php echo $pageid ?>" />
@ -114,7 +115,9 @@
echo "<tr><td><b>";
echo get_string("pagecontents", "lesson").":</b><br />\n";
print_textarea($usehtmleditor, 25, 70, 630, 400, "contents", $page->contents);
use_html_editor("contents"); // always the editor
if ($usehtmleditor) {
use_html_editor("contents");
}
echo "</td></tr>\n";
$n = 0;
switch ($page->qtype) {
@ -477,4 +480,5 @@
<input type="submit" value="<?php print_string("savepage", "lesson") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
</center>
</fieldset>
</form>

View File

@ -52,7 +52,7 @@
get_string("addabranchtable", "lesson")."</a></td></tr><tr><td>".
"<a href=\"lesson.php?id=$cm->id&amp;action=addpage&amp;pageid=0&amp;firstpage=1\">".
get_string("addaquestionpage", "lesson").
"</a></td></tr></table>\n", 'center');
"</a></td></tr></table>\n", 'center', '20%');
}
} else {
// Set some standard variables

View File

@ -23,6 +23,14 @@
vertical-align: middle;
}
.mod-lesson .invisiblefieldset.fieldsetfix {
display: block;
}
.mod-lesson .invisiblefieldset.fieldsetfix tr {
text-align: left;
}
/***
*** Style for view.php
***/

View File

@ -25,10 +25,7 @@
$course = get_record('course', 'id', $lesson->course);
}
$tabs = array();
$row = array();
$inactive = array();
$tabs = $row = $inactive = $activated = array();
/// user attempt count for reports link hover (completed attempts - much faster)
$counts = new stdClass;
@ -53,6 +50,7 @@
case 'reportdetail':
/// sub tabs for reports (overview and detail)
$inactive[] = 'reports';
$activated[] = 'reports';
$row = array();
$row[] = new tabobject('reportoverview', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id&amp;action=reportoverview", get_string('overview', 'lesson'));
@ -64,6 +62,7 @@
case 'single':
/// sub tabs for edit view (collapsed and expanded aka full)
$inactive[] = 'edit';
$activated[] = 'edit';
$row = array();
$row[] = new tabobject('collapsed', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&amp;mode=collapsed", get_string('collapsed', 'lesson'));
@ -72,6 +71,6 @@
break;
}
print_tabs($tabs, $currenttab, $inactive);
print_tabs($tabs, $currenttab, $inactive, $activated);
?>

View File

@ -688,14 +688,14 @@
}
// Each button must have its own form inorder for it to work with JavaScript turned off
$button = "<form id=\"answerform$i\" method=\"post\" action=\"$CFG->wwwroot/mod/lesson/lesson.php\">\n".
'<fieldset class="invisiblefieldset">';
'<fieldset class="invisiblefieldset">'.
"<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n".
"<input type=\"hidden\" name=\"action\" value=\"continue\" />\n".
"<input type=\"hidden\" name=\"pageid\" value=\"$pageid\" />\n".
"<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n".
"<input type=\"hidden\" name=\"jumpto\" value=\"$answer->jumpto\" />\n".
lesson_print_submit_link(strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options)), "answerform$i", '', $class, '', '', true).
'<fieldset>'.
'</fieldset>'.
'</form>';
$buttons[$type][] = $button;
@ -722,11 +722,13 @@
echo '</div><!--end slideshow div-->';
echo $fullbuttonhtml;
} else {
echo '<tr><td>';
echo '<tr><td></td></tr></table>'; // ends the answers table
// When buttons are horizontal and inside the table, the button then line wraps when clicked in FF.
// Seems like the border-collapse might be the problem? Easiest fix is to move the buttons outside
// of the table.
print_simple_box_start('center');
echo $fullbuttonhtml;
print_simple_box_end();
echo '</td></tr></table>'; // ends the answers table
}
break;