From: toyomoyo Date: Fri, 30 Mar 2007 07:04:43 +0000 (+0000) Subject: merged fix for MDL-9097, xhtml fixes for glossary X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5bd76d7fbad4a914ebcdbb3deada17323ed78110;p=moodle.git merged fix for MDL-9097, xhtml fixes for glossary --- diff --git a/mod/glossary/editcategories.html b/mod/glossary/editcategories.html index f2b1afc779..0dd66b12bf 100644 --- a/mod/glossary/editcategories.html +++ b/mod/glossary/editcategories.html @@ -30,8 +30,10 @@ + -

+

+

@@ -39,6 +41,7 @@ " /> " onclick="javascript:history.go(-1);" /> +

diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 140119406d..5c81b59549 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -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 "

" . get_string("edit"). " " . get_string("category","glossary") . ""; + echo "

" . get_string("edit"). " " . get_string("category","glossary") . ""; $name = $category->name; $usedynalink = $category->usedynalink; @@ -94,10 +92,10 @@ redirect("editcategories.php?id=$cm->id"); } else { - echo "

" . get_string("delete"). " " . get_string("category","glossary") . ""; + echo "

" . get_string("delete"). " " . get_string("category","glossary"). "

"; print_simple_box_start("center","40%", "#FFBBBB"); - echo "
".format_text($category->name)."
"; + echo "
".format_text($category->name, FORMAT_PLAIN)."
"; $num_entries = count_records("glossary_entries_categories","categoryid",$category->id); if ( $num_entries ) { @@ -105,18 +103,24 @@ } echo "

"; print_string("areyousuredelete","glossary"); + echo "

"; ?> -
- - - - - - -
- " /> - - + + + + +
+
+
+ + + + + + " /> +
+
+
prefix}glossary_categories WHERE name $ILIKE '$name' AND glossaryid=$glossary->id"); if ( $dupcategory ) { - echo "

" . get_string("add"). " " . get_string("category","glossary") . ""; + echo "

" . get_string("add"). " " . get_string("category","glossary"); print_simple_box_start("center","40%", "#FFBBBB"); echo "

" . get_string("duplicatedcategory","glossary") ."
"; - echo ""; print_simple_box_end(); redirect("editcategories.php?id=$cm->id&action=add&&name=$name"); @@ -157,7 +160,7 @@ } } } else { - echo "

" . get_string("add"). " " . get_string("category","glossary") . ""; + echo "

" . get_string("add"). " " . get_string("category","glossary"). "

"; $name=""; require "editcategories.html"; } @@ -170,36 +173,34 @@ ?> - -
-
- +
- - - + -
+ +
+
- + id,"name ASC"); if ( $categories ) { + echo '
'; foreach ($categories as $category) { $num_entries = count_records("glossary_entries_categories","categoryid",$category->id); ?> - - '; } ?> -
+ ".format_text($category->name)." ($num_entries " . get_string("entries","glossary") . ")"; + echo "".format_text($category->name, FORMAT_PLAIN)." ($num_entries " . get_string("entries","glossary") . ")"; ?> + id&action=delete&mode=cat&hook=$category->id\">\"" "; echo "id&action=edit&mode=cat&hook=$category->id\">\"""; @@ -208,14 +209,15 @@
-
+ id; @@ -236,9 +238,6 @@
-
-

