function image_effects

Load all image effects from the database.

@todo Remove after moving/resolving the todo.

Return value

An array of all image effects.

See also

image_effect_load()

1 string reference to 'image_effects'
image_update_8001 in drupal/core/modules/image/image.install
Remove the {image_styles} and {image_effects} tables.

File

drupal/core/modules/image/image.module, line 974
Exposes global functionality for creating image styles.

Code

function image_effects() {
  $effects =& drupal_static(__FUNCTION__);
  if (!isset($effects)) {
    $effects = array();

    // Add database image effects.
    // @todo Strictly speaking, this is obsolete. However, it demonstrates a
    //   use-case for retrieving/listing configuration objects using a wildcard
    //   within the name (instead of only the suffix).
    $result = db_select('image_effects', NULL, array(
      'fetch' => PDO::FETCH_ASSOC,
    ))
      ->fields('image_effects')
      ->orderBy('image_effects.weight', 'ASC')
      ->execute();
    foreach ($result as $effect) {
      $effect['data'] = unserialize($effect['data']);
      $definition = image_effect_definition_load($effect['name']);

      // Do not load image effects whose definition cannot be found.
      if ($definition) {
        $effect = array_merge($definition, $effect);
        $effects[$effect['ieid']] = $effect;
      }
    }
  }
  return $effects;
}