public function getSlotValue($slot, $settings) { sfProjectConfiguration::getActive()->loadHelpers('sfAsset'); $asset_id = $slot->getOption('asset_id', null, $settings['culture']); $asset = empty($asset_id) ? new sfAsset() : sfAssetPeer::retrieveFromUrl($asset_id); if (!$asset) { $asset = new sfAsset(); } return asset_image_tag($asset, $asset->isNew() ? 'small' : 'full') . ($asset->getDescription() != '' ? content_tag('span', $asset->getDescription(), 'class=desc') : null); }
<?php use_helper('sfAsset'); ?> <div class="w-gallery-content"> <?php if ($asset->isImage() || $asset->isPdf()) { echo asset_image_tag($asset); } ?> <div class="w-gallery-content-legend"> <?php echo $slot->getValue($settings['culture']); ?> </div> </div>
<?php use_helper('JavascriptBase', 'sfAsset'); ?> <?php if (!$sf_asset->isNew()) { ?> <div id="thumbnail"> <a href="<?php echo $sf_asset->getUrl('full'); ?> "><?php echo asset_image_tag($sf_asset, 'large', array('title' => __('See full-size version', null, 'sfAsset')), null); ?> </a> </div> <p><?php echo auto_wrap_text($sf_asset->getFilename()); ?> </p> <p><?php echo __('%weight% Kb', array('%weight%' => $sf_asset->getFilesize()), 'sfAsset'); ?> </p> <p><?php echo __('Created on %date%', array('%date%' => format_date($sf_asset->getCreatedAt('U'))), 'sfAsset'); ?> </p> <?php
<?php use_helper('sfAsset'); ?> <div class="assetImage"> <div class="thumbnails"> <?php echo link_to_asset_action(asset_image_tag($sf_asset, 'small', array(), isset($folder) ? $folder->getRelativePath() : null), $sf_asset); ?> </div> <div class="assetComment"> <?php echo auto_wrap_text($sf_asset->getFilename()); ?> <div class="details"> <?php echo __('%weight% KiB', array('%weight%' => $sf_asset->getFilesize()), 'sfAsset'); ?> <?php if (!$sf_user->hasAttribute('popup', 'sf_admin/sf_asset/navigation')) { ?> <?php echo link_to(image_tag('/sfDoctrineAssetsLibraryPlugin/images/delete.png', 'alt=delete class=deleteImage align=top'), '@sf_asset_library_delete_asset?id=' . $sf_asset->getId(), array('title' => __('Delete', null, 'sfAsset'), 'method' => 'delete', 'confirm' => __('Are you sure?', null, 'sfAsset'))); ?> <?php } ?> </div> </div> </div>
if ($pagination == 'thumbs-slider') { echo 'w-gallery-menu-slider'; } ?> "> <?php foreach ($gallery->getElements() as $i => $element) { ?> <?php $asset = $element->getThumb(); ?> <li><a href="#<?php echo $i; ?> "><?php echo asset_image_tag($asset, $thumb_size); ?> </a></li> <?php } ?> </ul> <?php } elseif ($pagination == 'numbers') { ?> <ul class="w-menu w-gallery-menu w-gallery-menu-numbers"> <?php for ($i = 0; $i < count($gallery->getElements()); $i++) { ?> <li><a href="#<?php echo $i;
/** * get input form field * @param string $name * @param integer $value possible value of asset id * @param array $options * @return string */ function input_sf_asset_image_tag($name, $value = null, $options = array()) { $url = str_replace('&', '&', url_for('@sf_asset_library_list?dir=' . sfConfig::get('app_sfAssetsLibrary_upload_dir', 'media') . '&popup=2')); $asset = empty($value) ? new sfAsset() : sfAssetTable::getInstance()->find($value); return '<a id="sf_asset_input_image" href="#" rel="{url: \'' . $url . '\', name: \'' . $name . '\', type: \'' . $options['type'] . '\'}">' . image_tag('/sfDoctrineAssetsLibraryPlugin/images/folder_open', array('alt' => 'Insert Image', 'title' => __('Insert Image', null, 'sfAsset'))) . '</a> ' . asset_image_tag($asset, 'small', array('id' => $options['id'] . '_img')); }
<?php use_helper('JavascriptBase', 'I18N', 'sfAsset'); ?> <p><?php echo button_to_function(__('Back to the list', null, 'sfAsset'), 'history.back()'); ?> </p> <script src="/js/tiny_mce/tiny_mce_popup.js"></script> <script src="/js/tiny_mce/plugins/sfAssetsLibrary/jscripts/sfAssetsLibrary.js"></script> <form action="" method="post" id="tinyMCE_insert_form"> <fieldset> <?php echo asset_image_tag($sf_asset, 'large', array('class' => 'thumb')); ?> <div class="form-row"> <label><?php echo __('Filename', null, 'sfAsset'); ?> </label> <div class=""><?php echo $sf_asset->getUrl(); ?> </div> </div> <?php echo $form; ?>
/** * get input form field * @param string $name * @param integer $value possible value of asset id * @param array $options * @return string */ function input_sf_asset_image_tag($name, $value = null, $options = array()) { $url = str_replace('&', '&', url_for('@sf_asset_library_list?dir=' . sfConfig::get('app_sfAssetsLibrary_upload_dir', 'media') . '&popup=2')); $asset = empty($value) ? new sfAsset() : sfAssetPeer::retrieveByPK($value); return '<a class="sf_asset_input_image" id="' . $options['id'] . '_link" href="#" rel="{url: \'' . $url . '\', name: \'' . $name . '\', type: \'' . $options['type'] . '\'}">' . image_tag('/sfAssetsLibraryPlugin/images/folder_open', array('alt' => 'Insert Image', 'title' => __('Insert Image', null, 'sfAsset'))) . '</a> ' . image_tag('/sfPlopPlugin/vendor/famfamfam/silk/folder_delete', array('id' => $options['id'] . '_delete', 'class' => 'sf_asset_delete_image', 'rel' => $options['id'], 'alt' => 'Delete Image', 'title' => __('Delete Image', null, 'sfAsset'))) . ' ' . asset_image_tag($asset, 'small', array('id' => $options['id'] . '_img')); }
<?php if (count($slotConfigs) > 0) { ?> <ul class="w-list"> <?php foreach ($slotConfigs as $galleryConfig) { ?> <?php $gallery_id = $galleryConfig->getOption('gallery_id', '', $settings['culture']); if (!$gallery_id && $settings['culture'] != sfPlop::get('sf_plop_default_culture')) { $gallery_id = $galleryConfig->getOption('gallery_id', null, sfPlop::get('sf_plop_default_culture')); } $gallery = sfAssetGalleryPeer::retrieveByPK($gallery_id); ?> <?php if ($gallery) { ?> <li> <?php echo link_to(asset_image_tag($gallery->getThumb()) . content_tag('span', $gallery->getTitle()), '@sf_plop_page_show?slug=' . $galleryConfig->getPage()->getSlug()); ?> </li> <?php } ?> <?php } ?> </ul> <?php }