Esempio n. 1
0
/**
 * Returns a bookmarks list to display in a popup (export_bookmarks / delete_bookmarks)
 * @global type $input
 * @global type $repository_path
 * @global type $user_files_path
 */
function bookmarks_popup()
{
    global $input;
    global $repository_path;
    global $user_files_path;
    $album = $input['album'];
    $asset = $input['asset'];
    $tab = $input['tab'];
    $source = $input['source'];
    ezmam_repository_path($repository_path);
    user_prefs_repository_path($user_files_path);
    if (isset($asset) && $asset != '') {
        $asset_meta = ezmam_asset_metadata_get($album, $asset);
        if ($tab == 'custom') {
            $bookmarks = user_prefs_asset_bookmarks_list_get($_SESSION['user_login'], $album, $asset);
        } else {
            $bookmarks = toc_asset_bookmark_list_get($album, $asset);
        }
    } else {
        if ($tab == 'custom') {
            $bookmarks = user_prefs_album_bookmarks_list_get($_SESSION['user_login'], $album);
        } else {
            $bookmarks = toc_album_bookmarks_list_get($album);
        }
    }
    switch ($input['display']) {
        case 'delete':
            include_once template_getpath('popup_delete_bookmarks.php');
            break;
        case 'export':
            include_once template_getpath('popup_export_bookmarks.php');
            break;
    }
}
Esempio n. 2
0
function asset_downloadable_set()
{
    global $input;
    global $repository_path;
    if (!isset($input['album']) || !isset($input['asset']) || !isset($input['downloadable'])) {
        die;
    }
    ezmam_repository_path($repository_path);
    $metadata = ezmam_asset_metadata_get($input['album'], $input['asset']);
    $metadata['downloadable'] = $input['downloadable'];
    $res = ezmam_asset_metadata_set($input['album'], $input['asset'], $metadata);
    if (!$res) {
        error_print_message(ezmam_last_error());
        die;
    }
}
Esempio n. 3
0
/**
 *
 * @param string $album
 * @return array_of_assoc_array
 * @desc returns an array of all albums with details in   assoc_arrays: ['name'] & ['metadata']
 */
function ezmam_asset_list_metadata($album)
{
    $repository_path = ezmam_repository_path();
    if ($repository_path === false) {
        return false;
    }
    //check if album exists
    if (!ezmam_album_exists($album)) {
        return false;
    }
    $asset_list = array();
    $idx = 0;
    $album_path = $repository_path . "/" . $album;
    //$dh=opendir($album_path);
    $dh = scandir($album_path, 1);
    if (!$dh) {
        return false;
    }
    //while (($file = readdir($dh)) !== false) {
    foreach ($dh as $file) {
        if ($file[0] != '.' && $file[0] != "_") {
            //filter out names starting with . (including '.' and '..' )or _
            if (is_dir($album_path . "/" . $file)) {
                //if its a directory add it to the list
                $asset = $file;
                //the album ref name is the directory name
                $asset_list[$idx]['name'] = $asset;
                $asset_list[$idx]['metadata'] = ezmam_asset_metadata_get($album, $asset);
                $idx += 1;
            }
        }
    }
    //end while
    return $asset_list;
}
Esempio n. 4
0
}
//if slide look for chapters
$chapter_slide_dir = $render_dir . '/chapter_slide';
if (is_dir($chapter_slide_dir)) {
    insert_chapterslide_media($album, $asset, $chapter_slide_dir);
}
print "intro-title-movie processing done";
//move processed render_dir to archive dir
rename($render_dir, $render_root_path . '/processed/' . basename($render_dir));
// delete video files that are already in the repository (original cam and slide)
foreach (glob($render_root_path . '/processed/' . basename($render_dir) . '/*') as $f) {
    if ((strpos($f, "cam") !== false || strpos($f, "slide") !== false) && !strpos($f, "xml")) {
        unlink($f);
    }
}
$asset_meta = ezmam_asset_metadata_get($album, $asset);
//if we found the duration of the encoded videos set the asset's duration
if (isset($duration) && is_numeric($duration)) {
    $asset_meta['duration'] = round($duration);
}
$asset_meta['status'] = 'processed';
$res = ezmam_asset_metadata_set($album, $asset, $asset_meta);
if (!$res) {
    print "asset metadata set error:" . ezmam_last_error() . "\n";
}
function high_low_media_mam_insert($album, $asset, $high_low, $cam_slide, $processing_assoc, $render_dir)
{
    global $title, $duration;
    //get qtinfo assoc info
    $qtinfo_assoc = metadata2assoc_array($render_dir . "/{$high_low}_{$cam_slide}_qtinfo.xml");
    if (!is_array($qtinfo_assoc)) {
Esempio n. 5
0
/**
 * Returns the asset full title from an asset name
 * @global type $repository_path 
 * @param type $album 
 * @param type $asset the original asset name
 * @return boolean|string the asset full title if the asset exists ; false otherwise
 */
function get_asset_title($album, $asset)
{
    global $repository_path;
    global $template_folder;
    ezmam_repository_path($repository_path);
    //
    // Usual sanity checks
    //
    if (!ezmam_album_exists($album)) {
        return false;
    }
    if (!ezmam_asset_exists($album, $asset)) {
        return template_get_message('Inexistant', get_lang());
    }
    $asset_title = ezmam_asset_metadata_get($album, $asset);
    $asset_title = $asset_title['title'];
    return $asset_title;
}