summaryrefslogtreecommitdiff
path: root/modules/box.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-04-20 11:52:50 +0000
committerDries Buytaert <dries@buytaert.net>2002-04-20 11:52:50 +0000
commit8043cb998f3325731bfab8d82251fa49639aec1d (patch)
tree3774b206865eb631134c447aa36e90af762b8c5b /modules/box.module
parent0a966e1ed42d1b7d0827b0318bcefb7101ac56df (diff)
downloadbrdo-8043cb998f3325731bfab8d82251fa49639aec1d.tar.gz
brdo-8043cb998f3325731bfab8d82251fa49639aec1d.tar.bz2
- Applied Marco's big patch, including contributions from Moshe:
+ Changed the db_query() API. + Wrapped all links in l(), lm(), la(), ..., drupal_url() functions. + XHTML-ified some HTML. + Wrapped a lot of text in the administrative pages in a t() function. + Replaced all $REQUEST_URI/$PATH_INFOs by request_uri(). + Small bugfixes (eg. bug in book_export_html() and clean-ups (eg. RSS code). + Fixed some bugs in the taxonomy module (eg. tree making bug), added new functionality (eg. new APIs for use by other modules), included Moshe's taxonomy extensions, and some documentation udpates. + ...
Diffstat (limited to 'modules/box.module')
-rw-r--r--modules/box.module14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/box.module b/modules/box.module
index cea18119b..25d3ea6c5 100644
--- a/modules/box.module
+++ b/modules/box.module
@@ -32,7 +32,7 @@ function box_help() {
function box_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
- $links[] = "<a href=\"admin.php?mod=box\">boxes</a>";
+ $links[] = la(t("boxes"), array("mod" => "box"));
}
return $links ? $links : array();
@@ -51,7 +51,7 @@ function box_block() {
}
function box_get_array($bid) {
- return db_fetch_array(db_query("SELECT * FROM boxes WHERE bid = '". check_input($bid) ."'"));
+ return db_fetch_array(db_query("SELECT * FROM boxes WHERE bid = '%s'", $bid));
}
function box_display() {
@@ -65,7 +65,7 @@ function box_display() {
$output .= " <TR><TH>Body:</TH><TD>". nl2br(htmlentities($block->body)) ."</TD></TR>\n";
$output .= " <TR><TH>Type:</TH><TD>". $type[$block->type] ."</TD></TR>\n";
$output .= " <TR><TH>Description:</TH><TD>". check_output($block->info) ."</TD></TR>\n";
- $output .= " <TR><TH>Operations:</TH><TD><A HREF=\"admin.php?mod=box&op=edit&id=$block->bid\">edit</A></TD></TR>\n";
+ $output .= " <TR><TH>Operations:</TH><TD>".la(t("edit"), array("mod" => "box", "op" => "edit", "id" => $block->bid))."</TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "<BR><BR>\n";
}
@@ -75,13 +75,13 @@ function box_display() {
function box_save($edit) {
if ($edit[bid] && $edit[title]) {
- db_query("UPDATE boxes SET title = '". check_input($edit[title]) ."', body = '". check_input($edit[body]) ."', info = '". check_input($edit[info]) ."', type = '". check_input($edit[type]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
+ db_query("UPDATE boxes SET title = '%s', body = '%s', info = '%s', type = '%s' WHERE bid = '%s'", $edit[title], $edit[body], $edit[info], $edit[type], $edit[bid]);
}
else if ($edit[bid]) {
- db_query("DELETE FROM boxes WHERE bid = '". check_input($edit[bid]) ."'");
+ db_query("DELETE FROM boxes WHERE bid = '%s'", $edit[bid]);
}
else {
- db_query("INSERT INTO boxes (title, body, info, type) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[body]) ."', '". check_input($edit[info]) ."', '". check_input($edit[type]) ."')");
+ db_query("INSERT INTO boxes (title, body, info, type) VALUES ('%s', '%s', '%s', '%s')", $edit[title], $edit[body], $edit[info], $edit[type]);
}
}
@@ -110,7 +110,7 @@ function box_admin() {
if (user_access("administer blocks")) {
- print "<SMALL><A HREF=\"admin.php?mod=box&op=add\">add new box</A> | <A HREF=\"admin.php?mod=box\">overview</A> | <A HREF=\"admin.php?mod=box&op=help\">help</A></SMALL><HR>\n";
+ print "<SMALL>".la(t("add new box"), array("mod" => "box", "op" => "add"))." | ".la(t("overview"), array("mod" => "box"))." | ".la(t("help"), array("mod" => "box", "op" => "help"))."</SMALL><HR>\n";
block_init();