$f, 'path' => '/' . $rel]; } } } return $files; } $allFiles = scanArsenal('/opt/wevads-arsenal/public', '', $excludeDirs, $excludeFiles); usort($allFiles, fn($a,$b) => strcmp($a['name'], $b['name'])); // Parse current menu.html - line-by-line approach (proven working) function parseMenuHTML($file) { $html = file_get_contents($file); if (!$html) return []; $lines = explode("\n", $html); $secs = []; $cur = null; foreach($lines as $l) { $l = trim($l); if (strpos($l, 'sec-title') !== false && strpos($l, 'onclick') !== false) { $icon = 'fas fa-folder'; $color = '#22d3ee'; $title = ''; if (preg_match('/class="([^"]+)" style="color:([^"]+)"/', $l, $m)) { $icon = $m[1]; $color = $m[2]; } if (preg_match('/<\/i>\s*(.+?)\s* $title, 'icon' => $icon, 'color' => $color, 'items' => []]; } if ($cur && strpos($l, 'class="item') !== false && strpos($l, 'href=') !== false) { $href = ''; $ico = ''; $name = ''; $tag = '5890'; if (preg_match('/href="([^"]+)"/', $l, $m)) $href = $m[1]; if (preg_match('/class="ico">([^<]*)([^<]*)$href, 'ico'=>$ico, 'name'=>$name, 'tag'=>$tag, 'highlight'=>$hl]; } } if ($cur) $secs[] = $cur; return $secs; } $menuSections = parseMenuHTML('/opt/wevads-arsenal/public/menu.html'); $filesJson = json_encode($allFiles, JSON_UNESCAPED_UNICODE); $menuJson = json_encode($menuSections, JSON_UNESCAPED_UNICODE); ?> Sidebar Admin - Arsenal

Sidebar Admin Arsenal 5890 • menu.html

Fichiers Arsenal
0
Structure Menu
0