function uniqueness_block in Uniqueness 6
Implementation of hook_block().
File
- ./
uniqueness.module, line 268 - uniqueness.module
Code
function uniqueness_block($op = 'list', $delta = 0, $edit = array()) {
// Check that the block widget is enabled
if (!uniqueness_widget_enabled(UNIQUENESS_WIDGET_BLOCK)) {
return;
}
if ($op == 'list') {
// @todo I think we can cache the block actually -- explore.
$blocks['uniqueness'] = array(
'info' => t('Uniqueness search'),
'cache' => BLOCK_NO_CACHE,
);
return $blocks;
}
elseif ($op == 'view') {
// We only operate on the node form for a type we search.
$options = _uniqueness_widget_store();
if ($options !== NULL && user_access('use uniqueness widget') && $delta == 'uniqueness' && in_array($options['op'], variable_get('uniqueness_type_' . $options['type'], array()))) {
$block['subject'] = filter_xss_admin(variable_get('uniqueness_default_title', t('Related content')));
$block['content'] = uniqueness_widget_content();
return $block;
}
}
}