mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Standardising the printing of content and summaries to use format_text()
This commit is contained in:
parent
7dd826818e
commit
43cbfc1999
@ -72,12 +72,12 @@
|
||||
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) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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>";
|
||||
|
||||
|
@ -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>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user