| @@ -1,44 +1,45 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | trait TimeInsertion |
| 4 | 4 | { |
| 5 | - public function dynamicText($mailId) | |
| 5 | + public function dynamicText(?int $mailId): ?object | |
| 6 | 6 | { |
| 7 | 7 | return $this->pluginDescription; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - public function textPopup() | |
| 10 | + public function textPopup(): void | |
| 11 | 11 | { |
| 12 | - $text = '<div class="acym__popup__listing text-center grid-x"> | |
| 13 | - <h1 class="acym__title acym__title__secondary text-center cell">'.acym_translation('ACYM_TIME_FORMAT').'</h1>'; | |
| 12 | + $others = [ | |
| 13 | + '{date:1}' => 'ACYM_DATE_FORMAT_LC1', | |
| 14 | + '{date:2}' => 'ACYM_DATE_FORMAT_LC2', | |
| 15 | + '{date:3}' => 'ACYM_DATE_FORMAT_LC3', | |
| 16 | + '{date:4}' => 'ACYM_DATE_FORMAT_LC4', | |
| 17 | + '{date:m/d/Y}' => 'm/d/Y', | |
| 18 | + '{date:d/m/Y}' => 'd/m/Y', | |
| 19 | + '{date:l}' => 'l', | |
| 20 | + '{date:W}' => 'W', | |
| 21 | + '{date:F}' => 'F', | |
| 22 | + '{date:Y}' => 'Y', | |
| 14 | 23 | |
| 15 | - $others = []; | |
| 16 | - $others['{date:1}'] = 'ACYM_DATE_FORMAT_LC1'; | |
| 17 | - $others['{date:2}'] = 'ACYM_DATE_FORMAT_LC2'; | |
| 18 | - $others['{date:3}'] = 'ACYM_DATE_FORMAT_LC3'; | |
| 19 | - $others['{date:4}'] = 'ACYM_DATE_FORMAT_LC4'; | |
| 20 | - $others['{date:m/d/Y}'] = 'm/d/Y'; | |
| 21 | - $others['{date:d/m/y}'] = 'd/m/y'; | |
| 22 | - $others['{date:l}'] = 'l'; | |
| 23 | - $others['{date:F}'] = 'F'; | |
| 24 | + ]; | |
| 24 | 25 | |
| 26 | + echo '<div class="acym__popup__listing text-center grid-x"> | |
| 27 | + <h1 class="acym__title acym__title__secondary text-center cell">'.esc_html(acym_translation('ACYM_TIME_FORMAT')).'</h1>'; | |
| 25 | 28 | |
| 26 | 29 | $k = 0; |
| 27 | 30 | foreach ($others as $tagname => $tag) { |
| 28 | - $text .= '<div class="grid-x medium-12 cell acym__row__no-listing acym__listing__row__popup text-left" onclick="setTag(\''.$tagname.'\', jQuery(this));" > | |
| 29 | - <div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.acym_translation($tag).'</div> | |
| 30 | - <div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.acym_getDate(time(), acym_translation($tag)).'</div> | |
| 31 | - </div>'; | |
| 31 | + echo '<div class="grid-x medium-12 cell acym__row__no-listing acym__listing__row__popup text-left" onclick="setTag(\''.esc_attr($tagname).'\', jQuery(this));" > | |
| 32 | + <div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.esc_html(acym_translation($tag)).'</div> | |
| 33 | + <div class="cell medium-6 small-12 acym__listing__title acym__listing__title__dynamics">'.esc_html(acym_getDate(time(), acym_translation($tag))).'</div> | |
| 34 | + </div>'; | |
| 32 | 35 | $k = 1 - $k; |
| 33 | 36 | } |
| 34 | 37 | |
| 35 | - $text .= '</div>'; | |
| 36 | - | |
| 37 | - echo $text; | |
| 38 | + echo '</div>'; | |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | - public function replaceContent(&$email, $send = true) | |
| 41 | + public function replaceContent(object &$email): void | |
| 41 | 42 | { |
| 42 | 43 | $extractedTags = $this->pluginHelper->extractTags($email, 'date'); |
| 43 | 44 | if (empty($extractedTags)) { |
| 44 | 45 | return; |