]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed some pretty major HTML errors :-) bug 5089
authormoodler <moodler>
Wed, 5 Apr 2006 08:19:09 +0000 (08:19 +0000)
committermoodler <moodler>
Wed, 5 Apr 2006 08:19:09 +0000 (08:19 +0000)
mod/data/lib.php
mod/data/view.php

index d7c6c1f3530d4898fc72382897c1565d9d2a8bde..a07e1ccac1284292a021b24c884674766f70d436 100755 (executable)
@@ -884,10 +884,11 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re
 
         ///actual replacement of the tags
         $newtext = preg_replace($patterns, $replacement, $data->{$template});
+        $options->para=false;
         if ($return) {
-            return format_text($newtext);
+            return format_text($newtext, FORMAT_HTML, $options);
         } else {
-            echo format_text($newtext);    //prints the template with tags replaced
+            echo format_text($newtext, FORMAT_HTML, $options);    //prints the template with tags replaced
         }
 
         /**********************************
@@ -964,8 +965,8 @@ function data_print_ratings($data, $record) {
             $ratings->assesspublic = $data->assesspublic;
             $ratings->allow = (($data->assessed != 2 or isteacher($data->course)) && !isguest());
             if ($ratings->allow) {
-                echo '<p /><form name="form" method="post" action="rate.php">';
                 echo '<div class="ratings" align="center">';
+                echo '<form name="form" method="post" action="rate.php">';
                 $useratings = true;
 
                 if ($useratings) {
@@ -997,8 +998,8 @@ function data_print_ratings($data, $record) {
                     echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
                     echo "<input type=\"submit\" value=\"".get_string("sendinratings", "data")."\" />";
                 }
-                echo '</div>';
                 echo "</form>";
+                echo '</div>';
             }
         }
     }
@@ -1116,7 +1117,7 @@ function data_print_comments($data, $record, $page=0) {
     echo '<input type="hidden" name="rid" value="'.$record->id.'" />';
 
     echo '<textarea name="commentcontent"></textarea>';
-    echo '<br><input type="submit" value="'.get_string('addcomment','data').'" />';
+    echo '<br /><input type="submit" value="'.get_string('addcomment','data').'" />';
     echo '</form></div>';
 }
 
@@ -1130,7 +1131,7 @@ function data_print_comment($data, $comment, $page=0) {
 
     $user = get_record('user','id',$comment->userid);
 
-    echo '<div align="center"><table cellspacing="0" width ="50%" class="forumpost">';
+    echo '<table cellspacing="0" align="center" width="50%" class="datacomment forumpost">';
 
     echo '<tr class="header"><td class="picture left">';
     print_user_picture($comment->userid, $data->course, $user->picture);
@@ -1169,7 +1170,7 @@ function data_print_comment($data, $comment, $page=0) {
 
     echo '</div>';
 
-    echo '</td></tr></table><div>'."\n\n";
+    echo '</td></tr></table>'."\n\n";
 }
 
 
index fa90edd054c71bc8a779b256879f4cb8807bae62..d44994ca6c52414e0537ce03420c7b9e8bfb1602 100755 (executable)
 /// Print the page header
     $PAGE->print_header($course->shortname.': %fullname%', '', $meta);
     
-    echo '<table id="layout-table"><tr>';
 
-    if (!empty($CFG->showblocksonmodpages) && 
-              (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
-        echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-        echo '</td>';
+/// If we have blocks, then print the left side here
+    if (!empty($CFG->showblocksonmodpages)) {
+        echo '<table id="layout-table"><tr>';
+        if ((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
+            echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
+            blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+            echo '</td>';
+        }
+        echo '<td id="middle-column">';
     }
 
-    echo '<td id="middle-column">';
-
     print_heading(format_string($data->name));
     
     // Do we need to show a link to the RSS feed for the records?
         data_print_preference_form($data, $perpage, $search, $sort, $order);
     }
 
+/// If we have blocks, then print the left side here
+    if (!empty($CFG->showblocksonmodpages)) {
+        echo '</td>';   // Middle column
+        if ((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) {
+            echo '<td style="width: '.$blocks_preferred_width.'px;" id="right-column">';
+            blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+            echo '</td>';
+        }
+        echo '</table>';
+    }
+
     print_footer($course);
 ?>