xref: /webtrees/app/Module/SlideShowModule.php (revision 4b9ff166b3342695f2a94855b7a33368e6d55c35)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roachnamespace Fisharebest\Webtrees;
38c2e8227SGreg Roach
48c2e8227SGreg Roach/**
58c2e8227SGreg Roach * webtrees: online genealogy
68c2e8227SGreg Roach * Copyright (C) 2015 webtrees development team
78c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify
88c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by
98c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or
108c2e8227SGreg Roach * (at your option) any later version.
118c2e8227SGreg Roach * This program is distributed in the hope that it will be useful,
128c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
138c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
148c2e8227SGreg Roach * GNU General Public License for more details.
158c2e8227SGreg Roach * You should have received a copy of the GNU General Public License
168c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
178c2e8227SGreg Roach */
188c2e8227SGreg Roach
198c2e8227SGreg Roach/**
208c2e8227SGreg Roach * Class SlideShowModule
218c2e8227SGreg Roach */
228c2e8227SGreg Roachclass SlideShowModule extends Module implements ModuleBlockInterface {
238c2e8227SGreg Roach	/** {@inheritdoc} */
248c2e8227SGreg Roach	public function getTitle() {
258c2e8227SGreg Roach		return /* I18N: Name of a module */ I18N::translate('Slide show');
268c2e8227SGreg Roach	}
278c2e8227SGreg Roach
288c2e8227SGreg Roach	/** {@inheritdoc} */
298c2e8227SGreg Roach	public function getDescription() {
308c2e8227SGreg Roach		return /* I18N: Description of the “Slide show” module */ I18N::translate('Random images from the current family tree.');
318c2e8227SGreg Roach	}
328c2e8227SGreg Roach
338c2e8227SGreg Roach	/** {@inheritdoc} */
348c2e8227SGreg Roach	public function getBlock($block_id, $template = true, $cfg = null) {
35*4b9ff166SGreg Roach		global $ctype, $WT_TREE;
368c2e8227SGreg Roach
378c2e8227SGreg Roach		$filter   = get_block_setting($block_id, 'filter', 'all');
388c2e8227SGreg Roach		$controls = get_block_setting($block_id, 'controls', '1');
398c2e8227SGreg Roach		$start    = get_block_setting($block_id, 'start', '0') || Filter::getBool('start');
408c2e8227SGreg Roach
418c2e8227SGreg Roach		// We can apply the filters using SQL
428c2e8227SGreg Roach		// Do not use "ORDER BY RAND()" - it is very slow on large tables.  Use PHP::array_rand() instead.
438c2e8227SGreg Roach		$all_media = Database::prepare(
448c2e8227SGreg Roach			"SELECT m_id FROM `##media`" .
458c2e8227SGreg Roach			" WHERE m_file = ?" .
468c2e8227SGreg Roach			" AND m_ext  IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')" .
478c2e8227SGreg Roach			" AND m_type IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')"
488c2e8227SGreg Roach		)->execute(array(
498c2e8227SGreg Roach			WT_GED_ID,
508c2e8227SGreg Roach			get_block_setting($block_id, 'filter_avi', '0') ? 'avi' : null,
518c2e8227SGreg Roach			get_block_setting($block_id, 'filter_bmp', '1') ? 'bmp' : null,
528c2e8227SGreg Roach			get_block_setting($block_id, 'filter_gif', '1') ? 'gif' : null,
538c2e8227SGreg Roach			get_block_setting($block_id, 'filter_jpeg', '1') ? 'jpg' : null,
548c2e8227SGreg Roach			get_block_setting($block_id, 'filter_jpeg', '1') ? 'jpeg' : null,
558c2e8227SGreg Roach			get_block_setting($block_id, 'filter_mp3', '0') ? 'mp3' : null,
568c2e8227SGreg Roach			get_block_setting($block_id, 'filter_ole', '1') ? 'ole' : null,
578c2e8227SGreg Roach			get_block_setting($block_id, 'filter_pcx', '1') ? 'pcx' : null,
588c2e8227SGreg Roach			get_block_setting($block_id, 'filter_pdf', '0') ? 'pdf' : null,
598c2e8227SGreg Roach			get_block_setting($block_id, 'filter_png', '1') ? 'png' : null,
608c2e8227SGreg Roach			get_block_setting($block_id, 'filter_tiff', '1') ? 'tiff' : null,
618c2e8227SGreg Roach			get_block_setting($block_id, 'filter_wav', '0') ? 'wav' : null,
628c2e8227SGreg Roach			get_block_setting($block_id, 'filter_audio', '0') ? 'audio' : null,
638c2e8227SGreg Roach			get_block_setting($block_id, 'filter_book', '1') ? 'book' : null,
648c2e8227SGreg Roach			get_block_setting($block_id, 'filter_card', '1') ? 'card' : null,
658c2e8227SGreg Roach			get_block_setting($block_id, 'filter_certificate', '1') ? 'certificate' : null,
668c2e8227SGreg Roach			get_block_setting($block_id, 'filter_coat', '1') ? 'coat' : null,
678c2e8227SGreg Roach			get_block_setting($block_id, 'filter_document', '1') ? 'document' : null,
688c2e8227SGreg Roach			get_block_setting($block_id, 'filter_electronic', '1') ? 'electronic' : null,
698c2e8227SGreg Roach			get_block_setting($block_id, 'filter_fiche', '1') ? 'fiche' : null,
708c2e8227SGreg Roach			get_block_setting($block_id, 'filter_film', '1') ? 'film' : null,
718c2e8227SGreg Roach			get_block_setting($block_id, 'filter_magazine', '1') ? 'magazine' : null,
728c2e8227SGreg Roach			get_block_setting($block_id, 'filter_manuscript', '1') ? 'manuscript' : null,
738c2e8227SGreg Roach			get_block_setting($block_id, 'filter_map', '1') ? 'map' : null,
748c2e8227SGreg Roach			get_block_setting($block_id, 'filter_newspaper', '1') ? 'newspaper' : null,
758c2e8227SGreg Roach			get_block_setting($block_id, 'filter_other', '1') ? 'other' : null,
768c2e8227SGreg Roach			get_block_setting($block_id, 'filter_painting', '1') ? 'painting' : null,
778c2e8227SGreg Roach			get_block_setting($block_id, 'filter_photo', '1') ? 'photo' : null,
788c2e8227SGreg Roach			get_block_setting($block_id, 'filter_tombstone', '1') ? 'tombstone' : null,
798c2e8227SGreg Roach			get_block_setting($block_id, 'filter_video', '0') ? 'video' : null,
808c2e8227SGreg Roach		))->fetchOneColumn();
818c2e8227SGreg Roach
828c2e8227SGreg Roach		// Keep looking through the media until a suitable one is found.
838c2e8227SGreg Roach		$random_media = null;
848c2e8227SGreg Roach		while ($all_media) {
858c2e8227SGreg Roach			$n = array_rand($all_media);
868c2e8227SGreg Roach			$media = Media::getInstance($all_media[$n]);
878c2e8227SGreg Roach			if ($media->canShow() && !$media->isExternal()) {
888c2e8227SGreg Roach				// Check if it is linked to a suitable individual
898c2e8227SGreg Roach				foreach ($media->linkedIndividuals('OBJE') as $indi) {
908c2e8227SGreg Roach					if (
918c2e8227SGreg Roach						$filter === 'all' ||
928c2e8227SGreg Roach						$filter === 'indi' && strpos($indi->getGedcom(), "\n1 OBJE @" . $media->getXref() . '@') !== false ||
938c2e8227SGreg Roach						$filter === 'event' && strpos($indi->getGedcom(), "\n2 OBJE @" . $media->getXref() . '@') !== false
948c2e8227SGreg Roach					) {
958c2e8227SGreg Roach						// Found one :-)
968c2e8227SGreg Roach						$random_media = $media;
978c2e8227SGreg Roach						break 2;
988c2e8227SGreg Roach					}
998c2e8227SGreg Roach				}
1008c2e8227SGreg Roach			}
1018c2e8227SGreg Roach			unset($all_media[$n]);
1028c2e8227SGreg Roach		};
1038c2e8227SGreg Roach
1048c2e8227SGreg Roach		$id = $this->getName() . $block_id;
1058c2e8227SGreg Roach		$class = $this->getName() . '_block';
106*4b9ff166SGreg Roach		if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
1078c2e8227SGreg Roach			$title = '<i class="icon-admin" title="' . I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>';
1088c2e8227SGreg Roach		} else {
1098c2e8227SGreg Roach			$title = '';
1108c2e8227SGreg Roach		}
1118c2e8227SGreg Roach		$title .= $this->getTitle();
1128c2e8227SGreg Roach
1138c2e8227SGreg Roach		if ($random_media) {
1148c2e8227SGreg Roach			$content = "<div id=\"random_picture_container$block_id\">";
1158c2e8227SGreg Roach			if ($controls) {
1168c2e8227SGreg Roach				if ($start) {
1178c2e8227SGreg Roach					$icon_class = 'icon-media-stop';
1188c2e8227SGreg Roach				} else {
1198c2e8227SGreg Roach					$icon_class = 'icon-media-play';
1208c2e8227SGreg Roach				}
1218c2e8227SGreg Roach				$content .= '<div dir="ltr" class="center" id="random_picture_controls' . $block_id . '"><br>';
1228c2e8227SGreg Roach				$content .= "<a href=\"#\" onclick=\"togglePlay(); return false;\" id=\"play_stop\" class=\"" . $icon_class . "\" title=\"" . I18N::translate('Play') . "/" . I18N::translate('Stop') . '"></a>';
1238c2e8227SGreg Roach				$content .= '<a href="#" onclick="jQuery(\'#block_' . $block_id . '\').load(\'index.php?ctype=' . $ctype . '&amp;action=ajax&amp;block_id=' . $block_id . '\');return false;" title="' . I18N::translate('Next image') . '" class="icon-media-next"></a>';
1248c2e8227SGreg Roach				$content .= '</div><script>
1258c2e8227SGreg Roach					var play = false;
1268c2e8227SGreg Roach						function togglePlay() {
1278c2e8227SGreg Roach							if (play) {
1288c2e8227SGreg Roach								play = false;
1298c2e8227SGreg Roach								jQuery("#play_stop").removeClass("icon-media-stop").addClass("icon-media-play");
1308c2e8227SGreg Roach							}
1318c2e8227SGreg Roach							else {
1328c2e8227SGreg Roach								play = true;
1338c2e8227SGreg Roach								playSlideShow();
1348c2e8227SGreg Roach								jQuery("#play_stop").removeClass("icon-media-play").addClass("icon-media-stop");
1358c2e8227SGreg Roach							}
1368c2e8227SGreg Roach						}
1378c2e8227SGreg Roach
1388c2e8227SGreg Roach						function playSlideShow() {
1398c2e8227SGreg Roach							if (play) {
1408c2e8227SGreg Roach								window.setTimeout("reload_image()", 6000);
1418c2e8227SGreg Roach							}
1428c2e8227SGreg Roach						}
1438c2e8227SGreg Roach						function reload_image() {
1448c2e8227SGreg Roach							if (play) {
1458c2e8227SGreg Roach								jQuery("#block_'.$block_id . '").load("index.php?ctype=' . $ctype . '&action=ajax&block_id=' . $block_id . '&start=1");
1468c2e8227SGreg Roach							}
1478c2e8227SGreg Roach						}
1488c2e8227SGreg Roach					</script>';
1498c2e8227SGreg Roach			}
1508c2e8227SGreg Roach			if ($start) {
1518c2e8227SGreg Roach				$content .= '<script>togglePlay();</script>';
1528c2e8227SGreg Roach			}
1538c2e8227SGreg Roach			$content .= '<div class="center" id="random_picture_content' . $block_id . '">';
1548c2e8227SGreg Roach			$content .= '<table id="random_picture_box"><tr><td class="details1">';
1558c2e8227SGreg Roach			$content .= $random_media->displayImage();
1568c2e8227SGreg Roach
1578c2e8227SGreg Roach			$content .= '<br>';
1588c2e8227SGreg Roach			$content .= '<a href="' . $random_media->getHtmlUrl() . '"><b>' . $random_media->getFullName() . '</b></a><br>';
1598c2e8227SGreg Roach			foreach ($random_media->linkedIndividuals('OBJE') as $individual) {
1608c2e8227SGreg Roach				$content .= '<a href="' . $individual->getHtmlUrl() . '">' . I18N::translate('View individual') . ' — ' . $individual->getFullname() . '</a><br>';
1618c2e8227SGreg Roach			}
1628c2e8227SGreg Roach			foreach ($random_media->linkedFamilies('OBJE') as $family) {
1638c2e8227SGreg Roach				$content .= '<a href="' . $family->getHtmlUrl() . '">' . I18N::translate('View family') . ' — ' . $family->getFullname() . '</a><br>';
1648c2e8227SGreg Roach			}
1658c2e8227SGreg Roach			foreach ($random_media->linkedSources('OBJE') as $source) {
1668c2e8227SGreg Roach				$content .= '<a href="' . $source->getHtmlUrl() . '">' . I18N::translate('View source') . ' — ' . $source->getFullname() . '</a><br>';
1678c2e8227SGreg Roach			}
1688c2e8227SGreg Roach			$content .= '<br><div class="indent">';
1698c2e8227SGreg Roach			$content .= print_fact_notes($random_media->getGedcom(), "1", false);
1708c2e8227SGreg Roach			$content .= '</div>';
1718c2e8227SGreg Roach			$content .= '</td></tr></table>';
1728c2e8227SGreg Roach			$content .= '</div>'; // random_picture_content
1738c2e8227SGreg Roach			$content .= '</div>'; // random_picture_container
1748c2e8227SGreg Roach		} else {
1758c2e8227SGreg Roach			$content = I18N::translate('This family tree has no images to display.');
1768c2e8227SGreg Roach		}
1778c2e8227SGreg Roach		if ($template) {
1788c2e8227SGreg Roach			echo Theme::theme()->formatBlock($id, $title, $class, $content);
1798c2e8227SGreg Roach		} else {
1808c2e8227SGreg Roach			return $content;
1818c2e8227SGreg Roach		}
1828c2e8227SGreg Roach	}
1838c2e8227SGreg Roach
1848c2e8227SGreg Roach	/** {@inheritdoc} */
1858c2e8227SGreg Roach	public function loadAjax() {
1868c2e8227SGreg Roach		return true;
1878c2e8227SGreg Roach	}
1888c2e8227SGreg Roach
1898c2e8227SGreg Roach	/** {@inheritdoc} */
1908c2e8227SGreg Roach	public function isUserBlock() {
1918c2e8227SGreg Roach		return true;
1928c2e8227SGreg Roach	}
1938c2e8227SGreg Roach
1948c2e8227SGreg Roach	/** {@inheritdoc} */
1958c2e8227SGreg Roach	public function isGedcomBlock() {
1968c2e8227SGreg Roach		return true;
1978c2e8227SGreg Roach	}
1988c2e8227SGreg Roach
1998c2e8227SGreg Roach	/** {@inheritdoc} */
2008c2e8227SGreg Roach	public function configureBlock($block_id) {
2018c2e8227SGreg Roach		if (Filter::postBool('save') && Filter::checkCsrf()) {
2028c2e8227SGreg Roach			set_block_setting($block_id, 'filter', Filter::post('filter', 'indi|event|all', 'all'));
2038c2e8227SGreg Roach			set_block_setting($block_id, 'controls', Filter::postBool('controls'));
2048c2e8227SGreg Roach			set_block_setting($block_id, 'start', Filter::postBool('start'));
2058c2e8227SGreg Roach			set_block_setting($block_id, 'filter_avi', Filter::postBool('filter_avi'));
2068c2e8227SGreg Roach			set_block_setting($block_id, 'filter_bmp', Filter::postBool('filter_bmp'));
2078c2e8227SGreg Roach			set_block_setting($block_id, 'filter_gif', Filter::postBool('filter_gif'));
2088c2e8227SGreg Roach			set_block_setting($block_id, 'filter_jpeg', Filter::postBool('filter_jpeg'));
2098c2e8227SGreg Roach			set_block_setting($block_id, 'filter_mp3', Filter::postBool('filter_mp3'));
2108c2e8227SGreg Roach			set_block_setting($block_id, 'filter_ole', Filter::postBool('filter_ole'));
2118c2e8227SGreg Roach			set_block_setting($block_id, 'filter_pcx', Filter::postBool('filter_pcx'));
2128c2e8227SGreg Roach			set_block_setting($block_id, 'filter_pdf', Filter::postBool('filter_pdf'));
2138c2e8227SGreg Roach			set_block_setting($block_id, 'filter_png', Filter::postBool('filter_png'));
2148c2e8227SGreg Roach			set_block_setting($block_id, 'filter_tiff', Filter::postBool('filter_tiff'));
2158c2e8227SGreg Roach			set_block_setting($block_id, 'filter_wav', Filter::postBool('filter_wav'));
2168c2e8227SGreg Roach			set_block_setting($block_id, 'filter_audio', Filter::postBool('filter_audio'));
2178c2e8227SGreg Roach			set_block_setting($block_id, 'filter_book', Filter::postBool('filter_book'));
2188c2e8227SGreg Roach			set_block_setting($block_id, 'filter_card', Filter::postBool('filter_card'));
2198c2e8227SGreg Roach			set_block_setting($block_id, 'filter_certificate', Filter::postBool('filter_certificate'));
2208c2e8227SGreg Roach			set_block_setting($block_id, 'filter_coat', Filter::postBool('filter_coat'));
2218c2e8227SGreg Roach			set_block_setting($block_id, 'filter_document', Filter::postBool('filter_document'));
2228c2e8227SGreg Roach			set_block_setting($block_id, 'filter_electronic', Filter::postBool('filter_electronic'));
2238c2e8227SGreg Roach			set_block_setting($block_id, 'filter_fiche', Filter::postBool('filter_fiche'));
2248c2e8227SGreg Roach			set_block_setting($block_id, 'filter_film', Filter::postBool('filter_film'));
2258c2e8227SGreg Roach			set_block_setting($block_id, 'filter_magazine', Filter::postBool('filter_magazine'));
2268c2e8227SGreg Roach			set_block_setting($block_id, 'filter_manuscript', Filter::postBool('filter_manuscript'));
2278c2e8227SGreg Roach			set_block_setting($block_id, 'filter_map', Filter::postBool('filter_map'));
2288c2e8227SGreg Roach			set_block_setting($block_id, 'filter_newspaper', Filter::postBool('filter_newspaper'));
2298c2e8227SGreg Roach			set_block_setting($block_id, 'filter_other', Filter::postBool('filter_other'));
2308c2e8227SGreg Roach			set_block_setting($block_id, 'filter_painting', Filter::postBool('filter_painting'));
2318c2e8227SGreg Roach			set_block_setting($block_id, 'filter_photo', Filter::postBool('filter_photo'));
2328c2e8227SGreg Roach			set_block_setting($block_id, 'filter_tombstone', Filter::postBool('filter_tombstone'));
2338c2e8227SGreg Roach			set_block_setting($block_id, 'filter_video', Filter::postBool('filter_video'));
2348c2e8227SGreg Roach		}
2358c2e8227SGreg Roach
2368c2e8227SGreg Roach		$filter   = get_block_setting($block_id, 'filter', 'all');
2378c2e8227SGreg Roach		$controls = get_block_setting($block_id, 'controls', '1');
2388c2e8227SGreg Roach		$start    = get_block_setting($block_id, 'start', '0') || Filter::getBool('start');
2398c2e8227SGreg Roach
2408c2e8227SGreg Roach		echo '<tr><td class="descriptionbox wrap width33">';
2418c2e8227SGreg Roach		echo I18N::translate('Show only individuals, events, or all?');
2428c2e8227SGreg Roach		echo '</td><td class="optionbox">';
2438c2e8227SGreg Roach		echo select_edit_control('filter', array('indi'=> I18N::translate('Individuals'), 'event'=> I18N::translate('Facts and events'), 'all'=> I18N::translate('All')), null, $filter, '');
2448c2e8227SGreg Roach		echo '</td></tr>';
2458c2e8227SGreg Roach
2468c2e8227SGreg Roach		$filters = array(
2478c2e8227SGreg Roach			'avi'        =>get_block_setting($block_id, 'filter_avi', '0'),
2488c2e8227SGreg Roach			'bmp'        =>get_block_setting($block_id, 'filter_bmp', '1'),
2498c2e8227SGreg Roach			'gif'        =>get_block_setting($block_id, 'filter_gif', '1'),
2508c2e8227SGreg Roach			'jpeg'       =>get_block_setting($block_id, 'filter_jpeg', '1'),
2518c2e8227SGreg Roach			'mp3'        =>get_block_setting($block_id, 'filter_mp3', '0'),
2528c2e8227SGreg Roach			'ole'        =>get_block_setting($block_id, 'filter_ole', '1'),
2538c2e8227SGreg Roach			'pcx'        =>get_block_setting($block_id, 'filter_pcx', '1'),
2548c2e8227SGreg Roach			'pdf'        =>get_block_setting($block_id, 'filter_pdf', '0'),
2558c2e8227SGreg Roach			'png'        =>get_block_setting($block_id, 'filter_png', '1'),
2568c2e8227SGreg Roach			'tiff'       =>get_block_setting($block_id, 'filter_tiff', '1'),
2578c2e8227SGreg Roach			'wav'        =>get_block_setting($block_id, 'filter_wav', '0'),
2588c2e8227SGreg Roach			'audio'      =>get_block_setting($block_id, 'filter_audio', '0'),
2598c2e8227SGreg Roach			'book'       =>get_block_setting($block_id, 'filter_book', '1'),
2608c2e8227SGreg Roach			'card'       =>get_block_setting($block_id, 'filter_card', '1'),
2618c2e8227SGreg Roach			'certificate'=>get_block_setting($block_id, 'filter_certificate', '1'),
2628c2e8227SGreg Roach			'coat'       =>get_block_setting($block_id, 'filter_coat', '1'),
2638c2e8227SGreg Roach			'document'   =>get_block_setting($block_id, 'filter_document', '1'),
2648c2e8227SGreg Roach			'electronic' =>get_block_setting($block_id, 'filter_electronic', '1'),
2658c2e8227SGreg Roach			'fiche'      =>get_block_setting($block_id, 'filter_fiche', '1'),
2668c2e8227SGreg Roach			'film'       =>get_block_setting($block_id, 'filter_film', '1'),
2678c2e8227SGreg Roach			'magazine'   =>get_block_setting($block_id, 'filter_magazine', '1'),
2688c2e8227SGreg Roach			'manuscript' =>get_block_setting($block_id, 'filter_manuscript', '1'),
2698c2e8227SGreg Roach			'map'        =>get_block_setting($block_id, 'filter_map', '1'),
2708c2e8227SGreg Roach			'newspaper'  =>get_block_setting($block_id, 'filter_newspaper', '1'),
2718c2e8227SGreg Roach			'other'      =>get_block_setting($block_id, 'filter_other', '1'),
2728c2e8227SGreg Roach			'painting'   =>get_block_setting($block_id, 'filter_painting', '1'),
2738c2e8227SGreg Roach			'photo'      =>get_block_setting($block_id, 'filter_photo', '1'),
2748c2e8227SGreg Roach			'tombstone'  =>get_block_setting($block_id, 'filter_tombstone', '1'),
2758c2e8227SGreg Roach			'video'      =>get_block_setting($block_id, 'filter_video', '0'),
2768c2e8227SGreg Roach		);
2778c2e8227SGreg Roach
2788c2e8227SGreg Roach		echo '<tr><td class="descriptionbox wrap width33">';
2798c2e8227SGreg Roach		echo I18N::translate('Filter');
2808c2e8227SGreg Roach		?>
2818c2e8227SGreg Roach	</td>
2828c2e8227SGreg Roach	<td class="optionbox">
283764a01d9SGreg Roach		<center><b><?php echo GedcomTag::getLabel('FORM'); ?></b></center>
2848c2e8227SGreg Roach		<table class="width100">
2858c2e8227SGreg Roach			<tr>
2868c2e8227SGreg Roach				<td class="width33">
2878c2e8227SGreg Roach					<label>
2888c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_avi" <?php echo $filters['avi'] ? 'checked' : ''; ?>>
2898c2e8227SGreg Roach						avi
2908c2e8227SGreg Roach				</td>
2918c2e8227SGreg Roach				<td class="width33">
2928c2e8227SGreg Roach					<label>
2938c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_bmp" <?php echo $filters['bmp'] ? 'checked' : ''; ?>>
2948c2e8227SGreg Roach						bmp
2958c2e8227SGreg Roach					</label>
2968c2e8227SGreg Roach				</td>
2978c2e8227SGreg Roach				<td class="width33">
2988c2e8227SGreg Roach					<label>
2998c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_gif" <?php echo $filters['gif'] ? 'checked' : ''; ?>>
3008c2e8227SGreg Roach						gif
3018c2e8227SGreg Roach					</label>
3028c2e8227SGreg Roach				</td>
3038c2e8227SGreg Roach			</tr>
3048c2e8227SGreg Roach			<tr>
3058c2e8227SGreg Roach				<td class="width33">
3068c2e8227SGreg Roach					<label>
3078c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_jpeg" <?php echo $filters['jpeg'] ? 'checked' : ''; ?>>
3088c2e8227SGreg Roach						jpeg
3098c2e8227SGreg Roach					</label>
3108c2e8227SGreg Roach				</td>
3118c2e8227SGreg Roach				<td class="width33">
3128c2e8227SGreg Roach					<label>
3138c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_mp3" <?php echo $filters['mp3'] ? 'checked' : ''; ?>>
3148c2e8227SGreg Roach						mp3
3158c2e8227SGreg Roach					</label>
3168c2e8227SGreg Roach				</td>
3178c2e8227SGreg Roach					<td class="width33">
3188c2e8227SGreg Roach					<label>
3198c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_ole" <?php echo $filters['ole'] ? 'checked' : ''; ?>>
3208c2e8227SGreg Roach						ole
3218c2e8227SGreg Roach					</label>
3228c2e8227SGreg Roach				</td>
3238c2e8227SGreg Roach			</tr>
3248c2e8227SGreg Roach			<tr>
3258c2e8227SGreg Roach				<td class="width33">
3268c2e8227SGreg Roach					<label>
3278c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_pcx" <?php echo $filters['pcx'] ? 'checked' : ''; ?>>
3288c2e8227SGreg Roach						pcx
3298c2e8227SGreg Roach					</label>
3308c2e8227SGreg Roach				</td>
3318c2e8227SGreg Roach				<td class="width33">
3328c2e8227SGreg Roach					<label>
3338c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_pdf" <?php echo $filters['pdf'] ? 'checked' : ''; ?>>
3348c2e8227SGreg Roach						pdf
3358c2e8227SGreg Roach					</label>
3368c2e8227SGreg Roach				</td>
3378c2e8227SGreg Roach				<td class="width33">
3388c2e8227SGreg Roach					<label>
3398c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_png" <?php echo $filters['png'] ? 'checked' : ''; ?>>
3408c2e8227SGreg Roach						png
3418c2e8227SGreg Roach					</label>
3428c2e8227SGreg Roach				</td>
3438c2e8227SGreg Roach			</tr>
3448c2e8227SGreg Roach			<tr>
3458c2e8227SGreg Roach				<td class="width33">
3468c2e8227SGreg Roach					<label>
3478c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_tiff" <?php echo $filters['tiff'] ? 'checked' : ''; ?>>
3488c2e8227SGreg Roach						tiff
3498c2e8227SGreg Roach					</label>
3508c2e8227SGreg Roach				</td>
3518c2e8227SGreg Roach				<td class="width33">
3528c2e8227SGreg Roach					<label>
3538c2e8227SGreg Roach						<input type="checkbox" value="yes" name="filter_wav" <?php echo $filters['wav'] ? 'checked' : ''; ?>>
3548c2e8227SGreg Roach						wav
3558c2e8227SGreg Roach					</label>
3568c2e8227SGreg Roach				</td>
3578c2e8227SGreg Roach				<td class="width33"></td>
3588c2e8227SGreg Roach				<td class="width33"></td>
3598c2e8227SGreg Roach			</tr>
3608c2e8227SGreg Roach		</table>
3618c2e8227SGreg Roach			<br>
362764a01d9SGreg Roach			<center><b><?php echo GedcomTag::getLabel('TYPE'); ?></b></center>
3638c2e8227SGreg Roach				<table class="width100">
3648c2e8227SGreg Roach					<tr>
3658c2e8227SGreg Roach					<?php
3668c2e8227SGreg Roach					//-- Build the list of checkboxes
3678c2e8227SGreg Roach					$i = 0;
368764a01d9SGreg Roach					foreach (GedcomTag::getFileFormTypes() as $typeName => $typeValue) {
3698c2e8227SGreg Roach						$i++;
3708c2e8227SGreg Roach						if ($i > 3) {
3718c2e8227SGreg Roach							$i = 1;
3728c2e8227SGreg Roach							echo '</tr><tr>';
3738c2e8227SGreg Roach						}
3748c2e8227SGreg Roach						echo '<td class="width33"><label><input type="checkbox" value="yes" name="filter_' . $typeName . '" ';
3758c2e8227SGreg Roach						echo ($filters[$typeName]) ? 'checked' : '';
3768c2e8227SGreg Roach						echo '> ' . $typeValue . '</label></td>';
3778c2e8227SGreg Roach					}
3788c2e8227SGreg Roach					?>
3798c2e8227SGreg Roach				</tr>
3808c2e8227SGreg Roach			</table>
3818c2e8227SGreg Roach		</td>
3828c2e8227SGreg Roach	</tr>
3838c2e8227SGreg Roach
3848c2e8227SGreg Roach	<?php
3858c2e8227SGreg Roach
3868c2e8227SGreg Roach		echo '<tr><td class="descriptionbox wrap width33">';
3878c2e8227SGreg Roach		echo I18N::translate('Show slide show controls?');
3888c2e8227SGreg Roach		echo '</td><td class="optionbox">';
3898c2e8227SGreg Roach		echo edit_field_yes_no('controls', $controls);
3908c2e8227SGreg Roach		echo '</td></tr>';
3918c2e8227SGreg Roach
3928c2e8227SGreg Roach		echo '<tr><td class="descriptionbox wrap width33">';
3938c2e8227SGreg Roach		echo I18N::translate('Start slide show on page load?');
3948c2e8227SGreg Roach		echo '</td><td class="optionbox">';
3958c2e8227SGreg Roach		echo edit_field_yes_no('start', $start);
3968c2e8227SGreg Roach		echo '</td></tr>';
3978c2e8227SGreg Roach	}
3988c2e8227SGreg Roach}
399