*** acidfree.module.orig	2011-02-07 21:44:01.000000000 +0100
--- acidfree.module	2011-02-10 22:28:40.000000000 +0100
***************
*** 651,656 ****
--- 651,660 ----
    $q = $_GET['q'];
    $nodes_to_check = array();
    switch ($form_id) {
+     case 'image_node_form':
+     // print_r ($form);
+       if (variable_get('acidfree_disable_album_selection', true)) _acidfree_image_node_form_alter($form);
+       break;
      case 'acidfree_node_form':
          _acidfree_node_form_alter($form, $form_state);
          break;
***************
*** 868,873 ****
--- 872,883 ----
              '#default_value' => variable_get('acidfree_show_quick_links', false),
              '#description' => t('Adds links for adding new items when displaying an album. If you choose to leave this disabled, you can still use the quick items block ') . l('(admin/build/block)','admin/build/block'),
          );
+     $form['album']['acidfree_disable_album_selection'] = array(
+             '#type' => 'checkbox',
+             '#title' => t('Disable album selection for quick links'),
+             '#default_value' => variable_get('acidfree_disable_album_selection', true),
+             '#description' => t('When using the quick links to add images, disable selection of an album. Instead, use the album from which the quick link was used.'),
+         );
      $form['album']['acidfree_show_alternate_view'] = array(
              '#type' => 'checkbox',
              '#title' => t('Show alternative album view'),
***************
*** 1466,1472 ****
                  'relations' => 1,
                  'hierarchy' => 2,
                  'multiple' => 1,
!                 'required' => 1,
                  'tags' => 0,
                  'module' => 'acidfree', // this could allow us to set custom paths
                  'weight' => 0,
--- 1476,1482 ----
                  'relations' => 1,
                  'hierarchy' => 2,
                  'multiple' => 1,
!                 'required' => 0,
                  'tags' => 0,
                  'module' => 'acidfree', // this could allow us to set custom paths
                  'weight' => 0,
***************
*** 3451,3456 ****
--- 3461,3487 ----
      _acidfree_filter_taxonomy($form['taxonomy'][$vid]);
  }
  
+ function _acidfree_image_node_form_alter(&$form) {
+     $vid = acidfree_get_vocab_id();
+     $pm = _path_match('node', 'add', 'image', '%d');
+     if ($pm[0]) $aid = $pm[0];
+     if ($aid) {
+       if ($tid = db_result (db_query ("SELECT tid FROM {acidfree_album} WHERE aid='$aid'"))) {
+ 	$term = taxonomy_get_term ($tid);
+ 	$form['album'] = array(
+ 	  '#type' => 'item',
+ 	  '#title' => t('Album'),
+ 	  '#value' => $term->name,
+ 	  '#weight' => -99,
+ 	);
+ 	$form['taxonomy'][$vid] = array(
+ 	  '#type' => 'value',
+ 	  '#value' => $tid,
+ 	);
+       }
+     }
+ }
+ 
  /** 
   * Implementation of hook_views_api().
   */
