예제 #1
0
function photo_light_slide_thumb($entity, $entity_id)
{
    use_helper('Lightbox');
    //require_once('../model/sfPhotoGalleryPeer.php');
    // Recupera l'array delle foto
    $images_raw = sfPhotoGalleryPeer::getLightboxArray($entity, $entity_id);
    if (count($images_raw) > 0) {
        // TODO AGGIUNGERE IL THUMB
        foreach ($images_raw as $image_raw) {
            $image = array();
            $image['image'] = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/photos/' . $image_raw['real_name']);
            $image['thumbnail'] = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/' . $image_raw['real_name']);
            $image['options'] = $image_raw['options'];
            $images[] = $image;
        }
        $link_opt = array('title' => $entity, 'slidename' => $entity . '_' . $entity_id);
        return light_slide_image($images[0]['thumbnail'], $images, $link_opt);
    }
    return '';
}