PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Core/wordpress/message.php +0 -49 10.0.1 → 11.1.1 View file →
@@ -1,49 +1,0 @@
1 -<?php
2 -
3 -use AcyMailing\Helpers\HeaderHelper;
4 -
5 -function acym_enqueueMessage($message, $type = 'success', $addNotification = true)
6 -{
7 - $type = str_replace(['notice', 'message'], ['info', 'success'], $type);
8 - $message = is_array($message) ? implode('<br/>', $message) : $message;
9 -
10 - $notification = new stdClass();
11 - $notification->message = $message;
12 - $notification->date = time();
13 - $notification->read = false;
14 - $notification->level = $type;
15 -
16 - $handledTypes = ['info', 'warning', 'error'];
17 -
18 - if ($addNotification && acym_isAdmin()) {
19 - $helperHeader = new HeaderHelper();
20 - $notification->id = $helperHeader->addNotification($notification);
21 - } else {
22 - $handledTypes[] = 'success';
23 - }
24 -
25 - if (in_array($type, $handledTypes)) {
26 - acym_session();
27 - if (empty($_SESSION['acymessage'.$type]) || !in_array($message, $_SESSION['acymessage'.$type])) {
28 - if (empty($notification->id)) {
29 - $_SESSION['acymessage'.$type][] = $message;
30 - } else {
31 - $_SESSION['acymessage'.$type][$notification->id] = $message;
32 - }
33 - }
34 - }
35 -
36 - return true;
37 -}
38 -
39 -function acym_displayMessages()
40 -{
41 - $types = ['success', 'info', 'warning', 'error'];
42 - acym_session();
43 - foreach ($types as $type) {
44 - if (empty($_SESSION['acymessage'.$type])) continue;
45 -
46 - acym_display($_SESSION['acymessage'.$type], $type);
47 - unset($_SESSION['acymessage'.$type]);
48 - }
49 -}