--- import_html/import_html.module	2006-04-03 18:08:03.000000000 -0700
+++ import_html.47/import_html.module	2006-04-14 17:16:16.000000000 -0700
@@ -144,8 +144,8 @@ function import_html_help($section) {
     return t("Import/Export an entire site to/from static HTML");
     case 'admin/modules/import_html':
     return t("Import/Export an entire site to/from static HTML");
-    case 'admin/help#import_html':
-      return file_get_contents(drupal_get_path("module", "import_html")."/import_html_help.htm");
+    case 'admin/help/import_html':
+    return file_get_contents(drupal_get_path("module", "import_html")."/import_html_help.htm");
   }
   return false;
 }
@@ -219,14 +219,50 @@ function import_html_page() {
     </p>");
   $output .= theme_box(t("About Importing"),$intro);
 
-  $group .= t("Fill in <b>ONE</b> path below.");
-  $group .= form_file(t('Site Root/Home Page on a dev server'), "client_site_root", 40, t('<b>If you are actually on the server</b> (localhost) Select the location of the site to import. You may have to select a file within the root directory (eg index.html).'));
-  $group .= form_textfield(t('Site Root on the Server'), "source_siteroot", variable_get("import_html_siteroot", "/www/htdocs/"), 40, 100, t('<b>If the files are on the server</b> (local to Drupal) Enter the absolute location of the site to import. You must have access permissions. Relative paths and aliases will be calculated from here.'));
-  $group .= form_textfield(t('Subsection to list'), "import_html_current_subsection", variable_get("import_html_current_subsection", ""), 40, 100, t('For large sites, its more convenient to just list and process sections. If a subdirectory is specified, only that will be displayed.'));
-  $group .= t('<p><b>Note</b> Big sites <i>will</i> take a long time to process, and processing may timeout. You can either increase the php timeout value and wait around, or just do sections at a time by using the subsection parameter above.</p>');
-  $group .= form_submit(t('Next'));
-  $group  = form($group, 'post', '?q=admin/import_html/list_filesystem');
-  $output .= form_group(t('Select HTML file source'), $group);
+$form["htmlsource"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Select HTML file source'),
+);
+
+$form["htmlsource"]["fillin"] = array(
+	'#type' => 'markup',
+	'#value' => t("Fill in <b>ONE</b> path below."),
+);
+$form["htmlsource"]["client_site_root"] = array(
+  '#type' => 'file',
+  '#title' => t('Site Root/Home Page on a dev server'),
+  '#size' => 40,
+  '#description' => t('<b>If you are actually on the server</b> (localhost) Select the location of the site to import. You may have to select a file within the root directory (eg index.html).'),
+);
+$form["htmlsource"]["source_siteroot"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Site Root on the Server'),
+  '#default_value' => variable_get("import_html_siteroot", "/www/htdocs/"),
+  '#size' => 40,
+  '#maxlength' => 100,
+  '#description' => t('<b>If the files are on the server</b> (local to Drupal) Enter the absolute location of the site to import. You must have access permissions. Relative paths and aliases will be calculated from here.'),
+);
+$form["htmlsource"]["import_html_current_subsection"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Subsection to list'),
+  '#default_value' => variable_get("import_html_current_subsection", ""),
+  '#size' => 40,
+  '#maxlength' => 100,
+  '#description' => t('For large sites, its more convenient to just list and process sections. If a subdirectory is specified, only that will be displayed.'),
+);
+$form["htmlsource"]["bigsites"] = array(
+	'#type' => 'markup',
+	'#value' => t('<p><b>Note</b> Big sites <i>will</i> take a long time to process, and processing may timeout. You can either increase the php timeout value and wait around, or just do sections at a time by using the subsection parameter above.</p>'),
+);
+$form[] = array(
+  '#type' => 'submit',
+  '#value' => t('Next'),
+);
+
+
+$form['#method'] = 'post';
+$form['#action'] = '?q=admin/import_html/list_filesystem';
+$output .= drupal_get_form('import_html_page', $form);
 
   print theme('page', $output);
 }
