getMergingAmendingSections(false, true) as $sect) { $amendmentsById[$sect->amendmentId] = $sect->getAmendment(); } $paragraphs = $section->getTextParagraphObjects(false, false, false, true); $type = $section->getSettings(); $lineNo = $section->getFirstLineNumber(); $hasLineNumbers = $section->getSettings()->lineNumbers; $paragraphNos = array_keys($paragraphs); $paragraphFirst = (count($paragraphNos) > 0 ? $paragraphNos[0] : null); $paragraphLast = (count($paragraphNos) > 0 ? $paragraphNos[count($paragraphNos) - 1] : null); echo '

' . Html::encode($section->getSectionTitle()) . '

'; echo '
'; if (!$type->hasAmendments) { echo ''; } if ($twoCols) { echo '
'; } else { echo '
'; } $firstLineCount = $lineNo; foreach ($paragraphNos as $paragraphNo) { $paragraph = $paragraphs[$paragraphNo]; if ($twoCols) { echo '
'; echo '
'; echo '
'; if ($section->getSettings()->fixedWidth || $hasLineNumbers) { foreach ($paragraph->lines as $i => $line) { if ($section->getSettings()->lineNumbers) { /** @var int $lineNo */ $lineNoStr = ''; $line = str_replace('###LINENUMBER###', $lineNoStr, $line); } $line = str_replace('
', '', $line); $first3 = substr($line, 0, 3); if ($i > 0 && !in_array($first3, ['', ''; } echo $line; } } else { echo $paragraph->origStr; } echo '
'; echo '
'; $add = ''; if ($paragraphNo === $paragraphFirst) { $add .= ' first'; } if ($paragraphNo === $paragraphLast) { $add .= ' last'; } echo '
'; } $firstLineNo = $firstLineCount; $lastLineNo = $firstLineNo + count($paragraph->lines) - 1; $firstLineCount = $firstLineNo + count($paragraph->lines); echo $this->render('_merging_paragraph', [ 'section' => $section, 'form' => $form, 'amendmentsById' => $amendmentsById, 'paragraphNo' => $paragraphNo, 'firstLineNo' => $firstLineNo, 'lastLineNo' => $lastLineNo, ]); if ($twoCols) { echo '
'; echo '
'; } } echo '
';