diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d5655a..2d7c5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.3.14 (2023-04-18) +* fixed "This action doesn't work on multiple selection" error + ## 1.3.13 (2023-04-11) * ```$xlsx->rightToLeft()``` - RTL mode. Column A is on the far right, Column B is one column left of Column A, and so on. Also, information in cells is displayed in the Right to Left format. diff --git a/src/SimpleXLSXGen.php b/src/SimpleXLSXGen.php index 0ca1fad..ed35ae6 100644 --- a/src/SimpleXLSXGen.php +++ b/src/SimpleXLSXGen.php @@ -140,8 +140,8 @@ class SimpleXLSXGen ', 'xl/_rels/workbook.xml.rels' => ' - -{SHEETS}', +{RELS} +', 'xl/worksheets/sheet1.xml' => ' @@ -298,17 +298,19 @@ class SimpleXLSXGen if ($cfilename === 'xl/_rels/workbook.xml.rels') { $s = ''; for ($i = 0; $i < $cnt_sheets; $i++) { - $s .= '\r\n"; } - $s .= ''; - $template = str_replace('{SHEETS}', $s, $template); + $s .= ''."\r\n"; + $s .= ''; + + $template = str_replace('{RELS}', $s, $template); $this->_writeEntry($fh, $cdrec, $cfilename, $template); $entries++; } elseif ($cfilename === 'xl/workbook.xml') { $s = ''; foreach ($this->sheets as $k => $v) { - $s .= ''; + $s .= ''; } $template = str_replace('{SHEETS}', $s, $template); $this->_writeEntry($fh, $cdrec, $cfilename, $template); @@ -597,10 +599,12 @@ class SimpleXLSXGen setlocale(LC_NUMERIC, 'C'); $COLS = []; $ROWS = []; - $SHEETVIEWS = 'rtl ? ' rightToLeft="1"' : '').'>'; - $AC = 'A1'; // Active Cell +// $SHEETVIEWS = 'rtl ? ' rightToLeft="1"' : '').'>'; + $SHEETVIEWS = ''; + $PANE = ''; if (count($this->sheets[$idx]['rows'])) { if ($this->sheets[$idx]['frozen'] !== '' || isset($this->sheets[$idx]['frozen'][0]) || isset($this->sheets[$idx]['frozen'][1])) { +// $AC = 'A1'; // Active Cell $x = $y = 0; if (is_string($this->sheets[$idx]['frozen'])) { $AC = $this->sheets[$idx]['frozen']; @@ -629,11 +633,16 @@ class SimpleXLSXGen if ($x === 0 && $y > 0) { $activepane = 'bottomLeft'; } - $SHEETVIEWS .= ''; + $PANE .= ''; + $PANE .= ''; } } - $SHEETVIEWS .= ''; - $SHEETVIEWS .= ''; + if ($this->rtl || $PANE) { + $SHEETVIEWS .= ' +rtl ? ' rightToLeft="1"' : ''); + $SHEETVIEWS .= $PANE ? ">\r\n" . $PANE . "\r\n" : ' />'; + $SHEETVIEWS .= "\r\n"; + } $COLS[] = ''; $CUR_ROW = 0; $COL = [];