';
echo '
'.esc_html(ACYM_NAME.' '.$currentLevel.' ');
if (version_compare($currentVersion, $latestVersion, '>=')) {
acym_tooltip(
[
'hoveredText' => ''.esc_html($currentVersion).'',
'textShownInTooltip' => acym_translation('ACYM_UP_TO_DATE'),
]
);
} elseif (!empty($latestVersion)) {
if ('wordpress' === ACYM_CMS) {
$downloadLink = admin_url().'update-core.php';
} else {
$downloadLink = ACYM_ACYMAILING_WEBSITE.'account/license/" target="_blank';
}
acym_tooltip(
[
'hoveredText' => ''.esc_html($currentVersion).'',
'textShownInTooltip' => acym_translationSprintf('ACYM_CLICK_UPDATE', $latestVersion),
'titleShownInTooltip' => acym_translation('ACYM_OLD_VERSION'),
'link' => $downloadLink,
]
);
}
echo '
';
$expirationDate = $this->config->get('expirationdate', 0);
if ((empty($expirationDate) || $expirationDate == -1) && empty($this->config->get('acymailer_apikey', ''))) {
return;
}
echo '';
if (acym_level(ACYM_ESSENTIAL) && ACYM_PRODUCTION) {
if ($expirationDate == -2) {
echo '
';
} elseif ($expirationDate < time()) {
//TODO redirect to the subscription page directly instead of the subscriptions listing
// We'll need to return the subscription id when calling the API
acym_tooltip(
[
'hoveredText' => '
'.esc_html(acym_translation('ACYM_SUBSCRIPTION_EXPIRED')).'',
'textShownInTooltip' => acym_translation('ACYM_SUBSCRIPTION_EXPIRED_LINK'),
'link' => ACYM_ACYMAILING_WEBSITE.'account/license/',
]
);
} else {
echo '
'.esc_html(
acym_translationSprintf(
'ACYM_VALID_UNTIL',
acym_getDate($expirationDate, acym_translation('ACYM_DATE_FORMAT_LC4'))
)
).'
';
}
}
$creditRemainingSendingMethod = '';
acym_trigger('onAcymGetCreditRemainingSendingMethod', [&$creditRemainingSendingMethod, $reloading]);
if (!empty($creditRemainingSendingMethod)) {
echo '
'.wp_kses($creditRemainingSendingMethod, [
'span' => [
'class' => true,
],
'a' => [
'href' => true,
'class' => true,
'title' => true,
'target' => true,
],
]).'
';
}
echo '
';
}
public function displayNotificationCenter(): void
{
$notifications = json_decode($this->config->get('notifications', '{}'), true);
if (!is_array($notifications) || empty($notifications)) {
$notifications = [];
}
$message = '';
//if we have a notifications for success
$notificationLevel = 0;
$successMessage = acym_getVar('string', 'acym_success', '', 'SESSION');
if (!empty($successMessage)) {
$message = $successMessage;
acym_setSession('acym_success', '');
$notificationLevel = 1;
}
if (!empty($notifications)) {
foreach ($notifications as $notification) {
if ($notification['read']) continue;
if ($notification['level'] === 'info' && $notificationLevel < 2) $notificationLevel = 2;
if ($notification['level'] === 'warning' && $notificationLevel < 3) $notificationLevel = 3;
if ($notification['level'] === 'error' && $notificationLevel < 4) $notificationLevel = 4;
}
}
$iconToDisplay = '';
$tooltip = false;
switch ($notificationLevel) {
case 0:
// default icon
$iconToDisplay = 'acymicon-bell';
$notificationLevel = '';
break;
case 1:
// success
$iconToDisplay = 'acymicon-check-circle acym__color__green';
$notificationLevel = 'acym__header__notification__button__success acym__header__notification__pulse';
$tooltip = true;
break;
case 2:
// info
$iconToDisplay = 'acymicon-bell acym__color__blue';
$notificationLevel = 'acym__header__notification__button__info';
break;
case 3:
// warning
$iconToDisplay = 'acymicon-exclamation-triangle acym__color__orange';
$notificationLevel = 'acym__header__notification__button__warning';
break;
case 4:
// error
$iconToDisplay = 'acymicon-exclamation-circle acym__color__red';
$notificationLevel = 'acym__header__notification__button__error';
break;
}
echo '';
}
public function displayNotificationCenterInner(array $notifications): void
{
if (empty($notifications)) {
echo '';
return;
}
echo '';
foreach ($notifications as $key => $notif) {
$fullMessageHover = $notif['message'];
if (strlen($notif['message']) > 150) {
$tag = new \stdClass();
$tag->wrap = 150;
$pluginHelper = new PluginHelper();
$notif['message'] = $pluginHelper->wrapText($notif['message'], $tag);
}
$logo = $notif['level'] === 'info' ? 'acymicon-bell' : ($notif['level'] === 'warning' ? 'acymicon-exclamation-triangle' : 'acymicon-exclamation-circle');
$read = $notif['read'] ? 'acym__header__notification__one__read' : '';
echo '';
}
}
public function addNotification(object $notif): string
{
if ($notif->level === 'success') {
acym_setSession('acym_success', $notif->message);
return '';
}
$notifications = json_decode($this->config->get('notifications', '[]'), true);
if (!is_array($notifications)) {
$notifications = [];
}
$notif->message = str_replace('