/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php switch ($op) { case 'list': $blocks[0]['info'] = t('Block 1'); $blocks[1]['info'] = t('Block 2'); return $blocks; case 'configure': if ($delta == 0 && user_access('administer module')) { } if ($delta == 1 && user_access('administer module')) { } return $form; case 'save': if ($delta == 0) { variable_set('module_block_setting_1', $edit['module_block_1']); } if ($delta == 1) { variable_set('module_block_setting_2', $edit['module_block_2']); } break; case 'view': if ($delta == 0) { $block['subject'] = t('Block 1 title'); $block['content'] = t('Block 1 content'); } if ($delta == 1) { $block['subject'] = t('Block 2 title'); $block['content'] = t('Block 2 content'); } return $block; } }