]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-9097, xhtml fixes for glossary
authortoyomoyo <toyomoyo>
Fri, 30 Mar 2007 07:04:43 +0000 (07:04 +0000)
committertoyomoyo <toyomoyo>
Fri, 30 Mar 2007 07:04:43 +0000 (07:04 +0000)
mod/glossary/editcategories.html
mod/glossary/editcategories.php
mod/glossary/export.php
mod/glossary/filter.php
mod/glossary/import.html
mod/glossary/lib.php
mod/glossary/print.php
mod/glossary/rate.php
mod/glossary/report.php
mod/glossary/showentry.php
mod/glossary/view.php

index f2b1afc779ee1bde9642d221b27ab2cefb55c8e8..0dd66b12bfd1bfa3b53be4498b6935c443f02d38 100644 (file)
       </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>
index 140119406dfae176042b9f8e27943a58a3938be1..5c81b59549eff0ce6c2b5de671148f75af534148 100644 (file)
@@ -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;
 
                 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 ) {
                 }
                 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);
             $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&amp;action=add&&amp;name=$name");
                 }
             }
         } 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";
         }
 
 ?>
 
-
-<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&amp;action=delete&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("delete") . "\"src=\"../../pix/t/delete.gif\" class=\"iconsmall\" /></a> ";
                 echo "<a href=\"editcategories.php?id=$cm->id&amp;action=edit&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("edit") . "\" src=\"../../pix/t/edit.gif\" class=\"iconsmall\" /></a>";
              </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;
         </tr>
         </table>
 
-</table>
-</p>
-
 
 </form>
 
index 16ff0b83efb9d33014dd69cdd7991212a7b1d159..f37dad575bfc1359a01c33d7204913f9680d0f89 100644 (file)
     <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();
index 3a8b8a9eb2d19a702efc4df41ee7a4bfe4fb3989..90ec18b38bde1e5e2e860c47e26db4d6c208bcc3 100644 (file)
@@ -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.
                                   '&amp;concept='.$encodedconcept.'" '.
                                   'onclick="return openpopup(\'/mod/glossary/showentry.php?courseid='.$courseid.
index 5a271c9af25d847e8d7961c171fa876d53311445..0f450498c445d80f2bb5be762af536eb497939d7 100644 (file)
@@ -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);
     <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>
     <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> 
index b6661d04d4d13d489bea3e6293c8b174f106554b..5cad095fcd586f529c8b8a92bf47c877e9d5c217 100644 (file)
@@ -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&amp;mode=cat&amp;hook=", $menu, "catmenu", $selected, "",
                       "", "", false);
index 1aa8dae0282a104453200968393e6aac2c93ff88..f9f5bde614c5327594c55b1947c7472e214f2695 100644 (file)
     }
 
     $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>';
index 3f123a4b3408e9411c04b398c9e33c9c2e316ba5..c7c0d7cd92acb3e147d6cffc76887900698320d6 100644 (file)
@@ -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;
index c9b17fb0aad7a566d4d92a9734f9bbc9f1d7c89a..bc9d4e70abf5f0d6756e476a56910dd3fdba654d 100644 (file)
@@ -51,8 +51,9 @@
         echo "<tr>";
         echo "<th class=\"header\" scope=\"col\">&nbsp;</th>";
         echo "<th class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&amp;sort=firstname\">$strname</a></th>";
-        echo "<th width=\"100%\" class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&amp;sort=rating\">$strrating</a></th>";
+        echo "<th class=\"header\" scope=\"col\" style=\"width:100%\"><a href=\"report.php?id=$entry->id&amp;sort=rating\">$strrating</a></th>";
         echo "<th class=\"header\" scope=\"col\"><a href=\"report.php?id=$entry->id&amp;sort=time\">$strtime</a></th>";
+        echo "</tr>";
         foreach ($ratings as $rating) {
             if (has_capability('mod/glossary:manageentries', $context)) {
                 echo '<tr class="teacher">';
                 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.'&amp;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.'&amp;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();
 ?>
index a01affd8fb1948356eb3861c956521088cee32b7..496ce9c2ba0c438e4d7e73b4c14526f3cd2553d7 100644 (file)
@@ -33,7 +33,7 @@
     if ($entries) {
         foreach ($entries as $key => $entry) {
             //$entries[$key]->footer = "<p align=\"right\">&raquo;&nbsp;<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\">&raquo;&nbsp;<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\">&raquo;&nbsp;<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);
         }
     }
index 4ad268c0bd6efca87cbeb0bd5eeb38eaa67df0f1..3e8b944cfbb545e7b5e6bdc7949b3a5e9ed239fa 100644 (file)
         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&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;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&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
                 print_box_end(); 
             }
         }
     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" /> ';
             } else {
                 $ratings->allow = true;
             }
-
+            $formsent = 1;
             echo "<form method=\"post\" action=\"rate.php\">";
+            echo "<div>";
             echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
         }
 
 
 
     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))) {
             }
         }
         echo "</div>";
+        echo "</div>";
         echo "</form>";
+    } else if (!empty($formsent)) {
+        // close the form properly if not  used
+        echo "</div>";
+        echo "</form>";  
     }
 
     if ( $paging ) {