Commit de95001c authored by Dries's avatar Dries

- Tidied up the use of check_output().  Might make rendering pages a bit
  snappier (performance improvement).
parent 8cb66b21
......@@ -41,8 +41,8 @@ function admin_page($mod) {
** Body:
*/
print "<div id=\"main\">";
print "<a href=\"http://drupal.org/\"><img align=\"right\" src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" border=\"0\" /></a>";
print "<div id=\"main\">";
if ($path = menu_path()) {
print "<h2>". la(t("Administration")) ." &gt; $path</h2>";
......
......@@ -457,7 +457,7 @@ function filter($text) {
return $text;
}
function check_output($text, $nl2br = 0) {
function check_output($text) {
if ($text) {
$text = stripslashes($text);
......
......@@ -46,15 +46,15 @@ function node($node, $main) {
}
}
$output = "<b>". check_output($node->title) ."</b> by ". format_name($node) ."<br />";
$output = "<b>$node->title</b> by ". format_name($node) ."<br />";
if (count($terms)) {
$output .= "<small>(". $this->links($terms) .")</small><br />";
}
if ($main && $node->teaser) {
$output .= check_output($node->teaser, 1);
$output .= check_output($node->teaser);
}
else {
$output .= check_output($node->body, 1);
$output .= check_output($node->body);
}
if ($links = link_node($node, $main)) {
$output .= "<br />[ ". $this->links($links) ." ]";
......@@ -65,7 +65,7 @@ function node($node, $main) {
}
function box($subject, $content, $region = "main") {
$output = "<b>". check_output($subject) ."</b><br />". check_output($content) ."<p />";
$output = "<b>$subject</b><br />$content<p />";
print $output;
}
......
......@@ -48,7 +48,7 @@ td {
}
hr {
margin: .5em 0;
height: 1px;
height: 1px;
color: #ccc;
}
#menu {
......
......@@ -67,7 +67,7 @@ function import_format_item($item, $feed = 0) {
}
// external link
$output .= "<a href=\"". check_output($item->link) ."\" target=\"new\">". check_output($item->title) ."</a>";
$output .= "<a href=\"$item->link\" target=\"new\">$item->title</a>";
return $output ."<br />";
}
......@@ -387,7 +387,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
while ($feed = db_fetch_object($result)) {
$rows[] = array(check_output($feed->title), check_output($feed->attributes), format_plural($feed->items, "item", "items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)), la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)), la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)));
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "item", "items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)), la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)), la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)));
}
$output .= table($header, $rows);
......@@ -398,7 +398,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
while ($bundle = db_fetch_object($result)) {
$rows[] = array(check_output($bundle->title), check_output($bundle->attributes), la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)));
$rows[] = array($bundle->title, $bundle->attributes, la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)));
}
$output .= table($header, $rows);
......@@ -411,7 +411,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) {
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)), "valign" => "top"), "<a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => la($item->feed, array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
}
$output .= table($header, $rows);
......@@ -511,7 +511,7 @@ function import_page_last() {
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -530,7 +530,7 @@ function import_page_feed($fid) {
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid));
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">$feed->description</div></p>";
$header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ."<a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" /></a><br /><br /></div></p>\n";
$result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid);
......@@ -546,7 +546,7 @@ function import_page_feed($fid) {
$output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n";
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -555,7 +555,7 @@ function import_page_feed($fid) {
$theme->header();
$theme->box(t("News feeds"), import_page_info());
$theme->box(check_output($feed->title), $header);
$theme->box($feed->title, $header);
$theme->box(t("Latest news"), $output);
$theme->footer();
}
......@@ -566,7 +566,7 @@ function import_page_bundle($bid) {
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid));
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\">". lm($bundle->title, array("mod" => "import", "op" => "bundle", "id" => $bundle->bid)) ."</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". t("A composite news feed about") ." ". check_output($bundle->attributes) .".</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". t("A composite news feed about") ." $bundle->attributes.</div></p>";
$keys = explode(",", $bundle->attributes);
foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'";
......@@ -585,7 +585,7 @@ function import_page_bundle($bid) {
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -594,7 +594,7 @@ function import_page_bundle($bid) {
$theme->header();
$theme->box(t("News feeds"), import_page_info());
$theme->box(check_output($bundle->title), $header);
$theme->box($bundle->title, $header);
$theme->box(t("Latest news"), $output);
$theme->footer();
......@@ -607,7 +607,7 @@ function import_page_sources() {
while ($feed = db_fetch_object($result)) {
$output .= lm($feed->title, array("mod" => "import", "op" => "feed", "id" => $feed->fid));
$output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />";
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), "", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />\n";
......
......@@ -67,7 +67,7 @@ function import_format_item($item, $feed = 0) {
}
// external link
$output .= "<a href=\"". check_output($item->link) ."\" target=\"new\">". check_output($item->title) ."</a>";
$output .= "<a href=\"$item->link\" target=\"new\">$item->title</a>";
return $output ."<br />";
}
......@@ -387,7 +387,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
while ($feed = db_fetch_object($result)) {
$rows[] = array(check_output($feed->title), check_output($feed->attributes), format_plural($feed->items, "item", "items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)), la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)), la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)));
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "item", "items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)), la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)), la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)));
}
$output .= table($header, $rows);
......@@ -398,7 +398,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
while ($bundle = db_fetch_object($result)) {
$rows[] = array(check_output($bundle->title), check_output($bundle->attributes), la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)));
$rows[] = array($bundle->title, $bundle->attributes, la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)));
}
$output .= table($header, $rows);
......@@ -411,7 +411,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) {
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)), "valign" => "top"), "<a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => la($item->feed, array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
}
$output .= table($header, $rows);
......@@ -511,7 +511,7 @@ function import_page_last() {
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -530,7 +530,7 @@ function import_page_feed($fid) {
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid));
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">$feed->description</div></p>";
$header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ."<a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" /></a><br /><br /></div></p>\n";
$result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid);
......@@ -546,7 +546,7 @@ function import_page_feed($fid) {
$output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n";
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -555,7 +555,7 @@ function import_page_feed($fid) {
$theme->header();
$theme->box(t("News feeds"), import_page_info());
$theme->box(check_output($feed->title), $header);
$theme->box($feed->title, $header);
$theme->box(t("Latest news"), $output);
$theme->footer();
}
......@@ -566,7 +566,7 @@ function import_page_bundle($bid) {
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid));
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\">". lm($bundle->title, array("mod" => "import", "op" => "bundle", "id" => $bundle->bid)) ."</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". t("A composite news feed about") ." ". check_output($bundle->attributes) .".</div></p>";
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". t("A composite news feed about") ." $bundle->attributes.</div></p>";
$keys = explode(",", $bundle->attributes);
foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'";
......@@ -585,7 +585,7 @@ function import_page_bundle($bid) {
}
if ($item->description) {
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>";
}
unset($links);
......@@ -594,7 +594,7 @@ function import_page_bundle($bid) {
$theme->header();
$theme->box(t("News feeds"), import_page_info());
$theme->box(check_output($bundle->title), $header);
$theme->box($bundle->title, $header);
$theme->box(t("Latest news"), $output);
$theme->footer();
......@@ -607,7 +607,7 @@ function import_page_sources() {
while ($feed = db_fetch_object($result)) {
$output .= lm($feed->title, array("mod" => "import", "op" => "feed", "id" => $feed->fid));
$output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />";
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), "", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />\n";
......
......@@ -62,13 +62,13 @@ function block_block($op = "list", $delta = 0) {
if ($op == "list") {
$result = db_query("SELECT bid, title, info FROM boxes ORDER BY title");
while ($block = db_fetch_object($result)) {
$blocks[$block->bid]["info"] = check_output($block->info);
$blocks[$block->bid]["info"] = $block->info;
}
return $blocks;
}
else {
$block = db_fetch_object(db_query("SELECT * FROM boxes WHERE bid = '%d'", $delta));
$data["subject"] = check_output($block->title);
$data["subject"] = $block->title;
$data["content"] = ($block->type == 1) ? eval($block->body) : $block->body;
return $data;
}
......
......@@ -62,13 +62,13 @@ function block_block($op = "list", $delta = 0) {
if ($op == "list") {
$result = db_query("SELECT bid, title, info FROM boxes ORDER BY title");
while ($block = db_fetch_object($result)) {
$blocks[$block->bid]["info"] = check_output($block->info);
$blocks[$block->bid]["info"] = $block->info;
}
return $blocks;
}
else {
$block = db_fetch_object(db_query("SELECT * FROM boxes WHERE bid = '%d'", $delta));
$data["subject"] = check_output($block->title);
$data["subject"] = $block->title;
$data["content"] = ($block->type == 1) ? eval($block->body) : $block->body;
return $data;
}
......
......@@ -123,7 +123,7 @@ function book_link($type, $node = 0, $main = 0) {
$result = db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
while ($book = db_fetch_object($result)) {
menu_add("administer book '". check_output($book->title) ."'", "admin.php?mod=book&op=view&id=$book->nid", "Display a book outline.", NULL, "collaborative books");
menu_add("administer book '$book->title'", "admin.php?mod=book&op=view&id=$book->nid", "Display a book outline.", NULL, "collaborative books");
}
}
......@@ -360,7 +360,7 @@ function book_body($node) {
ob_end_clean();
}
else {
$output = check_output(filter($node->body), 1);
$output = check_output(filter($node->body));
}
return $output;
......@@ -419,7 +419,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\">$location</td></tr>";
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td colspan=\"3\"><b><big>". check_output($node->title) ."</big></b>". ($node->body ? "<br /><small><i>". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->created))) ."</i></small> " : "") ."</td></tr>";
$output .= " <tr><td colspan=\"3\"><b><big>$node->title</big></b>". ($node->body ? "<br /><small><i>". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->created))) ."</i></small> " : "") ."</td></tr>";
}
if ($node->body) {
......@@ -436,7 +436,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), "node", "", array("title" => t("View the previous page in this book."))) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". lm(t("index"), array("mod" => "book"), "", array("title" => t("View this book's table of contents."))) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), "node", "", array("title" => t("View the next page in this book."))) : t("next")) ."</td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>". check_output($prev->title) ."</small>" : "&nbsp;") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), "node", "", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>". check_output($next->title) ."</small>" : "&nbsp;") ."</td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>$prev->title</small>" : "&nbsp;") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), "node", "", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>$next->title</small>" : "&nbsp;") ."</td></tr>";
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>";
$output .= "</table>";
......@@ -491,7 +491,7 @@ function book_tree_recurse($nid, $depth, $children) {
if ($depth > 0) {
if ($children[$nid]) {
foreach ($children[$nid] as $foo => $node) {
$output .= "<li>". l(check_output($node->title), array("id" => $node->nid)) ."</li>";
$output .= "<li>". l($node->title, array("id" => $node->nid)) ."</li>";
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children)) {
$output .= "<ul>$tree</ul>";
......@@ -537,7 +537,7 @@ function book_render() {
if ($node) {
// output the content:
$output .= "<dt>". l(check_output($node->title), array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>";
$output .= "<dt>". l($node->title, array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>";
}
}
......@@ -579,7 +579,7 @@ function book_print($id = "", $depth = 1) {
if ($node) {
// output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>";
$output .= "<h$depth>$node->title</h$depth>";
if ($node->body) {
$output .= "<ul>". book_body($node) ."</ul>";
......@@ -606,7 +606,7 @@ function book_print_recurse($parent = "", $depth = 1) {
if ($node) {
// output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>";
$output .= "<h$depth>$node->title</h$depth>";
if ($node->body) {
$output .= "<ul>". book_body($node) ."</ul>";
......@@ -652,7 +652,7 @@ function book_admin_view($nid, $depth = 0) {
$node = node_load(array("nid" => $nid));
$output .= "<h3>". check_output($node->title) ."</h3>";
$output .= "<h3>$node->title</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>title</th><th>weight</th><th colspan=\"3\">operations</th></tr>";
$output .= book_admin_view_line($node);
......@@ -707,7 +707,7 @@ function book_admin_orphan() {
$output .= " <tr><th>title</th><th colspan=\"2\">operations</th></tr>";
foreach ($pages as $nid => $node) {
if ($node->parent && empty($pages[$node->parent])) {
$output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>";
$output .= "<tr><td>". l($node->title, array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>";
}
}
$output .= "</table>";
......
......@@ -123,7 +123,7 @@ function book_link($type, $node = 0, $main = 0) {
$result = db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
while ($book = db_fetch_object($result)) {
menu_add("administer book '". check_output($book->title) ."'", "admin.php?mod=book&op=view&id=$book->nid", "Display a book outline.", NULL, "collaborative books");
menu_add("administer book '$book->title'", "admin.php?mod=book&op=view&id=$book->nid", "Display a book outline.", NULL, "collaborative books");
}
}
......@@ -360,7 +360,7 @@ function book_body($node) {
ob_end_clean();
}
else {
$output = check_output(filter($node->body), 1);
$output = check_output(filter($node->body));
}
return $output;
......@@ -419,7 +419,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\">$location</td></tr>";
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td colspan=\"3\"><b><big>". check_output($node->title) ."</big></b>". ($node->body ? "<br /><small><i>". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->created))) ."</i></small> " : "") ."</td></tr>";
$output .= " <tr><td colspan=\"3\"><b><big>$node->title</big></b>". ($node->body ? "<br /><small><i>". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->created))) ."</i></small> " : "") ."</td></tr>";
}
if ($node->body) {
......@@ -436,7 +436,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), "node", "", array("title" => t("View the previous page in this book."))) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". lm(t("index"), array("mod" => "book"), "", array("title" => t("View this book's table of contents."))) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), "node", "", array("title" => t("View the next page in this book."))) : t("next")) ."</td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>". check_output($prev->title) ."</small>" : "&nbsp;") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), "node", "", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>". check_output($next->title) ."</small>" : "&nbsp;") ."</td></tr>";
$output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>$prev->title</small>" : "&nbsp;") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), "node", "", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>$next->title</small>" : "&nbsp;") ."</td></tr>";
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>";
$output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>";
$output .= "</table>";
......@@ -491,7 +491,7 @@ function book_tree_recurse($nid, $depth, $children) {
if ($depth > 0) {
if ($children[$nid]) {
foreach ($children[$nid] as $foo => $node) {
$output .= "<li>". l(check_output($node->title), array("id" => $node->nid)) ."</li>";
$output .= "<li>". l($node->title, array("id" => $node->nid)) ."</li>";
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children)) {
$output .= "<ul>$tree</ul>";
......@@ -537,7 +537,7 @@ function book_render() {
if ($node) {
// output the content:
$output .= "<dt>". l(check_output($node->title), array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>";
$output .= "<dt>". l($node->title, array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>";
}
}
......@@ -579,7 +579,7 @@ function book_print($id = "", $depth = 1) {
if ($node) {
// output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>";
$output .= "<h$depth>$node->title</h$depth>";
if ($node->body) {
$output .= "<ul>". book_body($node) ."</ul>";
......@@ -606,7 +606,7 @@ function book_print_recurse($parent = "", $depth = 1) {
if ($node) {
// output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>";
$output .= "<h$depth>$node->title</h$depth>";
if ($node->body) {
$output .= "<ul>". book_body($node) ."</ul>";
......@@ -652,7 +652,7 @@ function book_admin_view($nid, $depth = 0) {
$node = node_load(array("nid" => $nid));
$output .= "<h3>". check_output($node->title) ."</h3>";
$output .= "<h3>$node->title</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>title</th><th>weight</th><th colspan=\"3\">operations</th></tr>";
$output .= book_admin_view_line($node);
......@@ -707,7 +707,7 @@ function book_admin_orphan() {
$output .= " <tr><th>title</th><th colspan=\"2\">operations</th></tr>";
foreach ($pages as $nid => $node) {
if ($node->parent && empty($pages[$node->parent])) {
$output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>";
$output .= "<tr><td>". l($node->title, array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>";
}
}
$output .= "</table>";
......
......@@ -45,12 +45,12 @@ function comment_user($type, $edit, &$user) {
switch ($type) {
case "view_public":
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
return form_item(t("Signature"), check_output($user->signature));
}
break;
case "view_private":
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
return form_item(t("Signature"), check_output($user->signature));
}
break;
case "edit_form":
......@@ -795,7 +795,7 @@ function comment_admin_overview($status = 0) {
$header = array(t("subject"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (comment_is_new($comment) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)), la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)));
$rows[] = array(l($comment->subject, array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (comment_is_new($comment) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)), la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
......@@ -1153,9 +1153,9 @@ function comment($comment, $link = 0) {
$output .= "<a name=\"$comment->cid\"></a>";
$output .= "<div style=\"border: 1px solid; padding: 10px;\">";
$output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">". check_output($comment->subject) . ($comment->new ? theme_invoke("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">$comment->subject ". ($comment->new ? theme_invoke("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"margin-left: 10px; padding-bottom: 10px; font-size: 90%;\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div></td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment, 1) ."</td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment) ."</td></tr>";
$output .= " <tr><td align=\"right\" colspan=\"2\">$link</td></tr>";
$output .= "</table>";
$output .= "</div><br />";
......@@ -1163,7 +1163,7 @@ function comment($comment, $link = 0) {
}
function comment_folded($comment) {
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") . " " . format_name($comment) ."</small><p />";
print l($comment->subject, array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") . " " . format_name($comment) ."</small><p />";
}
function comment_flat_collapsed($comments, $threshold) {
......
......@@ -45,12 +45,12 @@ function comment_user($type, $edit, &$user) {
switch ($type) {
case "view_public":
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
return form_item(t("Signature"), check_output($user->signature));
}
break;
case "view_private":
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
return form_item(t("Signature"), check_output($user->signature));
}
break;
case "edit_form":
......@@ -795,7 +795,7 @@ function comment_admin_overview($status = 0) {
$header = array(t("subject"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (comment_is_new($comment) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)), la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)));
$rows[] = array(l($comment->subject, array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (comment_is_new($comment) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)), la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
......@@ -1153,9 +1153,9 @@ function comment($comment, $link = 0) {
$output .= "<a name=\"$comment->cid\"></a>";
$output .= "<div style=\"border: 1px solid; padding: 10px;\">";
$output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">". check_output($comment->subject) . ($comment->new ? theme_invoke("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">$comment->subject ". ($comment->new ? theme_invoke("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"margin-left: 10px; padding-bottom: 10px; font-size: 90%;\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div></td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment, 1) ."</td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment) ."</td></tr>";
$output .= " <tr><td align=\"right\" colspan=\"2\">$link</td></tr>";
$output .= "</table>";
$output .= "</div><br />";
......@@ -1163,7 +1163,7 @@ function comment($comment, $link = 0) {
}
function comment_folded($comment) {
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") . " " . format_name($comment) ."</small><p />";
print l($comment->subject, array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") . " " . format_name($comment) ."</small><p />";
}
function comment_flat_collapsed($comments, $threshold) {
......
......@@ -180,16 +180,16 @@ function forum_view($node, $main = 0) {
/* TODO: find out what this code was ment to do and either use it or not.
$output .= "<p>"._forum_get_icon($node)." ".lm(check_output($voc->name), array("mod" => "forum"))." : ".lm(check_output($term_data->name), array("mod" => "forum", "tid" => $term_data->tid));
$output .= "<p>". _forum_get_icon($node) ." ". lm($voc->name, array("mod" => "forum")) ." : ". lm($term_data->name, array("mod" => "forum", "tid" => $term_data->tid));
$output .= " / <b>". check_output($node->title) ."</b><br>".t("%a by %b", array("%a" => format_date($node->created), "%b" => format_name($node)))."</p><p>". check_output($node->body, 1) ."</p>";
$output .= " / <b>$node->title</b><br>".t("%a by %b", array("%a" => format_date($node->created), "%b" => format_name($node)))."</p><p>". check_output($node->body) ."</p>";
$output .= "<p>". $theme->links(link_node($node, $main)) ."</p>";
#$theme->box(t("Discussion forum"), $output);