Index: views_fusion.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_fusion/views_fusion.module,v
retrieving revision 1.6
diff -u -r1.6 views_fusion.module
--- views_fusion.module	27 Jan 2007 23:24:22 -0000	1.6
+++ views_fusion.module	18 Feb 2007 12:52:20 -0000
@@ -1,31 +1,20 @@
 <?php
-// $Id: views_fusion.module,v 1.6 2007/01/27 23:24:22 fago Exp $
+// $Id: views_fusion.module,v 1.4.2.2 2007/01/27 23:24:08 fago Exp $
 
 /**
  * @file
  * Provides fusing of multiple views.
  */
 
-
-/**
- * Implementation of hook_help().
- */
-function views_fusion_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Provides fusing of multiple views.');
-  }
-}
-
-
 /**
  * Implementation of hook_menu().
  */
 function views_fusion_menu($may_cache) {
   
   if ($may_cache) {
-    $items[] = array('path' => 'admin/views/fusion', 'title' => t('fusion'),
-        'callback' => 'views_fusion_admin',
+    $items[] = array('path' => 'admin/build/views/fusion', 'title' => t('Fusion'),
+        'callback' => 'drupal_get_form',
+        'callback arguments' => 'views_fusion_admin',
         'access' => user_access('administer views'),
         'type' => MENU_LOCAL_TASK,
     );        
@@ -38,37 +27,41 @@
 
   $tables = _views_fusion_get_tables();
   
+  // probably not needed since drupal 5 has dependency system
   if (!$tables['fields']) {
-    return t('If you want to use views fusion you have to activate an appropriate node relation module, e.g. the nodefamily module.');
+    $msg = t('If you want to use views fusion you have to activate an appropriate node relation module, e.g. the nodefamily module.');
+    $form['warning'] = array('#type' => 'markup', '#value' => $msg);
   }
+  else {
+    $form['overview'] = array('#type' => 'markup', '#value' => views_fusion_overview());
 
-  $form['add'] = array('#type' => 'fieldset', '#title' => t('Add another views fusion'));
-  $form['add']['vid'] = array(
-    '#type' => 'select',
-    '#title' => t('Fuse view'),
-    '#options' => _views_fusion_get_views_list(),
-    '#required' => true,
-  );
-  $form['add']['mvid'] = array(
-    '#type' => 'select',
-    '#title' => t('with view'),
-    '#options' => _views_fusion_get_views_list(),
-    '#required' => true,
-  );
-  $form['add']['uses'] = array(
-    '#type' => 'select',
-    '#title' => t('using'),
-    '#options' => $tables['titles'],
-    '#required' => true,
-  );  
-  $form['add']['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Add fusion'),
-    '#weight' => 10,
-  );
+    $form['add'] = array('#type' => 'fieldset', '#title' => t('Add another views fusion'));
+    $form['add']['vid'] = array(
+      '#type' => 'select',
+      '#title' => t('Fuse view'),
+      '#options' => _views_fusion_get_views_list(),
+      '#required' => true,
+    );
+    $form['add']['mvid'] = array(
+      '#type' => 'select',
+      '#title' => t('with view'),
+      '#options' => _views_fusion_get_views_list(),
+      '#required' => true,
+    );
+    $form['add']['uses'] = array(
+      '#type' => 'select',
+      '#title' => t('using'),
+      '#options' => $tables['titles'],
+      '#required' => true,
+    );  
+    $form['add']['submit'] = array(
+      '#type' => 'submit',
+      '#value' => t('Add fusion'),
+      '#weight' => 10,
+    );
+  }
 
-  $output = views_fusion_overview();
-  return drupal_get_form('views_fusion_admin', $form) . $output;      
+  return $form;      
 }
 
 
@@ -181,12 +174,12 @@
       return '';
   }
   
-  if (arg(3) && arg(4)) {
+  if (arg(4) && arg(5)) {
       //delete the fusion
-      db_query("DELETE FROM {views_fusion} WHERE vid=%d AND mvid=%d", arg(3), arg(4));
+      db_query("DELETE FROM {views_fusion} WHERE vid=%d AND mvid=%d", arg(4), arg(5));
       views_invalidate_cache();
       drupal_set_message('Your fusion has been deleted.');
-      drupal_goto('admin/views/fusion');
+      drupal_goto('admin/build/views/fusion');
   }
   
   $header = array(t('primary view'), t('fused view'), t('using'), '');
@@ -195,7 +188,7 @@
   
   while ($fusion = db_fetch_object($result)) {
     $rows[] = array($fusion->name, $fusion->mname, $tables['titles'][$fusion->uses], 
-                    l(t('delete'),'admin/views/fusion/' . $fusion->vid .'/'. $fusion->mvid));
+                    l(t('delete'),'admin/build/views/fusion/' . $fusion->vid .'/'. $fusion->mvid));
   }  
   
   return theme('table', $header, $rows, array('class' => 'views_fusion'));
@@ -488,4 +481,4 @@
     unset($form['status']['#default_value'][$key]);
     drupal_set_message(t('The module %module was deactivated--it requires the following disabled/non-existant modules to function properly: %dependencies', array('%module' => $module, '%dependencies' => implode(', ', $missing_dependency_list))), 'error');
   }
-}
\ No newline at end of file
+}
