You are here

function iek_get_overlays in Image effect kit 7

Same name and namespace in other branches
  1. 8 iek.module \iek_get_overlays()

Gets a list of available image overlays.

Parameters

string $overlay_name: A overlay name if you just want to get a particular image overlay. Leaves empty if you want to get all available overlays.

Return value

array Particular overlays if the 'overlay_name' is given. All available overlays otherwise.

2 calls to iek_get_overlays()
iek_gd_overlay in ./iek.gd.inc
Add a overlay on an image by using the GD toolkit.
iek_image_overlay_form in ./iek.module
Effect configuration form for iek_image_overlay.

File

./iek.module, line 1272
Primarily Drupal hooks and global API functions to manipulate image styles.

Code

function iek_get_overlays($overlay_name = '') {
  $overlays = module_invoke_all('iek_overlay');

  // Invoke hook_iek_overlay_alter().
  // To allow all modules to alter the overlays.
  drupal_alter('iek_overlay', $overlays);
  if (!empty($overlay_name)) {
    foreach ($overlays as $item1) {
      foreach ($item1['children'] as $item2) {
        if ($item2['name'] == $overlay_name) {
          return $item2;
        }
      }
    }
  }
  return $overlays;
}