function theme_block_refresh_js in Block Refresh 5
call the js for an enabled block div. you might need to override $div if your blocks have different id's than the drupal standard. or you may wish to manually put this code in your block.tpl.php file for fine-tune control, although that would take some finagling to do properly.
1 theme call to theme_block_refresh_js()
- block_refresh_footer in ./
block_refresh.module - implements hook_footer calls the jquery to refresh blocks automatically, but only if the blocks exist on the current page and are enabled
File
- ./
block_refresh.module, line 205
Code
function theme_block_refresh_js($block) {
// this is the block div css id and content class
$div = "#block-{$block['block']['block']}-{$block['block']['delta']} .content";
// we store seconds, but js expects milliseconds
$timer = $block['timer'] * 1000;
$base = base_path();
$js .= " _block_refresh_data['{$div}'] = new block_refresh_data({$timer}, '{$base}block_refresh/{$block['block']['block']}/{$block['block']['delta']}');\n";
$js .= " block_refresh_timer('{$div}');";
return $js;
}