From: moodler Date: Mon, 9 Aug 2004 14:49:16 +0000 (+0000) Subject: Standardising the printing of content and summaries to use format_text() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=43cbfc19992abfcef475af9ef4f28c5c1ef8474e;p=moodle.git Standardising the printing of content and summaries to use format_text() --- diff --git a/mod/resource/index.php b/mod/resource/index.php index fd8c6420be..a6468c4e87 100644 --- a/mod/resource/index.php +++ b/mod/resource/index.php @@ -72,12 +72,12 @@ if (!$resource->visible) { // Show dimmed if the mod is hidden $table->data[] = array ($printsection, "coursemodule\">$resource->name", - text_to_html($resource->summary) ); + format_text($resource->summary) ); } else { //Show normal if the mod is visible $table->data[] = array ($printsection, "coursemodule\">$resource->name", - text_to_html($resource->summary) ); + format_text($resource->summary) ); } } diff --git a/mod/resource/type/directory/resource.class.php b/mod/resource/type/directory/resource.class.php index 97ff68d7ba..eb644adc4b 100644 --- a/mod/resource/type/directory/resource.class.php +++ b/mod/resource/type/directory/resource.class.php @@ -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); } diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 5933fb0b5c..8266199848 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -291,7 +291,8 @@ function display() { echo ''; 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 = "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}"; @@ -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) { diff --git a/mod/resource/type/html/resource.class.php b/mod/resource/type/html/resource.class.php index 6c5b69fabe..baca50709f 100644 --- a/mod/resource/type/html/resource.class.php +++ b/mod/resource/type/html/resource.class.php @@ -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 ''; 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 = "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}"; @@ -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 "

$strlastmodified: ".userdate($this->resource->timemodified)."

"; diff --git a/mod/resource/type/text/resource.class.php b/mod/resource/type/text/resource.class.php index dd845bae06..d45adc05f2 100644 --- a/mod/resource/type/text/resource.class.php +++ b/mod/resource/type/text/resource.class.php @@ -76,7 +76,7 @@ function display() { $navigation = "framename}\" href=\"index.php?id={$this->course->id}\">$strresources ->"; } $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 ''; 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 = "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}"; @@ -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 "

$strlastmodified: ".userdate($this->resource->timemodified)."

";