annotate core/modules/image/image.api.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /**
Chris@0 4 * @file
Chris@0 5 * Hooks related to image styles and effects.
Chris@0 6 */
Chris@0 7
Chris@0 8 /**
Chris@0 9 * @addtogroup hooks
Chris@0 10 * @{
Chris@0 11 */
Chris@0 12
Chris@0 13 /**
Chris@0 14 * Alter the information provided in \Drupal\image\Annotation\ImageEffect.
Chris@0 15 *
Chris@0 16 * @param $effects
Chris@0 17 * The array of image effects, keyed on the machine-readable effect name.
Chris@0 18 */
Chris@0 19 function hook_image_effect_info_alter(&$effects) {
Chris@0 20 // Override the Image module's 'Scale and Crop' effect label.
Chris@0 21 $effects['image_scale_and_crop']['label'] = t('Bangers and Mash');
Chris@0 22 }
Chris@0 23
Chris@0 24 /**
Chris@0 25 * Respond to image style flushing.
Chris@0 26 *
Chris@0 27 * This hook enables modules to take effect when a style is being flushed (all
Chris@0 28 * images are being deleted from the server and regenerated). Any
Chris@0 29 * module-specific caches that contain information related to the style should
Chris@0 30 * be cleared using this hook. This hook is called whenever a style is updated,
Chris@0 31 * deleted, or any effect associated with the style is update or deleted.
Chris@0 32 *
Chris@0 33 * @param \Drupal\image\ImageStyleInterface $style
Chris@0 34 * The image style object that is being flushed.
Chris@0 35 */
Chris@0 36 function hook_image_style_flush($style) {
Chris@0 37 // Empty cached data that contains information about the style.
Chris@0 38 \Drupal::cache('mymodule')->deleteAll();
Chris@0 39 }
Chris@0 40
Chris@0 41 /**
Chris@0 42 * @} End of "addtogroup hooks".
Chris@0 43 */