mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
merged fix for MDL-9097, xhtml fixes for glossary
This commit is contained in:
parent
be833e823c
commit
5bd76d7fba
@ -30,8 +30,10 @@
|
||||
</select> <?php helpbutton("linkcategory", get_string("linkcategory", "glossary"), "glossary") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<p align="center">
|
||||
<p style="text-align:center">
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
|
||||
<input type="hidden" name="action" value="<?php p($action) ?>" />
|
||||
<input type="hidden" name="confirm" value="1" />
|
||||
@ -39,6 +41,7 @@
|
||||
<input type="hidden" name="hook" value="<?php p($hook) ?>" />
|
||||
<input type="submit" value="<?php print_string("savechanges") ?>" />
|
||||
<input type="reset" value="<?php print_string("back","glossary") ?>" onclick="javascript:history.go(-1);" />
|
||||
</div>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -19,8 +19,6 @@
|
||||
if (! $cm = get_coursemodule_from_id('glossary', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
@ -70,7 +68,7 @@
|
||||
add_to_log($course->id, "glossary", "edit category", "editcategories.php?id=$cm->id", $hook,$cm->id);
|
||||
}
|
||||
} else {
|
||||
echo "<p align=\"center\">" . get_string("edit"). " " . get_string("category","glossary") . "<font size=\"3\">";
|
||||
echo "<p style=\"text-align:center\">" . get_string("edit"). " " . get_string("category","glossary") . "<span style=\"font-size:1.5em\">";
|
||||
|
||||
$name = $category->name;
|
||||
$usedynalink = $category->usedynalink;
|
||||
@ -94,10 +92,10 @@
|
||||
|
||||
redirect("editcategories.php?id=$cm->id");
|
||||
} else {
|
||||
echo "<p align=\"center\">" . get_string("delete"). " " . get_string("category","glossary") . "<font size=\"3\">";
|
||||
echo "<p style=\"text-align:center\">" . get_string("delete"). " " . get_string("category","glossary"). "</p>";
|
||||
|
||||
print_simple_box_start("center","40%", "#FFBBBB");
|
||||
echo "<div class=\"boxaligncenter\"><b>".format_text($category->name)."</b><br/>";
|
||||
echo "<div class=\"boxaligncenter\"><b>".format_text($category->name, FORMAT_PLAIN)."</b><br/>";
|
||||
|
||||
$num_entries = count_records("glossary_entries_categories","categoryid",$category->id);
|
||||
if ( $num_entries ) {
|
||||
@ -105,18 +103,24 @@
|
||||
}
|
||||
echo "<p>";
|
||||
print_string("areyousuredelete","glossary");
|
||||
echo "</p>";
|
||||
?>
|
||||
<form id="form" method="post" action="editcategories.php">
|
||||
|
||||
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
|
||||
<input type="hidden" name="action" value="delete" />
|
||||
<input type="hidden" name="confirm" value="1" />
|
||||
<input type="hidden" name="mode" value="<?php echo $mode ?>" />
|
||||
<input type="hidden" name="hook" value="<?php echo $hook ?>" />
|
||||
<table border="0" width="100"><tr><td align="right" width="50%" />
|
||||
<input type="submit" value=" <?php print_string("yes")?> " />
|
||||
</form>
|
||||
</td><td align="left" width="50%">
|
||||
<table border="0" width="100">
|
||||
<tr>
|
||||
<td align="right" style="width:50%">
|
||||
<form id="form" method="post" action="editcategories.php">
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
|
||||
<input type="hidden" name="action" value="delete" />
|
||||
<input type="hidden" name="confirm" value="1" />
|
||||
<input type="hidden" name="mode" value="<?php echo $mode ?>" />
|
||||
<input type="hidden" name="hook" value="<?php echo $hook ?>" />
|
||||
<input type="submit" value=" <?php print_string("yes")?> " />
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
<td align="left" style="width:50%">
|
||||
|
||||
<?php
|
||||
unset($options);
|
||||
@ -133,11 +137,10 @@
|
||||
$ILIKE = sql_ilike();
|
||||
$dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name' AND glossaryid=$glossary->id");
|
||||
if ( $dupcategory ) {
|
||||
echo "<p align=\"center\">" . get_string("add"). " " . get_string("category","glossary") . "<font size=\"3\">";
|
||||
echo "<p style=\"text-align:center\">" . get_string("add"). " " . get_string("category","glossary");
|
||||
|
||||
print_simple_box_start("center","40%", "#FFBBBB");
|
||||
echo "<div style=\"text-align:center\">" . get_string("duplicatedcategory","glossary") ."</div>";
|
||||
echo "</center>";
|
||||
print_simple_box_end();
|
||||
|
||||
redirect("editcategories.php?id=$cm->id&action=add&&name=$name");
|
||||
@ -157,7 +160,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<p align=\"center\">" . get_string("add"). " " . get_string("category","glossary") . "<font size=\"3\">";
|
||||
echo "<p style=\"text-align:center\">" . get_string("add"). " " . get_string("category","glossary"). "</p>";
|
||||
$name="";
|
||||
require "editcategories.html";
|
||||
}
|
||||
@ -170,36 +173,34 @@
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
<form method="post" action="editcategories.php">
|
||||
<table width="40%" class="generalbox" cellpadding="5">
|
||||
<table width="40%" class="boxaligncenter generalbox" cellpadding="5">
|
||||
<tr>
|
||||
<td width="90%" align="center"><b>
|
||||
<td style="width:90%" align="center"><b>
|
||||
<?php p(get_string("categories","glossary")) ?></b></td>
|
||||
<td width="10%" align="center"><b>
|
||||
<td style="width:10%" align="center"><b>
|
||||
<?php p(get_string("action")) ?></b></td>
|
||||
</tr>
|
||||
<tr><td width="100%" colspan="2">
|
||||
<tr><td style="width:100%" colspan="2">
|
||||
|
||||
<table width="100%">
|
||||
|
||||
|
||||
<?php
|
||||
$categories = get_records("glossary_categories","glossaryid",$glossary->id,"name ASC");
|
||||
|
||||
if ( $categories ) {
|
||||
echo '<table width="100%">';
|
||||
foreach ($categories as $category) {
|
||||
$num_entries = count_records("glossary_entries_categories","categoryid",$category->id);
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td width="90%" align="left">
|
||||
<td style="width:90%" align="left">
|
||||
<?php
|
||||
echo "<b>".format_text($category->name)."</b> <font size=-1>($num_entries " . get_string("entries","glossary") . ")</font>";
|
||||
echo "<b>".format_text($category->name, FORMAT_PLAIN)."</b> <span style=\"font-size:0.75em\">($num_entries " . get_string("entries","glossary") . ")</span>";
|
||||
?>
|
||||
</td>
|
||||
<td width="10%" align="center"><b>
|
||||
<td style="width:10%" align="center"><b>
|
||||
<?php
|
||||
echo "<a href=\"editcategories.php?id=$cm->id&action=delete&mode=cat&hook=$category->id\"><img alt=\"" . get_string("delete") . "\"src=\"../../pix/t/delete.gif\" class=\"iconsmall\" /></a> ";
|
||||
echo "<a href=\"editcategories.php?id=$cm->id&action=edit&mode=cat&hook=$category->id\"><img alt=\"" . get_string("edit") . "\" src=\"../../pix/t/edit.gif\" class=\"iconsmall\" /></a>";
|
||||
@ -208,14 +209,15 @@
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td width="100%" colspan="2" align="center">
|
||||
<td style="width:100%" colspan="2" align="center">
|
||||
<?php
|
||||
|
||||
$options['id'] = $cm->id;
|
||||
@ -236,9 +238,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
@ -53,8 +53,10 @@
|
||||
<tr><td align="center">
|
||||
<input type="submit" value="<?php p($strexportfile)?>" />
|
||||
</td></tr></table>
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php p($id)?>" />
|
||||
<input type="hidden" name="cat" value="<?php p($cat)?>" />
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
print_box_end();
|
||||
|
@ -136,7 +136,7 @@ function glossary_filter($courseid, $text) {
|
||||
$encodedconcept = urlencode($concept->concept);
|
||||
$title = str_replace('"', "'", strip_tags($glossaryname.': '.$concept->concept));
|
||||
}
|
||||
$href_tag_begin = '<a target="entry" class="glossary autolink glossaryid'.$concept->glossaryid.'" title="'.$title.'" '.
|
||||
$href_tag_begin = '<a class="glossary autolink glossaryid'.$concept->glossaryid.'" title="'.$title.'" '.
|
||||
'href="'.$CFG->wwwroot.'/mod/glossary/showentry.php?courseid='.$courseid.
|
||||
'&concept='.$encodedconcept.'" '.
|
||||
'onclick="return openpopup(\'/mod/glossary/showentry.php?courseid='.$courseid.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<form method="post" action="import.php" enctype="multipart/form-data">
|
||||
<table border="0" cellpadding="3" cellspacing="3" width="100%">
|
||||
<tr>
|
||||
<td align="right" valign="top" width="30%"><b><?php print_string("filetoimport","glossary") ?>:<br />
|
||||
<td align="right" style="width:30%;vertical-align:top"><b><?php print_string("filetoimport","glossary") ?>:<br />
|
||||
<?php
|
||||
echo '(';
|
||||
print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
|
||||
@ -9,7 +9,7 @@
|
||||
helpbutton("filetoimport", get_string("filetoimport", "glossary"), "glossary");
|
||||
?>
|
||||
</b></td>
|
||||
<td width="70%">
|
||||
<td style="width:70%">
|
||||
<?php
|
||||
require_once($CFG->dirroot.'/lib/uploadlib.php');
|
||||
upload_print_form_fragment(1,array('file'),null,false,null,0,0);
|
||||
@ -20,13 +20,13 @@
|
||||
<td align="right" colspan="2">
|
||||
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
||||
<tr>
|
||||
<td width="25%" align="right"><?php print_string("destination","glossary") ?>:</td>
|
||||
<td width="25%"><select size="1" name="dest">
|
||||
<td align="right" style="width:25%"><?php print_string("destination","glossary") ?>:</td>
|
||||
<td style="width:25%"><select size="1" name="dest">
|
||||
<option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option>
|
||||
<option value="new"><?php print_string("newglossary","glossary") ?></option>
|
||||
</select> <?php helpbutton("destination", get_string("destination", "glossary"), "glossary") ?></td>
|
||||
<td width="25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
|
||||
<td width="25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" /> <?php helpbutton("importcategories", get_string("importcategories", "glossary"), "glossary") ?></td>
|
||||
<td style="width:25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
|
||||
<td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" /> <?php helpbutton("importcategories", get_string("importcategories", "glossary"), "glossary") ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@ -35,13 +35,15 @@
|
||||
<td align="right" colspan="2">
|
||||
<table border="0" cellpadding="3" cellspacing="3" width="100%">
|
||||
<tr>
|
||||
<td width="50%" align="right"><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
|
||||
<td width="50%"><input type="reset" value="<?php print_string("revert") ?>" /></td>
|
||||
<td style="width:50%" align="right"><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
|
||||
<td style="width:50%"><input type="reset" value="<?php print_string("revert") ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php p($id) ?>" />
|
||||
<input type="hidden" name="step" value="1" />
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1265,7 +1265,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
echo '<table border="0" width="100%">';
|
||||
echo '<tr>';
|
||||
|
||||
echo '<td align="center" width="20%">';
|
||||
echo '<td align="center" style="width:20%">';
|
||||
if (has_capability('mod/glossary:managecategories', $context)) {
|
||||
$options['id'] = $cm->id;
|
||||
$options['mode'] = 'cat';
|
||||
@ -1274,7 +1274,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
echo '<td align="center" width="60%">';
|
||||
echo '<td align="center" style="width:60%">';
|
||||
echo '<b>';
|
||||
|
||||
$menu[GLOSSARY_SHOW_ALL_CATEGORIES] = get_string("allcategories","glossary");
|
||||
@ -1298,7 +1298,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
}
|
||||
|
||||
if ( $category ) {
|
||||
echo format_text($category->name);
|
||||
echo format_text($category->name, FORMAT_PLAIN);
|
||||
} else {
|
||||
if ( $hook == GLOSSARY_SHOW_NOT_CATEGORISED ) {
|
||||
|
||||
@ -1313,7 +1313,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
|
||||
}
|
||||
}
|
||||
echo '</b></td>';
|
||||
echo '<td align="center" width="20%">';
|
||||
echo '<td align="center" style="width:20%">';
|
||||
|
||||
echo popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&mode=cat&hook=", $menu, "catmenu", $selected, "",
|
||||
"", "", false);
|
||||
|
@ -144,7 +144,7 @@
|
||||
}
|
||||
|
||||
$site = get_record("course","id",1);
|
||||
echo '<p align="right"><font size="-1">' . userdate(time()) . '</font></p>';
|
||||
echo '<p style="text-align:right"><span style="font-size:0.75em">' . userdate(time()) . '</span></p>';
|
||||
echo get_string("site") . ': <strong>' . format_string($site->fullname) . '</strong><br />';
|
||||
echo get_string("course") . ': <strong>' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')</strong><br />';
|
||||
echo get_string("modulename","glossary") . ': <strong>' . format_string($glossary->name, true) . '</strong>';
|
||||
|
@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
if ($data = data_submitted("$CFG->wwwroot/mod/glossary/view.php")) { // form submitted
|
||||
|
||||
print_object($data);
|
||||
foreach ((array)$data as $entry => $rating) {
|
||||
if ($entry == "id") {
|
||||
continue;
|
||||
|
@ -51,8 +51,9 @@
|
||||
echo "<tr>";
|
||||
echo "<th class=\"header\" scope=\"col\"> </th>";
|
||||
echo "<th class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&sort=firstname\">$strname</a></th>";
|
||||
echo "<th width=\"100%\" class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&sort=rating\">$strrating</a></th>";
|
||||
echo "<th class=\"header\" scope=\"col\" style=\"width:100%\"><a href=\"report.php?id=$entry->id&sort=rating\">$strrating</a></th>";
|
||||
echo "<th class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&sort=time\">$strtime</a></th>";
|
||||
echo "</tr>";
|
||||
foreach ($ratings as $rating) {
|
||||
if (has_capability('mod/glossary:manageentries', $context)) {
|
||||
echo '<tr class="teacher">';
|
||||
@ -60,11 +61,11 @@
|
||||
echo '<tr>';
|
||||
}
|
||||
echo '<td class="picture">';
|
||||
print_user_picture($rating->id, $glossary->course, $rating->picture, false, false, true, true);
|
||||
print_user_picture($rating->id, $glossary->course, $rating->picture, false, false, true);
|
||||
echo '</td>';
|
||||
echo '<td nowrap="nowrap" class="author"><a target="_blank" href="'.$CFG->wwwroot.'/user/view.php?id='.$rating->id.'&course='.$glossary->course.'">'.fullname($rating).'</a></td>';
|
||||
echo '<td nowrap="nowrap" align="center" class="rating">'.$scalemenu[$rating->rating].'</td>';
|
||||
echo '<td nowrap="nowrap" align="center" class="time">'.userdate($rating->time).'</td>';
|
||||
echo '<td class="author"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$rating->id.'&course='.$glossary->course.'">'.fullname($rating).'</a></td>';
|
||||
echo '<td style="white-space:nowrap" align="center" class="rating">'.$scalemenu[$rating->rating].'</td>';
|
||||
echo '<td style="white-space:nowrap" align="center" class="time">'.userdate($rating->time).'</td>';
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>";
|
||||
@ -72,5 +73,5 @@
|
||||
}
|
||||
|
||||
close_window_button();
|
||||
|
||||
print_footer();
|
||||
?>
|
||||
|
@ -33,7 +33,7 @@
|
||||
if ($entries) {
|
||||
foreach ($entries as $key => $entry) {
|
||||
//$entries[$key]->footer = "<p align=\"right\">» <a onClick=\"if (window.opener) {window.opener.location.href='$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid'; return false;} else {openpopup('/mod/glossary/view.php?g=$entry->glossaryid', 'glossary', 'menubar=1,location=1,toolbar=1,scrollbars=1,directories=1,status=1,resizable=1', 0); return false;}\" href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\" target=\"_blank\">".format_string($entry->glossaryname,true)."</a></p>"; // Could not get this to work satisfactorily in all cases - Martin
|
||||
$entries[$key]->footer = "<p align=\"right\">» <a target=\"_blank\" href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
|
||||
$entries[$key]->footer = "<p style=\"text-align:right\">» <a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
|
||||
add_to_log($entry->courseid, "glossary", "view entry", "showentry.php?eid=$entry->id", $entry->id, $entry->cmid);
|
||||
}
|
||||
}
|
||||
|
@ -308,7 +308,7 @@
|
||||
if ( $showcommonelements and $mode != 'search') {
|
||||
if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) {
|
||||
print_box_start('printicon');
|
||||
echo " <a title =\"". get_string("printerfriendly","glossary") ."\" target=\"printview\" href=\"print.php?id=$cm->id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
|
||||
echo " <a title =\"". get_string("printerfriendly","glossary") ."\" href=\"print.php?id=$cm->id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
|
||||
print_box_end();
|
||||
}
|
||||
}
|
||||
@ -327,7 +327,7 @@
|
||||
if ($showcommonelements ) {
|
||||
echo '<form method="post" action="view.php">';
|
||||
|
||||
echo '<table align="center" width="70%" border="0">';
|
||||
echo '<table class="boxaligncenter" width="70%" border="0">';
|
||||
echo '<tr><td align="center" class="glossarysearchbox">';
|
||||
|
||||
echo '<input type="submit" value="'.$strsearch.'" name="searchbutton" /> ';
|
||||
@ -405,8 +405,9 @@
|
||||
} else {
|
||||
$ratings->allow = true;
|
||||
}
|
||||
|
||||
$formsent = 1;
|
||||
echo "<form method=\"post\" action=\"rate.php\">";
|
||||
echo "<div>";
|
||||
echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
|
||||
}
|
||||
|
||||
@ -487,6 +488,7 @@
|
||||
|
||||
|
||||
if ($ratingsmenuused) {
|
||||
|
||||
echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />";
|
||||
if ($glossary->scale < 0) {
|
||||
if ($scale = get_record("scale", "id", abs($glossary->scale))) {
|
||||
@ -494,7 +496,12 @@
|
||||
}
|
||||
}
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
} else if (!empty($formsent)) {
|
||||
// close the form properly if not used
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
if ( $paging ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user