2009-07-12 08:36:35 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Hooks related to image styles and effects.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup hooks
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-07-23 16:14:41 +00:00
|
|
|
* Alter the information provided in \Drupal\image\Annotation\ImageEffect.
|
2010-09-11 01:54:43 +00:00
|
|
|
*
|
|
|
|
* @param $effects
|
|
|
|
* The array of image effects, keyed on the machine-readable effect name.
|
|
|
|
*/
|
|
|
|
function hook_image_effect_info_alter(&$effects) {
|
2013-07-23 16:14:41 +00:00
|
|
|
// Override the Image module's 'Scale and Crop' effect label.
|
|
|
|
$effects['image_scale_and_crop']['label'] = t('Bangers and Mash');
|
2010-09-11 01:54:43 +00:00
|
|
|
}
|
|
|
|
|
2009-07-12 08:36:35 +00:00
|
|
|
/**
|
|
|
|
* Respond to image style flushing.
|
|
|
|
*
|
|
|
|
* This hook enables modules to take effect when a style is being flushed (all
|
|
|
|
* images are being deleted from the server and regenerated). Any
|
|
|
|
* module-specific caches that contain information related to the style should
|
|
|
|
* be cleared using this hook. This hook is called whenever a style is updated,
|
2010-02-01 07:07:57 +00:00
|
|
|
* deleted, or any effect associated with the style is update or deleted.
|
2009-07-12 08:36:35 +00:00
|
|
|
*
|
2013-07-08 22:37:04 +00:00
|
|
|
* @param \Drupal\image\ImageStyleInterface $style
|
|
|
|
* The image style object that is being flushed.
|
2009-07-12 08:36:35 +00:00
|
|
|
*/
|
|
|
|
function hook_image_style_flush($style) {
|
|
|
|
// Empty cached data that contains information about the style.
|
2012-11-28 21:36:29 +00:00
|
|
|
cache('mymodule')->deleteAll();
|
2009-07-12 08:36:35 +00:00
|
|
|
}
|
2009-10-16 00:52:46 +00:00
|
|
|
|
2009-07-12 08:36:35 +00:00
|
|
|
/**
|
|
|
|
* @} End of "addtogroup hooks".
|
|
|
|
*/
|