';
if (trim($entry->get_subtitle()) != '') {
$feed .= '' . nl2br($entry->get_subtitle());
}
$feed .= '
';
foreach ($entry->get_content() as $Feed_item) {
/* @var $Feed_item \Feed_Entry_Item */
$record = $Feed_item->get_record();
$thumbnail = $record->get_thumbnail();
$title = $record->get_title();
$caption = $twig->render(
'common/caption.html.twig', array('view' => 'internal_publi', 'record' => $record)
);
$preview = "
";
$docType = $record->get_type();
$isVideo = ($docType == 'video');
$isAudio = ($docType == 'audio');
$isImage = ($docType == 'image');
$duration = '';
if ( ! $isVideo && ! $isAudio)
$isImage = true;
if ($isVideo) {
$duration = $record->get_formated_duration();
if ($duration != '')
$duration = '
' . $duration . '
';
}
if ($isAudio) {
$duration = $record->get_formated_duration();
if ($duration != '')
$duration = '
' . $duration . '
';
}
$ratio = $thumbnail->get_width() / $thumbnail->get_height();
if ($ratio > 1) {
$cw = min(((int) $th_size - 30), $thumbnail->get_width());
$ch = $cw / $ratio;
$pv = floor(($th_size - $ch) / 2);
$ph = floor(($th_size - $cw) / 2);
$imgStyle = 'width:' . $cw . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
} else {
$ch = min(((int) $th_size - 30), $thumbnail->get_height());
$cw = $ch * $ratio;
$pv = floor(($th_size - $ch) / 2);
$ph = floor(($th_size - $cw) / 2);
$imgStyle = 'height:' . $ch . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
}
$feed .= "
get_sbas_id() . "\"
id='IMGT_" . $record->get_serialize_key() . "_PUB_" . $entry->get_id()
. "' class='IMGT diapo'
onclick=\"openPreview('FEED','" . $Feed_item->get_ord() . "','" . $entry->get_id() . "');\">";
$feed .= '
';
$feed .= "
";
$feed .= $title;
$feed .= "
\n";
$feed .= '
';
$feed .= "
\n";
$feed .= $duration . " get_url() . "\" style=\"" . $imgStyle . "\" />";
$feed .= " |
";
$feed .= '
';
$feed .= '
';
$feed .= '';
$feed .= '';
$feed .= " | \n";
$feed .= "\n";
$feed .= $preview;
$feed .= " | ";
$feed .= "
";
$feed .= "
";
$feed .= "
";
$feed .= "
";
}
$feed .= '