I have a module that I’ve activated, but it does not show up in the disabled blocks list.
The module is named “My Module”
Inside the my_module folder I have:
my_module.module
my_module.info
my_module.info:
name = My Module
description = My module description.
core = 6.x
package = My Modules
my_module.module
<?php
function hook_block($op = 'list', $delta = 0, $edit = array()){
switch ($op) {
case 'list':
$block = array();
//List out all blocks you want to create here
$block[0]["info"] = t('Display info');
break;
case 'view':
switch ($delta) {
case 0:
$block['subject'] = "ADMIN Header of the block";
global $user;
if(in_array('Site admin', array_values($user->roles) || $user->uid == 1)){
$block['content'] = "input form";
$block['subject'] = "Header of the block";
}
break;
}
}
}
?>
You’re not returning any values in your hook call. You’ll need to return the array for it to be displayed. I also never tend to use
break;when writing implementations of hook_block either.Try removing the
break;and addingreturn $block;at the end of both cases.e.g
and
I’m sure you’ve seen it, but this might be beneficial to others http://api.drupal.org/api/drupal/developer–hooks–core.php/function/hook_block/6