You are here

function imagecrop_widget_settings_alter in Image javascript crop 6

Implementation of hook_widget_settings_alter().

File

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

Code

function imagecrop_widget_settings_alter(&$settings, $op, $widget) {

  // Only support modules that implement hook_insert_widgets().
  $widget_type = isset($widget['widget_type']) ? $widget['widget_type'] : $widget['type'];
  if ($widget_type != 'imagefield_widget' && $widget_type != 'image_fupload_imagefield_widget' && $widget_type != 'linkimagefield_widget') {
    return;
  }

  // Add our new options to the list of settings to be saved.
  if ($op == 'save') {
    $settings = array_merge($settings, imagecrop_widget_settings());
  }

  // Add the additional settings to the form.
  if ($op == 'form') {
    $settings = array_merge($settings, imagecrop_widget_form($widget));
  }
}