| 1 |
<?php |
| 2 |
|
| 3 |
use AcyMailing\Classes\OverrideClass; |
| 4 |
|
| 5 |
trait OverrideInsertion |
| 6 |
{ |
| 7 |
public function dynamicText(?int $mailId): ?object |
| 8 |
{ |
| 9 |
$overridesClass = new OverrideClass(); |
| 10 |
$overrideParams = $overridesClass->getParamsByMailId($mailId); |
| 11 |
if (!empty($overrideParams)) { |
| 12 |
return $this->pluginDescription; |
| 13 |
} |
| 14 |
|
| 15 |
return null; |
| 16 |
} |
| 17 |
|
| 18 |
public function textPopup(): void |
| 19 |
{ |
| 20 |
$mailId = acym_getVar('int', 'mail_id', 0); |
| 21 |
if (empty($mailId)) return; |
| 22 |
?> |
| 23 |
<script type="text/javascript"> |
| 24 |
function changeOverrideTag(tagname, element) { |
| 25 |
if (!tagname) return; |
| 26 |
setTag('{' + tagname + '}', element); |
| 27 |
} |
| 28 |
</script> |
| 29 |
<?php |
| 30 |
$text = '<div class="acym__popup__listing text-center grid-x">'; |
| 31 |
$text .= '<h1 class="acym__title acym__title__secondary text-center cell">'.acym_translation('ACYM_ORIGINAL_EMAIL_DATA').'</h1>'; |
| 32 |
|
| 33 |
$overridesClass = new OverrideClass(); |
| 34 |
$overrideParams = $overridesClass->getParamsByMailId($mailId); |
| 35 |
|
| 36 |
foreach ($overrideParams as $key => $overrideParam) { |
| 37 |
$text .= '<div style="cursor:pointer" class="grid-x medium-12 cell acym__row__no-listing acym__listing__row__popup text-left" onclick="changeOverrideTag(\''.$key.'\', jQuery(this));" > |
| 38 |
<div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.$overrideParam['nicename'].'</div> |
| 39 |
<div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.$overrideParam['description'].'</div> |
| 40 |
</div>'; |
| 41 |
} |
| 42 |
|
| 43 |
$text .= '</div>'; |
| 44 |
|
| 45 |
echo $text; |
| 46 |
} |
| 47 |
} |
| 48 |
|