|
|
@@ -56,6 +56,17 @@ class TCEMainHook
|
|
|
'default_hero_lte600' => array('width' => 560, 'height' => 373),
|
|
|
)
|
|
|
),
|
|
|
+ 'mrm_be_cm_dynamic_tileexternaloverview' => array(
|
|
|
+ 'default' => array(
|
|
|
+ 'default_hero_lte600' => array('width' => 560, 'height' => 373),
|
|
|
+ ),
|
|
|
+ 'i_1_1' => array(
|
|
|
+ 'square_big' => array('width' => 520, 'height' => 520),
|
|
|
+ ),
|
|
|
+ 'i_21_9' => array(
|
|
|
+ 'flat_big' => array('width' => 700, 'height' => 300),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
'mrm_be_cm_heroimage' => array(
|
|
|
'default' => array(
|
|
|
'lte600' => array('width' => 560, 'height' => 373),
|
|
|
@@ -223,7 +234,7 @@ class TCEMainHook
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- $qrfilename = '/var/www/html/public/typo3temp/' . mt_rand(0, 0xffffff) . '_' . mt_rand(0, 0xffffff) . '.svg';
|
|
|
+ $qrfilename = '/var/www/html/typo3temp/' . mt_rand(0, 0xffffff) . '_' . mt_rand(0, 0xffffff) . '.svg';
|
|
|
\QRcode::svg("https://abi.de" . $slugData, $qrfilename);
|
|
|
$qrsvg = file_get_contents($qrfilename);
|
|
|
unlink($qrfilename);
|
|
|
@@ -1597,8 +1608,7 @@ class TCEMainHook
|
|
|
} else {
|
|
|
$cleaned[$new_value]['text'] = $val;
|
|
|
}
|
|
|
- }
|
|
|
- elseif (strpos($key, 'url') != false) {
|
|
|
+ } elseif (strpos($key, 'url') != false) {
|
|
|
$new_value = str_replace('url', '', $key);
|
|
|
if (!array_key_exists($new_value, $cleaned)) {
|
|
|
continue;
|
|
|
@@ -1609,27 +1619,25 @@ class TCEMainHook
|
|
|
}
|
|
|
|
|
|
$data = [];
|
|
|
- foreach($cleaned as $k => $val) {
|
|
|
- foreach($val as $field => $value) {
|
|
|
- if(isset($value) && !empty($value)) {
|
|
|
+ foreach ($cleaned as $k => $val) {
|
|
|
+ foreach ($val as $field => $value) {
|
|
|
+ if (isset($value) && !empty($value)) {
|
|
|
$data[$k][$field] = $value;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- foreach($data as $key => $value) {
|
|
|
+ foreach ($data as $key => $value) {
|
|
|
$box = $this->createContentElement("boxwrapper");
|
|
|
- if(isset($value['headline']) && !empty($value['headline'])) {
|
|
|
+ if (isset($value['headline']) && !empty($value['headline'])) {
|
|
|
$box["subElements"] = array_merge($box["subElements"], $this->checkText($value['headline'], $dbReference, $processedData, "h3"));
|
|
|
}
|
|
|
- if(isset($value['text']) && !empty($value['text'])) {
|
|
|
+ if (isset($value['text']) && !empty($value['text'])) {
|
|
|
$box["subElements"] = array_merge($box["subElements"], $this->checkText($value['text'], $dbReference, $processedData, "typo3_paragraph"));
|
|
|
}
|
|
|
- if(isset($value['url']) && !empty($value['url'])) {
|
|
|
+ if (isset($value['url']) && !empty($value['url'])) {
|
|
|
$box["subElements"] = array_merge($box["subElements"], $this->checkText($value['url'], $dbReference, $processedData, "link"));
|
|
|
}
|
|
|
$elements[] = $box;
|
|
|
@@ -2033,6 +2041,24 @@ class TCEMainHook
|
|
|
$subs[] = $s;
|
|
|
$processedData["status"]["hasQuiz"] = true;
|
|
|
break;
|
|
|
+ case "mrm_be_cm_dynamic_tileexternaloverview":
|
|
|
+ $type = "tile_external";
|
|
|
+ $prop = [];
|
|
|
+ $elements = [];
|
|
|
+
|
|
|
+ $imageData = $this->processImagesTTContent($dbReference, "mrm_be_cm_dynamic_tileexternaloverview");
|
|
|
+
|
|
|
+ foreach ($imageData as $key => $val) {
|
|
|
+ foreach ($val as $k => $field) {
|
|
|
+ $prop[$key]['type'] = 'tile_external';
|
|
|
+ if ($k === 'title') $prop[$key]['props']['headline'] = $field;
|
|
|
+ if ($k === 'caption') $prop[$key]['props']['description'] = $field;
|
|
|
+ if ($k === 'sources') $prop[$key]['props']['image']['sources'] = $field;
|
|
|
+ if ($k === 'link') $prop[$key]['props']['link'] = $this->processLink($field, null, $processedData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $subs[] = $this->createContentElement('external_tileoverview', array(), null, $prop);
|
|
|
+ break;
|
|
|
|
|
|
default:
|
|
|
$this->log("MISSING PROCESSDATA 4 " . $dbReference['CType']);
|
|
|
@@ -2041,6 +2067,23 @@ class TCEMainHook
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private function processLink($link, $dbReference, &$processedData)
|
|
|
+ {
|
|
|
+ $cleanedLink = [];
|
|
|
+ if (substr($link, 0, 2) === 't3') {
|
|
|
+ $parts = explode(' ', $link);
|
|
|
+ $cleanedLink['href'] = $this->replaceT3Link($parts[0], $dbReference, $processedData);
|
|
|
+ $cleanedLink['target'] = '_top';
|
|
|
+ //$cleanedLink['title'] = $parts[3] ?? '';
|
|
|
+ } else {
|
|
|
+ $parts = explode(' ', $link);
|
|
|
+ $cleanedLink['href'] = $parts[0];
|
|
|
+ $cleanedLink['target'] = $parts[1];
|
|
|
+ //$cleanedLink['title'] = $parts[3] ?? '';
|
|
|
+ }
|
|
|
+ return $cleanedLink;
|
|
|
+ }
|
|
|
+
|
|
|
private function checkText($txt, $dbReference, &$processedData, $defaultElementType = "typo3_paragraph")
|
|
|
{
|
|
|
$txt = $this->checkTextForInternalLinks($txt, $dbReference, $processedData);
|
|
|
@@ -2297,10 +2340,14 @@ class TCEMainHook
|
|
|
$alt = $img['reference']['alternative'] != NULL ? $img['reference']['alternative'] : ($img['original']['alternative'] != NULL ? $img['original']['alternative'] : NULL);
|
|
|
$title = $img['reference']['title'] != NULL ? $img['reference']['title'] : ($img['original']['title'] != NULL ? $img['original']['title'] : NULL);
|
|
|
$caption = $img['reference']['description'] != NULL ? $img['reference']['description'] : ($img['original']['description'] != NULL ? $img['original']['description'] : NULL);
|
|
|
+ $link = $img['reference']['link'] != NULL ? $img['reference']['link'] : ($img['original']['link'] != NULL ? $img['original']['link'] : NULL);
|
|
|
+
|
|
|
$copyright = $img['reference']['copyright'] != NULL ? $img['reference']['copyright'] : ($img['original']['copyright'] != NULL ? $img['original']['copyright'] : NULL);
|
|
|
if ($alt != NULL) $processArray['alt'] = $alt;
|
|
|
if ($title != NULL) $processArray['title'] = $title;
|
|
|
if ($caption != NULL) $processArray['caption'] = $caption;
|
|
|
+ if ($link != NULL) $processArray['link'] = $link;
|
|
|
+
|
|
|
if ($copyright != NULL) $processArray['copyright'] = $copyright;
|
|
|
|
|
|
if ($cropareas['passthru']) {
|
|
|
@@ -2479,6 +2526,6 @@ class TCEMainHook
|
|
|
if (!$isString) {
|
|
|
$msg = json_encode($msg, JSON_PRETTY_PRINT);
|
|
|
}
|
|
|
- file_put_contents('/var/www/html/public/typo3temp/debug.log', $msg . PHP_EOL, FILE_APPEND);
|
|
|
+ file_put_contents('/var/www/html/typo3temp/debug.log', $msg . PHP_EOL, FILE_APPEND);
|
|
|
}
|
|
|
}
|