function photo_lightbox_slideshow($entity, $entity_id, $options = array()) { // Convert options string to option array if (is_string($options)) { $options = _convert_string_option($options); } use_helper('Lightbox'); // 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); // $label = icon_path('image_multi'); $label = 'Gallery'; // CUSTOMIZE LABEL TEXT if (isset($options['label'])) { $label = $options['label']; } // ICON if (isset($options['icon']) && $options['icon'] == 'true') { use_helper('sfIcon'); $label = icon_path('image_multi'); } return light_slide_image($label, $images, $link_opt); } return ''; }
function file_link_to_add($entity, $entity_id, $options = array()) { // Convert options string to option array if (is_string($options)) { $options = _convert_string_option($options); } $label = 'Add file'; // CUSTOMIZE LABEL TEXT if (isset($options['label'])) { $label = $options['label']; } // ICON if (isset($options['icon']) && $options['icon'] == 'true') { use_helper('sfIcon'); $label = icon_tag('folder_add') . ' ' . $label; } $url = "files/create?entity={$entity}&entity_id={$entity_id}"; // swicth link to with or without modalBox if (isset($options['modalbox']) && $options['modalbox'] == 'true') { use_helper('ModalBox'); return m_link_to($label, $url); } else { return link_to($label, $url); } }