<?php $count = 0; $source = isset($asset) && $asset != '' ? 'details' : 'assets'; foreach ($imported_bookmarks as $index => $bookmark) { // only display bookmarks that are related to the selected album and/or asset if ($bookmark['album'] == $album && (!isset($asset) || $asset == '' || $bookmark['asset'] == $asset)) { ++$count; ?> <li> <input style="float: left;" type="checkbox" name="import_selection[]" value="<?php echo $index; ?> "/> <?php if ($_SESSION['target'] == 'custom' && user_prefs_asset_bookmark_exists($_SESSION['user_login'], $bookmark['album'], $bookmark['asset'], $bookmark['timecode']) || $_SESSION['target'] == 'official' && toc_asset_bookmark_exists($bookmark['album'], $bookmark['asset'], $bookmark['timecode'])) { ?> <div style="display: inline-block; width: 457px; padding-left: 8px; color:#ff0000;"> <a class="tooltip"><span style="padding-left: 0px;"><b><?php print_info(substr(get_user_friendly_date($bookmark['asset'], '/', false, get_lang(), false), 0, 10)); ?> </b></span> <?php echo get_asset_title($bookmark['album'], $bookmark['asset']); ?> <div class="right-arrow"></div> <?php print_bookmark_title($bookmark['title']); ?>
/** * Removes a specific bookmark from the bookmarks file (table of contents). * If it is the last bookmark contained in the file, the file is deleted. * @param type $album the album of the bookmark * @param type $asset the asset of the bookmark * @param type $timecode the timecode of the bookmark * @return an array of bookmarks if the bookmark has been deleted; false otherwise */ function toc_asset_bookmark_delete($album, $asset, $timecode) { // Sanity check if (!ezmam_album_exists($album)) { return false; } if (!isset($timecode) || $timecode == '' || $timecode < 0) { return false; } // 1) set the repository path $toc_path = ezmam_repository_path(); if ($toc_path === false) { return false; } // set user's file path $toc_path = $toc_path . '/' . $album; if (toc_asset_bookmark_exists($album, $asset, $timecode)) { $bookmarks_list = toc_album_bookmarks_list_get($album); // if it is the last bookmark in the file, the file is deleted if (count($bookmarks_list) == 1) { return toc_album_bookmarks_delete_all($album); } foreach ($bookmarks_list as $index => $bookmark) { if ($bookmark['asset'] == $asset && $bookmark['timecode'] == $timecode) { unset($bookmarks_list[$index]); } } // rewrites the bookmarks file return assoc_array2xml_file($bookmarks_list, $toc_path . "/_bookmarks.xml", "bookmarks", "bookmark"); } }