--- imagefield_import.module 2008-05-19 21:02:14.000000000 -0600 +++ imagefield_import-live.module 2008-05-16 10:25:11.000000000 -0600 @@ -39,7 +39,7 @@ function imagefield_import_perm() { */ function imagefield_import_menu($may_cache) { $items = array(); - if (!$may_cache) { + if ($may_cache) { $items[] = array( 'path' => 'admin/content/imagefield_import', 'title' => t('Imagefield import'), @@ -65,11 +65,6 @@ function imagefield_import_menu($may_cac // Create the imagefield_import_form that was defined in callback arguments in the Implementation of hook_menu(). function imagefield_import_form() { $form = array(); - - //get the content type and field names - $targetsetting = variable_get('imagefield_import_fieldname', FALSE); - list($type, $field) = split(":::", $targetsetting); - // Getting the path the user set as in import folder $dirpath = variable_get('imagefield_import_path', ''); // Check it's configuration out and throw a DSM if it isn't configured properly @@ -82,13 +77,13 @@ function imagefield_import_form() { // PHP function that sorts an array by key ksort($files); if ($files) { + // a little hack from the image_import.module to get the taxonmy controls onto our form--- + // Don't know yet if it works? if (module_exists('taxonomy')) { - // a little hack from the image_import.module to get the taxonmy controls onto our form--- - $form['type'] = array('#type' => 'value', '#value' => $type); + $form['type'] = array('#type' => 'value', '#value' => 'image'); $form['#node'] = new stdClass(); - $form['#node']->type = $type; - $form_id = $type . '_node_form'; - taxonomy_form_alter($form_id, $form); + $form['#node']->type = 'image'; + taxonomy_form_alter('imagefield_node_form', $form); unset($form['type']); unset($form['#node']); } @@ -100,10 +95,9 @@ function imagefield_import_form() { // a $fields multidimentional array for each of the files will need these elements $fields = array('filesize', 'dimensions', 'title', 'body'); foreach ($fields as $field) { - $form['files'][$field][0] = NULL; //$form['files'][filesize][0], etc. = null + $form['files'][$field][0] = NULL; } $filelist = array(0 => NULL); - //cycle through each file that was found foreach ($files as $file) { // image_get_info is a Drupal Function That Gets Details about an image $info = image_get_info($file->filename); @@ -132,7 +126,6 @@ function imagefield_import_form() { } // Remove our 0 elements. unset($filelist[0]); - //I DON'T THINK THIS IS NECESSARY...WAS DONE ABOVE foreach ($fields as $field) { $form['files'][$field][0] = NULL; } @@ -360,9 +353,9 @@ function imagefield_create_node_from($fi //if (module_exists('comment')) { // $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE); // } - if (module_exists('taxonomy')) { - $node->taxonomy = $taxonomy; - } + // if (module_exists('taxonomy')) { + // $node->taxonomy = $taxonomy; + // } $node->new_file = TRUE; $node->$field = array( array(