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) { ...@@ -41,8 +41,8 @@ function admin_page($mod) {
** Body: ** 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 "<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()) { if ($path = menu_path()) {
print "<h2>". la(t("Administration")) ." &gt; $path</h2>"; print "<h2>". la(t("Administration")) ." &gt; $path</h2>";
......
...@@ -457,7 +457,7 @@ function filter($text) { ...@@ -457,7 +457,7 @@ function filter($text) {
return $text; return $text;
} }
function check_output($text, $nl2br = 0) { function check_output($text) {
if ($text) { if ($text) {
$text = stripslashes($text); $text = stripslashes($text);
......
...@@ -46,15 +46,15 @@ function node($node, $main) { ...@@ -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)) { if (count($terms)) {
$output .= "<small>(". $this->links($terms) .")</small><br />"; $output .= "<small>(". $this->links($terms) .")</small><br />";
} }
if ($main && $node->teaser) { if ($main && $node->teaser) {
$output .= check_output($node->teaser, 1); $output .= check_output($node->teaser);
} }
else { else {
$output .= check_output($node->body, 1); $output .= check_output($node->body);
} }
if ($links = link_node($node, $main)) { if ($links = link_node($node, $main)) {
$output .= "<br />[ ". $this->links($links) ." ]"; $output .= "<br />[ ". $this->links($links) ." ]";
...@@ -65,7 +65,7 @@ function node($node, $main) { ...@@ -65,7 +65,7 @@ function node($node, $main) {
} }
function box($subject, $content, $region = "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; print $output;
} }
......
...@@ -48,7 +48,7 @@ td { ...@@ -48,7 +48,7 @@ td {
} }
hr { hr {
margin: .5em 0; margin: .5em 0;
height: 1px; height: 1px;
color: #ccc; color: #ccc;
} }
#menu { #menu {
......
...@@ -67,7 +67,7 @@ function import_format_item($item, $feed = 0) { ...@@ -67,7 +67,7 @@ function import_format_item($item, $feed = 0) {
} }
// external link // 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 />"; return $output ."<br />";
} }
...@@ -387,7 +387,7 @@ function import_view() { ...@@ -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)); $header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows); unset($rows);
while ($feed = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -398,7 +398,7 @@ function import_view() { ...@@ -398,7 +398,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations")); $header = array(t("title"), t("attributes"), t("operations"));
unset($rows); unset($rows);
while ($bundle = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -411,7 +411,7 @@ function import_tag() { ...@@ -411,7 +411,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item")); $header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -511,7 +511,7 @@ function import_page_last() { ...@@ -511,7 +511,7 @@ function import_page_last() {
} }
if ($item->description) { 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); unset($links);
...@@ -530,7 +530,7 @@ function import_page_feed($fid) { ...@@ -530,7 +530,7 @@ function import_page_feed($fid) {
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $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("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"; $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); $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) { ...@@ -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"; $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) { 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); unset($links);
...@@ -555,7 +555,7 @@ function import_page_feed($fid) { ...@@ -555,7 +555,7 @@ function import_page_feed($fid) {
$theme->header(); $theme->header();
$theme->box(t("News feeds"), import_page_info()); $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->box(t("Latest news"), $output);
$theme->footer(); $theme->footer();
} }
...@@ -566,7 +566,7 @@ function import_page_bundle($bid) { ...@@ -566,7 +566,7 @@ function import_page_bundle($bid) {
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $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("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); $keys = explode(",", $bundle->attributes);
foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'"; foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'";
...@@ -585,7 +585,7 @@ function import_page_bundle($bid) { ...@@ -585,7 +585,7 @@ function import_page_bundle($bid) {
} }
if ($item->description) { 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); unset($links);
...@@ -594,7 +594,7 @@ function import_page_bundle($bid) { ...@@ -594,7 +594,7 @@ function import_page_bundle($bid) {
$theme->header(); $theme->header();
$theme->box(t("News feeds"), import_page_info()); $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->box(t("Latest news"), $output);
$theme->footer(); $theme->footer();
...@@ -607,7 +607,7 @@ function import_page_sources() { ...@@ -607,7 +607,7 @@ function import_page_sources() {
while ($feed = db_fetch_object($result)) { while ($feed = db_fetch_object($result)) {
$output .= lm($feed->title, array("mod" => "import", "op" => "feed", "id" => $feed->fid)); $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"; $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) { ...@@ -67,7 +67,7 @@ function import_format_item($item, $feed = 0) {
} }
// external link // 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 />"; return $output ."<br />";
} }
...@@ -387,7 +387,7 @@ function import_view() { ...@@ -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)); $header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows); unset($rows);
while ($feed = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -398,7 +398,7 @@ function import_view() { ...@@ -398,7 +398,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations")); $header = array(t("title"), t("attributes"), t("operations"));
unset($rows); unset($rows);
while ($bundle = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -411,7 +411,7 @@ function import_tag() { ...@@ -411,7 +411,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item")); $header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) { 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); $output .= table($header, $rows);
...@@ -511,7 +511,7 @@ function import_page_last() { ...@@ -511,7 +511,7 @@ function import_page_last() {
} }
if ($item->description) { 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); unset($links);
...@@ -530,7 +530,7 @@ function import_page_feed($fid) { ...@@ -530,7 +530,7 @@ function import_page_feed($fid) {
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $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("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"; $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); $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) { ...@@ -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"; $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) { 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); unset($links);
...@@ -555,7 +555,7 @@ function import_page_feed($fid) { ...@@ -555,7 +555,7 @@ function import_page_feed($fid) {
$theme->header(); $theme->header();
$theme->box(t("News feeds"), import_page_info()); $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->box(t("Latest news"), $output);
$theme->footer(); $theme->footer();
} }
...@@ -566,7 +566,7 @@ function import_page_bundle($bid) { ...@@ -566,7 +566,7 @@ function import_page_bundle($bid) {
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $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("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); $keys = explode(",", $bundle->attributes);
foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'"; foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'";
...@@ -585,7 +585,7 @@ function import_page_bundle($bid) { ...@@ -585,7 +585,7 @@ function import_page_bundle($bid) {
} }
if ($item->description) { 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); unset($links);
...@@ -594,7 +594,7 @@ function import_page_bundle($bid) { ...@@ -594,7 +594,7 @@ function import_page_bundle($bid) {
$theme->header(); $theme->header();
$theme->box(t("News feeds"), import_page_info()); $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->box(t("Latest news"), $output);
$theme->footer(); $theme->footer();
...@@ -607,7 +607,7 @@ function import_page_sources() { ...@@ -607,7 +607,7 @@ function import_page_sources() {
while ($feed = db_fetch_object($result)) { while ($feed = db_fetch_object($result)) {
$output .= lm($feed->title, array("mod" => "import", "op" => "feed", "id" => $feed->fid)); $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"; $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) { ...@@ -62,13 +62,13 @@ function block_block($op = "list", $delta = 0) {
if ($op == "list") { if ($op == "list") {
$result = db_query("SELECT bid, title, info FROM boxes ORDER BY title"); $result = db_query("SELECT bid, title, info FROM boxes ORDER BY title");
while ($block = db_fetch_object($result)) { while ($block = db_fetch_object($result)) {
$blocks[$block->bid]["info"] = check_output($block->info); $blocks[$block->bid]["info"] = $block->info;
} }
return $blocks; return $blocks;
} }
else { else {
$block = db_fetch_object(db_query("SELECT * FROM boxes WHERE bid = '%d'", $delta)); $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; $data["content"] = ($block->type == 1) ? eval($block->body) : $block->body;
return $data; return $data;
} }
......
...@@ -62,13 +62,13 @@ function block_block($op = "list", $delta = 0) { ...@@ -62,13 +62,13 @@ function block_block($op = "list", $delta = 0) {
if ($op == "list") { if ($op == "list") {
$result = db_query("SELECT bid, title, info FROM boxes ORDER BY title"); $result = db_query("SELECT bid, title, info FROM boxes ORDER BY title");
while ($block = db_fetch_object($result)) { while ($block = db_fetch_object($result)) {
$blocks[$block->bid]["info"] = check_output($block->info); $blocks[$block->bid]["info"] = $block->info;
} }
return $blocks; return $blocks;
} }
else { else {
$block = db_fetch_object(db_query("SELECT * FROM boxes WHERE bid = '%d'", $delta)); $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; $data["content"] = ($block->type == 1) ? eval($block->body) : $block->body;
return $data; return $data;
} }
......
...@@ -123,7 +123,7 @@ function book_link($type, $node = 0, $main = 0) { ...@@ -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"); $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)) { 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) { ...@@ -360,7 +360,7 @@ function book_body($node) {
ob_end_clean(); ob_end_clean();
} }
else { else {
$output = check_output(filter($node->body), 1); $output = check_output(filter($node->body));
} }
return $output; return $output;
...@@ -419,7 +419,7 @@ function book_view($node, $main = 0) { ...@@ -419,7 +419,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\">$location</td></tr>"; $output .= " <tr><td colspan=\"3\">$location</td></tr>";
$output .= " <tr><td colspan=\"3\"><hr /></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) { if ($node->body) {
...@@ -436,7 +436,7 @@ function book_view($node, $main = 0) { ...@@ -436,7 +436,7 @@ function book_view($node, $main = 0) {
$output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; $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 ? 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\"><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 .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>";
$output .= "</table>"; $output .= "</table>";
...@@ -491,7 +491,7 @@ function book_tree_recurse($nid, $depth, $children) { ...@@ -491,7 +491,7 @@ function book_tree_recurse($nid, $depth, $children) {
if ($depth > 0) { if ($depth > 0) {
if ($children[$nid]) { if ($children[$nid]) {
foreach ($children[$nid] as $foo => $node) { 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)) { if ($tree = book_tree_recurse($node->nid, $depth - 1, $children)) {
$output .= "<ul>$tree</ul>"; $output .= "<ul>$tree</ul>";
...@@ -537,7 +537,7 @@ function book_render() { ...@@ -537,7 +537,7 @@ function book_render() {
if ($node) { if ($node) {
// output the content: // 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) { ...@@ -579,7 +579,7 @@ function book_print($id = "", $depth = 1) {
if ($node) { if ($node) {
// output the content: // output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>"; $output .= "<h$depth>$node->title</h$depth>";
if ($node->body) { if ($node->body) {
$output .= "<ul>". book_body($node) ."</ul>"; $output .= "<ul>". book_body($node) ."</ul>";
...@@ -606,7 +606,7 @@ function book_print_recurse($parent = "", $depth = 1) { ...@@ -606,7 +606,7 @@ function book_print_recurse($parent = "", $depth = 1) {
if ($node) { if ($node) {
// output the content: // output the content:
$output .= "<h$depth>". check_output($node->title) ."</h$depth>";