| Versionen | |
|---|---|
| drupal7 | hook_block_configure($delta = '') |
Configuration form for the block.
Any module can export a block (or blocks) to be displayed by defining the _block hook. This hook is called by theme.inc to display a block, and also by block.module to procure the list of available blocks.
$delta Which block to return. This is a descriptive string used to identify blocks within each module and also within the theme system. The $delta for each block is defined within the array that your module returns when the hook_block_list() implementation is called.
Optionally return the configuration form.
After completing your blocks, do not forget to enable them in the block admin menu.
For a detailed usage example, see block_example.module.
modules/
<?php
function hook_block_configure($delta = '') {
if ($delta == 'exciting') {
$form['items'] = array(
'#type' => 'select',
'#title' => t('Number of items'),
'#default_value' => variable_get('mymodule_block_items', 0),
'#options' => array('1', '2', '3'),
);
return $form;
}
}
?>
Kommentare
Kommentar hinzufügen