Xhtml fixes for MDL-7861.

This commit is contained in:
vyshane 2007-01-08 07:58:22 +00:00
parent 47cab2ad76
commit 0fd5feef05
5 changed files with 32 additions and 28 deletions

View File

@ -305,7 +305,7 @@ class question_category_object {
$this->edittable->align["$category->id.name"] = "left";
$this->edittable->wrap["$category->id.name"] = "nowrap";
$row["$category->id.name"] = '<a ' . $linkcss . ' title="' . $this->str->edit. '" href="category.php?id=' . $this->course->id .
'&amp;edit=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/edit.gif" height="11" width="11" border="0"
'&amp;edit=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/edit.gif" height="11" width="11"
alt="' .$this->str->edit. '" /> ' . $fill . $category->name . '</a>';
$this->edittable->align["$category->id.info"] = "left";
@ -320,17 +320,17 @@ class question_category_object {
$this->edittable->wrap["$category->id.publish"] = "nowrap";
if (!empty($category->publish)) {
$row["$category->id.publish"] = '<a title="' . $this->str->hide . '" href="category.php?id=' . $this->course->id . '&amp;hide=' . $category->id .
'&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/hide.gif" height="11" width="11" border="0" alt="' .$this->str->hide. '" /></a> ';
'&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/hide.gif" height="11" width="11" alt="' .$this->str->hide. '" /></a> ';
} else {
$row["$category->id.publish"] = '<a title="' . $this->str->publish . '" href="category.php?id=' . $this->course->id . '&amp;publish=' . $category->id .
'&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/show.gif" height="11" width="11" border="0" alt="' .$this->str->publish. '" /></a> ';
'&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/show.gif" height="11" width="11" alt="' .$this->str->publish. '" /></a> ';
}
if ($category->id != $this->defaultcategory->id) {
$this->edittable->align["$category->id.delete"] = "center";
$this->edittable->wrap["$category->id.delete"] = "nowrap";
$row["$category->id.delete"] = '<a title="' . $this->str->delete . '" href="category.php?id=' . $this->course->id .
'&amp;delete=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/delete.gif" height="11" width="11" border="0" alt="' .$this->str->delete. '" /></a> ';
'&amp;delete=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'"><img src="' . $this->pixpath . '/t/delete.gif" height="11" width="11" alt="' .$this->str->delete. '" /></a> ';
} else {
$row["$category->id.delete"] = '';
}
@ -340,11 +340,11 @@ class question_category_object {
$icons = '';
if ($up) {
$icons .= '<a title="' . $this->str->moveup .'" href="category.php?id=' . $this->course->id . '&amp;moveup=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'">
<img src="' . $this->pixpath . '/t/up.gif" height="11" width="11" border="0" alt="' . $this->str->moveup. '" /></a> ';
<img src="' . $this->pixpath . '/t/up.gif" height="11" width="11" alt="' . $this->str->moveup. '" /></a> ';
}
if ($down) {
$icons .= '<a title="' . $this->str->movedown .'" href="category.php?id=' . $this->course->id . '&amp;movedown=' . $category->id . '&amp;sesskey='.$USER->sesskey.$pagelink.'">
<img src="' . $this->pixpath . '/t/down.gif" height="11" width="11" border="0" alt="' .$this->str->movedown. '" /></a> ';
<img src="' . $this->pixpath . '/t/down.gif" height="11" width="11" alt="' .$this->str->movedown. '" /></a> ';
}
$row["$category->id.order"]= $icons;

View File

@ -159,17 +159,21 @@ function question_category_form($course, $current, $recurse=1, $showhidden=false
$strshow = get_string("show", "quiz");
$streditcats = get_string("editcategories", "quiz");
echo "<table width=\"100%\"><tr><td width=\"20\" nowrap=\"nowrap\">";
echo "<b>$strcategory:</b>&nbsp;";
echo "<table style=\"width:100%;\"><tr><td style=\"width:20px; white-space:nowrap;\">";
echo "<strong>$strcategory:</strong>&nbsp;";
echo "</td><td>";
popup_form ("edit.php?courseid=$course->id&amp;cat=", $catmenu, "catmenu", $current, "", "", "", false, "self");
echo "</td><td align=\"right\">";
echo "<form method=\"get\" action=\"$CFG->wwwroot/question/category.php\">";
echo "<fieldset class='invisiblefieldset'>";
echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
echo "<input type=\"submit\" value=\"$streditcats\" />";
echo '</fieldset>';
echo "</form>";
echo '</td></tr></table>';
echo '<form method="post" action="edit.php" id="displayoptions">';
echo "<fieldset class='invisiblefieldset'>";
echo '<table><tr><td>';
echo "<input type=\"hidden\" name=\"courseid\" value=\"{$course->id}\" />";
echo '<input type="hidden" name="recurse" value="0" />';
@ -188,9 +192,9 @@ function question_category_form($course, $current, $recurse=1, $showhidden=false
}
echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';
print_string('showhidden', 'quiz');
echo '</td><noscript><td valign="center">';
echo '</td><td valign="middle"><noscript>';
echo ' <input type="submit" value="'. get_string('go') .'" />';
echo '</td></noscript></tr></table></form>';
echo '</noscript></td></tr></table></fieldset></form>';
}
@ -240,7 +244,7 @@ function question_list($course, $categoryid, $quizid=0,
$strpreview = get_string("preview","quiz");
if (!$categoryid) {
echo "<p align=\"center\"><b>";
echo "<p style=\"text-align:center;\"><b>";
print_string("selectcategoryabove", "quiz");
echo "</b></p>";
if ($quizid) {
@ -268,7 +272,7 @@ function question_list($course, $categoryid, $quizid=0,
echo '<td valign="top" align="right">';
popup_form ("$CFG->wwwroot/question/question.php?category=$category->id&amp;qtype=", $qtypemenu, "addquestion",
"", "choose", "", "", false, "self");
echo '</td><td width="10" valign="top" align="right">';
echo '</td><td style="width:10px;" valign="top" align="right">';
helpbutton("questiontypes", $strcreatenewquestion, "quiz");
echo '</td></tr>';
}
@ -278,7 +282,7 @@ function question_list($course, $categoryid, $quizid=0,
echo '</td></tr>';
}
echo '<tr><td colspan="3" align="right"><font size="2">';
echo '<tr><td colspan="3" align="right" style="font-size:0.8em;">';
if (has_capability('moodle/question:import', $context)) {
echo '<a href="'.$CFG->wwwroot.'/question/import.php?category='.$category->id.'">'.$strimportquestions.'</a>';
@ -290,7 +294,7 @@ function question_list($course, $categoryid, $quizid=0,
echo "<a href=\"$CFG->wwwroot/question/export.php?category={$category->id}&amp;courseid={$course->id}\">$strexportquestions</a>";
helpbutton("export", $strexportquestions, "quiz");
}
echo '</font></td></tr>';
echo '</td></tr>';
echo '</table>';
@ -302,7 +306,7 @@ function question_list($course, $categoryid, $quizid=0,
$showhidden = $showhidden ? '' : " AND hidden = '0'";
if (!$totalnumber = count_records_select('question', "category IN ($categorylist) AND parent = '0' $showhidden")) {
echo "<p align=\"center\">";
echo "<p style=\"text-align:center;\">";
print_string("noquestions", "quiz");
echo "</p>";
return;
@ -313,7 +317,7 @@ function question_list($course, $categoryid, $quizid=0,
$page = 0;
if (!$questions = get_records_select('question', "category IN ($categorylist) AND parent = '0' $showhidden", $sortorder, '*', 0, $perpage)) {
// There are no questions at all
echo "<p align=\"center\">";
echo "<p style=\"text-align:center;\">";
print_string("noquestions", "quiz");
echo "</p>";
return;
@ -330,41 +334,41 @@ function question_list($course, $categoryid, $quizid=0,
print_simple_box_start('center', '100%', '#ffffff', 0);
echo '<table id="categoryquestions" cellspacing="0"><tr>';
$actionwidth = $canedit ? 95 : 70;
echo "<th width=\"$actionwidth\" nowrap=\"nowrap\" class=\"header\" scope=\"col\">$straction</th>";
echo "<th width=\"$actionwidth\" style=\"white-space:nowrap;\" class=\"header\" scope=\"col\">$straction</th>";
$sortoptions = array('name, qtype ASC' => get_string("sortalpha", "quiz"),
'qtype, name ASC' => get_string("sorttypealpha", "quiz"),
'id ASC' => get_string("sortage", "quiz"));
$orderselect = choose_from_menu ($sortoptions, 'sortorder', $sortorder, false, 'this.form.submit();', '0', true);
$orderselect .= '<noscript><input type="submit" value="'.get_string("sortsubmit", "quiz").'" /></noscript>';
echo "<th width=\"100%\" align=\"left\" nowrap=\"nowrap\" class=\"header\" scope=\"col\">$strquestionname $orderselect</th>
<th nowrap=\"nowrap\" class=\"header\" scope=\"col\">$strtype</th>";
echo "<th width=\"100%\" align=\"left\" style=\"white-space:nowrap;\" class=\"header\" scope=\"col\">$strquestionname $orderselect</th>
<th style=\"white-space:nowrap;\" class=\"header\" scope=\"col\">$strtype</th>";
echo "</tr>\n";
foreach ($questions as $question) {
echo "<tr>\n<td nowrap=\"nowrap\">\n";
echo "<tr>\n<td style=\"white-space:nowrap;\">\n";
// add to quiz
if ($quizid && has_capability('mod/quiz:manage', $context)) {
echo "<a title=\"$straddtoquiz\" href=\"edit.php?addquestion=$question->id&amp;quizid=$quizid&amp;sesskey=$USER->sesskey\"><img
src=\"$CFG->pixpath/t/moveleft.gif\" border=\"0\" alt=\"$straddtoquiz\" /></a>&nbsp;";
src=\"$CFG->pixpath/t/moveleft.gif\" alt=\"$straddtoquiz\" /></a>&nbsp;";
}
// preview
echo "<a title=\"$strpreview\" href=\"javascript:void();\" onClick=\"openpopup('/question/preview.php?id=$question->id&amp;quizid=$quizid','$strpreview', " .
QUESTION_PREVIEW_POPUP_OPTIONS . ", false)\"><img
src=\"$CFG->pixpath/t/preview.gif\" border=\"0\" alt=\"$strpreview\" /></a>&nbsp;";
src=\"$CFG->pixpath/t/preview.gif\" alt=\"$strpreview\" /></a>&nbsp;";
// edit, hide, delete question, using question capabilities, not quiz capabilieies
if (has_capability('moodle/question:manage', $context)) {
echo "<a title=\"$stredit\" href=\"$CFG->wwwroot/question/question.php?id=$question->id\"><img
src=\"$CFG->pixpath/t/edit.gif\" border=\"0\" alt=\"$stredit\" /></a>&nbsp;";
src=\"$CFG->pixpath/t/edit.gif\" alt=\"$stredit\" /></a>&nbsp;";
// hide-feature
if($question->hidden) {
echo "<a title=\"$strrestore\" href=\"edit.php?courseid=$course->id&amp;unhide=$question->id&amp;sesskey=$USER->sesskey\"><img
src=\"$CFG->pixpath/t/restore.gif\" border=\"0\" alt=\"$strrestore\" /></a>";
src=\"$CFG->pixpath/t/restore.gif\" alt=\"$strrestore\" /></a>";
} else {
echo "<a title=\"$strdelete\" href=\"edit.php?courseid=$course->id&amp;deleteselected=$question->id&amp;q$question->id=1\"><img
src=\"$CFG->pixpath/t/delete.gif\" border=\"0\" alt=\"$strdelete\" /></a>";
src=\"$CFG->pixpath/t/delete.gif\" alt=\"$strdelete\" /></a>";
}
}
echo "&nbsp;<input title=\"$strselect\" type=\"checkbox\" name=\"q$question->id\" value=\"1\" />";

View File

@ -38,7 +38,7 @@ class description_qtype extends default_questiontype {
$editlink = '';
if (has_capability('moodle/question:manage', get_context_instance(CONTEXT_COURSE, $cmoptions->course))) {
$stredit = get_string('edit');
$linktext = '<img src="'.$CFG->pixpath.'/t/edit.gif" border="0" alt="'.$stredit.'" />';
$linktext = '<img src="'.$CFG->pixpath.'/t/edit.gif" alt="'.$stredit.'" />';
$editlink = link_to_popup_window('/question/question.php?id='.$question->id, $stredit, $linktext, 450, 550, $stredit, '', true);
}

View File

@ -567,7 +567,7 @@ class default_questiontype {
$editlink = '';
if ($context && has_capability('moodle/question:manage', $context)) {
$stredit = get_string('edit');
$linktext = '<img src="'.$CFG->pixpath.'/t/edit.gif" border="0" alt="'.$stredit.'" />';
$linktext = '<img src="'.$CFG->pixpath.'/t/edit.gif" alt="'.$stredit.'" />';
$editlink = link_to_popup_window('/question/question.php?inpopup=1&amp;id='.$question->id, 'editquestion', $linktext, 450, 550, $stredit, '', true);
}

View File

@ -140,7 +140,7 @@
delete_records('question_rqp_types', 'id', $type->id);
} else {
foreach ($servers as $server) {
$actions = '<a title="' . $strinfo . '" href="types.php?info='.$server->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/i/info.gif" border="0" alt="'.$strinfo.'" align="absbottom" /></a>&nbsp;<a title="'.$strdelete.'" href="types.php?delete='.$server->id.'&amp;sesskey='.sesskey().'"><img src="../../../../pix/t/delete.gif" border="0" alt="'.$strdelete.'" /></a>';
$actions = '<a title="' . $strinfo . '" href="types.php?info='.$server->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/i/info.gif" alt="'.$strinfo.'" align="absbottom" /></a>&nbsp;<a title="'.$strdelete.'" href="types.php?delete='.$server->id.'&amp;sesskey='.sesskey().'"><img src="../../../../pix/t/delete.gif" alt="'.$strdelete.'" /></a>';
$serverurl = ($info == $server->id) ? '<b>'.$server->url.'</b>' : $server->url;
$table->add_data(array($type->name, $serverurl, $actions));
}