function _textimage_image_list in Textimage 7.2
Same name and namespace in other branches
- 5.2 textimage_admin.inc \_textimage_image_list()
- 5 textimage.module \_textimage_image_list()
- 6.2 textimage_admin.inc \_textimage_image_list()
Returns an array of files with jpg, png, and gif extensions.
From a specified directory.
Parameters
string $imagesdir: Full path of the images directory.
Return value
array Array of image files.
2 calls to _textimage_image_list()
- textimage_preset_edit in ./
textimage.admin.inc - Todo.
- textimage_settings_form in ./
textimage.admin.inc - Todo.
File
- ./
textimage.admin.inc, line 865 - Textimage admin page callback
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;
}