diff --git a/cambridge.info b/cambridge.info index a998c83b267db39391a4091e58a2104056fd511c..58788aea4025d7b2ea5554172e62d7f676cd277e 100644 --- a/cambridge.info +++ b/cambridge.info @@ -34,6 +34,7 @@ dependencies[] = admin_menu dependencies[] = admin_menu_toolbar dependencies[] = advanced_help dependencies[] = date +dependencies[] = imagecrop dependencies[] = link dependencies[] = pathauto dependencies[] = php diff --git a/cambridge.install b/cambridge.install index 2473ef730754b23223d1a82829043556c1239b87..19caed39622d3bffa1b046aed06dc557f7235942 100644 --- a/cambridge.install +++ b/cambridge.install @@ -16,4 +16,90 @@ function cambridge_install() { require_once 'cambridge_lite.install'; cambridge_lite_install(); + + // Set some sensible defaults for the Image javascript crop module. + + variable_set('imagecrop_popup', 'imagecrop_iframe'); + variable_set('imagecrop_scale_default', 1); + variable_set('imagecrop_show_cancel_button', 1); + variable_set('imagecrop_ui_controls', 1); + + // Replace standard scaling/cropping image style effects and replace them with a Javascript crop effect. + + $carousel = image_style_load('carousel'); + foreach ($carousel['effects'] as $effect) { + image_effect_delete($effect); + } + + image_effect_save( + array( + 'name' => 'imagecrop_javascript', + 'data' => array( + 'width' => 885, + 'height' => 432, + 'xoffset' => 'center', + 'yoffset' => 'center', + 'resizable' => 0, + 'downscaling' => 0, + 'aspect_ratio' => 'CROP', + 'disable_if_no_data' => 0, + ), + 'isid' => $carousel['isid'], + 'weight' => 0, + ) + ); + + $instance = field_info_instance('node', 'field_carousel_image', 'carousel_item'); + $instance['settings']['imagecrop'] = array('carousel' => 'carousel', 'leading' => 0, 'inline' => 0); + field_update_instance($instance); + + $leading = image_style_load('leading'); + foreach ($leading['effects'] as $effect) { + image_effect_delete($effect); + } + + image_effect_save( + array( + 'name' => 'imagecrop_javascript', + 'data' => array( + 'width' => 590, + 'height' => 288, + 'xoffset' => 'center', + 'yoffset' => 'center', + 'resizable' => 0, + 'downscaling' => 0, + 'aspect_ratio' => 'CROP', + 'disable_if_no_data' => 0, + ), + 'isid' => $leading['isid'], + 'weight' => 0, + ) + ); + + $instance = field_info_instance('node', 'field_leading_image', 'page'); + $instance['settings']['imagecrop'] = array('leading' => 'leading', 'carousel' => 0, 'inline' => 0); + field_update_instance($instance); + + $inline = image_style_load('inline'); + foreach ($inline['effects'] as $effect) { + image_effect_delete($effect); + } + + image_effect_save( + array( + 'name' => 'imagecrop_javascript', + 'data' => array( + 'width' => 250, + 'height' => 250, + 'xoffset' => 'center', + 'yoffset' => 'center', + 'resizable' => 0, + 'downscaling' => 0, + 'aspect_ratio' => 'CROP', + 'disable_if_no_data' => 0, + ), + 'isid' => $inline['isid'], + 'weight' => 0, + ) + ); } diff --git a/cambridge.make b/cambridge.make index 896757ed35e2db1d9e9877ee453ce05f9c455939..5a809f435bd1c7258c7364bf246da77ef9e8f462 100644 --- a/cambridge.make +++ b/cambridge.make @@ -11,3 +11,4 @@ projects[context] = "3.0-beta7" projects[date] = "2.6" projects[easy_breadcrumb] = "2.7" projects[google_analytics] = "1.3" +projects[imagecrop] = "1.0-rc3"