You are here

function imagecrop_linkitem in Image javascript crop 5

Same name and namespace in other branches
  1. 6 imagecrop.module \imagecrop_linkitem()
  2. 7 imagecrop.module \imagecrop_linkitem()

Helper function to add click link

Return value

$form form markup

1 call to imagecrop_linkitem()
imagecrop_form_alter in ./imagecrop.module
Implementation of hook_form_alter(). Hook into several existing image modules/fields.

File

./imagecrop.module, line 255
Provides a javascript toolbox through an imagecache action.

Code

function imagecrop_linkitem($fid) {
  if (!module_exists('thickbox')) {
    return '<a href="javascript:;" onclick="window.open(\'' . url('imagecrop/showcrop/' . $fid, NULL, NULL, TRUE) . '\',\'imagecrop\',\'menubar=0,resizable=1,width=700,height=650\');">' . t('Javascript crop') . '</a>';
  }
  else {
    return '<a class="thickbox" href="' . url('imagecrop/showcrop/' . $fid, NULL, NULL, TRUE) . '?KeepThis=true&TB_iframe=true&height=500&width=700">' . t('Javascript crop') . '</a>';
  }
}