Exemplo n.º 1
0
 /**
  * Populate extended file info (duration, etc)
  * 
  * @throws PodcastMetadataException
  * @return bool
  */
 protected function populatePodcastMetadata()
 {
     elgg_load_library('elgg:podcasts');
     $return = podcasts_populate_file_info($this);
     if ($return == 127) {
         $ex = elgg_echo('podcasts:error:exiftoolnotfound');
         throw new PodcastMetadataException($ex);
     } else {
         if ($return > 0) {
             $ex = elgg_echo('podcasts:error:exiftoolfailed');
             throw new PodcastMetadataException($ex);
         } else {
             return TRUE;
         }
     }
 }
Exemplo n.º 2
0
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'file', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date} {$comments_link} {$categories}";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
// Check if this file is playable with podcast player
elgg_load_library('elgg:podcasts');
$mimetype = podcasts_get_mime_type($file->getFilenameOnFilestore());
if (ElggPodcast::checkValidMimeType($mimetype)) {
    // Load JS/CSS
    elgg_load_js('elgg.podcasts');
    elgg_load_js('soundmanager2');
    elgg_load_css('elgg.podcasts');
    if (!$file->duration) {
        podcasts_populate_file_info($file);
    }
    $player = elgg_view('podcasts/player', array('entity_guid' => $file->guid));
}
if ($full && !elgg_in_context('gallery')) {
    $extra = '';
    if (elgg_view_exists("file/specialcontent/{$mime}")) {
        $extra = elgg_view("file/specialcontent/{$mime}", $vars);
    } else {
        if (elgg_view_exists("file/specialcontent/{$base_type}/default")) {
            $extra = elgg_view("file/specialcontent/{$base_type}/default", $vars);
        }
    }
    $params = array('entity' => $file, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle);
    $params = $params + $vars;
    $summary = elgg_view('object/elements/summary', $params);