--- flexiconvert/flexiconvert.module	2007-01-31 11:01:21.000000000 -0800
+++ flexiconvert-new/flexiconvert.module	2007-02-28 19:19:33.808797828 -0800
@@ -5,8 +5,6 @@
  */
 function flexiconvert_help($section) { 
   switch ($section) {
-    case 'admin/modules#description':
-        return t('Tool to help convert flexinodes to cck nodes');
     case 'admin/help#flexiconvert':
         return t('Flexiconvert will convert some kinds of flexinode types into cck types.<br>' .
             '<b>Limitations:</b> <ul>' .
@@ -44,7 +42,7 @@ function flexiconvert_menu($may_cache) {
   return $items;
 }
 
-function flexiconvert_submit( $form_id, $form_values ) {
+function flexiconvert_form_submit( $form_id, $form_values ) {
   $flexitype = $form_values['flexitype'];
   $ccktype = $form_values['ccktype'];
   variable_set( 'flexiconvert_flexitype', $flexitype );      
@@ -88,7 +86,7 @@ function flexiconvert_submit( $form_id, 
     // INSERT flexinode data as rows in cck table 
     $nid = $row['nid'];
     $node = $nodes[$nid];
-    $cck_table = "node_$ccktype";
+    $cck_table = "content_type_$ccktype";
     $sql = "insert into {$cck_table} (nid, vid) value ('$nid', '$nid')";
     //drupal_set_message( "$count: $sql" );
     db_query( $sql );
@@ -118,6 +116,10 @@ function flexiconvert_submit( $form_id, 
 
 function flexiconvert_page() { 
   drupal_set_title( "Flexiconvert" ); 
+  return drupal_get_form('flexiconvert_form');
+}
+
+function flexiconvert_form() {
   $types = array();
   $result = db_query( "SELECT name, ctype_id FROM {flexinode_type}" );
   while( $row = db_fetch_array( $result ) ) {
@@ -133,9 +135,9 @@ function flexiconvert_page() { 
   ); 
 
   $ccktypes = array();
-  $result = db_query( "SELECT label, type_name FROM {node_type_content}" );
+  $result = db_query( "SELECT type, name FROM {node_type}" );
   while( $row = db_fetch_array( $result ) ) {
-    $ccktypes[ $row['type_name'] ] = $row['label']; 
+    $ccktypes[ $row['type'] ] = $row['name']; 
   }   
   $form['ccktype'] = array(
     '#type' => 'select',
@@ -148,8 +150,7 @@ function flexiconvert_page() { 
     '#type' => 'submit',
     '#value' => t('Do It'),
   );
-  
-  return drupal_get_form('flexiconvert', $form);
+  return $form;
 }
 
 
