'; echo ''; echo ''; echo ''; echo ''; echo '

'; echo '

', WT_I18N::translate('The file “%s” does not exist.', $rowm['m_file']), '

'; echo ''; echo ''; } else if (!file_exists($rowm['m_file'])) { echo '
  • '; echo ''; echo ''; echo ''; echo ''; echo ''; } else { echo '
  • '; echo '
  • '; echo ''; echo ''; echo '

    '; echo '

    ', WT_I18N::translate('The file “%s” does not exist.', $rowm['m_file']), '

    '; echo '
    '; } // Else Media files are present in "media" directory } else { //If media is linked to a 'private' person if (!WT_Media::getInstance($rowm['m_media'])->canDisplayDetails() || !canDisplayFact($rowm['m_media'], $rowm['m_gedfile'], $rowm['mm_gedrec'])) { return false; } else { // Media is NOT linked to private person // If reorder media has been clicked if (isset($reorder) && $reorder==1) { echo '
  • '; // Else If reorder media has NOT been clicked // Highlight Album Thumbnails - Changed=new (blue), Changed=old (red), Changed=no (none) } else if ($rtype=='new') { echo '
  • '; } else if ($rtype=='old') { echo '
  • '; } else { echo '
  • '; } } } // Add blue or red borders $styleadd=''; if ($rtype=='new') $styleadd = 'change_new'; if ($rtype=='old') $styleadd = 'change_old'; // NOTE Start printing the media details if (!media_exists($mainMedia)) { if (!media_exists($rowm['m_file'])) { $thumbnail = ''; $isExternal = ''; // isFileExternal($thumbnail); } else { $thumbnail = thumbnail_file($rowm['m_file'], true, false, $pid); $isExternal = isFileExternal($thumbnail); } } else { $thumbnail = thumbnail_file($mainMedia, true, false, $pid); $isExternal = isFileExternal($thumbnail); // echo $thumbnail; } $linenum = 0; // If Fact details can be shown -------------------------------------------------------------------------------------------- if (canDisplayFact($pid, $rowm['m_file'], $rowm['mm_gedrec'])) { // Get the title of the media $media=WT_Media::getInstance($rowm['m_media']); $mediaTitle = $media->getFullName(); $mainMedia = check_media_depth($rowm['m_file'], 'NOTRUNC'); $mainFileExists = true; $imgsize = findImageSize($mainMedia); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; // Get the tooltip link for source $sour = WT_Source::getInstance(get_gedcom_value('SOUR', 1, $rowm['m_gedrec'])); //Get media item Notes $haystack = $rowm['m_gedrec']; $needle = '1 NOTE'; $before = substr($haystack, 0, strpos($haystack, $needle)); $after = substr(strstr($haystack, $needle), strlen($needle)); $final = $before.$needle.$after; $notes = PrintReady(htmlspecialchars(print_fact_notes($final, 1, true, true), ENT_QUOTES)); // Get info on how to handle this media file $mediaInfo = mediaFileInfo($mainMedia, $thumbnail, $rowm['m_media'], $mediaTitle, $notes); //text alignment for Tooltips if ($TEXT_DIRECTION=='rtl') { $alignm = 'right'; $left = 'true'; } else { $alignm = 'left'; $left = 'false'; } // Tooltip Options $tt_opts = ", BALLOON," . true ; // true=balloon, false=normal $tt_opts .= ", LEFT," . $left; $tt_opts .= ", ABOVE, true"; $tt_opts .= ", TEXTALIGN, '" . $alignm . "'"; $tt_opts .= ", WIDTH, -480 "; $tt_opts .= ", BORDERCOLOR, ''"; $tt_opts .= ", TITLEBGCOLOR, ''"; $tt_opts .= ", CLOSEBTNTEXT, 'X'"; $tt_opts .= ", CLOSEBTN, false"; $tt_opts .= ", CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000']"; $tt_opts .= ", OFFSETX, -30"; $tt_opts .= ", OFFSETY, 110"; $tt_opts .= ", STICKY, true"; $tt_opts .= ", PADDING, 6"; $tt_opts .= ", CLICKCLOSE, true"; $tt_opts .= ", DURATION, 8000"; $tt_opts .= ", BGCOLOR, '#f3f3f3'"; $tt_opts .= ", JUMPHORZ, 'true' "; $tt_opts .= ", JUMPVERT, 'false' "; $tt_opts .= ", DELAY, 0"; // Prepare Below Thumbnail menu ---------------------------------------------------- if ($TEXT_DIRECTION== 'rtl') { $submenu_class = 'submenuitem_rtl'; $submenu_hoverclass = 'submenuitem_hover_rtl'; } else { $submenu_class = 'submenuitem'; $submenu_hoverclass = 'submenuitem_hover'; } $menu = new WT_Menu(); // Truncate media title to 13 chars (45 chars if Streetview) and add ellipsis $mtitle = $mediaTitle; if (strpos($rowm['m_file'], 'http://maps.google.')===0) { if (utf8_strlen($mtitle)>16) { $mtitle = utf8_substr($rowm['m_file'], 0, 45).WT_I18N::translate('…'); } } else { if (utf8_strlen($mtitle)>16) { $mtitle = utf8_substr($mtitle, 0, 13).WT_I18N::translate('…'); } } // Continue menu construction // If media file is missing from 'media' directory, but is referenced in Gedcom if (!media_exists($rowm['m_file']) && !media_exists($mainMedia)) { $menu->addLabel("\"\"" . WT_I18N::translate('Edit')." (". $rowm['m_media'].")", 'right'); } else { $menu->addLabel("\"\"" . $mtitle, 'right'); } // Next line removed to avoid gallery thumbnail duplication // $menu['link'] = mediaInfo['url']; if ($rtype=='old') { // Do not print menu if item has changed and this is the old item } else { // Continue printing menu $menu->addClass('', '', 'submenu'); // View Notes if (strpos($rowm['m_gedrec'], "\n1 NOTE")) { $submenu = new WT_Menu('  ' . WT_I18N::translate('View Notes') . '  ', '#', 'right'); // Notes Tooltip ---------------------------------------------------- $sonclick = 'TipTog('; // Contents of Notes $sonclick .= "'"; $sonclick .= "<font color=#008800><b>" . WT_I18N::translate('Notes') . ":</b></font><br />"; $sonclick .= $notes; $sonclick .= "'"; // Notes Tooltip Parameters $sonclick .= $tt_opts; $sonclick .= ");"; $sonclick .= "return false;"; $submenu->addOnclick($sonclick); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); } //View Details $submenu = new WT_Menu("  " . WT_I18N::translate('View Details') . "  ", WT_SERVER_NAME.WT_SCRIPT_PATH . "mediaviewer.php?mid=" . $rowm['m_media'], "right"); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); //View Source if ($sour && $sour->canDisplayDetails()) { $submenu = new WT_Menu("  " . WT_I18N::translate('View Source') . "  ", $sour->getHtmlUrl(), "right"); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); } if (WT_USER_CAN_EDIT) { // Edit Media $submenu = new WT_Menu("  " . WT_I18N::translate('Edit media') . "  ", "#", "right"); $submenu->addOnclick("return window.open('addmedia.php?action=editmedia&pid={$rowm['m_media']}&linktoid={$rowm['mm_gid']}', '_blank', 'top=50,left=50,width=600,height=700,resizable=1,scrollbars=1');"); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); if (WT_USER_IS_ADMIN) { // Manage Links if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) { $submenu = new WT_Menu("  " . WT_I18N::translate('Manage links') . "  ", "#", "right"); $submenu->addOnclick("return window.open('inverselink.php?mediaid={$rowm['m_media']}&linkto=manage', '_blank', 'top=50,left=50,width=570,height=650,resizable=1,scrollbars=1');"); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); } else { $submenu = new WT_Menu("  " . WT_I18N::translate('Set link') . "  ", "#", "right", "right"); $ssubmenu = new WT_Menu(WT_I18N::translate('To Person')); $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid={$rowm['m_media']}&linkto=person', '_blank', 'top=50,left=50,width=570,height=650,resizable=1,scrollbars=1');"); $ssubmenu->addClass('submenuitem', 'submenuitem_hover', 'submenu'); $submenu->addSubMenu($ssubmenu); $ssubmenu = new WT_Menu(WT_I18N::translate('To Family')); $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid={$rowm['m_media']}&linkto=family', '_blank', 'top=50,left=50,width=570,height=650,resizable=1,scrollbars=1');"); $ssubmenu->addClass('submenuitem', 'submenuitem_hover', 'submenu'); $submenu->addSubMenu($ssubmenu); $ssubmenu = new WT_Menu(WT_I18N::translate('To Source')); $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid={$rowm['m_media']}&linkto=source', '_blank', 'top=50,left=50,width=570,height=650,resizable=1,scrollbars=1');"); $ssubmenu->addClass('submenuitem', 'submenuitem_hover', 'submenu'); $submenu->addSubMenu($ssubmenu); $menu->addSubMenu($submenu); } // Unlink Media $submenu = new WT_Menu("  " . WT_I18N::translate('Unlink Media') . "  ", "#", "right"); $submenu->addOnclick("return delete_record('$pid', 'OBJE', '".$rowm['m_media']."');"); $submenu->addClass($submenu_class, $submenu_hoverclass); $menu->addSubMenu($submenu); } } } // Check if allowed to View media if ($isExternal || media_exists($thumbnail) && canDisplayFact($rowm['m_media'], $rowm['m_gedfile'], $rowm['m_gedrec'])) { $mainFileExists = false; // Get Media info if ($isExternal || media_exists($rowm['m_file']) || media_exists($mainMedia)) { $mainFileExists = true; $imgsize = findImageSize($rowm['m_file']); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; // Start Thumbnail Enclosure table --------------------------------------------- // Pull table up 90px if media object is a "streetview" if (strpos($rowm['m_file'], 'http://maps.google.')===0) { echo "
  • "; } else { echo "
    "; } echo ""; // Check for Notes associated media item if ($reorder) { // If reorder media has been clicked echo ""; echo ""; } $item++; echo ""; //View Edit Menu ---------------------------------- if (!$reorder) { // If not reordering media print View or View-Edit Menu echo ""; echo ""; echo ""; echo ""; echo ""; } // echo "
    "; echo ''; echo "" . $rowm['m_media'] . "
    "; // If not reordering, enable Lightbox or popup and show thumbnail tooltip ------ if (!$reorder) { echo ''; } } // Now finally print the thumbnail ----------------------------------------------------- $height = 78; $size = findImageSize($mediaInfo['thumb']); if ($size[1]<$height) $height = $size[1]; echo "\"\""; // Close anchor -------------------------------------------------------------- if ($mainFileExists) { echo ""; } echo "
    "; echo $menu->getMenu(); echo "
    "; } } // NOTE End If Show fact details // If media file is missing but details are in Gedcom then add the menu as well //if (!media_exists($rowm['m_file'])) { if (!media_exists($mainMedia) && !media_exists($rowm['m_file'])) { echo ''; echo ''; echo ''; echo $menu->getMenu(); echo ''; echo ''; echo ''; } //close off the table echo ''; $media_data = $rowm['m_media']; echo ''; $sort_i++; echo '
  • '; return true; }