<?php

	
    lt_include( PLOG_CLASS_PATH."class/misc/glob.class.php" );
    lt_include( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );    
	
	/**
	 * deals with smileys in disk and so on...
	 */
	class Avatars
	{
        /**
         * tries to detect and load all the different avatas that can be found in the
         * avatars folder, so that the user can chose the nicest one :)
		 *
		 * @static
         */
        function scanAvatarImages()
        {
            $gifImages = Glob::glob( AVATAR_FILE_PATH , '*.gif');
            $jpgImages = Glob::glob( AVATAR_FILE_PATH , '*.jpg');
            
            $avatarImages = Array();
            
            if ( !empty($gifImages) ) {
                foreach($gifImages as $image) {
                    $imageName =  basename($image);
                    array_push( $avatarImages, $imageName);
                }
            }

            if ( !empty($jpgImages) ) {
                foreach($jpgImages as $image) {
                    $imageName =  basename($image);
                    array_push( $avatarImages, $imageName);
                }
            }                       
            
            return $avatarImages;
        }		
	}
?>