- diff --git a/mod/glossary/export.php b/mod/glossary/export.php index 16ff0b83ef..f37dad575b 100644 --- a/mod/glossary/export.php +++ b/mod/glossary/export.php @@ -53,8 +53,10 @@
+
+
concept); $title = str_replace('"', "'", strip_tags($glossaryname.': '.$concept->concept)); } - $href_tag_begin = 'glossaryid.'" title="'.$title.'" '. 'href="'.$CFG->wwwroot.'/mod/glossary/showentry.php?courseid='.$courseid. '&concept='.$encodedconcept.'" '. 'onclick="return openpopup(\'/mod/glossary/showentry.php?courseid='.$courseid. diff --git a/mod/glossary/import.html b/mod/glossary/import.html index 5a271c9af2..0f450498c4 100644 --- a/mod/glossary/import.html +++ b/mod/glossary/import.html @@ -1,7 +1,7 @@
- - @@ -35,13 +35,15 @@
:
+
:
maxbytes, $course->maxbytes))); @@ -9,7 +9,7 @@ helpbutton("filetoimport", get_string("filetoimport", "glossary"), "glossary"); ?>
+ dirroot.'/lib/uploadlib.php'); upload_print_form_fragment(1,array('file'),null,false,null,0,0); @@ -20,13 +20,13 @@ - - + - - + +
:: :" /> :" />
- - + +
" />" />" />" />
+
+
diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index b6661d04d4..5cad095fcd 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1265,7 +1265,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) { echo ''; echo ''; - echo ''; - echo ''; - echo '"; echo ""; echo ""; - echo ""; + echo ""; echo ""; + echo ""; foreach ($ratings as $rating) { if (has_capability('mod/glossary:manageentries', $context)) { echo ''; @@ -60,11 +61,11 @@ echo ''; } echo ''; - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; echo "\n"; } echo "
'; + echo ''; 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 ''; + echo ''; echo ''; $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 ''; + echo ''; echo popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&mode=cat&hook=", $menu, "catmenu", $selected, "", "", "", false); diff --git a/mod/glossary/print.php b/mod/glossary/print.php index 1aa8dae028..f9f5bde614 100644 --- a/mod/glossary/print.php +++ b/mod/glossary/print.php @@ -144,7 +144,7 @@ } $site = get_record("course","id",1); - echo '

' . userdate(time()) . '

'; + echo '

' . userdate(time()) . '

'; echo get_string("site") . ': ' . format_string($site->fullname) . '
'; echo get_string("course") . ': ' . format_string($course->fullname) . ' ('. format_string($course->shortname) . ')
'; echo get_string("modulename","glossary") . ': ' . format_string($glossary->name, true) . ''; diff --git a/mod/glossary/rate.php b/mod/glossary/rate.php index 3f123a4b34..c7c0d7cd92 100644 --- a/mod/glossary/rate.php +++ b/mod/glossary/rate.php @@ -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; diff --git a/mod/glossary/report.php b/mod/glossary/report.php index c9b17fb0aa..bc9d4e70ab 100644 --- a/mod/glossary/report.php +++ b/mod/glossary/report.php @@ -51,8 +51,9 @@ echo "
 id&sort=firstname\">$strnameid&sort=rating\">$strratingid&sort=rating\">$strratingid&sort=time\">$strtime
'; - 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 ''.fullname($rating).''.$scalemenu[$rating->rating].''.userdate($rating->time).''.fullname($rating).''.$scalemenu[$rating->rating].''.userdate($rating->time).'
"; @@ -72,5 +73,5 @@ } close_window_button(); - + print_footer(); ?> diff --git a/mod/glossary/showentry.php b/mod/glossary/showentry.php index a01affd8fb..496ce9c2ba 100644 --- a/mod/glossary/showentry.php +++ b/mod/glossary/showentry.php @@ -33,7 +33,7 @@ if ($entries) { foreach ($entries as $key => $entry) { //$entries[$key]->footer = "

» 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)."

"; // Could not get this to work satisfactorily in all cases - Martin - $entries[$key]->footer = "

» wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."

"; + $entries[$key]->footer = "

» wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."

"; add_to_log($entry->courseid, "glossary", "view entry", "showentry.php?eid=$entry->id", $entry->id, $entry->cmid); } } diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 4ad268c0bd..3e8b944cfb 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -308,7 +308,7 @@ if ( $showcommonelements and $mode != 'search') { if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) { print_box_start('printicon'); - echo " id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\">\""."; + echo " id&mode=$mode&hook=".urlencode($hook)."&sortkey=$sortkey&sortorder=$sortorder&offset=$offset\">\""."; print_box_end(); } } @@ -327,7 +327,7 @@ if ($showcommonelements ) { echo '
'; - echo ''; + echo '
'; echo '
'; echo ' '; @@ -405,8 +405,9 @@ } else { $ratings->allow = true; } - + $formsent = 1; echo ""; + echo "
"; echo "id\" />"; } @@ -487,6 +488,7 @@ if ($ratingsmenuused) { + echo "
"; if ($glossary->scale < 0) { if ($scale = get_record("scale", "id", abs($glossary->scale))) { @@ -494,7 +496,12 @@ } } echo "
"; + echo "
"; echo ""; + } else if (!empty($formsent)) { + // close the form properly if not used + echo ""; + echo ""; } if ( $paging ) {