You are here

function imagecrop_jquery_dialog in Image javascript crop 7

Render the imagecrop links for jquery ui dialog.

3 string references to 'imagecrop_jquery_dialog'
imagecrop_linkitem in ./imagecrop.module
Helper function to add the imagecrop button.
imagecrop_process_form_element in ./imagecrop.module
Process function for imagecrop-enabled fields.
imagecrop_settings_form in includes/imagecrop.admin.inc
General settings form from the imagecrop module.

File

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

Code

function imagecrop_jquery_dialog($url, $width, $height, $text, $style, &$element) {
  $element['#attached']['library'][] = array(
    'system',
    'ui.dialog',
  );
  $element['#attached']['js'][] = drupal_get_path('module', 'imagecrop') . '/js/dialog.js';
  if (!empty($style)) {
    preg_match('/style="(.*?)"/', $style, $style_contents);
    $style = isset($style_contents[1]) ? $style_contents[1] : '';
  }
  return l($text, $url, array(
    'attributes' => array(
      'class' => 'imagecrop-button button',
      'title' => t('Crop image'),
      'style' => $style,
    ),
  ));
}