. */ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; use Fisharebest\Webtrees\Functions\FunctionsPrint; use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; use Fisharebest\Webtrees\Query\QueryMedia; /** * @global Tree $WT_TREE */ global $WT_TREE; require 'includes/session.php'; $controller = new PageController; $controller ->setPageTitle(I18N::translate('Media objects')) ->pageHeader(); $action = Filter::get('action'); $page = Filter::getInteger('page'); $max = Filter::get('max', '10|20|30|40|50|75|100|125|150|200', '20'); $folder = Filter::get('folder', null, ''); // MySQL needs an empty string, not NULL $filter = Filter::get('filter', null, ''); // MySQL needs an empty string, not NULL $subdirs = Filter::get('subdirs', '1'); $details = Filter::get('details', '1'); $form_type = Filter::get('form_type', implode('|', array_keys(GedcomTag::getFileFormTypes()))); // reset all variables if ($action === 'reset') { $max = '20'; $folder = ''; $subdirs = ''; $details = ''; $filter = ''; $form_type = ''; } // A list of all subfolders used by this tree $folders = QueryMedia::folderList(); // A list of all media objects matching the search criteria $medialist = QueryMedia::mediaList( $folder, $subdirs === '1' ? 'include' : 'exclude', 'title', $filter, $form_type ); ?>

getPageTitle() ?>

'folder', 'name' => 'folder']) ?> 'subdirs', 'checked' => ($subdirs === '1')]) ?>
'max', 'name' => 'max']) ?>
''] + GedcomTag::getFileFormTypes(), $form_type, ['id' => 'form-type', 'name' => 'form_type']) ?>
'details', 'checked' => ($details === '1')]) ?>
getName()) . '&folder=' . rawurlencode($folder) . '&subdirs=' . rawurlencode($subdirs) . '&filter=' . rawurlencode($filter) . '&form_type=' . rawurlencode($form_type) . '&max=' . rawurlencode($max); $count = count($medialist); $pages = (int) (($count + $max - 1) / $max); $page = max(min($page, $pages), 1); ?>

1): ?>
1): ?>
displayImage(300, 200, 'contain', ['class' => 'img-fluid']) ?>

getMediaType(); if ($mediatype) { echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype)); } if ($media->isExternal()) { echo GedcomTag::getLabelValue('URL', $media->getFilename()); } else { if ($media->fileExists()) { if ($details === '1') { if (Auth::isEditor($WT_TREE)) { echo GedcomTag::getLabelValue('FILE', $media->getFilename()); } echo GedcomTag::getLabelValue('FORM', $media->mimeType()); echo GedcomTag::getLabelValue('__FILE_SIZE__', $media->getFilesize()); $imgsize = $media->getImageAttributes(); if ($imgsize['WxH']) { echo GedcomTag::getLabelValue('__IMAGE_SIZE__', $imgsize['WxH']); } } } else { echo '

', /* I18N: %s is a filename */ I18N::translate('The file ā€œ%sā€ does not exist.', $media->getFilename()), '

'; } } echo FunctionsPrintFacts::printFactSources($media->getGedcom(), 1); echo FunctionsPrint::printFactNotes($media->getGedcom(), 1); ?>

1): ?>
1): ?>