]> git.mjollnir.org Git - moodle.git/commitdiff
Standardising the printing of content and summaries to use format_text()
authormoodler <moodler>
Mon, 9 Aug 2004 14:49:16 +0000 (14:49 +0000)
committermoodler <moodler>
Mon, 9 Aug 2004 14:49:16 +0000 (14:49 +0000)
mod/resource/index.php
mod/resource/type/directory/resource.class.php
mod/resource/type/file/resource.class.php
mod/resource/type/html/resource.class.php
mod/resource/type/text/resource.class.php

index fd8c6420bec9e7793d4e0d13ee1b90a3a8677e64..a6468c4e87e7b339b8279515a4d700b6b753207a 100644 (file)
         if (!$resource->visible) {      // Show dimmed if the mod is hidden
            $table->data[] = array ($printsection, 
                 "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
-                text_to_html($resource->summary) );
+                format_text($resource->summary) );
 
         } else {                        //Show normal if the mod is visible
            $table->data[] = array ($printsection, 
                 "<a $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
-                text_to_html($resource->summary) );
+                format_text($resource->summary) );
         }
     }
 
index 97ff68d7babb4dc22f40152e4dfdb438fe7f476d..eb644adc4bfcddc0c060e4bdb6fc53f2b5fb2a2f 100644 (file)
@@ -71,7 +71,8 @@ function display() {
     }
 
     if (trim(strip_tags($this->resource->summary))) {
-        print_simple_box(text_to_html($this->resource->summary), "center");
+        $formatoptions->noclean = true;
+        print_simple_box(format_text($this->resource->summary, FORMAT_MOODLE, $formatoptions), "center");
         print_spacer(10,10);
     }
 
