You are here

function _textimage_image_list in Textimage 5.2

Same name and namespace in other branches
  1. 5 textimage.module \_textimage_image_list()
  2. 6.2 textimage_admin.inc \_textimage_image_list()
  3. 7.2 textimage.admin.inc \_textimage_image_list()

Returns an array of files with jpg, png, and gif extensions in the specified directory.

Parameters

$imagesdir: Full path of the images directory.

Return value

Array of image files.

2 calls to _textimage_image_list()
textimage_preset_edit in ./textimage_admin.inc
textimage_settings_form in ./textimage_admin.inc
@file

File

./textimage_admin.inc, line 861

Code

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