Split template, rearrange some markup
[mkdru-moved-to-drupal.org.git] / mkdru.module
index 1644223..8633149 100644 (file)
@@ -13,7 +13,6 @@ function mkdru_node_info() {
       'name' => t("Z39.50/SRU metasearch interface"),
       'module' => 'mkdru',
       'description' => t("Metasearch interface for Z39.50/SRU and other targets via a Pazpar2/Service Proxy backend"),
-
     )
   );
 }
@@ -70,7 +69,7 @@ function mkdru_init(){
   // Applies our module specific CSS to all pages. This works best because
   // all CSS is aggregated and cached so we reduce the number of HTTP 
   // requests and the size is negligible.
-  drupal_add_css(drupal_get_path('module', 'mkdru') .'/mkdru-page.css');
+  drupal_add_css(drupal_get_path('module', 'mkdru') .'/mkdru.css');
 }
 
 
@@ -197,8 +196,6 @@ function mkdru_nodeapi(&$node, $op, $teaser, $page) {
 
 /**
  * Implementation of hook_delete().
- *
- * When a node is deleted, we need to remove all related records from our table.
  */
 function mkdru_delete($node) {
   // Deleting by nid covers all revisions.
@@ -221,11 +218,15 @@ function mkdru_load($node) {
 */
 function mkdru_theme() {
   return array(
-    'mkdru_page' => array(
-      'template' => 'mkdru-page',
+    'mkdru_form' => array(
+      'template' => 'mkdru-form',
       'arguments' => array(),
     ),
-    'mkdru_page_js' => array(
+    'mkdru_results' => array(
+      'template' => 'mkdru-results',
+      'arguments' => array(),
+    ),
+    'mkdru_js' => array(
       'arguments' => array('node' => NULL),
     ),
 //     'mkdru_block_facet' => array(
@@ -238,7 +239,7 @@ function mkdru_theme() {
 /**
 * Theme function to include Javascript search client and deps
 */
-function theme_mkdru_page_js($node) {
+function theme_mkdru_js($node) {
   $path = drupal_get_path('module', 'mkdru');
   // Include client library.
   drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') . '/pz2.js', 'module', 'footer');
@@ -251,14 +252,18 @@ function theme_mkdru_page_js($node) {
 * Implementation of hook_view()
 */
 function mkdru_view($node, $teaser = FALSE, $page = FALSE) {
-  $node->content['mkdru_page_js'] = array(
-    '#value' => theme('mkdru_page_js', $node), 
+  $node->content['mkdru_js'] = array(
+    '#value' => theme('mkdru_js', $node), 
     '#weight' => 0,
   );
-  $node->content['mkdru_page'] = array(
-    '#value' => theme('mkdru_page'), 
+  $node->content['mkdru_form'] = array(
+    '#value' => theme('mkdru_form'), 
     '#weight' => 1,
   );
+  $node->content['mkdru_results'] = array(
+    '#value' => theme('mkdru_results'), 
+    '#weight' => 2,
+  );
   return $node;
 }
 
@@ -293,15 +298,15 @@ function mkdru_block($op='list', $delta='sources', $edit=array()) {
 //           return $block;
         case 'mkdru_sources':
           $block['subject'] = t('Source');
-          $block['content'] = '<div id="mkdru-sources"> </div>';
+          $block['content'] = '<div class="mkdru-facet mkdru-facet-sources"> </div>';
           return $block;
         case 'mkdru_subjects':
           $block['subject'] = t('Subject');
-          $block['content'] = '<div id="mkdru-subjects"> </div>';
+          $block['content'] = '<div class="mkdru-facet mkdru-facet-subjects"> </div>';
           return $block;
         case 'mkdru_authors':
           $block['subject'] = t('Author');
-          $block['content'] = '<div id="mkdru-authors"> </div>';
+          $block['content'] = '<div class="mkdru-facet mkdru-facet-authors"> </div>';
           return $block;
     }
   }