You are here

function emfield_imagerotator_url in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 deprecated/emfield-deprecated.inc \emfield_imagerotator_url()
  2. 6.2 emfield.module \emfield_imagerotator_url()

Returns the URL to the registered JW Image Rotator, if such exists.

1 call to emfield_imagerotator_url()
emfield_settings in ./emfield.admin.inc
Callback for admin/content/emfield.

File

./emfield.module, line 794
Embedded Media Field is a CCK-based framework for 3rd party media files.

Code

function emfield_imagerotator_url($reset = FALSE) {
  static $path;
  if (is_null($path) || $reset) {
    if (is_null($path = variable_get('emfield_imagerotator_url', NULL)) || !$path && $reset) {
      global $base_path;
      $path = '';
      $files = drupal_system_listing('(^imagerotator\\.swf$)', 'plugins', 'basename', 0);
      if (!empty($files)) {
        $file = array_pop($files);
        $path = $file->filename;
      }
      else {
        $files = drupal_system_listing('(^imagerotator\\.swf$)', 'modules', 'basename', 0);
        if (!empty($files)) {
          $file = array_pop($files);
          $path = $file->filename;
        }
      }
      variable_set('emfield_imagerotator_url', $path);
    }
  }
  return $path;
}