<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
	<title>MagixMedia - Gestionnaire</title>
	<style>
		body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; }
	</style>
	<script data-main="./main.default.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
	<script>
		define('elFinderConfig', {
			// elFinder options (REQUIRED)
			defaultOpts : {
				url : 'php/connector.minimal.php', // Ton connecteur sécurisé
				lang: 'fr', // On force le français
				height: '100%',
				// --- CHARGEMENT DU THÈME MATERIAL ---
				// elFinder va charger ce CSS juste après ses propres styles pour bien les écraser
				cssAutoLoad : ['themes/material/css/theme-gray.css?v=3'],
				// ------------------------------------
				thumbnails : {
					width : 128, // Taille de génération des miniatures
					height : 128
				},
				uiOptions : {
					cwd : {
						iconsSize : 80 // Valeur par défaut souvent à 48 ou 64. Teste 80 ou 96.
					}/*,
					toolbar : [
						['back', 'forward'],
						['mkdir', 'upload'],
						['open', 'download', 'getfile'],
						['info', 'quicklook'], // <--- ON AJOUTE 'quicklook' ICI
						['copy', 'cut', 'paste'],
						['rm'],
						['duplicate', 'rename', 'edit', 'resize'],
						['view', 'sort']
					]*/
				},
				// --- LE PONT TINYMCE 7 ---
				getFileCallback: function(file) {
					// On envoie l'URL à TinyMCE via postMessage
					window.parent.postMessage({
						mceAction: 'insertFile',
						content: file.url
					}, '*');
				},
				// -------------------------

				commandsOptions : {
					getfile: {
						oncomplete: 'close', // Ferme la popup après sélection
						folders: false       // Interdit la sélection de dossiers
					},
					edit : {
						extraOptions : {
							creativeCloudApiKey : '',
							managerUrl : ''
						}
					},
					quicklook : {
						sharecadMimes : ['image/vnd.dwg', 'image/vnd.dxf', 'model/vnd.dwf', 'application/vnd.hp-hpgl', 'application/plt', 'application/step', 'model/iges', 'application/vnd.ms-pki.stl', 'application/sat', 'image/cgm', 'application/x-msmetafile'],
						googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/postscript', 'application/rtf'],
						officeOnlineMimes : ['application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation']
					}
				},
				bootCallback : function(fm, extraObj) {
					fm.bind('init', function() {
						// Code à l'initialisation si besoin
					});
					var title = document.title;
					fm.bind('open', function() {
						var path = '',
								cwd  = fm.cwd();
						if (cwd) {
							path = fm.path(cwd.hash) || null;
						}
						document.title = path? path + ':' + title : title;
					}).bind('destroy', function() {
						document.title = title;
					});
				}
			},
			managers : {
				'elfinder': {}
			}
		});
	</script>
</head>
<body>

<div id="elfinder" style="height: 100vh; border: none;"></div>

</body>
</html>