|
3 | 3 |
|
4 | 4 | class Snippet extends \DDTools\Snippet { |
5 | 5 | protected |
6 | | - $version = '3.8.0', |
| 6 | + $version = '3.8.1', |
7 | 7 |
|
8 | 8 | $params = [ |
9 | 9 | //Defaults |
@@ -236,7 +236,7 @@ protected function prepareParams($params = []){ |
236 | 236 |
|
237 | 237 | /** |
238 | 238 | * run |
239 | | - * @version 1.6.1 (2022-06-04) |
| 239 | + * @version 1.6.2 (2022-06-09) |
240 | 240 | * |
241 | 241 | * @return {string} |
242 | 242 | */ |
@@ -535,27 +535,6 @@ function(){ |
535 | 535 | $this->params->outputFormat == 'html' || |
536 | 536 | $this->params->outputFormat == 'htmlarray' |
537 | 537 | ){ |
538 | | - if ( |
539 | | - //Если шаблоны колонок заданы |
540 | | - !empty($this->params->colTpl) && |
541 | | - //Но их не хватает |
542 | | - ( |
543 | | - $temp = |
544 | | - count(array_values($data)[0]) - |
545 | | - count($this->params->colTpl) |
546 | | - ) > 0 |
547 | | - ){ |
548 | | - //Дозабьём недостающие последним |
549 | | - $this->params->colTpl = array_merge( |
550 | | - $this->params->colTpl, |
551 | | - array_fill( |
552 | | - $temp - 1, |
553 | | - $temp, |
554 | | - $this->params->colTpl[count($this->params->colTpl) - 1] |
555 | | - ) |
556 | | - ); |
557 | | - } |
558 | | - |
559 | 538 | $rowIndex = 0; |
560 | 539 |
|
561 | 540 | //Перебираем строки |
@@ -602,7 +581,13 @@ function(){ |
602 | 581 | ]); |
603 | 582 | } |
604 | 583 |
|
605 | | - //If template for the column exists |
| 584 | + //If template for this column is not set |
| 585 | + if (!isset($this->params->colTpl[$columnIndex])){ |
| 586 | + //Use previous |
| 587 | + $this->params->colTpl[$columnIndex] = $this->params->colTpl[$columnIndex - 1]; |
| 588 | + } |
| 589 | + |
| 590 | + //If template for the column is needed |
606 | 591 | if (!empty($this->params->colTpl[$columnIndex])){ |
607 | 592 | $columnValue = \ddTools::parseText([ |
608 | 593 | 'text' => $this->params->colTpl[$columnIndex], |
|
0 commit comments