t('Resize'), 'descritpion' => t('Resize an image to an exact set of dimensions, ignoring aspect ratio.'), 'function' => 'mymodule_resize_image', 'form' => 'mymodule_resize_form', 'summary' => 'mymodule_resize_summary', 'file' => 'mymodule.actions.inc', ); return $actions; } /** * Respond to preset updating. * * This hook enables modules to take action when a preset is saved by, for * example, updating a module specific variable to reflect a change in the * presets name. * * @param $preset * The preset being updated. * @return * None. */ function hook_image_preset_save($preset) { // If a module defines an image preset and that preset is renamed by the user // the module should update any references to that preset. if (isset($preset['old_name'] && $preset['old_name'] == variable_get('mymodule_image_preset', '')) { variable_set('mymodule_image_preset', $preset['name']); } } /** * Respond to preset deletion. * * This hook enables modules to take action when a preset is being deleted by, * for example, replacing the preset being deleted with another one. * * @param $preset * The preset being deleted. * @return * None. */ function hook_image_preset_delete($preset) { // Administrators can choose an optional replacement preset when deleting. // Update the modules preset variable accordingly. if (isset($preset['old_name'] && $preset['old_name'] == variable_get('mymodule_image_preset', '')) { variable_set('mymodule_image_preset', $preset['name']); } } /** * Respond to preset flushing. * * This hook enables modules to take action when a preset is being flushed by, * for example, emptying any module specific caches that contain information * related to the preset. This hook is called whenever a preset is updated, * deleted, any action associated with the preset is update or deleted, or when * the user selects the preset flush option. * * @param $preset * The preset being flushed. */ function hook_image_preset_flush($preset) { // Empty cached data that contains information about the preset. cache_clear_all('*', 'cache_mymodule', TRUE); } /** * @} End of "addtogroup hooks". */