views_block.module in Views Hacks 6
Same filename and directory in other branches
File
views_block/views_block.moduleView source
<?php
/**
* Implementation of hook_views_api().
*/
function views_block_views_api() {
return array(
'api' => 2,
);
}
/**
* Implementation of hook_views_bulk_operations_object_info().
*/
function views_block_views_bulk_operations_object_info() {
return array(
'block' => array(
'type' => 'block',
'base_table' => 'blocks',
'load' => 'views_block_load',
'title' => 'info',
),
);
}
function views_block_load($bid) {
$block = db_fetch_object(db_query("SELECT * FROM {blocks} b LEFT JOIN {boxes} box ON b.bid = box.bid WHERE b.bid=%d", $bid));
if ($block) {
if ($block->module != 'block') {
$blocks = module_invoke($block->module, 'block', 'list');
$block->info = $blocks[$block->delta]['info'];
}
if (empty($block->info)) {
$block->info = '(' . t('none') . ')';
}
return $block;
}
return NULL;
}
Functions
Name | Description |
---|---|
views_block_load | |
views_block_views_api | Implementation of hook_views_api(). |
views_block_views_bulk_operations_object_info | Implementation of hook_views_bulk_operations_object_info(). |