You are here

function imagefield_crop_menu in Imagefield Crop 5

Same name and namespace in other branches
  1. 7.3 imagefield_crop.module \imagefield_crop_menu()

TODO:

o) After changing crop see the old cropped image on preview [Same with imagefield] o) Make the resizing box a little faster (ease on JS code) [NOT NOW] o) Experiencing some segmentation faults (WSOD) [Probably xdebug related] o) Test with imagefield-2.0 [edit existing node loses the image] o) NEW NODE: Uploading a file with existing filename shows the cropped image [??] o) Sometimes we see old file (upload file with exising filename into crop box of existing node. Probably a problem with 'file_create_path' [??]

File

./imagefield_crop.module, line 21

Code

function imagefield_crop_menu($may_cache) {

  // REFACTOR: Maybe this is not needed, if we can use the original imagefield_menu
  if (!$may_cache && $_SESSION['imagefield']) {
    foreach ($_SESSION['imagefield'] as $fieldname => $files) {
      if (is_array($files)) {
        foreach ($files as $delta => $file) {
          if ($file['crop']['preview']) {
            $items[] = array(
              'path' => $file['crop']['preview'],
              'callback' => '_imagefield_crop_cropped_preview',
              'access' => TRUE,
              'type' => MENU_CALLBACK,
            );
          }
        }
      }
    }
  }
  return $items;
}