? image-d6upgrade-181809-13.patch
? image-d6upgrade-181809-15.patch
? image-d6upgrade-181809-16.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/README.txt,v
retrieving revision 1.6
diff -u -p -r1.6 README.txt
--- README.txt	18 Jul 2007 17:04:02 -0000	1.6
+++ README.txt	7 Dec 2007 02:25:46 -0000
@@ -7,4 +7,4 @@ other nodes, or used on their own to dis
 diagrams. 
 
 Author:
-James Walker <james@bryght.com>
+James Walker <james@lullabot.com>
Index: image.imagemagick.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.imagemagick.inc,v
retrieving revision 1.19
diff -u -p -r1.19 image.imagemagick.inc
--- image.imagemagick.inc	28 Oct 2007 19:55:05 -0000	1.19
+++ image.imagemagick.inc	7 Dec 2007 02:25:46 -0000
@@ -13,7 +13,7 @@ function image_imagemagick_info() {
  */
 function image_imagemagick_settings() {
   $form['#after_build'] = array('_image_imagemagick_build_version');
-  
+
   $form['imagemagick_binary'] = array(
     '#type' => 'fieldset',
     '#title' => t('ImageMagick Binary'),
Index: image.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.info,v
retrieving revision 1.4
diff -u -p -r1.4 image.info
--- image.info	18 Jul 2007 17:04:02 -0000	1.4
+++ image.info	7 Dec 2007 02:25:46 -0000
@@ -2,3 +2,4 @@
 name = Image
 description = Allows uploading, resizing and viewing of images.
 package = Image
+core = 6.x
Index: image.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.install,v
retrieving revision 1.14
diff -u -p -r1.14 image.install
--- image.install	10 Oct 2007 04:10:07 -0000	1.14
+++ image.install	7 Dec 2007 02:25:46 -0000
@@ -4,35 +4,46 @@
 /**
  * Installing and updating image.module.
  */
+function image_schema() {
+  $schema['image'] = array(
+    'description' => t('Stores image files information.'),
+    'fields' => array(
+      'nid' => array(
+        'description' => t('Primary Key: The {node}.nid of the image node.'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'fid' => array(
+        'description' => t('Index: The {files}.fid of the image file.'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'image_size' => array(
+        'description' => t('Primary Key: The {files}.filename of the image file.  For image module this indicates the file size.'),
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+  );
+  return $schema;
+}
+
+/**
+ * Installing and updating image.module.
+ */
 function image_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {image} (
-          `nid` INTEGER UNSIGNED NOT NULL,
-          `fid` INTEGER UNSIGNED NOT NULL,
-          `image_size` VARCHAR(32) NOT NULL,
-          PRIMARY KEY (`nid`, `image_size`),
-          INDEX image_fid(`fid`)
-        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-    case 'pgsql':
-      db_query("CREATE TABLE {image} (
-          nid int_unsigned NOT NULL,
-          fid int_unsigned NOT NULL,
-          image_size VARCHAR(32) NOT NULL,
-          PRIMARY KEY (nid, image_size)
-        );
-        CREATE INDEX {image_fid} on {image}(fid);");
-      break;
-  }
+  drupal_install_schema('image');
 }
 
 /**
  * Implementation of hook_uninstall().
  */
 function image_uninstall() {
-  db_query('DROP TABLE {image}');
+  drupal_uninstall_schema('image');
 
   variable_del('image_max_upload_size');
   variable_del('image_updated');
Index: image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v
retrieving revision 1.259
diff -u -p -r1.259 image.module
--- image.module	13 Nov 2007 03:21:53 -0000	1.259
+++ image.module	7 Dec 2007 02:25:47 -0000
@@ -16,8 +16,8 @@ if (module_exists('views')) {
 /**
  * Implementation of hook_help
  */
-function image_help($section) {
-  switch ($section) {
+function image_help($path, $arg) {
+  switch ($path) {
     case 'admin/help#image':
       $output = '<p>'. t('The image module is used to create and administer images for your site. Each image is stored as a post, with thumbnails of the original generated automatically. There are two default thumbnail sizes, thumbnail and preview. The thumbnail size is shown as the preview for image posts and when browsing image galleries. The preview is the default size when first displaying an image node.') .'</p>';
       $output .= '<p>'. t('Image administration allows the image directory and the image sizes to be set.</p><p>
@@ -34,6 +34,31 @@ Image galleries are used to organize and
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function image_theme() {
+  return array(
+    'image_settings_sizes_form' => array(
+      'arguments' => array('form' => NULL),
+    ),
+    'image_teaser ' => array(
+      'arguments' => array('node' => NULL),
+    ),
+    'image_body' => array(
+      'arguments' => array('node' => NULL),
+    ),
+    'image_display' => array(
+      'arguments' => array(
+        'node' => NULL,
+        'label' => NULL,
+        'url' => NULL,
+        'attributes' => NULL,
+      ),
+    ),
+  );
+}
+
+/**
  * Implementation of hook_node_info
  */
 function image_node_info() {
@@ -141,8 +166,12 @@ function image_admin_settings() {
       '#size' => 25,
       '#maxlength' => 32,
     );
+    // TODO: currently getting "notice: Array to string conversion in /Users/addi/Sites/upgrade6/includes/form.inc on line 715." on this screen when saving the configs.
+    
+    // For required sizes, set the value and disable the field.
     if (_image_is_required_size($key)) {
-      $form['image_sizes'][$key]['label']['#attributes'] = array('disabled' => 'disabled');
+      $form['image_sizes'][$key]['label']['#disabled'] = TRUE;
+      $form['image_sizes'][$key]['label']['#value'] = $size['label'];
       $form['image_sizes'][$key]['label']['#required'] = TRUE;
     }
     $form['image_sizes'][$key]['operation'] = array(
@@ -175,7 +204,7 @@ function image_admin_settings() {
 /**
  * Check that the sizes provided have the required amount of information.
  */
-function image_settings_sizes_validate(&$form) {
+function image_settings_sizes_validate($form, &$form_state) {
   foreach (element_children($form) as $key) {
     // If there's a label they must provide at either a height or width.
     if ($key != IMAGE_ORIGINAL && !empty($form[$key]['label']['#value'])) {
@@ -192,13 +221,13 @@ function image_settings_sizes_validate(&
  *
  * Remove deleted sizes, and use the label as indexes for new sizes.
  */
-function image_settings_sizes_submit($form_id, &$form_values) {
+function image_settings_sizes_submit($form, &$form_state) {
   $old_sizes = image_get_sizes();
 
   // If the size's operation, or dimensions change we need to rebuild.
   $rebuild = FALSE;
 
-  foreach ($form_values['image_sizes'] as $key => $size) {
+  foreach ($form_state['values']['image_sizes'] as $key => $size) {
     // Changed to the original setting only affect new images and they
     // shouldn't be able to add or remove it.
     if ($key == IMAGE_ORIGINAL) {
@@ -207,25 +236,25 @@ function image_settings_sizes_submit($fo
 
     // Remove sizes without labels.
     if (empty($size['label'])) {
-      unset($form_values['image_sizes'][$key]);
+      unset($form_state['values']['image_sizes'][$key]);
     }
 
     // Check if only one is set, indicating an addition or removal.
-    if (isset($form_values['image_sizes'][$key]) ^ isset($old_sizes[$key])) {
+    if (isset($form_state['values']['image_sizes'][$key]) ^ isset($old_sizes[$key])) {
       $rebuild |= TRUE;
 
       // When adding a new size, we need to assign a key.
-      if (isset($form_values['image_sizes'][$key])) {
-        unset($form_values['image_sizes'][$key]);
+      if (isset($form_state['values']['image_sizes'][$key])) {
+        unset($form_state['values']['image_sizes'][$key]);
         $new_key = drupal_strtolower(drupal_substr($size['label'], 0, 32));
-        $form_values['image_sizes'][$new_key] = $size;
+        $form_state['values']['image_sizes'][$new_key] = $size;
       }
     }
     // Check for changes.
-    else if (isset($form_values['image_sizes'][$key]) && isset($old_sizes[$key])) {
+    else if (isset($form_state['values']['image_sizes'][$key]) && isset($old_sizes[$key])) {
       // Did the operation, height or width change?
       foreach (array('operation', 'height', 'width') as $field) {
-        $rebuild |= ($form_values['image_sizes'][$key][$field] != $old_sizes[$key][$field]);
+        $rebuild |= ($form_state['values']['image_sizes'][$key][$field] != $old_sizes[$key][$field]);
       }
     }
   }
@@ -234,10 +263,10 @@ function image_settings_sizes_submit($fo
   // derivative images are rebuilt.
   if ($rebuild) {
     drupal_set_message(t('Changes to the images sizes mean that the derivative images will need to be regenerated.'));
-    $form_values['image_updated'] = time();
+    $form_state['values']['image_updated'] = time();
   }
 
-  return system_settings_form_submit($form_id, $form_values);
+  return system_settings_form_submit($form, $form_state);
 }
 
 function theme_image_settings_sizes_form(&$form) {
@@ -251,7 +280,7 @@ function theme_image_settings_sizes_form
     $row[] = drupal_render($form[$key]['link']);
     $rows[] = $row;
   }
-  $output .= theme('table', $header, $rows);
+  $output = theme('table', $header, $rows);
   $output .= drupal_render($form);
 
   return $output;
@@ -260,32 +289,23 @@ function theme_image_settings_sizes_form
 /**
  * Implementation of hook_menu
  */
-function image_menu($may_cache) {
+function image_menu() {
   $items = array();
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'node/add/image',
-      'title' => t('Image'),
-      'access' => user_access('create images'),
-    );
-    $items[] = array(
-      'path' => 'image/view',
-      'title' => t('image'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK,
-      'callback' => 'image_fetch',
-    );
-    $items[] = array(
-      'path' => 'admin/settings/image',
-      'title' => t('Image'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('image_admin_settings'),
-      'access' => user_access('administer site configuration'),
-      'type' => MENU_NORMAL_ITEM,
-      'description' => t('Image module settings.'),
-    );
-  }
+  $items['image/view'] = array(
+    'title' => 'image',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'page callback' => 'image_fetch',
+  );
+  $items['admin/settings/image'] = array(
+    'title' => 'Image',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('image_admin_settings'),
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+    'description' => 'Image module settings.',
+  );
 
   return $items;
 }
@@ -346,8 +366,13 @@ function image_prepare(&$node, $field_na
   if (is_null($field_name)) {
     $field_name = 'image';
   }
+  
+  // Validators for file_save_upload().
+  $validators = array(
+    'file_validate_is_image' => array(),
+  );
 
-  if ($file = file_check_upload($field_name)) {
+  if ($file = file_save_upload($field_name, $validators)) {
     // Ensure the file is an image.
     $image_info = image_get_info($file->filepath);
     if (!$image_info || empty($image_info['extension'])) {
@@ -356,10 +381,7 @@ function image_prepare(&$node, $field_na
     }
 
     // Save the file to the temp directory.
-    $file = file_save_upload($field_name, _image_filename($file->filename, IMAGE_ORIGINAL, TRUE));
-    if (!$file) {
-      return;
-    }
+    file_copy($file, _image_filename($file->filename, IMAGE_ORIGINAL, TRUE));
 
     // Resize the original.
     $aspect_ratio = $image_info['height'] / $image_info['width'];
@@ -664,7 +686,7 @@ function image_load(&$node) {
   // Correct any problems with the derivative images.
   if ($node->rebuild_images) {
     image_update($node);
-    watchdog('image', t('Derivative images were regenerated for %title.', array('%title' => $node->title)), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+    watchdog('image', 'Derivative images were regenerated for %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
   }
 }
 
@@ -958,16 +980,7 @@ function _image_build_derivatives(&$node
         break;
 
       case 'scale_crop':
-        // This is based on Drupal 6's image_scale_and_crop(). Scales the
-        // image so that the image's smaller dimension matches the
-        // requested size and the crops any overlap on the image's larger
-        // dimension.
-        $scale = max($size['width'] / $image_info['width'], $size['height'] / $image_info['height']);
-        $x = round(($image_info['width'] * $scale - $size['width']) / 2);
-        $y = round(($image_info['height'] * $scale - $size['height']) / 2);
-        if (image_resize($original_path, $destination, $image_info['width'] * $scale, $image_info['height'] * $scale)) {
-          $status = image_crop($destination, $destination, $x, $y, $size['width'], $size['height']);
-        }
+        $status = image_scale_and_crop($destination, $destination,  $size['width'], $size['height']);
         break;
     }
 
@@ -1088,11 +1101,13 @@ function _image_insert(&$node, $size, $i
     $node->images[$size] = $image_path;
 
     $image_info = image_get_info($image_path);
-    $fid = db_next_id('{files}_fid');
-    db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', '%s')",
-             $fid, $node->nid, $size, $image_path, $image_info['mime_type'], $image_info['file_size']);
-    db_query("INSERT INTO {image} (nid, image_size, fid) VALUES (%d, '%s', %d)",
-             $node->nid, $size, $fid);
+    $fid = db_last_insert_id('files', 'fid');
+    db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) 
+      VALUES (%d, %d, '%s', '%s', '%s', '%s')",
+      $fid, $node->nid, $size, $image_path, $image_info['mime_type'], $image_info['file_size']);
+    db_query("INSERT INTO {image} (nid, image_size, fid) 
+      VALUES (%d, '%s', %d)",
+      $node->nid, $size, $fid);
   }
 }
 
Index: views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/views.inc,v
retrieving revision 1.4
diff -u -p -r1.4 views.inc
--- views.inc	27 Aug 2007 22:50:39 -0000	1.4
+++ views.inc	7 Dec 2007 02:25:47 -0000
@@ -99,7 +99,7 @@ function image_views_handler_image_img($
  */
 function image_views_handler_image_img_link($fieldinfo, $fielddata, $value, $data) {
   $node = node_load($data->nid);
-  return l(image_display($node, $fielddata['options']), "node/{$node->nid}", array(), NULL, NULL, FALSE, TRUE);
+  return l(image_display($node, $fielddata['options']), "node/{$node->nid}", array('html' => TRUE));
 }
 
 /**
Index: contrib/image_attach/image_attach.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_attach/image_attach.info,v
retrieving revision 1.3
diff -u -p -r1.3 image_attach.info
--- contrib/image_attach/image_attach.info	18 Jul 2007 17:04:24 -0000	1.3
+++ contrib/image_attach/image_attach.info	7 Dec 2007 02:25:47 -0000
@@ -2,4 +2,5 @@
 name = Image Attach
 description = Allows easy attaching of image nodes to other content types.
 package = Image
-dependencies = image
\ No newline at end of file
+dependencies[] = image
+core = 6.x
\ No newline at end of file
Index: contrib/image_attach/image_attach.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_attach/image_attach.install,v
retrieving revision 1.11
diff -u -p -r1.11 image_attach.install
--- contrib/image_attach/image_attach.install	18 Nov 2007 21:28:46 -0000	1.11
+++ contrib/image_attach/image_attach.install	7 Dec 2007 02:25:47 -0000
@@ -1,31 +1,42 @@
 <?php
 // $Id: image_attach.install,v 1.11 2007/11/18 21:28:46 drewish Exp $
 
-function image_attach_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      db_query("CREATE TABLE {image_attach} (
-        nid int(10) unsigned NOT NULL default '0',
-        iid int(10) unsigned NOT NULL default '0',
-        PRIMARY KEY  (nid),
-        KEY (iid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
+/**
+ * Implementation of hook_schema().
+ */
+function image_attach_schema() {
+  $schema['image_attach'] = array(
+    'description' => t('Stores the image/node relationship.'),
+    'fields' => array(
+      'nid' => array(
+        'description' => t('Primary Key: The {node}.nid of the node.'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'iid' => array(
+        'description' => t('TODO'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+  );
+  return $schema;
+}
 
-    case 'pgsql':
-      db_query("CREATE TABLE {image_attach} (
-        nid integer NOT NULL default '0',
-        iid integer NOT NULL default '0',
-        PRIMARY KEY (nid)
-      )");
-      db_query("CREATE INDEX {image_attach}_iid_idx ON {image_attach}(iid)");
-      break;
-  }
+/**
+ * Implementation of hook_install().
+ */
+function image_attach_install() {
+  drupal_install_schema('image_attach');
 }
 
+/**
+ * Implementation of hook_uninstall().
+ */
 function image_attach_uninstall() {
-  db_query('DROP TABLE {image_attach}');
+  drupal_uninstall_schema('image_attach');
   variable_del('image_attach_existing');
   variable_del('image_attach_block_0_size');
 }
@@ -56,11 +67,11 @@ function image_attach_update_2() {
   switch ($GLOBALS['db_type']) {
     case 'mysqli':
     case 'mysql':
-      $ret[] = update_sql("DELETE FROM {image_attach} USING {image_attach} LEFT JOIN {node} n ON {image_attach}.iid = n.nid WHERE n.nid IS NULL OR n.type != 'image'");
+      $ret[] = update_sql("DELETE FROM {image_attach} USING {image_attach} LEFT JOIN {node} n ON {image_attach}.iid = n.nid WHERE n.nid IS NULL OR n.type <> 'image'");
       break;
 
     case 'pgsql':
-      $ret[] = update_sql("DELETE FROM {image_attach} USING {node} n WHERE {image_attach}.iid = n.nid AND (n.nid IS NULL OR n.type != 'image')");
+      $ret[] = update_sql("DELETE FROM {image_attach} USING {node} n WHERE {image_attach}.iid = n.nid AND (n.nid IS NULL OR n.type <> 'image')");
       break;
   }
   return $ret;
Index: contrib/image_attach/image_attach.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_attach/image_attach.module,v
retrieving revision 1.32
diff -u -p -r1.32 image_attach.module
--- contrib/image_attach/image_attach.module	18 Nov 2007 21:28:46 -0000	1.32
+++ contrib/image_attach/image_attach.module	7 Dec 2007 02:25:47 -0000
@@ -10,8 +10,8 @@ define('IMAGE_ATTACH_HIDDEN', 'hidden');
 /**
  * Implementation of hook_help().
  */
-function image_attach_help($section) {
-  switch ($section) {
+function image_attach_help($path, $arg) {
+  switch ($path) {
     case 'admin/settings/modules#description':
       return t('Allows easy attaching of image nodes to other content types.');
   }
@@ -20,27 +20,23 @@ function image_attach_help($section) {
 /**
  * Implementation of hook_menu()
  */
-function image_attach_menu($may_cache) {
+function image_attach_menu() {
   $items = array();
 
-  if ($may_cache) {
-      $items[] = array(
-        'path' => 'image_attach',
-        'title' => t('Image Attachment View'),
-        'callback' => 'image_attach_view_image',
-        'access' => user_access('access content'),
-        'type' => MENU_CALLBACK,
-      );
-      $items[] = array(
-        'path' => 'admin/settings/image_attach',
-        'title' => t('Image attach'),
-        'description' => t('Enable image attach for content'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('image_attach_admin_settings'),
-        'access' => user_access('administer site configuration'),
-        'type' => MENU_NORMAL_ITEM,
-      );
-  }
+  $items['image_attach'] = array(
+    'title' => 'Image Attachment View',
+    'page callback' => 'image_attach_view_image',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/settings/image_attach'] = array(
+    'title' => 'Image attach',
+    'description' => 'Enable image attach for content',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('image_attach_admin_settings'),
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+  );
   return $items;
 }
 
@@ -84,7 +80,7 @@ function image_attach_block($op = 'list'
               $img = image_display($image, variable_get('image_attach_block_0_size', IMAGE_THUMBNAIL));
               return array(
                 'subject' => t('Attached Images'),
-                'content' => l($img, "node/$node->iid", array(), NULL, NULL, FALSE, TRUE),
+                'content' => l($img, "node/$node->iid", array('html' => TRUE)),
               );
             }
           }
@@ -122,7 +118,7 @@ function image_attach_block($op = 'list'
 /**
  * implementation of hook_form_alter()
  */
-function image_attach_form_alter($form_id, &$form) {
+function image_attach_form_alter(&$form, $form_state, $form_id) {
   // Content type settings form.
   if ($form_id == 'node_type_form' && $form['#node_type']->type != 'image') {
     _image_check_settings();
@@ -433,6 +429,20 @@ function image_attach_views_handler_filt
 }
 
 /**
+ * Implementation of hook_theme() registry.
+ **/
+function image_attach_theme() {
+  return array(
+    'image_attach_teaser' => array(
+      'arguments' => array($node),
+    ),
+    'image_attach_body' => array(
+      'arguments' => array($node),
+    ),
+  );
+}
+
+/**
  * Theme the teaser.
  *
  * Override this in template.php to include a case statement if you want different node types to appear differently.
@@ -452,7 +462,7 @@ function theme_image_attach_teaser($node
     $info = image_get_info(file_create_path($image->images[$img_size]));
 
     $output = '<div style="width: '. $info['width'] .'px" class="image-attach-teaser">';
-    $output .= l(image_display($image, $img_size), "node/$node->nid", array(), NULL, NULL, FALSE, TRUE);
+    $output .= l(image_display($image, $img_size), "node/$node->nid", array('html' => TRUE));
     $output .= '</div>'."\n";
 
     return $output;
@@ -476,7 +486,7 @@ function theme_image_attach_body($node) 
     $info = image_get_info(file_create_path($image->images[$img_size]));
 
     $output = '<div style="width: '. $info['width'] .'px" class="image-attach-body">';
-    $output .= l(image_display($image, $img_size), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
+    $output .= l(image_display($image, $img_size), "node/$node->iid", array('html' => TRUE));
     $output .= '</div>'."\n";
 
     return $output;
Index: contrib/image_gallery/image_gallery.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_gallery/image_gallery.info,v
retrieving revision 1.4
diff -u -p -r1.4 image_gallery.info
--- contrib/image_gallery/image_gallery.info	18 Jul 2007 17:04:31 -0000	1.4
+++ contrib/image_gallery/image_gallery.info	7 Dec 2007 02:25:47 -0000
@@ -2,5 +2,6 @@
 name = Image Gallery
 description = Allows sorting and displaying of image galleries based on categories.
 package = Image
-dependencies = image taxonomy
-
+dependencies[] = image
+dependencies[] = taxonomy
+core = 6.x
Index: contrib/image_gallery/image_gallery.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_gallery/image_gallery.module,v
retrieving revision 1.20
diff -u -p -r1.20 image_gallery.module
--- contrib/image_gallery/image_gallery.module	7 Sep 2007 19:26:24 -0000	1.20
+++ contrib/image_gallery/image_gallery.module	7 Dec 2007 02:25:47 -0000
@@ -1,8 +1,8 @@
 <?php
 // $Id: image_gallery.module,v 1.20 2007/09/07 19:26:24 drewish Exp $
 
-function image_gallery_help($section) {
-  switch ($section) {
+function image_gallery_help($path, $arg) {
+  switch ($path) {
     case 'admin/image':
       return '<p>'. t('Image galleries can be used to organize and present groups of images. Galleries may be nested. To add a new gallery click the "add gallery" tab.') .'</p>';
   }
@@ -12,55 +12,49 @@ function image_gallery_perm() {
   return array('administer images');
 }
 
-function image_gallery_menu($may_cache) {
+function image_gallery_menu() {
   $items = array();
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'image',
-      'title' => t('Image galleries'),
-      'access' => user_access('access content'),
-      'type' => MENU_SUGGESTED_ITEM,
-      'callback' => 'image_gallery_page',
-    );
-    $items[] = array(
-      'path' => 'admin/content/image',
-      'title' => t('Image galleries'),
-      'access' => user_access('administer images'),
-      'callback' => 'image_gallery_admin',
-      'description' => t('Create and manage image galleries.'),
-    );
-    $items[] = array(
-      'path' => 'admin/content/image/list',
-      'title' => t('List'),
-      'access' => user_access('administer images'),
-      'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10,
-    );
-    $items[] = array(
-      'path' => 'admin/content/image/add',
-      'title' => t('Add gallery'),
-      'access' => user_access('administer images'),
-      'callback' => 'image_gallery_admin_add',
-      'type' => MENU_LOCAL_TASK,
-    );
-    $items[] = array(
-      'path' => 'admin/settings/image_gallery',
-      'title' => t('Image gallery'),
-      'access' => user_access('administer site configuration'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('image_gallery_admin_settings'),
-      'description' => t('Configure appearance of image galleries.'),
-    );
-  }
-  elseif (is_numeric(arg(4))) {
+  $items['image'] = array(
+    'title' => 'Image galleries',
+    'access arguments' => array('access content'),
+    'type' => MENU_SUGGESTED_ITEM,
+    'page callback' => 'image_gallery_page',
+  );
+  $items['admin/content/image'] = array(
+    'title' => 'Image galleries',
+    'access arguments' => array('administer images'),
+    'page callback' => 'image_gallery_admin',
+    'description' => 'Create and manage image galleries.',
+  );
+  $items['admin/content/image/list'] = array(
+    'title' => 'List',
+    'access arguments' => array('administer images'),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -10,
+  );
+  $items['admin/content/image/add'] = array(
+    'title' => 'Add gallery',
+    'access arguments' => array('administer images'),
+    'page callback' => 'image_gallery_admin_add',
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/settings/image_gallery'] = array(
+    'title' => 'Image gallery',
+    'access arguments' => array('administer site configuration'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('image_gallery_admin_settings'),
+    'description' => 'Configure appearance of image galleries.',
+  );
+  // TODO: I've no idea if this is correct.
+  if (is_numeric(arg(4))) {
     $term = taxonomy_get_term(arg(4));
     if ($term) {
-      $items[] = array(
-        'path' => 'admin/content/image/edit',
-        'title' => t('Edit image gallery'),
-        'callback' => 'image_gallery_admin_add',
-        'callback arguments' => array((array)$term),
-        'access' => user_access('administer images'),
+      $items['admin/content/image/edit'] = array(
+        'title' => 'Edit image gallery',
+        'page callback' => 'image_gallery_admin_add',
+        'page arguments' => array((array)$term),
+        'access arguments' => array('administer images'),
         'type' => MENU_CALLBACK,
       );
     }
@@ -114,21 +108,21 @@ function image_gallery_nodeapi(&$node, $
     case 'view':
       if ($page && !$teaser && $node->type == 'image') {
         $vid = _image_gallery_get_vid();
-        $terms = taxonomy_node_get_terms_by_vocabulary($node->nid, $vid);
+        $terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
         $term = array_pop($terms);
         if ($term) {
-          $vocabulary = taxonomy_get_vocabulary($vid);
+          $vocabulary = taxonomy_vocabulary_load($vid);
           // Breadcrumb navigation
           $breadcrumb = array();
-          $breadcrumb[] = array('path' => 'image', 'title' => $vocabulary->name);
+          $breadcrumb[] = l(t('Home'), NULL);
+          $breadcrumb[] = l($vocabulary->name, 'image');
           if ($parents = taxonomy_get_parents_all($term->tid)) {
             $parents = array_reverse($parents);
-            foreach ($parents as $p) {
-              $breadcrumb[] = array('path' => 'image/tid/'. $p->tid, 'title' => $p->name);
+            foreach ($parents as $parent) {
+              $breadcrumb[] = l($parent->name, 'image/tid/'. $parent->tid);
             }
           }
-          $breadcrumb[] = array('path' => 'node/'. $node->nid);
-          menu_set_location($breadcrumb);
+          drupal_set_breadcrumb($breadcrumb);
         }
       }
       break;
@@ -147,7 +141,7 @@ function image_gallery_page($type = NULL
     // The values of $descendant_tids should be safe for raw inclusion in the
     // SQL since they're all loaded from integer fields in the database.
     $sql = 'SELECT n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. implode(',', $descendant_tids) .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
-    if ($nid = db_result(db_query_range(db_rewrite_sql($sql), 0, 1))) {
+    if ($nid = db_result(db_query_range(db_rewrite_sql($sql)))) {
       $galleries[$i]->latest = node_load(array('nid' => $nid));
     }
   }
@@ -162,15 +156,17 @@ function image_gallery_page($type = NULL
     $gallery = taxonomy_get_term($tid);
     $parents = taxonomy_get_parents($tid);
     foreach ($parents as $parent) {
-      $breadcrumb[] = array('path' => 'image/tid/'. $parent->tid, 'title' => $parent->name);
+      // Breadcrumb navigation
+      $breadcrumb = array();
+      $breadcrumb[] = l(t('Home'), NULL);
+      $breadcrumb[] = l($parent->name, 'image/tid/'. $parent->tid);
     }
-    $breadcrumb[] = array('path' => 'image', 'title' => t('Image galleries'));
+    $breadcrumb[] = l(t('Image galleries'), 'image');
     $breadcrumb = array_reverse($breadcrumb);
     drupal_set_title($gallery->name);
   }
 
-  $breadcrumb[] = array('path' => $_GET['q']);
-  menu_set_location($breadcrumb);
+  drupal_set_breadcrumb($breadcrumb);
   $content = theme('image_gallery', $galleries, $images);
   return $content;
 }
@@ -249,22 +245,22 @@ function image_gallery_admin_form($edit 
       '#value' => $edit['tid'],
     );
   }
-
-  $form['#base'] = 'image_gallery_admin';
+  $form['#submit'][] = 'image_gallery_admin_submit';
+  $form['#theme'][] = 'image_gallery_admin';
   return $form;
 }
 
-function image_gallery_admin_submit($form_id, $form_values) {
-  $status = taxonomy_save_term($form_values);
+function image_gallery_admin_submit($form, &$form_state) {
+  $status = taxonomy_save_term($form_state['values']);
   switch ($status) {
     case SAVED_NEW:
-      drupal_set_message(t('Created new gallery %term.', array('%term' => $form_values['name'])));
+      drupal_set_message(t('Created new gallery %term.', array('%term' => $form_state['values']['name'])));
       break;
     case SAVED_UPDATED:
-      drupal_set_message(t('The gallery %term has been updated.', array('%term' => $form_values['name'])));
+      drupal_set_message(t('The gallery %term has been updated.', array('%term' => $form_state['values']['name'])));
       break;
     case SAVED_DELETED:
-      drupal_set_message(t('The gallery %term has been deleted.', array('%term' => $form_values['name'])));
+      drupal_set_message(t('The gallery %term has been deleted.', array('%term' => $form_state['values']['name'])));
       break;
   }
   return 'admin/content/image';
@@ -279,9 +275,9 @@ function image_gallery_confirm_delete($t
   return confirm_form($form, t('Are you sure you want to delete the image gallery %name?', array('%name' => $term->name)), 'admin/content/image', t('Deleting an image gallery will delete all sub-galleries. This action cannot be undone.'), t('Delete'), t('Cancel'));
 }
 
-function image_gallery_confirm_delete_submit($form_id, $form_values) {
-  taxonomy_del_term($form_values['tid']);
-  drupal_set_message(t('The image gallery %term and all sub-galleries have been deleted.', array('%term' => $form_values['name'])));
+function image_gallery_confirm_delete_submit($form, &$form_state) {
+  taxonomy_del_term($form_state['values']['tid']);
+  drupal_set_message(t('The image gallery %term and all sub-galleries have been deleted.', array('%term' => $form_state['values']['name'])));
 
   return 'admin/content/image';
 }
@@ -326,6 +322,20 @@ function _image_gallery_parent_select($t
 }
 
 /**
+ * Implementation of hook_theme() registry.
+ **/
+function image_gallery_theme() {
+  return array(
+    'image_gallery' => array(
+      'arguments' => array($galleries, $images),
+    ),
+    'image_gallery_img' => array(
+      'arguments' => array($image, $size),
+    ),
+  );
+}
+
+/**
  * Theme a gallery page
  */
 function theme_image_gallery($galleries, $images) {
@@ -364,7 +374,7 @@ function theme_image_gallery($galleries,
     $content .= $pager;
   }
 
-  If (count($images) + count($galleries) == 0) {
+  if (count($images) + count($galleries) == 0) {
       $content .= '<p class="count">'. format_plural(0, 'There is 1 image in this gallery', 'There are @count images in this gallery') ."</p>\n";
   }
 
Index: contrib/image_im_advanced/image_im_advanced.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_im_advanced/image_im_advanced.info,v
retrieving revision 1.1
diff -u -p -r1.1 image_im_advanced.info
--- contrib/image_im_advanced/image_im_advanced.info	26 Aug 2007 21:30:02 -0000	1.1
+++ contrib/image_im_advanced/image_im_advanced.info	7 Dec 2007 02:25:47 -0000
@@ -2,3 +2,4 @@
 name = ImageMagick Advanced Options
 description = Adds advanced options to the ImageMagick image toolkit.
 package = Image
+core = 6.x
Index: contrib/image_im_advanced/image_im_advanced.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_im_advanced/image_im_advanced.module,v
retrieving revision 1.3
diff -u -p -r1.3 image_im_advanced.module
--- contrib/image_im_advanced/image_im_advanced.module	27 Aug 2007 15:03:41 -0000	1.3
+++ contrib/image_im_advanced/image_im_advanced.module	7 Dec 2007 02:25:47 -0000
@@ -24,7 +24,7 @@ function image_im_advanced_options() {
  *
  * Add options to the Image toolkit settings form.
  */
-function image_im_advanced_form_alter($form_id, &$form) {
+function image_im_advanced_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'system_image_toolkit_settings' && 'imagemagick' == image_get_toolkit()) {
     $options = image_im_advanced_options();
 
@@ -158,7 +158,7 @@ function image_im_advanced_imagemagick_a
       // Add sharpening filter.
       if ($options['unsharp']['amount'] && $options['unsharp']['radius']) {
         // 0.7 and 0.02 are reasonable values for Sigma and Threshold.
-        $args['unsharp'] = '-unsharp ' . $options['unsharp']['radius'] . 'x0.7+' . round($options['unsharp']['amount'] / 100, 2) . '+0.02';
+        $args['unsharp'] = '-unsharp '. $options['unsharp']['radius'] .'x0.7+'. round($options['unsharp']['amount'] / 100, 2) .'+0.02';
       }
       break;
 
@@ -177,7 +177,7 @@ function image_im_advanced_imagemagick_a
 
   // Convert to specified color profile.
   if (!empty($options['profile']['path']) && is_readable($options['profile']['path'])) {
-    $args['profile'] = '-profile ' . $options['profile']['path'];
+    $args['profile'] = '-profile '. $options['profile']['path'];
   }
 
   // Assign a color space. Skip this if a color profile has been provided,
@@ -195,7 +195,7 @@ function image_im_advanced_imagemagick_a
   // Set JPEG quality.
   if ($image['mime_type'] == 'image/jpeg') {
     if (empty($args['quality']) && $options['jpeg_quality']) {
-      $args['quality'] = '-quality ' . $options['jpeg_quality'];
+      $args['quality'] = '-quality '. $options['jpeg_quality'];
     }
   }
 
Index: contrib/image_import/image_import.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_import/image_import.info,v
retrieving revision 1.3
diff -u -p -r1.3 image_import.info
--- contrib/image_import/image_import.info	18 Jul 2007 17:04:37 -0000	1.3
+++ contrib/image_import/image_import.info	7 Dec 2007 02:25:47 -0000
@@ -2,5 +2,6 @@
 name = Image Import
 description = Allows batches of images to be imported from a directory on the server.
 package = Image
-dependencies = image
+dependencies[] = image
+core = 6.x
 
Index: contrib/image_import/image_import.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_import/image_import.module,v
retrieving revision 1.11
diff -u -p -r1.11 image_import.module
--- contrib/image_import/image_import.module	24 Jul 2007 17:33:42 -0000	1.11
+++ contrib/image_import/image_import.module	7 Dec 2007 02:25:47 -0000
@@ -4,8 +4,8 @@
 /**
  * Implementation of hook_help().
  */
-function image_import_help($section = '') {
-  switch ($section) {
+function image_import_help($path, $arg) {
+  switch ($path) {
     case 'admin/content/image_import':
       $output = '<p>'. t("Import multiple image files and save them as image nodes. The files will be moved from their location into the image module's files directory. ")
         . t("Searching for image files in %dirpath.", array('%dirpath' => realpath(variable_get('image_import_path', '')))) .'</p>';
@@ -27,28 +27,25 @@ function image_import_perm() {
 /**
  * Implementation of hook_menu().
  */
-function image_import_menu($may_cache) {
+function image_import_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/content/image_import',
-      'title' => t('Image import'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('image_import_form'),
-      'access' => user_access('import images'),
-      'type' => MENU_NORMAL_ITEM,
-      'description' => t('Import images from the filesystem.')
-    );
-    $items[] = array(
-      'path' => 'admin/settings/image_import',
-      'title' => t('Image import'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('image_import_admin_settings'),
-      'access' => user_access('administer site configuration'),
-      'type' => MENU_NORMAL_ITEM,
-      'description' => t('Change settings for the Image Import module.')
-    );
-  }
+  
+  $items['admin/content/image_import'] = array(
+    'title' => 'Image import',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('image_import_form'),
+    'access arguments' => array('import images'),
+    'type' => MENU_NORMAL_ITEM,
+    'description' => 'Import images from the filesystem.',
+  );
+  $items['admin/settings/image_import'] = array(
+    'title' => 'Image import',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('image_import_admin_settings'),
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+    'description' => 'Change settings for the Image Import module.',
+  );
 
   return $items;
 }
@@ -67,11 +64,11 @@ function image_import_form() {
 
   if ($files) {
     if (module_exists('taxonomy')) {
-      // here's a little hack to get the taxonmy controls onto our form
+      // here's a little hack to get the taxonomy controls onto our form
       $form['type'] = array('#type' => 'value', '#value' => 'image');
       $form['#node'] = new stdClass();
       $form['#node']->type = 'image';
-      taxonomy_form_alter('image_node_form', $form);
+      taxonomy_form_alter(&$form, $form_state, 'image_node_form');
       unset($form['type']);
       unset($form['#node']);
     }
@@ -146,6 +143,17 @@ function image_import_form() {
   return $form;
 }
 
+/**
+ * Implementation of hook_theme() registry.
+ **/
+function image_import_form_theme() {
+  return array(
+    'image_import_form' => array(
+      'arguments' => array($form),
+    ),
+  );
+}
+
 function theme_image_import_form($form) {
   $output = '';
   if (isset($form['import_file']) && $form['import_file']['#type'] == 'checkboxes') {
@@ -168,27 +176,27 @@ function theme_image_import_form($form) 
   return $output . drupal_render($form);
 }
 
-function image_import_form_submit($form_id, $form_values) {
-  $op = isset($form_values['op']) ? $form_values['op'] : '';
+function image_import_form_submit($form, &$form_state) {
+  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
   if ($op == t('Import')) {
     $dirpath = variable_get('image_import_path', '');
     if (file_check_directory($dirpath)) {
       $nodes = array();
       $files = array();
-      foreach (array_filter($form_values['import_file']) as $index) {
+      foreach (array_filter($form_state['values']['import_file']) as $index) {
         // try to avoid php's script timeout with a bunch of large files or
         // a slow machine
         if (!ini_get('safe_mode')) {
           set_time_limit(0);
         }
-        $origname = $form_values['file_list'][$index];
+        $origname = $form_state['values']['file_list'][$index];
         $filename = file_check_location($dirpath .'/'. $origname, $dirpath);
         if ($filename) {
           $node = image_create_node_from(
             $filename,
-            $form_values['title'][$index],
-            $form_values['body'][$index],
-            $form_values['taxonomy']
+            $form_state['values']['title'][$index],
+            $form_state['values']['body'][$index],
+            $form_state['values']['taxonomy']
           );
 
           if ($node) {
