This module is fantastic. Thank you for developing it!

Very simple change which allows thickbox alternative to opening a new browser window (note: thickbox module must be installed). The height and width can be adjusted as needed.

function imagecrop_formitem($fid, $weight = 0) {
  $form = array(
    '#type' => 'item',
    '#value' => '<a class="thickbox" href="' . url('imagecrop/showcrop/'. $fid, NULL, NULL, TRUE) . '?height=600&width=600">'. t('Javascript crop') .'</a>',
    '#weight' => $weight,
  );
  return $form;
}

Comments

swortis’s picture

Actually.. use this instead:

function imagecrop_formitem($fid, $weight = 0) {
  $form = array(
    '#type' => 'item',
    '#value' => '<a class="thickbox" href="' . url('imagecrop/showcrop/'. $fid, NULL, NULL, TRUE) . '?KeepThis=true&TB_iframe=true&height=600&width=700">'. t('Javascript crop') .'</a>',
    '#weight' => $weight,
  );
  return $form;
}
swentel’s picture

I've been experimenting with it allready but somehow failed to get it working, I'll try out your code tonight or tomorrow!

swentel’s picture

Status: Active » Fixed

commited to drupal 5 branch, thanks.
*way* cool this feature!

swortis’s picture

My pleasure.

(I'd be delighted to work on some CSS for the module if you need/want help in that department.)

swentel’s picture

CSS needs some cleanup, true. Texts too I think. Definitely for D6, but you're free to submit patches for the D5 version. I'm only going to concentrate on bugs right now for D5.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.