. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Report; use function str_contains; use function str_replace; use function stripos; /** * Class ReportHtmlCell */ class ReportHtmlCell extends ReportBaseCell { /** * HTML Cell renderer * * @param HtmlRenderer $renderer * * @return void */ public function render($renderer) { if (str_contains($this->text, '{{:ptp:}}')) { return; } $temptext = str_replace('#PAGENUM#', (string) $renderer->pageNo(), $this->text); // underline «title» part of Source item $temptext = str_replace([ '«', '»', ], [ '', '', ], $temptext); // Set up the text style if ($renderer->getCurrentStyle() !== $this->styleName) { $renderer->setCurrentStyle($this->styleName); } // If (Future-feature-enable/disable cell padding) $cP = $renderer->cPadding; // Adjust the positions if ($this->left === ReportBaseElement::CURRENT_POSITION) { $this->left = $renderer->getX(); } else { $renderer->setX($this->left); } if ($this->top === ReportBaseElement::CURRENT_POSITION) { $this->top = $renderer->getY(); } else { $renderer->setY($this->top); } // Start collecting the HTML code echo '