index 5933fb0b5cb4342bec4423e64d389b456eddcc2c..8266199848286ca683c2e1173b6e36ba3a02f797 100644 (file)
@@ -291,7 +291,8 @@ function display() {
         echo '</script>';
 
         if (trim(strip_tags($this->resource->summary))) {
-            print_simple_box(text_to_html($this->resource->summary), "center");
+            $formatoptions->noclean = true;
+            print_simple_box(format_text($this->resource->summary, FORMAT_MOODLE, $formatoptions), "center");
         }
 
         $link = "<a href=\"$CFG->wwwroot/mod/resource/view.php?inpopup=true&id={$this->cm->id}\" target=\"resource{$this->resource->id}\" onClick=\"return openpopup('/mod/resource/view.php?inpopup=true&id={$this->cm->id}', 'resource{$this->resource->id}','{$this->resource->popup}');\">{$this->resource->name}</a>";
@@ -415,7 +416,8 @@ function display() {
         }
 
         if (trim($this->resource->summary)) {
-            print_simple_box(format_text($this->resource->summary), 'center');
+            $formatoptions->noclean = true;
+            print_simple_box(format_text($this->resource->summary, FORMAT_MOODLE, $formatoptions), "center");
         }
 
         if ($inpopup) {
index 6c5b69fabed1c47e1af78b13fcbd033f2facc04b..baca50709f1580b8fea561cb7cc59e7ead0bdd6d 100644 (file)
@@ -79,14 +79,15 @@ function display() {
     }
 
     $pagetitle = strip_tags($this->course->shortname.': '.$this->resource->name);
-
+    $formatoptions->noclean = true;
     $inpopup = !empty($_GET["inpopup"]);
 
     if ($this->resource->popup) {
         if ($inpopup) {                    /// Popup only
             add_to_log($this->course->id, "resource", "view", "view.php?id={$this->cm->id}", $this->resource->id, $this->cm->id);
             print_header();
-            print_simple_box(format_text($this->resource->alltext, FORMAT_HTML), "center", "", "$THEME->cellcontent", "20");
+            print_simple_box(format_text($this->resource->alltext, FORMAT_HTML, $formatoptions), 
+                                         "center", "", "$THEME->cellcontent", "20");
         } else {                           /// Make a page and a pop-up window
 
             print_header($pagetitle, $this->course->fullname, "$navigation {$this->resource->name}", 
@@ -100,7 +101,7 @@ function display() {
             echo '</script>';
     
             if (trim(strip_tags($this->resource->summary))) {
-                print_simple_box(format_text($this->resource->summary, FORMAT_HTML), "center");
+                print_simple_box(format_text($this->resource->summary, FORMAT_MOODLE, $formatoptions), "center");
             }
     
             $link = "<a href=\"$CFG->wwwroot/mod/resource/view.php?inpopup=true&id={$this->cm->id}\" target=\"resource{$this->resource->id}\" onClick=\"return openpopup('/mod/resource/view.php?inpopup=true&id={$this->cm->id}', 'resource{$this->resource->id}','{$this->resource->popup}');\">{$this->resource->name}</a>";
@@ -121,7 +122,7 @@ function display() {
                      "", "", true, update_module_button($this->cm->id, $this->course->id, $strresource), 
                      navmenu($this->course, $this->cm));
     
-        print_simple_box(format_text($this->resource->alltext, FORMAT_HTML), "center", "", "$THEME->cellcontent", "20");
+        print_simple_box(format_text($this->resource->alltext, FORMAT_HTML, $formatoptions), "center", "", "$THEME->cellcontent", "20");
     
         echo "<center><p><font size=1>$strlastmodified: ".userdate($this->resource->timemodified)."</p></center>";
     
index dd845bae06ead8577d59c09c3b2258af5734d179..d45adc05f2831a54903de91c588a63fa4c531264 100644 (file)
@@ -76,7 +76,7 @@ function display() {
         $navigation = "<a target=\"{$CFG->framename}\" href=\"index.php?id={$this->course->id}\">$strresources</a> ->";     }
 
     $pagetitle = strip_tags($this->course->shortname.': '.$this->resource->name);
-
+    $formatoptions->noclean = true;
     $inpopup = !empty($_GET["inpopup"]);
 
     if ($this->resource->popup) {
@@ -84,7 +84,7 @@ function display() {
             add_to_log($this->course->id, "resource", "view", "view.php?id={$this->cm->id}", 
                        $this->resource->id, $this->cm->id);
             print_header();
-            print_simple_box(format_text($this->resource->alltext, $this->resource->options), 
+            print_simple_box(format_text($this->resource->alltext, $this->resource->options, $formatoptions), 
                              "center", "", "$THEME->cellcontent", "20");
         } else {                           /// Make a page and a pop-up window
 
@@ -99,7 +99,7 @@ function display() {
             echo '</script>';
     
             if (trim(strip_tags($this->resource->summary))) {
-                print_simple_box(format_text($this->resource->summary, FORMAT_HTML), "center");
+                print_simple_box(format_text($this->resource->summary, FORMAT_MOODLE, $formatoptions), "center");
             }
     
             $link = "<a href=\"$CFG->wwwroot/mod/resource/view.php?inpopup=true&id={$this->cm->id}\" target=\"resource{$this->resource->id}\" onClick=\"return openpopup('/mod/resource/view.php?inpopup=true&id={$this->cm->id}', 'resource{$this->resource->id}','{$this->resource->popup}');\">{$this->resource->name}</a>";
@@ -120,7 +120,7 @@ function display() {
                      "", "", true, update_module_button($this->cm->id, $this->course->id, $strresource), 
                      navmenu($this->course, $this->cm));
     
-        print_simple_box(format_text($this->resource->alltext, $this->resource->options), 
+        print_simple_box(format_text($this->resource->alltext, $this->resource->options, $formatoptions), 
                          "center", "", "$THEME->cellcontent", "20");
     
         echo "<center><p><font size=1>$strlastmodified: ".userdate($this->resource->timemodified)."</p></center>";