You are here

function node_gallery_images_check_update in Node Gallery 6.2

Same name and namespace in other branches
  1. 6.3 node_gallery.pages.inc \node_gallery_images_check_update()

Check if we need to update this image;

Parameters

unknown_type $old_image:

unknown_type $new_image:

unknown_type $compare_fields:

Return value

unknown

1 call to node_gallery_images_check_update()
node_gallery_images_edit_submit in ./node_gallery.pages.inc

File

./node_gallery.pages.inc, line 620
Node gallery pages.

Code

function node_gallery_images_check_update($old_image, $new_image, $compare_fields) {
  foreach ($compare_fields as $f) {

    //a hack for cck field validate;
    if (module_exists('content')) {
      if (is_array($new_image->{$f})) {
        foreach ($new_image->{$f} as &$ff) {
          if (is_array($ff)) {
            unset($ff['_error_element']);
          }
        }
      }
    }
    if ($new_image->{$f} != $old_image->{$f}) {
      return TRUE;
    }
  }
  return FALSE;
}