You are here

function _textimage_background_image_list in Textimage 7.3

Returns an array of files with image extensions in the specified directory.

Parameters

string $images_dir: URL of the images directory.

Return value

array Array of image files.

1 call to _textimage_background_image_list()
textimage_background_effect_form in effects/textimage_background.inc
Settings for 'textimage_background' image effect.

File

effects/textimage_background.inc, line 675
Implementation of the 'textimage_background' image effect.

Code

function _textimage_background_image_list($images_dir) {
  $filelist = array();
  if (is_dir($images_dir) && ($handle = opendir($images_dir))) {
    while ($file = readdir($handle)) {
      if (preg_match("/\\.gif|\\.png|\\.jpg\$/i", $file) == 1) {
        $filelist[] = $file;
      }
    }
    closedir($handle);
  }
  return $filelist;
}