]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6717 @0:01
authorsoufiane <soufiane@cubedesigners.com>
Tue, 13 Feb 2024 16:16:14 +0000 (17:16 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 13 Feb 2024 16:16:14 +0000 (17:16 +0100)
app/Console/Commands/FluidbookSettingsExport.php

index 115af783569a132f63076b45746a085c01537ebf..23de3b740c45a3c613cf43d3d96d2f5fd78ea421 100644 (file)
@@ -85,18 +85,16 @@ class FluidbookSettingsExport extends ToolboxCommand
 
         foreach ($keys as $key) {
             $c++;
-            if($field[$key]['type'] !== 'hidden') {
-                $columns = max($columns, $c);
-                $cell = $sheet->getCellByColumnAndRow($c, $line);
-                $cell->setValue($key);
-                $style = $sheet->getStyleByColumnAndRow($c, $line);
-                if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable') {
-                    $style->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
-                    $style->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('dddddd');
-                }
-                $style->getFont()->setBold(true);
-                $style->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
+            $columns = max($columns, $c);
+            $cell = $sheet->getCellByColumnAndRow($c, $line);
+            $cell->setValue($key);
+            $style = $sheet->getStyleByColumnAndRow($c, $line);
+            if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable') {
+                $style->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
+                $style->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('dddddd');
             }
+            $style->getFont()->setBold(true);
+            $style->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
         }
 
         for ($i = 0; $i < sizeof($settings); $i++) {
@@ -104,13 +102,13 @@ class FluidbookSettingsExport extends ToolboxCommand
             $line++;
             foreach ($keys as $key) {
                 $columns = max($columns, $c);
-                if (array_key_exists($key, $settings[$i]) && $field[$key]['type'] !== 'hidden') {
+                if (array_key_exists($key, $settings[$i])) {
                     $value = $settings[$i][$key] ?? "";
                     $value = is_array($value) ? json_encode($value) : $value;
                     $sheet->getCellByColumnAndRow($c, $line)->setValue($value);
                     $style = $sheet->getStyleByColumnAndRow($c, $line);
 
-                    if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable') {
+                    if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable' || $field[$key]['type'] === 'hidden') {
                         $style->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
                         $style->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('dddddd');
                     }