@@ -239,73 +275,125 @@ function import_html_page() {
  */
 function import_html_settings() {
 
-  // Do pseudo-validation on this val.
-  // Warn, but don't die on error
-  // Initializing the XSL doc just to check is inefficient, but this is just a config screen.
-  if (! _import_html_get_xsl_doc() ) {
-    form_set_error("import_html_translation_template","XSL File unable to be parsed");
-  }
-
-  // check htmltidy is present and correct
-//  include_once 'tidy-functions.inc';
-  include_once 'install-htmltidy.inc';
-  if($_POST['op'] == t('install htmltidy binary')){
-    htmltidy_install();
-  }
-  if(! htmltidy_test($warning)){
-    drupal_set_message('HTMLTidy executable is not available. '.$warning,'error');
-
-    $install .= form_textfield(t('Path to HTMLTidy executable'), "htmltidy_apppath", variable_get("htmltidy_apppath", "/usr/local/bin/tidy"), 40, 100,
-    t('
+	// Do pseudo-validation on this val.
+	// Warn, but don't die on error
+	// Initializing the XSL doc just to check is inefficient, but this is just a config screen.
+	if (! _import_html_get_xsl_doc() ) {
+	  form_set_error("import_html_translation_template","XSL File unable to be parsed");
+	}
+
+	// check htmltidy is present and correct
+	//include_once 'tidy-functions.inc';
+	include_once 'install-htmltidy.inc';
+	if($_POST['op'] == t('install htmltidy binary')){
+	   	htmltidy_install();
+	}
+	if(! htmltidy_test($warning)){
+  		drupal_set_message('HTMLTidy executable is not available. '.$warning,'error');
+
+$form["Install"] = array(
+  '#type' => 'fieldset',
+  '#title' => 'Install',
+  '#collapsible' => TRUE,
+);
+
+$form["Install"]["htmltidy_apppath"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Path to HTMLTidy executable'),
+  '#default_value' => variable_get("htmltidy_apppath", "/usr/local/bin/tidy"),
+  '#size' => 40,
+  '#maxlength' => 100,
+  '#description' => t('
       We require the HTML Binary to be available on the server. Please
       <a href="http://tidy.sourceforge.net/">download and install it</a>
       wherever you can, then tell me where to find it.
-    '));
-
-
-    $install .= t('If you are unable to install the htmltidy binary yourself, try this button to download and unpack it on the server (Linux only so far).');
-    $install .= '<br/>'.form_button(t('install htmltidy binary'),'op', 'submit').'<br/>';
-    $install .= t('There is a <i>small</i> chance it will work for you, but configurations are different everywhere. This will work only on Linux, Windows users can just <a href="http://tidy.sourceforge.net/">get the exe</a> and drop it in this directory.');
-    $output .= form_group('Install',$install);
-  } else {
-    $output .= '<p>HTMLTidy is present and correct: ' . $warning.'</p>';
-  }
-
-
-  $group = 'How the content is extracted from the source documents.';
+    '),
+);
 
-  $group .= form_textfield(t('HTML Translation Template'), "import_html_translation_template", variable_get("import_html_translation_template", "html2drupal.xslt"), 40, 100,
-    t('
+$form["Install"]["unable"] = array(
+	'#type' => 'markup',
+	'#value' => t('If you are unable to install the htmltidy binary yourself, try this button to download and unpack it on the server (Linux only so far).'),
+);
+$form["Install"]["installtidy"] = array(
+	'#type' => 'button',
+	'#name' => 'op',
+	'#button_type' => 'submit',
+	'#value' => 'install htmltidy binary',
+);
+$form["Install"]["unable"] = array(
+	'#type' => 'markup',
+	'#value' => t('There is a <i>small</i> chance it will work for you, but configurations are different everywhere. This will work only on Linux, Windows users can just <a href="http://tidy.sourceforge.net/">get the exe</a> and drop it in this directory.'),
+);
+
+} else {
+	$form["unable"] = array(
+		'#type' => 'markup',
+		'#value' => '<p>HTMLTidy is present and correct: ' . $warning.'</p>',
+	);
+}
+
+$form["Import"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Import and Content Analysis Options'),
+  '#collapsible' => TRUE,
+);
+
+$form["Import"]["help"] = array(
+	'#type' => 'markup',
+	'#value' => t('How the content is extracted from the source documents.'),
+);
+
+$form["Import"]["import_html_translation_template"] = array(
+  '#type' => 'textfield',
+  '#title' => t('HTML Translation Template'),
+  '#default_value' => variable_get("import_html_translation_template", "html2drupal.xslt"),
+  '#size' => 40,
+  '#maxlength' => 100,
+  '#description' => t('
         This file must be a valid XSL Template that can convert from your source
         HTML to the drupal XML schema. The path defined here will be searched
         for first in the current module directory, and then relative to the
         <code>files</code> directory.
-    '));
+    '),
+);
 
-  $group .= form_textfield(t('Content Tag ID'), "import_html_content_tag_id", variable_get("import_html_content_tag_id", "main"), 20, 100,
-    t("
+$form["Import"]["import_html_content_tag_id"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Content Tag ID'),
+  '#default_value' => variable_get("import_html_content_tag_id", "main"),
+  '#size' => 20,
+  '#maxlength' => 100,
+  '#description' => t("
         If your source document is structured well enough to have the actual
         content in a named div or something (&lt;div id='main'&gt;...content )
         what is that name?
         The default template will search for 'main','copy','story','text',and
         'bodyCopy'. If your input uses another label, set it here.
-      "));
+      "),
+);
 
-  // TODO set import content type to something other than 'page'
-
-  // Just a select, the filter radios are much to bulky for here.
-  $group .= form_select(t('Default Input Filter'),'import_html_preferred_filter', import_html_get_preferred_filter(), import_html_get_preferred_filter(TRUE) ,
-    t("
+$form["Import"]['import_html_preferred_filter'] = array(
+  '#type' => 'select',
+  '#title' => t('Default Input Filter'),
+  '#default_value' => import_html_get_preferred_filter(),
+  '#options' => import_html_get_preferred_filter(TRUE),
+  '#description' => t("
         After importing HTML, the end result may still have a standard filter
         applied to it internally. Normally 'Full HTML' is correct here,
         although it may create unwanted hard breaks. Use 'Unfiltered HTML'
         if you want the content verbatim.
         Modify only if you want to strip the source right down, execute php,
         or do other filter magic on the input.
-    "));
+    "),
+);
 
-  $group .= form_textfield(t('Default Document'), "import_html_default_document", variable_get("import_html_default_document", "index.htm"), 40, 40,
-    t('
+$form["Import"]["import_html_default_document"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Default Document'),
+  '#default_value' => variable_get("import_html_default_document", "index.htm"),
+  '#size' => 40,
+  '#maxlength' => 40,
+  '#description' => t('
         What is the default document name for pages served in directories on
         the current site (index.htm, index.html, default.asp, index.php)?
         When documents of this name are imported, they can be given both
@@ -313,16 +401,27 @@ function import_html_settings() {
         When the navigation menu is built, this file is served when the
         directory link is clicked.
         This should end up emulating normal website navigation behaviour.
-    '));
-
-  $output .= form_group(t('Import and Content Analysis Options'), $group);
-
-
+    '),
+);
 
-  $replication ='How and where the imported content is reproduced on this site. (requires path.module)';
 
-  $replication .= form_checkbox(t('Trim Suffixes'), "import_html_trim_suffixes", TRUE, variable_get("import_html_trim_suffixes", TRUE),
-    t('
+$form["Replication"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Replication Options'),
+  '#collapsible' => TRUE,
+);
+
+$form["Replication"]["help"] = array(
+	'#type' => 'markup',
+	'#value' => t('How and where the imported content is reproduced on this site. (requires path.module)'),
+);
+
+$form["Replication"]["import_html_trim_suffixes"] = array(
+  '#type' => 'checkbox',
+  '#title' => t('Trim Suffixes'),
+  '#return_value' => TRUE,
+  '#default_value' => variable_get("import_html_trim_suffixes", TRUE),
+  '#description' => t('
         When importing files, new url_aliases will be generated based on the
         old path. Optionally, the new primary alias can have the suffix
         chopped of. So <code>old/path/file.htm</code> wil be accessed as just
@@ -334,10 +433,15 @@ function import_html_settings() {
         cause you to end up with duplicates if importing the same file again.
         <br/>This just defines the name given to the page, it does not
         automatically update any links <em>to</em> the page (see below).
-    '));
+    '),
+);
 
-  $replication .= form_checkbox(t('Legacy Aliases'), "import_html_legacy_aliases", TRUE, variable_get("import_html_legacy_aliases", TRUE),
-    t('
+$form["Replication"]["import_html_legacy_aliases"] = array(
+  '#type' => 'checkbox',
+  '#title' => t('Legacy Aliases'),
+  '#return_value' => TRUE,
+  '#default_value' => variable_get("import_html_legacy_aliases", TRUE),
+  '#description' => t('
         Optionally, a secondary alias can be made that DOES have the old
         full suffix. This supports old links and hrefs.
         The new node may end up with two aliases (thats OK) but the tidy
@@ -345,10 +449,15 @@ function import_html_settings() {
         Uncheck this if you do NOT want old URL support.
         These two options are independant of each other. If both are off
         the new page will have no url_alias.
-    '));
+    '),
+);
 
-  $replication .= form_checkbox(t('Try to Relink Files by discarding suffixes'), "import_html_relink_files", TRUE, variable_get("import_html_relink_files", FALSE),
-    t('
+$form["Replication"]["import_html_relink_files"] = array(
+  '#type' => 'checkbox',
+  '#title' => t('Try to Relink Files by discarding suffixes'),
+  '#return_value' => TRUE,
+  '#default_value' => variable_get("import_html_relink_files", FALSE),
+  '#description' => t('
         <b>If</b> you choose not to support the Legacy Aliases suffixes
         on your new pages, <em>existing links to those pages will break</em>.
         This includes inline links from within the content we are importing.
@@ -366,70 +475,101 @@ function import_html_settings() {
         this option plus "Trim Suffixes" should be able to work together to
         rename all files. You\'ll want to run a link checker afterwards!
 
-    '));
+    '),
+);
 
-  $replication .= form_textfield(
-    t('Extra File Storage Path'), 
-    "import_html_file_storage_path", 
-    ensure_trailing_slash( variable_get("import_html_file_storage_path", variable_get('file_directory_path', 'files')."/imported/") ),
-    20, 100,
-    t("
+$form["Replication"]["import_html_file_storage_path"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Extra File Storage Path'),
+  '#default_value' => ensure_trailing_slash( variable_get("import_html_file_storage_path", variable_get('file_directory_path', 'files')."/imported/") ),
+  '#size' => 20,
+  '#maxlength' => 100,
+  '#description' => t("
         Where, beneath siteroot, should extra imported <strong>files</strong>
         be stored. Images and suchlike will be put into a heirachy mirroring
         their old location, but all under this directory.
-    "));
+    "),
+);
 
-  $replication .= form_textfield(t('Import Site Prefix'), "import_html_import_site_prefix", ensure_trailing_slash( variable_get("import_html_import_site_prefix", 'imported/' ) ), 20, 100,
-    t("
+$form["Replication"]["import_html_import_site_prefix"] = array(
+  '#type' => 'textfield',
+  '#title' => t('Import Site Prefix'),
+  '#default_value' => ensure_trailing_slash( variable_get("import_html_import_site_prefix", 'imported/' ) ),
+  '#size' => 20,
+  '#maxlength' => 100,
+  '#description' => t("
         Where, beneath siteroot, should extra imported <strong>pages</strong>
         <em>appear to be</em> served from? If you wish to keep the imported
         pages separate from the main site, setting this value to look like a
         subdirectory will make the imported site act like a subsite.
         Otherwise leave it blank and new pages will be added under the top
         level navigation.
-    "));
-
-  if(module_exist('menu')){
-    $options = menu_parent_options(0);
-    $replication .= form_select(t('Menu Parent'), "import_html_menu_parent_id", variable_get("import_html_menu_parent_id", 0 ), $options,
-      t("
-          Where in the menu system should the new heirachy of pages be built in the menu system?
-      "));
-  } else {
-    $replication .= t('If you enable the menu.module, the structure of the imported files can be imported as well');
-  }
-
-
-  $output .= form_group(t('Replication Options'), $replication);
-
+    "),
+);
 
-  $group = 'How to handle problems when importing';
+if(module_exist('menu')){
+  $options = menu_parent_options(0);
 
-  $group .= form_select(
-    t("Duplicate Handling"),
-    'import_html_handle_duplicates',
-    variable_get('import_html_handle_duplicates', IMPORT_HTML_MERGE),
-    array(IMPORT_HTML_MERGE=>'overwrite/merge' ,IMPORT_HTML_SKIP=>'skip'),
-    t('If attempting to import a file into a path that already exisits in the system (such as by repeating an import process), do what?')
-  ) ;
-  $group .= form_select(
-    t("No Title"),
-    'import_html_handle_no_title',
-    variable_get('import_html_handle_no_title', IMPORT_HTML_GUESS),
-    array(IMPORT_HTML_GUESS=>'use the document path' ,IMPORT_HTML_SKIP=>'skip, do not import' ,IMPORT_HTML_DEFAULT=>'set to a placeholder value'),
-    t('If parsing the input document fails to return any title at all, do what?')
-  ) ;
-
-  $group .= t("<p>
-    Other logic, like whether to use the TITLE tag or the H1 tag found in a
-    file is defined in the XSL template, which you can tune yourself.
-    </p>");
+$form["Replication"]["import_html_menu_parent_id"] = array(
+  '#type' => 'select',
+  '#title' => t('Menu Parent'),
+  '#default_value' => variable_get("import_html_menu_parent_id", 0 ),
+  '#options' => $options,
+  '#description' => t("
+          Where in the menu system should the new heirachy of pages be built in the menu system?
+      "),
+);
+} else {
+	$form["Replication"]["nomenu"] = array(
+		'#type' => 'markup',
+		'#value' => t('If you enable the menu.module, the structure of the imported files can be imported as well'),
+	);
+}
 
-  $output .= form_group(t('Advanced Import Tuning'), $group);
 
-  $output .= '<p>'.l("Proceed to import","admin/import_html").'</p>';
+// tuning
+
+$form["Advanced"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Advanced Import Tuning'),
+  '#collapsible' => TRUE,
+);
+
+$form["Advanced"]["help"] = array(
+	'#type' => 'markup',
+	'#value' => t('How to handle problems when importing'),
+);
+
+$form["Advanced"]['import_html_handle_duplicates'] = array(
+  '#type' => 'select',
+  '#title' => t("Duplicate Handling"),
+  '#default_value' => variable_get('import_html_handle_duplicates', IMPORT_HTML_MERGE),
+  '#options' => array(IMPORT_HTML_MERGE=>'overwrite/merge' ,IMPORT_HTML_SKIP=>'skip'),
+  '#description' => t('If attempting to import a file into a path that already exisits in the system (such as by repeating an import process), do what?'),
+);
+
+$form["Advanced"]['import_html_handle_no_title'] = array(
+  '#type' => 'select',
+  '#title' => t("No Title"),
+  '#default_value' => variable_get('import_html_handle_no_title', IMPORT_HTML_GUESS),
+  '#options' => array(IMPORT_HTML_GUESS=>'use the document path' ,IMPORT_HTML_SKIP=>'skip, do not import' ,IMPORT_HTML_DEFAULT=>'set to a placeholder value'),
+  '#description' => t('If parsing the input document fails to return any title at all, do what?'),
+);
+
+$form["Advanced"]["import_html_other_logic"] = array(
+	'#type' => 'markup',
+	'#value' => t("<p>
+	    Other logic, like whether to use the TITLE tag or the H1 tag found in a
+	    file is defined in the XSL template, which you can tune yourself.
+	    </p>"),
+);
+
+$form["import_html_proceed"] = array(
+	'#type' => 'markup',
+	'#value' => '<p>'.l("Proceed to import","admin/import_html").'</p>',
+);
 
-  return $output;
+  return $form;
   // Hey, it's cool this form gets called automatically,
   // but where does it save? seems all varnames just become variables
   // - which is what I want, I guess.
@@ -446,16 +586,30 @@ function import_html_demo_page() {
       extracted on a simple import.
     </p>");
 
-  $group .= form_textfield(t('URL to import'), "source_url", "", 80,240,
-    t('
-        Local file paths are OK, although you may have to use the
-        <kbd>file://</kbd> syntax on them, depending on your system.
-    '));
-  $group .= form_submit(t('Next'));
-  $group  = form($group, 'post', '?q=admin/import_html/import_files');
-  $output .= form_group(t('Select HTML file source'), $group);
+	$form["Select"] = array(
+	  '#type' => 'fieldset',
+	  '#title' => t('Select HTML file source'),
+	);
+	$form["Select"]["source_url"] = array(
+	  '#type' => 'textfield',
+	  '#title' => t('URL to import'),
+	  '#default_value' => "",
+	  '#size' => 80,
+	  '#maxlength' => 240,
+	  '#description' => t('
+	        Local file paths are OK, although you may have to use the
+	        <kbd>file://</kbd> syntax on them, depending on your system.
+	    '),
+	);
+	$form[] = array(
+	  '#type' => 'submit',
+	  '#value' => t('Next'),
+	);
+	$form['#method'] = 'post';
+	$form['#action'] = '?q=admin/import_html/import_files';
+	$output = drupal_get_form('import_html_demo_page', $form);
 
-  print theme('page', $output);
+    print theme('page', $output);
 
 
 }
@@ -569,6 +723,18 @@ function import_html_list_filesystem($ba
   import_html_add_filebrowser_style();
   import_html_add_filebrowser_js();
 
+$form["Files"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Select Files to import'),
+);
+
+$form["Files"]["treecontent"] = array(
+  '#type' => 'fieldset',
+  '#title' => t('Tree View'),
+);
+
+$output .= _import_html_format_tree_group($tree,"","/");
+
   $tree_content .=  "<div class='treeContent'>";
   $tree_content .= "<label for='all_pages' class='page'><input type='checkbox' id='all_pages' onclick='select_all_by_type(\"page\",this.checked)' />: All Pages</label>  ";
   $tree_content .= "<label for='all_images' class='image'><input type='checkbox' id='all_images' onclick='select_all_by_type(\"image\",this.checked)' />: All Images</label>  ";
@@ -579,32 +745,38 @@ function import_html_list_filesystem($ba
 
   $tree_content .= "</div>";
 
-  if(module_exist('menu')){
-    $tree_content.= form_checkbox(
-      t("Add each page to menu"), 
-      "import_html_create_menus", 
-      TRUE,  
-      variable_get("import_html_create_menus", TRUE),
-      t( 'requires menu.module'.(module_exist('menu')?'(installed)':' (Which is NOT available)')) 
-    );
-    
-    $options = menu_parent_options(0);
-    $tree_content .= form_select(
-      t('Menu Parent'), 
-      "import_html_menu_parent_id", 
-      variable_get("import_html_menu_parent_id", 0 ),
-      $options 
-    );
-  } else {
-    $tree_content .= t('Menu is not enabled, so the heirachical structure of the imported files will NOT be retained.');
-  }
 
-  $tree_content .= form_hidden("source_siteroot", variable_get("import_html_siteroot", "/www/htdocs/"));
-  $tree_content .= form_submit(t('Import'));
-  $tree_form .= form($tree_content, 'post', '?q=admin/import_html/import_files');
+if(module_exist('menu')){
+	$form["Files"]["import_html_create_menus"] = array(
+	  '#type' => 'checkbox',
+	  '#title' => t("Add each page to menu"),
+	  '#return_value' => TRUE,
+	  '#default_value' => variable_get("import_html_create_menus", TRUE),
+	  '#description' => t( 'requires menu.module'.(module_exist('menu')?'(installed)':' (Which is NOT available)')),
+	);
+	$options = menu_parent_options(0);
+	$form["Files"]["import_html_menu_parent_id"] = array(
+	  '#type' => 'select',
+	  '#title' => t('Menu Parent'),
+	  '#default_value' => variable_get("import_html_menu_parent_id", 0 ),
+	  '#options' => $options,
+	);
 
-  $output .= form_group(t('Select Files to import'), $tree_form);
+  }
 
+$form["source_siteroot"] = array(
+  '#type' => 'hidden',
+  '#value' => variable_get("import_html_siteroot", "/www/htdocs/"),
+);
+
+$form[] = array(
+  '#type' => 'submit',
+  '#value' => t('Import'),
+);
+
+  $form['#method'] = 'post';
+  $form['#action'] = '?q=admin/import_html/import_files';
+  $output .= drupal_get_form('import_html_list_filesystem', $form);
   return $output;
 }
 
@@ -958,7 +1130,7 @@ function import_html_add_node_navigation
 function _import_html_process_html_page(&$node,$path="",$rel_path="") {
 
   // Convert the node to an object, if necessary.
-  $node = array2object($node);
+  $node = (object) $node;
 
   if (! init_xsl()) {
     trigger_error("Sorry, with no XML support there will be no content scanning AT ALL. Aborting process. See the import_html_help.htm for info on enabling XML under PHP.", E_USER_ERROR);
