function image_effect_definition_load

image_effect_definition_load($effect, $style_name = NULL)

Loads the definition for an image effect.

The effect definition is a set of core properties for an image effect, not containing any user-settings. The definition defines various functions to call when configuring or executing an image effect. This loader is mostly for internal use within image.module. Use image_effect_load() or image_style_load() to get image effects that contain configuration.

Parameters

$effect: The name of the effect definition to load.

$style: An image style array to which this effect will be added.

Return value

An array containing the image effect definition with the following keys:

  • "effect": The unique name for the effect being performed. Usually prefixed with the name of the module providing the effect.
  • "module": The module providing the effect.
  • "help": A description of the effect.
  • "function": The name of the function that will execute the effect.
  • "form": (optional) The name of a function to configure the effect.
  • "summary": (optional) The name of a theme function that will display a one-line summary of the effect. Does not include the "theme_" prefix.

File

modules/image/image.module, line 1217
Exposes global functionality for creating image styles.

Code

function image_effect_definition_load($effect, $style_name = NULL) {
  $definitions = image_effect_definitions();

  // If a style is specified, do not allow loading of default style
  // effects.
  if (isset($style_name)) {
    $style = image_style_load($style_name, NULL);
    if ($style['storage'] == IMAGE_STORAGE_DEFAULT) {
      return FALSE;
    }
  }

  return isset($definitions[$effect]) ? $definitions[$effect] : FALSE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.module/function/image_effect_definition_load/7.x