You are here

function imagecache_action_definitions in ImageCache 5.2

Same name and namespace in other branches
  1. 6.2 imagecache.module \imagecache_action_definitions()

Pull in actions exposed by other modules using hook_imagecache_actions().

Parameters

$reset: Boolean flag indicating whether the cached data should be wiped and recalculated.

Return value

An array of actions to be used when transforming images.

4 calls to imagecache_action_definitions()
imagecache_action_definition in ./imagecache.module
imagecache_ui_action_form in ./imagecache_ui.module
imagecache_ui_preset_form in ./imagecache_ui.module
_imagecache_apply_action in ./imagecache.module

File

./imagecache.module, line 148
Dynamic image resizer and image cacher.

Code

function imagecache_action_definitions($reset = false) {
  static $actions;
  if (!isset($actions) || $reset) {
    if (!$reset && ($cache = cache_get('imagecache_actions')) && !empty($cache->data)) {
      $actions = unserialize($cache->data);
    }
    else {
      foreach (module_implements('imagecache_actions') as $module) {
        foreach (module_invoke($module, 'imagecache_actions') as $key => $action) {
          $action['module'] = $module;
          if ($action['file']) {
            $action['file'] = drupal_get_path('module', $action['module']) . '/' . $action['file'];
          }
          $actions[$key] = $action;
        }
      }
      uasort($actions, '_imagecache_definitions_sort');
      cache_set('imagecache_actions', 'cache', serialize($actions));
    }
  }
  return $actions;
}