", i18n::translate('MultiMedia Objects'), "

\n\t"; // Get Javascript variables from lb_config.php --------------------------- if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; if ($theme_name=="Minimal") { // Force icon options to "text" when we're dealing with the Minimal theme if ($LB_AL_HEAD_LINKS!="none") $LB_AL_HEAD_LINKS = "text"; if ($LB_AL_THUMB_LINKS!="none") $LB_AL_THUMB_LINKS = "text"; if ($LB_ML_THUMB_LINKS!="none") $LB_ML_THUMB_LINKS = "text"; } } //-- automatically generate an image if (WT_USER_IS_ADMIN && $action=="generate" && !empty($file) && !empty($thumb)) { generate_thumbnail($file, $thumb); } if ($search == "yes") { if ($folder == "ALL") { $folder = $MEDIA_DIRECTORY; $currentdironly = false; } // show external links only if looking at top level directory $showExternal = ($folder == $MEDIA_DIRECTORY) ? true : false; $medialist=get_medialist($currentdironly, $folder, true, false, $showExternal); //-- remove all private media objects foreach($medialist as $key => $media) { echo " "; // Display when user has Edit rights or when object belongs to current GEDCOM $disp = WT_USER_CAN_EDIT || $media["GEDFILE"]==WT_GED_ID; // Display when Media objects aren't restricted by global privacy $disp &= displayDetailsById($media["XREF"], "OBJE"); // Display when this Media object isn't restricted $disp &= !FactViewRestricted($media["XREF"], $media["GEDCOM"]); /** -- already included in the displayDetailsById() function if ($disp) { $links = $media["LINKS"]; //-- make sure that only media with links are shown if (count($links) != 0) { foreach($links as $id=>$type) { $disp &= displayDetailsById($id, $type); } } } */ if (!$disp) unset($medialist[$key]); } usort($medialist, "mediasort"); // Reset numbering of medialist array } // A form for filtering the media items ?>
0) { ?>
> >
> 0) { if (empty($folder)) { if (!empty($_SESSION['upload_folder'])) $folder = $_SESSION['upload_folder']; else $folder = "ALL"; } $folders = array_merge(array("ALL"), get_media_folders()); echo "
"; } else echo ""; // Text field for filter and "submit" button ?>
> checked="checked" />
 
1) { foreach($medialist as $key => $media) { if (!filterMedia($media, $filter, "http")) unset($medialist[$key]); } } usort($medialist, "mediasort"); // Reset numbering of medialist array } if ($search=="yes") { $_SESSION["medialist"] = $medialist; } else { $medialist = $_SESSION["medialist"]; } // Sort the media list according to the user's wishes $sortedMediaList = $medialist; // Default sort (by title) has already been done if ($sortby=='file') usort($sortedMediaList, 'filesort'); // Count the number of items in the medialist $ct=count($sortedMediaList); $start = 0; $max = 20; if (isset($_GET["start"])) $start = $_GET["start"]; if (isset($_GET["max"])) $max = $_GET["max"]; $count = $max; if ($start+$count > $ct) $count = $ct-$start; echo "\n\t
", i18n::translate('Media Objects found'), " ", $ct, "

