Index: img_assist.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v retrieving revision 1.68 diff -U3 -r1.68 img_assist.module --- img_assist.module 13 Feb 2007 22:54:39 -0000 1.68 +++ img_assist.module 15 Feb 2007 18:52:37 -0000 @@ -750,7 +750,7 @@ */ function img_assist_properties() { $nid = arg(2); - $edit = (arg(3)) ? 1 : 0; // edit is put into a hidden field so the javascripts can see it + $edited = (arg(3)) ? 1 : 0; // edited is put into a hidden field so the javascripts can see it if (is_numeric($nid)) { $node = node_load(array('nid' => $nid)); @@ -761,7 +761,7 @@ $node->body = str_replace("\r", ' ', strip_tags($node->body)); $node->body = str_replace("\n", ' ', trim($node->body)); - $output = drupal_get_form('img_assist_properties_form', $node, $edit); + $output = drupal_get_form('img_assist_properties_form', $node, $edited); } else { $output = t('Image ID not found'); } @@ -772,7 +772,7 @@ /** * Construct the image properties form */ -function img_assist_properties_form($node, $edit) { +function img_assist_properties_form($node, $edited) { $image_info = image_get_info(file_create_path($node->images['_original'])); // Select (or generate) a preview image @@ -975,9 +975,9 @@ '#type' => 'hidden', '#value' => $node->nid, ); - $form['edit'] = array( + $form['edited'] = array( '#type' => 'hidden', - '#value' => $edit, + '#value' => $edited, ); $form['aspect'] = array( '#type' => 'hidden', @@ -1023,6 +1023,11 @@ } function img_assist_insert_html() { + $output = drupal_get_form('img_assist_insert_html_form'); + print theme('img_assist_page', $output, array('id'=>'img_assist_insert_html', 'onload'=>'parent.insertImage();', 'class'=>'img_assist')); +} + +function img_assist_insert_html_form() { $htmlcode = img_assist_set_htmlcode(); $form[] = array('#value'=>'
' . $htmlcode . '
'); @@ -1031,8 +1036,8 @@ '#value' => 'html2', ); //$form['#attributes'] = array('name'=>'img_assist'); - $output = drupal_get_form('img_assist_insert_html', $form); - print theme('img_assist_page', $output, array('id'=>'img_assist_insert_html', 'onload'=>'parent.insertImage();', 'class'=>'img_assist')); + + return $form; } /********************************************************************