PHP theming for facets.
authorJason Skomorowski <jason@indexdata.com>
Tue, 25 Jan 2011 20:47:02 +0000 (21:47 +0100)
committerJason Skomorowski <jason@indexdata.com>
Tue, 25 Jan 2011 20:47:02 +0000 (21:47 +0100)
mkdru-block-facet.tpl.php
mkdru.module

index 61a6c24..c32aed9 100644 (file)
@@ -1 +1 @@
-<div id="<?php print $divId ?>"> </div>
+<div class="mkdru-facet <?php print $class ?>"> </div>
index 13ef18a..5a6eb81 100644 (file)
@@ -245,12 +245,12 @@ function mkdru_theme() {
     ),
     'mkdru_block_search' => array(
       'template' => 'mkdru-block-search',
-      'arguments' => array('nid' => null, 'path' => NULL),
+      'arguments' => array('nid' => NULL, 'path' => NULL),
     ),
-//     'mkdru_block_facet' => array(
-//       'template' => 'mkdru-block-facet',
-//       'arguments' => array('divId' => NULL),
-//     ),
+    'mkdru_block_facet' => array(
+      'template' => 'mkdru-block-facet',
+      'arguments' => array('class' => NULL)
+    )
   );
 }
 
@@ -312,30 +312,17 @@ function mkdru_block($op='list', $delta='sources', $edit=array()) {
 
     case 'view':
       switch ($delta) {
-        // TODO: make the facet themable, I have no clue why this won't work
-//         case 'mkdru_sources':
-//           $block['subject'] = t('Source');
-//           $block['content'] = theme('mkdru_block_facet', 'mkdru-sources');
-//           return $block;
-//         case 'mkdru_subjects':
-//           $block['subject'] = t('Subject');
-//           $block['content'] = theme('mkdru_block_facet', 'mkdru-subjects');
-//           return $block;
-//         case 'mkdru_authors':
-//           $block['subject'] = t('Author');
-//           $block['content'] = theme('mkdru_block_facet', 'mkdru-authors');
-//           return $block;
         case 'mkdru_sources':
           $block['subject'] = t('Source');
-          $block['content'] = '<div class="mkdru-facet mkdru-facet-sources"> </div>';
+          $block['content'] = theme('mkdru_block_facet', 'mkdru-facet-sources');
           return $block;
         case 'mkdru_subjects':
           $block['subject'] = t('Subject');
-          $block['content'] = '<div class="mkdru-facet mkdru-facet-subjects"> </div>';
+          $block['content'] = theme('mkdru_block_facet', 'mkdru-facet-subjects');
           return $block;
         case 'mkdru_authors':
           $block['subject'] = t('Author');
-          $block['content'] = '<div class="mkdru-facet mkdru-facet-authors"> </div>';
+          $block['content'] = theme('mkdru_block_facet', 'mkdru-facet-authors');
           return $block;
     }
     if (substr($delta, 0, 13) == 'mkdru_search_') {