pluginDescription; } public function textPopup(): void { $text = '

'.acym_translation('ACYM_TIME_FORMAT').'

'; $others = []; $others['{date:1}'] = 'ACYM_DATE_FORMAT_LC1'; $others['{date:2}'] = 'ACYM_DATE_FORMAT_LC2'; $others['{date:3}'] = 'ACYM_DATE_FORMAT_LC3'; $others['{date:4}'] = 'ACYM_DATE_FORMAT_LC4'; $others['{date:m/d/Y}'] = 'm/d/Y'; $others['{date:d/m/y}'] = 'd/m/y'; $others['{date:l}'] = 'l'; $others['{date:W}'] = 'W'; $others['{date:F}'] = 'F'; $others['{date:Y}'] = 'Y'; $k = 0; foreach ($others as $tagname => $tag) { $text .= '
'.acym_translation($tag).'
'.acym_getDate(time(), acym_translation($tag)).'
'; $k = 1 - $k; } $text .= '
'; echo $text; } public function replaceContent(object &$email): void { $extractedTags = $this->pluginHelper->extractTags($email, 'date'); if (empty($extractedTags)) { return; } $tags = []; foreach ($extractedTags as $i => $oneTag) { if (isset($tags[$i])) { continue; } $time = time(); if (!empty($oneTag->senddate) && !empty($email->sending_date)) { $time = strtotime($email->sending_date); } if (!empty($oneTag->add)) { $time += intval($oneTag->add); } if (!empty($oneTag->remove)) { $time -= intval($oneTag->remove); } if (empty($oneTag->id) || is_numeric($oneTag->id)) { $oneTag->id = acym_translation('ACYM_DATE_FORMAT_LC'.$oneTag->id); } $oneTag->id = str_replace( ['%A', '%d', '%B', '%m', '%Y', '%y', '%H', '%M', '%S', '%a', '%I', '%p', '%w'], ['l', 'd', 'F', 'm', 'Y', 'y', 'H', 'i', 's', 'D', 'h', 'a', 'w'], $oneTag->id ); $tags[$i] = acym_date($time, $oneTag->id, true); } $this->pluginHelper->replaceTags($email, $tags); } }