stany.ferer 1 год назад
Родитель
Сommit
9515bbddc0
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 2
      core/class/xml.class.php
  2. 2 1
      core/views/pages/cms.document.php

+ 1 - 2
core/class/xml.class.php

@@ -13,7 +13,7 @@ class xml{
 
         // Affichage du XML formaté avec du style CSS pour colorer les éléments XML
         header('Content-Type: text/html; charset=UTF-8');
-        echo "<html><head><title>Visualisation XML avec couleurs</title>";
+        echo "<html><head>";
         // Ajouter du CSS pour colorer les éléments XML et gérer l'enroulement
         echo "
             <style>
@@ -32,7 +32,6 @@ class xml{
             </style>
         ";
         echo "</head><body>";
-        echo "<h1>Visualisation du fichier XML avec code couleur</h1>";
 
         // Remplacer les éléments pour les colorier avec du CSS
         $formatted_xml = preg_replace('/(&lt;\/?)(\w+)(.*?&gt;)/', '<span class="tag">$1$2</span>$3', $formatted_xml);

+ 2 - 1
core/views/pages/cms.document.php

@@ -183,7 +183,8 @@ if (isset($document["id"])) {
             <?php } else {
                 $getMime = mime_content_type(file::download($files["principal"]["id"], DIR_DATAS_DOCS));
                 $heigh = ($getMime == "application/pdf" OR $getMime == "text/xml" OR $getMime == "application/xml") ? "height:110vh;" : NULL;
-                echo '  <div style="margin-top:22px;">
+                $marginTop = ($getMime == "text/xml" OR $getMime == "application/xml") ? "margin-top:4px;" : "margin-top:22px;";
+                echo '  <div style="' . $marginTop . '">
                         <embed src="/document.php?id=' . $files["principal"]["id"] . '" style="width:100%; margin-top:10px;' . $heigh . '" /></embed>
                     </div><br />
                     ';