function agenda_block in Agenda 6
Same name and namespace in other branches
- 6.2 agenda.module \agenda_block()
Implementation of hook_block().
File
- ./
agenda.module, line 108
Code
function agenda_block($op = 'list', $delta = 0) {
switch ($op) {
case 'list':
$res = db_query("SELECT bid, value FROM {agenda} WHERE name = 'title'");
$blocks = array();
while ($block = db_fetch_object($res)) {
$blocks[$block->bid] = array(
'info' => t('Agenda: @title', array(
'@title' => agenda_variable_get($block->bid, 'title', 'New block'),
)),
'cache' => BLOCK_CACHE_GLOBAL,
);
}
return $blocks;
break;
case 'view':
$block = array(
'subject' => t('Upcoming'),
'content' => agenda_display_block($delta),
);
return $block;
break;
}
}