From f86a944979de75225dc3ddd00920ebedbfe307ed Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Sun, 12 May 2002 15:40:57 +0000 Subject: - applied Stevens link patch. - fixed block permissions. - fixed user admin page errors: http://www.drupal.org/node.php?id=173. - cleaned up common.inc a bit: removed format_info, path_img, field_merge. --- modules/block.module | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/block.module') diff --git a/modules/block.module b/modules/block.module index b74d2c2a1..d227e8b62 100644 --- a/modules/block.module +++ b/modules/block.module @@ -77,9 +77,9 @@ function block_admin_display() { $weights = array(0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); $output .= ''; - //$output .= ''. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .''; + //$output .= ''. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), "", array("title" => t("View the block details"))) .''; $output .= "$block->name"; - $output .= ''. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "Administer module") : $block->module) .''; + $output .= ''. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "", array("title" => t("Administer module"))) : $block->module) .''; $output .= ''. form_checkbox(NULL, "$block->name][status", 1, $block->status) .''; $output .= ''. form_checkbox(NULL, "$block->name][custom", 1, $block->custom) .''; $output .= ''. form_select(NULL, "$block->name][weight", $block->weight, $weights) .''; @@ -259,13 +259,17 @@ function block_user($type, &$edit, &$user) { case "edit_form": $result = db_query("SELECT * FROM blocks WHERE custom = '%d' ORDER BY name", 1); - $form = ''; while ($block = db_fetch_object($result)) { - $form .= "\n"; + $data = module_invoke($block->module, "block"); + if ($data[$block->delta]["subject"]) { + $form .= "\n"; + } + } + + if (isset($form)) { + return form_item(t("Block configuration"), '
$block->name". form_checkbox(NULL, "block][$block->name", 1, $user->block[$block->name]) ."
$block->name". form_checkbox(NULL, "block][$block->name", 1, $user->block[$block->name]) ."
'. $form .'
', "Enable the blocks you would like to see displayed in the side bars."); } - $form .= ''; - return form_item(t("Block configuration"), $form, "Enable the blocks you would like to see displayed in the side bars."); } } -- cgit v1.2.3