getAuthenticatedUser(); $feeds = \Feed_Collection::load_all($appbox, $user); $th_size = $user->getPrefs('images_size'); $core = \bootstrap::getCore(); $twig = $core->getTwig(); ?>

get_aggregate()->get_entries(0, 5)->get_entries() as $entry) { /* @var $entry \Feed_Entry_Adapter */ $feed .= '
' . '
' . '

' . '' . $entry->get_title() . '

' . '' . ' ' . \phraseadate::getPrettyString($entry->get_created_on()) . ' '; if ($entry->get_author_email()) $feed .= ''; $feed .= $entry->get_author_name(); if ($entry->get_author_email()) $feed .= ''; if ($entry->get_updated_on() > $entry->get_created_on()) $feed .= '
' . _('publications:: derniere mise a jour') . ' ' . \phraseadate::getPrettyString($entry->get_updated_on()) . '

'; $feed .= '
'; if (trim($entry->get_subtitle()) != '') { $feed .= '' . nl2br($entry->get_subtitle()); } $feed .= '
'; $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 .= '\n"; $feed .= ""; $feed .= ""; $feed .= "
'; $feed .= "\n"; $feed .= $preview; $feed .= "
"; $feed .= "
"; $feed .= "
"; } $feed .= '
' . '
'; } echo '
' . $feed . '
';