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/block.module | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'modules/block.module') diff --git a/modules/block.module b/modules/block.module index 819c60231..6024a347d 100644 --- a/modules/block.module +++ b/modules/block.module @@ -18,7 +18,7 @@ function block_perm() { function block_link($type) { if ($type == "admin" && user_access("administer blocks")) { - $links[] = "blocks"; + $links[] = la(t("blocks"), array("mod" => "block")); } return $links ? $links : array(); @@ -26,7 +26,7 @@ function block_link($type) { function block_admin_save($edit) { foreach ($edit as $key=>$value) { - db_query("UPDATE blocks SET region = '". check_input($value["region"]) ."', status = '". check_input($value["status"]) ."', path = '". check_input($value["path"]) ."', weight = '". check_input($value["weight"]) ."' WHERE name = '". check_input($key) ."'"); + db_query("UPDATE blocks SET region = '%s', status = '%s', path = '%s', weight = '%s' WHERE name = '%s'", $value["region"], $value["status"], $value["path"], $value["weight"], $key); } } @@ -34,12 +34,12 @@ function block_admin_display() { $result = db_query("SELECT * FROM blocks ORDER BY module"); // Generate output: - $output .= "
\n"; + $output .= " "block"), "admin")." method=\"post\">\n"; $output .= "\n"; $output .= " \n"; while ($block = db_fetch_object($result)) { - $module = module_hook($block->module, "admin") ? "module\">$block->module" : $block->module; + $module = module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module)) : $block->module; $status = "
blockmodulestatusweightregionpath
\n"; - while ($block = db_fetch_object($result)) $lblocks .= " \n"; - $lblocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; + $lblocks .= "\n"; + while ($block = db_fetch_object($result)) $lblocks .= " \n"; + $lblocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; $result = db_query("SELECT * FROM blocks WHERE status > 0 AND region = 1 ORDER BY weight"); - $rblocks .= "\n"; - while ($block = db_fetch_object($result)) $rblocks .= " \n"; - $rblocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; + $rblocks .= "\n"; + while ($block = db_fetch_object($result)) $rblocks .= " \n"; + $rblocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; - $output .= "

layout scheme #1:

\n"; - $output .= "\n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= "
header
\n". ($lblocks ? $lblocks : " ") ." \n". ($rblocks ? $rblocks : " ") ."
footer
\n"; + $output .= "

layout scheme #1:

\n"; + $output .= "\n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= "
header
\n". ($lblocks ? $lblocks : " ") ." \n". ($rblocks ? $rblocks : " ") ."
footer
\n"; $result = db_query("SELECT * FROM blocks WHERE status > 0 ORDER BY weight"); - $blocks .= "\n"; - while ($block = db_fetch_object($result)) $blocks .= " \n"; - $blocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; - - $output .= "

layout scheme #2:

\n"; - $output .= "\n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= "
header
 \n". ($blocks ? $blocks : " ") ."
footer
\n"; - - $output .= "

layout scheme #3:

\n"; - $output .= "\n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= "
header
\n". ($blocks ? $blocks : " ") ." 
footer
\n"; + $blocks .= "\n"; + while ($block = db_fetch_object($result)) $blocks .= " \n"; + $blocks .= "
". ($block->status == 2 ? "$block->name" : $block->name) ."$block->weight
\n"; + + $output .= "

layout scheme #2:

\n"; + $output .= "\n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= "
header
 \n". ($blocks ? $blocks : " ") ."
footer
\n"; + + $output .= "

layout scheme #3:

\n"; + $output .= "\n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= "
header
\n". ($blocks ? $blocks : " ") ." 
footer
\n"; print $output; } @@ -128,7 +128,7 @@ function block_admin() { if (user_access("administer blocks")) { - print "configure | preview | help
\n"; + print "".la(t("configure"), array("mod" => "block"))." | ".la(t("preview"), array("mod" => "block", "op" => "preview"))." | ".la(t("help"), array("mod" => "block", "op" => "help"))."
\n"; block_init(); -- cgit v1.2.3