"; if ($ct>0) { $currentPage = ((int) ($start / $max)) + 1; $lastPage = (int) (($ct + $max - 1) / $max); $IconRarrow = "\"\""; $IconLarrow = "\"\""; $IconRDarrow = "\"\""; $IconLDarrow = "\"\""; print"\n\t\n"; // echo page back, page number, page forward controls echo "\n"; // -- echo the array echo "\n\n"; for ($i=0; $i<$count; $i++) { $media = $sortedMediaList[$start+$i]; $isExternal = isFileExternal($media["FILE"]); $imgsize = findImageSize($media["FILE"]); $imgwidth = $imgsize[0]+40; $imgheight = $imgsize[1]+150; $name = trim($media["TITL"]); // $name1 = addslashes($media["TITL"]); $showFile = WT_USER_CAN_EDIT; if ($name=="") { //$showFile = false; if ($isExternal) $name = "URL"; else $name = basename($media["FILE"]); } echo "\n\t\t\t"; if ($i%2 == 1 && $i < ($count-1)) echo "\n\t\t\n\t\t"; } echo "\n\t\t"; // echo page back, page number, page forward controls echo "\n"; echo "
\n"; echo "\n\t\n"; echo "\n\n"; echo ""; echo ""; echo ""; echo "\n
"; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($currentPage > 1) { echo "", $IconLDarrow, "\n"; } if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; echo "", $IconLarrow, "\n"; } } } else { if ($ct>$max) { if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconRDarrow, "\n"; } if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; echo "", $IconRarrow, "\n"; } } } echo "", i18n::translate('Page %s of %s', $currentPage, $lastPage), ""; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; echo "", $IconRarrow, "\n"; } if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconRDarrow, "\n"; } } } else { if ($ct>$max) { if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; echo "", $IconLarrow, "\n"; } if ($currentPage > 1) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconLDarrow, "\n"; } } } echo "
"; echo "\n\t\n\t\t\n\t\t", '
"; //Get media item Notes $haystack = $media["GEDCOM"]; $needle = "1 NOTE"; $before = substr($haystack, 0, strpos($haystack, $needle)); $after = substr(strstr($haystack, $needle), strlen($needle)); $worked = str_replace("1 NOTE", "1 NOTE
", $after); $final = $before.$needle.$worked; $notes = PrintReady(htmlspecialchars(addslashes(print_fact_notes($final, 1, true, true)), ENT_COMPAT, 'UTF-8')); // Get info on how to handle this media file $mediaInfo = mediaFileInfo($media["FILE"], $media["THUMB"], $media["XREF"], $name, $notes); //-- Thumbnail field echo ''; echo '', PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')), ''; echo "
'; if (WT_USE_LIGHTBOX) { if (WT_USER_CAN_EDIT) { if ($LB_ML_THUMB_LINKS != "none") { echo ""; // ---------- Edit Media -------------------- echo ""; // ---------- Link Media to person, family or source --------------- echo ""; // ---------- View Media Details (mediaviewer) -------------------- echo ""; echo "
"; echo ""; if ($LB_ML_THUMB_LINKS == "icon" || $LB_ML_THUMB_LINKS == "both") { echo "\"\"   " ; } if ($LB_ML_THUMB_LINKS == "both") { echo "
"; } if ($LB_ML_THUMB_LINKS == "both" || $LB_ML_THUMB_LINKS == "text") { echo i18n::translate('Edit Details') ; } echo "
" . "\n"; echo "
"; require WT_ROOT.'modules/lightbox/functions/lb_link.php'; echo ""; echo ""; if ($LB_ML_THUMB_LINKS == "icon" || $LB_ML_THUMB_LINKS == "both") { echo "   \"\""; } if ($LB_ML_THUMB_LINKS == "both") { echo "
"; } if ($LB_ML_THUMB_LINKS == "both" || $LB_ML_THUMB_LINKS == "text") { echo i18n::translate('View Details') ; } echo "
" . "\n" ; echo "
"; } // ------------ Linespace --------------------- echo "
"; } } echo ""; if (begRTLText($name) && $TEXT_DIRECTION=="ltr") { if ($SHOW_ID_NUMBERS) { echo "(", $media["XREF"], ")   "; } echo "", PrintReady($name), ""; } else { echo "", PrintReady($name), ""; if ($SHOW_ID_NUMBERS) { echo "   "; if ($TEXT_DIRECTION=="rtl") echo getRLM(); echo "(", $media["XREF"], ")"; if ($TEXT_DIRECTION=="rtl") echo getRLM(); } } if ($showFile) { if ($isExternal) echo "
URL"; else echo "
", PrintReady($media["FILE"]), ""; } echo "

"; if (!$isExternal && !$media["EXISTS"]) { echo "
", i18n::translate('File not found.'), " ", PrintReady($media["FILE"]), ""; } if (!$isExternal && $media["EXISTS"]) { $imageTypes = array("", "GIF", "JPG", "PNG", "SWF", "PSD", "BMP", "TIFF", "TIFF", "JPC", "JP2", "JPX", "JB2", "SWC", "IFF", "WBMP", "XBM"); if (!empty($imgsize[2])) { echo "\n\t\t\t
", i18n::translate('Media Format'), ":
", $imageTypes[$imgsize[2]], ""; } else if (empty($imgsize[2])) { $path_end=substr($media["FILE"], strlen($media["FILE"])-5); $imageType = strtoupper(substr($path_end, strpos($path_end, ".")+1)); echo "\n\t\t\t
", i18n::translate('Media Format'), ":
", $imageType, ""; } $fileSize = media_filesize($media["FILE"]); $sizeString = getfilesize($fileSize); echo "   ", $sizeString, ""; if ($imgsize[2]!==false) { echo "\n\t\t\t
", i18n::translate('Image Dimensions'), ":
", $imgsize[0], $TEXT_DIRECTION =="rtl"?(" " . getRLM() . "x" . getRLM() . " ") : " x ", $imgsize[1], ""; } } echo "
"; print_fact_sources($media["GEDCOM"], $media["LEVEL"]+1); print_fact_notes($media["GEDCOM"], $media["LEVEL"]+1); echo "
"; PrintMediaLinks($media["LINKS"], "small"); echo "
\n"; echo "
\n"; print"\n\t\n"; echo "\n\n"; echo ""; echo ""; echo ""; echo "\n
"; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($currentPage > 1) { echo "", $IconLDarrow, "\n"; } if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; echo "", $IconLarrow, "\n"; } } } else { if ($ct>$max) { if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconRDarrow, "\n"; } if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; echo "", $IconRarrow, "\n"; } } } echo "", i18n::translate('Page %s of %s', $currentPage, $lastPage), ""; if ($TEXT_DIRECTION=="ltr") { if ($ct>$max) { if ($start+$max < $ct) { $newstart = $start+$count; if ($start<0) $start = 0; echo "", $IconRarrow, "\n"; } if ($currentPage < $lastPage) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconRDarrow, "\n"; } } } else { if ($ct>$max) { if ($start>0) { $newstart = $start-$max; if ($start<0) $start = 0; echo "", $IconLarrow, "\n"; } if ($currentPage > 1) { $lastStart = ((int) ($ct / $max)) * $max; echo "", $IconLDarrow, "\n"; } } } echo "

"; } echo "\n
\n"; // -- load up the slideshow code if (!WT_USE_LIGHTBOX) { if (file_exists(WT_ROOT.'modules/slideshow/slideshow.php')) { require_once WT_ROOT.'modules/slideshow/slideshow.php'; } } print_footer(); ?>