-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbmd.php
More file actions
76 lines (66 loc) · 2.66 KB
/
Copy pathbmd.php
File metadata and controls
76 lines (66 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once __DIR__ . '/config.php';
$pageTitle = 'BMD';
$activeNav = 'bmd';
$realRoot = realpath($FILES_ROOT);
$bmdFiles = [];
if ($realRoot && is_dir($realRoot)) {
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($realRoot, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ($iterator as $file) {
if (strtolower($file->getExtension()) === 'bmd') {
$relativePath = substr($file->getPathname(), strlen($realRoot) + 1);
$size = $file->getSize();
$bmdFiles[] = ['path' => $relativePath, 'size' => $size];
}
}
usort($bmdFiles, function($a, $b) {
return strnatcasecmp($a['path'], $b['path']);
});
}
include __DIR__ . '/includes/header.php';
?>
<h2>BMD 3D Models</h2>
<p class="root-path">Root: <code><?php echo htmlspecialchars($FILES_ROOT); ?></code></p>
<?php if (!empty($bmdFiles)): ?>
<p class="file-count"><?php echo count($bmdFiles); ?> BMD file(s) found</p>
<div class="file-grid" id="file-grid">
<?php foreach ($bmdFiles as $file): ?>
<div class="file-card bmd-card" data-file="<?php echo htmlspecialchars($file['path']); ?>" data-name="<?php echo htmlspecialchars(basename($file['path'])); ?>" data-size="<?php echo $file['size']; ?>">
<div class="file-placeholder fbx-icon">BMD</div>
<div class="file-name" title="<?php echo htmlspecialchars($file['path']); ?>"><?php echo htmlspecialchars(basename($file['path'])); ?></div>
<div class="file-path"><?php echo htmlspecialchars(dirname($file['path']) === '.' ? '' : dirname($file['path'])); ?></div>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="empty-state">
<p>No BMD files found.</p>
</div>
<?php endif; ?>
<!-- BMD Viewer Modal -->
<div class="modal-overlay" id="modal">
<div class="modal-content modal-content-fbx">
<div class="modal-header">
<span class="modal-filename" id="modal-filename"></span>
<button class="modal-close" id="modal-close">×</button>
</div>
<div class="fbx-viewport" id="fbx-viewport"></div>
<div class="modal-info" id="modal-info"></div>
</div>
</div>
<script src="js/group-toggle.js"></script>
<script src="js/selection.js"></script>
<script src="js/bmd-parser.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
}
}
</script>
<script type="module" src="js/bmd-app.js"></script>
<?php include __DIR__ . '/includes/footer.php'; ?>