From 4df4972a2a7429f91acd889dbaa60ef9e40c684a Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Fri, 28 Jan 2011 01:24:54 +0100 Subject: [PATCH] Restrict block visibility to mkdru node type --- mkdru.info | 4 ++-- mkdru.module | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mkdru.info b/mkdru.info index e618a45..a5c816f 100644 --- a/mkdru.info +++ b/mkdru.info @@ -1,3 +1,3 @@ -name = Z39.50/SRU metasearch -description = Metasearching of Z39.50 and other targets via Index Data's Pazpar2 and associated tool stack. +name = Pazpar2 metasearch integration +description = Metasearching of Z39.50, SRU and SOLR targets via Index Data's Pazpar2 and associated tool stack. core = 6.x diff --git a/mkdru.module b/mkdru.module index 5a6eb81..9d55303 100644 --- a/mkdru.module +++ b/mkdru.module @@ -294,13 +294,28 @@ function mkdru_block($op='list', $delta='sources', $edit=array()) { switch ($op) { case 'list': // facet blocks + // D6 has no setting for note type visibility, set + // the default to limit facet display to this type + $visPHP = ' arg(1))); + return $node->type == "mkdru"; + } +?>'; + // 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_sources']['visibility'] = 2; + $blocks['mkdru_sources']['pages'] = $visPHP; $blocks['mkdru_subjects']['info'] = t('mkdru - subject facets'); $blocks['mkdru_subjects']['cache'] = BLOCK_NO_CACHE; + $blocks['mkdru_subjects']['visibility'] = 2; + $blocks['mkdru_subjects']['pages'] = $visPHP; $blocks['mkdru_authors']['info'] = t('mkdru - author facets'); $blocks['mkdru_authors']['cache'] = BLOCK_NO_CACHE; + $blocks['mkdru_authors']['visibility'] = 2; + $blocks['mkdru_authors']['pages'] = $visPHP; // search blocks $result = db_query("SELECT title, nid FROM {node} WHERE type = 'mkdru';"); while ($node = db_fetch_object($result)) { -- 1.7.10.4