Exemplo n.º 1
0
/**
 * Moves all bookmarks of an asset from the public to the private album and reverse.
 * @param type $album
 * @param type $asset
 */
function toc_album_bookmarks_swap($album, $asset)
{
    $bookmarks = toc_asset_bookmark_list_get($album, $asset);
    toc_asset_bookmarks_delete_all($album, $asset);
    $album = suffix_replace($album);
    $count = count($bookmarks);
    for ($index = 0; $index < $count; $index++) {
        $bookmarks[$index]['album'] = $album;
    }
    toc_album_bookmarks_add($bookmarks);
}
Exemplo n.º 2
0
/**
 * Unpublishes an asset, i.e. moves it from public album to private
 * @param type $asset_name $the asset to move
 * @param type $public_album public album name
 * @return bool error status
 */
function ezmam_asset_unpublish($public_album, $asset_name)
{
    if (!ezmam_album_exists($public_album)) {
        ezmam_last_error("ezmam_asset_publish: private album does not exist");
        return false;
    }
    if (!ezmam_asset_exists($public_album, $asset_name)) {
        ezmam_last_error("ezmam_asset_publish: asset does not exist");
        return false;
    }
    $private_album = suffix_replace($public_album);
    $res = ezmam_asset_move($asset_name, $public_album, $private_album);
    return $res;
}