mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 06:32:40 +01:00
Remove unused method
This commit is contained in:
parent
bd2e05d3ac
commit
7f342b589d
@ -279,50 +279,4 @@ class TemplateEngine
|
||||
{
|
||||
DB::rollBack();
|
||||
}
|
||||
|
||||
public static function wrapElementsIntoTables(string $wrapper, string $body, $settings): ?string
|
||||
{
|
||||
$documents['wrapper'] = new \DOMDocument();
|
||||
@$documents['wrapper']->loadHTML($wrapper);
|
||||
|
||||
$documents['master'] = new \DOMDocument();
|
||||
|
||||
$documents['master']->loadHTML(
|
||||
view('email.template.master', ['header' => '', 'slot' => '', 'settings' => $settings])->render()
|
||||
);
|
||||
|
||||
$styles = $documents['master']->getElementsByTagName('style')->item(0)->nodeValue;
|
||||
|
||||
$documents['wrapper']->saveHTML();
|
||||
|
||||
$documents['body'] = new \DOMDocument();
|
||||
$documents['body']->loadHTML(empty($body) ? '<div></div>' : mb_convert_encoding((new CssToInlineStyles())->convert($body, $styles), 'HTML-ENTITIES', 'UTF-8'));
|
||||
|
||||
$table_html ='
|
||||
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="overflow-wrap:break-word;word-break:break-word;padding:5px;font-family:arial,helvetica,sans-serif;" align="left">
|
||||
<div style="color: #000000; line-height: 140%; text-align: left; word-wrap: break-word;" id="table-content" class="content-contrast-color"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
foreach ($documents['body']->getElementsByTagName('body')->item(0)->childNodes as $element) {
|
||||
$table = new \DOMDocument();
|
||||
|
||||
$table->loadHTML($table_html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
|
||||
$element = $table->importNode($element, true);
|
||||
|
||||
$table->getElementById('table-content')->appendChild($element);
|
||||
|
||||
$node = $documents['wrapper']->importNode($table->documentElement, true);
|
||||
|
||||
$documents['wrapper']->getElementById('content-wrapper')->appendChild($node);
|
||||
}
|
||||
|
||||
return $documents['wrapper']->getElementById('content-wrapper')->ownerDocument->saveHTML($documents['wrapper']->getElementById('content-wrapper'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user