function weather_es_block in Weather_es 6
Same name and namespace in other branches
- 5 weather_es.module \weather_es_block()
- 6.3 weather_es.module \weather_es_block()
- 6.2 weather_es.module \weather_es_block()
Implementation of hook_block().
File
- ./
weather_es.module, line 374 - Non-displayable characters.
Code
function weather_es_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Weather_es: system-wide');
$blocks[1]['info'] = t('Weather_es: custom user');
return $blocks;
case 'configure':
return $form;
case 'view':
default:
if ($delta == 0 and user_access('access content')) {
// Show the system weather_es block
$title = t('System weather');
$content = block_weather_es_contents(0);
}
else {
if ($delta == 1 and user_access('administer custom weather_es block')) {
// Show the user weather_es block
$title = t('User weather');
$content = block_weather_es_contents(1);
}
}
$block['subject'] = $title;
$block['content'] = $content;
return $block;
}
}