From 8043cb998f3325731bfab8d82251fa49639aec1d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Apr 2002 11:52:50 +0000 Subject: - 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. + ... --- modules/box.module | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/box.module') 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[] = "boxes"; + $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 .= " Body:". nl2br(htmlentities($block->body)) ."\n"; $output .= " Type:". $type[$block->type] ."\n"; $output .= " Description:". check_output($block->info) ."\n"; - $output .= " Operations:bid\">edit\n"; + $output .= " Operations:".la(t("edit"), array("mod" => "box", "op" => "edit", "id" => $block->bid))."\n"; $output .= "\n"; $output .= "

\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 "add new box | overview | help
\n"; + print "".la(t("add new box"), array("mod" => "box", "op" => "add"))." | ".la(t("overview"), array("mod" => "box"))." | ".la(t("help"), array("mod" => "box", "op" => "help"))."
\n"; block_init(); -- cgit v1.2.3