'mkdru_js' => array(
'arguments' => array('node' => NULL),
),
+ 'mkdru_block_search' => array(
+ 'template' => 'mkdru-block-search',
+ 'arguments' => array('nid' => null, 'path' => NULL),
+ ),
// 'mkdru_block_facet' => array(
// 'template' => 'mkdru-block-facet',
// 'arguments' => array('divId' => NULL),
function mkdru_block($op='list', $delta='sources', $edit=array()) {
switch ($op) {
case 'list':
+ // facet blocks
+ // NB: block caching is redundant for static content
$blocks['mkdru_sources']['info'] = t('mkdru - source facets');
$blocks['mkdru_sources']['cache'] = BLOCK_NO_CACHE;
$blocks['mkdru_subjects']['info'] = t('mkdru - subject facets');
$blocks['mkdru_subjects']['cache'] = BLOCK_NO_CACHE;
$blocks['mkdru_authors']['info'] = t('mkdru - author facets');
$blocks['mkdru_authors']['cache'] = BLOCK_NO_CACHE;
+ // search blocks
+ $result = db_query("SELECT title, nid FROM {node} WHERE type = 'mkdru';");
+ while ($node = db_fetch_object($result)) {
+ $blocks['mkdru_search_' . $node->nid]['info'] =
+ t('mkdru - search box for "' . $node->title . '"');
+ $blocks['mkdru_sources']['cache'] = BLOCK_NO_CACHE;
+ };
return $blocks;
case 'view':
$block['content'] = '<div class="mkdru-facet mkdru-facet-authors"> </div>';
return $block;
}
+ if (substr($delta, 0, 13) == 'mkdru_search_') {
+ $nid = substr($delta, 13);
+ $block['content'] = theme('mkdru_block_search', $nid, '/node/' . $nid);
+ return $block;
+ }
}
}