hoi!

i'm trying to learn how to write a drupal module, that puts a block at the side. i read the "Creating modules: post 4.3.1" in the module developer's guide and tried to do the same. i can select the module in the modules section, but the block does not appear in the blocks section and i also can not see any permission. this is even if i copy and paste the onthisdate module from the module developer's guide.

here is the code from my module (simplified):

function test_help($section) {
switch($section) {
case "admin/system/modules#name":
$output = "test";
break;
case "admin/system/module#description":
$output = "test module";
break;
default:
$output = "test";
break;
}
return $output;
}

function test_perm() {
return array("adminster test");
}

function test_block($op = "list", $delta = 0) {
if ($op == "list") {
$blocks[0]['info'] = t("Test");
return $blocks;
} else {
$block['subject'] = t('TestBlock');
$block['content'] = "test";
return $block;
}
}

any help?

Comments

birger’s picture

k. found the problem:
the _help function should be like this:
function test_help($section) {
switch($section) {
case "admin/system/modules#description":
$output = "test module";
break;
}
return $output;
}
(forgot the "s" from modules)
/birger