This commit is contained in:
salam committed 2025-10-21 07:24:54 +02:00
1 parent 551ad2369e
commit 9881d8c37b
23 files changed
+662 -236

No files matched your search

+12 -29
View File
@@ -2,42 +2,25 @@
namespace App\Actions\Generate\Gutachten;
use App\Utilities\Html;
use App\Actions\Generate\MakeGutachten;
use App\Actions\Generate\Utilities\Format;
use App\Actions\Generate\Utilities\Html;
class Inhalt
{
public static function load($standardtext)
public static function create()
{
$html = '<div class="header">INHALTSVERZEICHNIS</div>';
$standardtext = strip_tags($standardtext, '<br>');
$standardtext = str_replace('<br>', '§§', $standardtext);
$standardtext = str_replace('<br/>', '§§', $standardtext);
$standardtext = str_replace('<br />', '§§', $standardtext);
$arr = explode('§§', $standardtext);
$html .= '<table class="inhalt">';
foreach ($arr as $value) {
$tmp = explode('|', $value);
$tmp[0] = $tmp[0] ?? '';
$tmp[1] = $tmp[1] ?? '';
$tmp[2] = $tmp[2] ?? '';
$tmp[3] = $tmp[3] ?? '';
$html .= '<tr>';
$html .= Html::td($tmp[0]);
$html .= Html::td($tmp[1]);
$html .= Html::td($tmp[2]);
$html .= Html::td($tmp[3]);
$html .= '</tr>';
foreach (MakeGutachten::$inhaltesverzeichnis as $inhalt) {
if ($inhalt->ueberschrift_anzeigen) {
$html .= '<tr>';
$html .= Html::td(Format::index($inhalt->ordnungszahl));
$html .= Html::td($inhalt->name);
$html .= Html::td(Format::seite($inhalt->seite));
$html .= '</tr>';
}
}
$html .= '</table>';
return $html;