You are here

function user_badges_image_selects in User Badges 6

Same name and namespace in other branches
  1. 5 user_badges.module \user_badges_image_selects()
  2. 6.2 user_badges.admin.inc \user_badges_image_selects()

Select options for printing a list of images in the image library

Return value

An array of images from the image library, in the form $filename => $image_html

2 calls to user_badges_image_selects()
user_badges_edit_form in ./user_badges.admin.inc
Define the edit form for userbadges.
user_badges_images_form in ./user_badges.admin.inc
form to upload the badge images or to delete existing ones

File

./user_badges.admin.inc, line 727
@brief User Badges admin functions

Code

function user_badges_image_selects() {
  $selects = array();
  $dir = file_create_path('badges');
  $files = file_scan_directory($dir, '.*\\.(((J|j)(p|P)(g|G))|((p|P)(n|N)(g|G))|((g|G)(i|I)(f|F)))', array(
    '.',
    '..',
    'CVS',
  ), 0, FALSE);
  foreach ($files as $file) {
    $selects[$file->filename] = theme('image', $file->filename, $file->filename, $file->filename);
  }
  return $selects;
}