<?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 bookmark from the bookmarks file. If it is the last bookmark of * the file, the file is deleted * @param type $user the user * @param type $album the album * @param type $asset the asset * @param type $timecode the timecode of the bookmark * @return boolean true if the bookmark has been deleted; false otherwise */ function user_prefs_asset_bookmark_delete($user, $album, $asset, $timecode) { // Sanity check if (!isset($user) || $user == '') { return false; } if (!ezmam_album_exists($album)) { return false; } if (!isset($timecode) || $timecode == '' || $timecode < 0) { return false; } // 1) set the repository path $user_files_path = user_prefs_repository_path(); if ($user_files_path === false) { return false; } // set user's file path $user_path = $user_files_path . '/' . $user; if (user_prefs_asset_bookmark_exists($user, $album, $asset, $timecode)) { $bookmarks_list = user_prefs_album_bookmarks_list_get($user, $album); // if there is no bookmark anymore, the file is deleted if (count($bookmarks_list) == 1) { return user_prefs_album_bookmarks_delete_all($user, $album); } foreach ($bookmarks_list as $index => $bookmark) { if ($bookmark['asset'] == $asset && $bookmark['timecode'] == $timecode) { unset($bookmarks_list[$index]); } } return assoc_array2xml_file($bookmarks_list, $user_path . "/bookmarks_{$album}.xml", "bookmarks", "bookmark"); } }