71 lines
2.6 KiB
PHP
71 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace HermannTelser\Gutachten\Downloads;
|
|
|
|
use HermannTelser\Gutachten\Utility\Helper;
|
|
use TYPO3\CMS\Core\Core\Environment;
|
|
|
|
class Deckblatt
|
|
{
|
|
/**
|
|
* @param mixed $value
|
|
* @param mixed $_platzhalter
|
|
* @param mixed $_gutachter
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function create($value, $_projekt, $_platzhalter, $_gutachter, $_auftraggeber)
|
|
{
|
|
|
|
$gutachter = Helper::replacePlatzhalter($_platzhalter, $_gutachter[0]['txt']);
|
|
// gutachter
|
|
$html = '<div class="deckblatt">';
|
|
if ($_gutachter[0]['id'] == 1) {
|
|
$image = Environment::getProjectPath()."/public/typo3conf/ext/gutachten/Resources/Public/BenutzerLogos/" . $_gutachter[0]['logo'];
|
|
$html .= '<div class="gutachter">';
|
|
$html .= '<img src="'.$image.'" style="width:80mm; height:auto">';
|
|
$html .= '</div>';
|
|
} else {
|
|
$kopf = Helper::replacePlatzhalter($_platzhalter, $_gutachter[0]['kopf']);
|
|
$html .= '<div class="gutachter"><h3>'.strip_tags($kopf).'</h3>'.$gutachter.'</div>';
|
|
}
|
|
|
|
// title
|
|
$title = Helper::replacePlatzhalter($_platzhalter, $value['txt']);
|
|
$title = explode('<br />', $title);
|
|
if (isset($value['paragraph6'])) {
|
|
$html .= '<div class="gutachten"><h1>GUTACHTEN gem. §6</h1>';
|
|
} else {
|
|
$txt = $value['titel']=='Deckblatt' ? 'GUTACHTEN' : $value['titel'];
|
|
$html .= '<div class="gutachten"><h1>' . $txt . '</h1>';
|
|
}
|
|
$html .= '<div class="pl-1">'.strip_tags($title[0]).'</div></div>';
|
|
|
|
$projektname = $title[0];
|
|
// zweck
|
|
if (isset($value['paragraph6'])) {
|
|
$html .= '<div class="zweckbox bold">'.$_projekt[0]['name'].'<br />'.$title[1].'</div>';
|
|
}
|
|
else {
|
|
$html .= '<div class="zweckbox"><h3>ZUR FESTSETZUNG DER NUTZWERTE</h3>'.$_projekt[0]['name'].'<br />'.$title[1].'</div>';
|
|
}
|
|
|
|
$auftraggeber = Helper::replacePlatzhalter($_platzhalter, $_auftraggeber[0]['txt']);
|
|
// first line h3
|
|
$auftraggeber = str_replace("<br />", "|||", $auftraggeber);
|
|
$auftraggeber = str_replace("</div>", "|||", $auftraggeber);
|
|
$auftraggeber = strip_tags($auftraggeber);
|
|
$tmp = explode('|||', $auftraggeber);
|
|
$html .= '<div class="auftraggeber">';
|
|
foreach ($tmp as $key => $value) {
|
|
if ($value[0] == '-') {
|
|
$html .= '<h3>' . trim(substr($value, 1)) . '</h3>';
|
|
} else {
|
|
$html .= trim(strip_tags($value)).'<br />';
|
|
}
|
|
}
|
|
$html .= '</div>';
|
|
return $html;
|
|
}
|
|
}
|