2000000) { $content = file_get_contents($filePath, false, null, max(0, $fileSize - 2000000)); } else { $content = file_get_contents($filePath); } } else { $content = "⚠️ File not found or not readable: $filePath"; } // Prepare the download button HTML if filePath starts with /app $downloadButtonHtml = ''; if (strpos($filePath, '/app') === 0 && file_exists($filePath)) { $downloadButtonHtml = ' '; } // Prepare buttons HTML $buttonsHtml = ''; $totalButtons = count($buttons); $colClass = $totalButtons > 0 ? (12 / $totalButtons) : 12; foreach ($buttons as $button) { $labelStringCode = isset($button['labelStringCode']) ? $button['labelStringCode'] : ''; $event = isset($button['event']) ? $button['event'] : ''; $buttonsHtml .= '
'; } // Render HTML $html = '