function image_effect_definition_load

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.
4 calls to image_effect_definition_load()
image_effects in modules/image/image.module
Loads all image effects from the database.
image_help in modules/image/image.module
Implements hook_help().
image_styles in modules/image/image.module
Gets an array of all styles and their settings.
image_style_form_add_submit in modules/image/image.admin.inc
Submit handler for adding a new image effect to an image style.

File

modules/image/image.module, line 1296

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.