diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-05-12 15:40:57 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-05-12 15:40:57 +0000 |
commit | f86a944979de75225dc3ddd00920ebedbfe307ed (patch) | |
tree | f2a1ebeb51fea0ee7ccdc5019c7fa1856893e48c /modules/block.module | |
parent | 497ab799ef0cdb40068d84c0bd2eccd2f7a3a480 (diff) | |
download | brdo-f86a944979de75225dc3ddd00920ebedbfe307ed.tar.gz brdo-f86a944979de75225dc3ddd00920ebedbfe307ed.tar.bz2 |
- 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.
Diffstat (limited to 'modules/block.module')
-rw-r--r-- | modules/block.module | 16 |
1 files changed, 10 insertions, 6 deletions
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 .= '<tr>'; - //$output .= '<td>'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .'</td>'; + //$output .= '<td>'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), "", array("title" => t("View the block details"))) .'</td>'; $output .= "<td>$block->name</td>"; - $output .= '<td>'. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "Administer module") : $block->module) .'</td>'; + $output .= '<td>'. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "", array("title" => t("Administer module"))) : $block->module) .'</td>'; $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][status", 1, $block->status) .'</td>'; $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][custom", 1, $block->custom) .'</td>'; $output .= '<td>'. form_select(NULL, "$block->name][weight", $block->weight, $weights) .'</td>'; @@ -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 = '<table border="0" cellpadding="2" cellspacing="2">'; while ($block = db_fetch_object($result)) { - $form .= "<tr><td>$block->name</td><td>". form_checkbox(NULL, "block][$block->name", 1, $user->block[$block->name]) ."</td></tr>\n"; + $data = module_invoke($block->module, "block"); + if ($data[$block->delta]["subject"]) { + $form .= "<tr><td>$block->name</td><td>". form_checkbox(NULL, "block][$block->name", 1, $user->block[$block->name]) ."</td></tr>\n"; + } + } + + if (isset($form)) { + return form_item(t("Block configuration"), '<table border="0" cellpadding="2" cellspacing="2">'. $form .'</table>', "Enable the blocks you would like to see displayed in the side bars."); } - $form .= '</table>'; - return form_item(t("Block configuration"), $form, "Enable the blocks you would like to see displayed in the side bars."); } } |