Popup Builder – Responsive WordPress Pop up - Version 3.0.2

Version Description

Current Version of Popup Builder is 2.6.7

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 3.0.2
Comparing to
See all releases

Code changes from version 2.6.7.6 to 3.0.2

Files changed (160) hide show
  1. PopupBuilderInit.php +100 -0
  2. classes/PopupInstaller.php +0 -221
  3. classes/SGFblikePopup.php +0 -138
  4. classes/SGHtmlPopup.php +0 -91
  5. classes/SGImagePopup.php +0 -59
  6. classes/SGPBExtension.php +0 -237
  7. classes/SGPBExtensionManager.php +0 -229
  8. classes/SGPBExtensionsConnector.php +0 -243
  9. classes/SGPopup.php +0 -515
  10. classes/SGPopupBuilderMain.php +0 -84
  11. classes/SGShortcodePopup.php +0 -59
  12. classes/SgRegistry.php +0 -38
  13. classes/index.php +0 -0
  14. classes/sgDataTable/SGPopupTable.php +0 -112
  15. classes/sgDataTable/Table.php +0 -189
  16. com/boot.php +11 -0
  17. com/classes/Actions.php +938 -0
  18. com/classes/Ajax.php +363 -0
  19. com/classes/ConditionBuilder.php +188 -0
  20. com/classes/ConditionCreator.php +562 -0
  21. com/classes/ConvertToNewVersion.php +727 -0
  22. com/classes/Filters.php +266 -0
  23. com/classes/Installer.php +290 -0
  24. com/classes/Javascript.php +124 -0
  25. com/classes/MediaButton.php +85 -0
  26. com/classes/PopupChecker.php +666 -0
  27. com/classes/PopupGroupFilter.php +218 -0
  28. com/classes/PopupInstaller.php +6 -0
  29. com/classes/PopupLoader.php +157 -0
  30. com/classes/PopupType.php +37 -0
  31. com/classes/RegisterPostType.php +584 -0
  32. helpers/Helper_functions.php → com/classes/SGPBRequirementsChecker.php +9 -9
  33. com/classes/ScriptsLoader.php +299 -0
  34. com/classes/Style.php +120 -0
  35. com/classes/Updates.php +247 -0
  36. com/classes/dataTable/Subscribers.php +69 -0
  37. com/classes/extension/SgpbIPopupExtension.php +10 -0
  38. com/classes/extension/SgpbPopupExtension.php +288 -0
  39. com/classes/extension/SgpbPopupExtensionRegister.php +64 -0
  40. com/classes/popups/FblikePopup.php +113 -0
  41. com/classes/popups/HtmlPopup.php +51 -0
  42. com/classes/popups/ImagePopup.php +89 -0
  43. com/classes/popups/PopupData.php +20 -0
  44. com/classes/popups/SGPopup.php +1495 -0
  45. com/classes/popups/SubscriptionPopup.php +576 -0
  46. com/config/config.php +130 -0
  47. com/config/configPackage.php +8 -0
  48. com/config/dataConfig.php +790 -0
  49. com/helpers/AdminHelper.php +780 -0
  50. com/helpers/ConfigDataHelper.php +956 -0
  51. com/helpers/Functions.php +197 -0
  52. com/helpers/MultipleChoiceButton.php +271 -0
  53. com/helpers/PopupBuilderActivePackage.php +62 -0
  54. com/helpers/ScriptsIncluder.php +135 -0
  55. com/libs/EDD_SL_Plugin_Updater.php +371 -0
  56. {classes/sgDataTable → com/libs}/ListTable.php +3 -1
  57. com/libs/Table.php +253 -0
  58. config-pkg.php +0 -6
  59. config.php +0 -124
  60. files/index.php +0 -0
  61. files/main_section/fblike.php +0 -19
  62. files/main_section/html.php +0 -19
  63. files/main_section/image.php +0 -10
  64. files/main_section/shortcode.php +0 -2
  65. files/options_section/fblike.php +0 -30
  66. files/options_section/html.php +0 -25
  67. files/options_section/image.php +0 -25
  68. files/options_section/pro.php +0 -160
  69. files/options_section/shortcode.php +0 -25
  70. files/sg_admin_post.php +0 -233
  71. files/sg_functions.php +0 -891
  72. files/sg_more_plugins.php +0 -68
  73. files/sg_popup_actions.php +0 -183
  74. files/sg_popup_ajax.php +0 -669
  75. files/sg_popup_create.php +0 -125
  76. files/sg_popup_create_new.php +0 -1567
  77. files/sg_popup_filetrs.php +0 -10
  78. files/sg_popup_main.php +0 -32
  79. files/sg_popup_media_button.php +0 -242
  80. files/sg_popup_page_selection.php +0 -80
  81. files/sg_popup_save.php +0 -542
  82. files/sg_popup_settings.php +0 -51
  83. helpers/Integrate_external_settings.php +0 -215
  84. helpers/SgPopupGetData.php +0 -220
  85. helpers/index.php +0 -0
  86. img/AWeberPro.png +0 -0
  87. img/AdblockPro.png +0 -0
  88. img/AgeRestrictionPro.png +0 -0
  89. img/ContactFormButtonPro.png +0 -0
  90. img/CountdownButtonPro.png +0 -0
  91. img/ExitIntent.png +0 -0
  92. img/ExitIntentPro.png +0 -0
  93. img/Facebook.png +0 -0
  94. img/HTML-Button.png +0 -0
  95. img/Images-Button.png +0 -0
  96. img/ShortcodePopup.png +0 -0
  97. img/SocialButtonPro.png +0 -0
  98. img/SubscriptionButtonPro.png +0 -0
  99. img/VideoPopupPro.png +0 -0
  100. img/analiticsPro.png +0 -0
  101. img/blog-wp-kicker.png +0 -0
  102. img/colorbox1/border.png +0 -0
  103. img/colorbox1/controls.png +0 -0
  104. img/colorbox1/loading.gif +0 -0
  105. img/colorbox1/loading_background.png +0 -0
  106. img/colorbox2/controls.png +0 -0
  107. img/colorbox2/loading.gif +0 -0
  108. img/colorbox3/controls.png +0 -0
  109. img/colorbox3/loading.gif +0 -0
  110. img/colorbox4/border1.png +0 -0
  111. img/colorbox4/border2.png +0 -0
  112. img/colorbox4/loading.gif +0 -0
  113. img/colorbox5/border.png +0 -0
  114. img/colorbox5/controls.png +0 -0
  115. img/colorbox5/loading.gif +0 -0
  116. img/colorbox5/loading_background.png +0 -0
  117. img/colorbox6/border1.png +0 -0
  118. img/colorbox6/border2.png +0 -0
  119. img/colorbox6/colorbox_overlay.png +0 -0
  120. img/colorbox6/colorbox_sprite.png +0 -0
  121. img/colorbox6/loading.gif +0 -0
  122. img/default-image.png +0 -0
  123. img/down_arrow-2x.gif +0 -0
  124. img/iframePopupPro.png +0 -0
  125. img/index.php +0 -0
  126. img/info-error.png +0 -0
  127. img/info.png +0 -0
  128. img/mailchimpPro.png +0 -0
  129. img/newYearBg.jpg +0 -0
  130. img/pattern.jpg +0 -0
  131. img/proOptions.png +0 -0
  132. img/sg-shopping-cart-blue.png +0 -0
  133. img/sg-shopping-cart-white.png +0 -0
  134. img/sg-shopping-cart.png +0 -0
  135. img/social-icons.png +0 -0
  136. img/socialPopup.png +0 -0
  137. img/theme1.jpg +0 -0
  138. img/theme2.jpg +0 -0
  139. img/theme3.jpg +0 -0
  140. img/theme4.jpg +0 -0
  141. img/theme5.jpg +0 -0
  142. img/theme6.jpg +0 -0
  143. img/wpAjax.gif +0 -0
  144. img/wpspin_light.gif +0 -0
  145. javascript/index.php +0 -0
  146. javascript/jquery.sgcolorbox-min.js +0 -97
  147. javascript/sg_popup_backend.js +0 -655
  148. javascript/sg_popup_core.js +0 -6
  149. javascript/sg_popup_frontend.js +0 -1358
  150. javascript/sg_popup_init.js +0 -8
  151. javascript/sg_popup_javascript.php +0 -70
  152. javascript/sg_popup_support_plugins.js +0 -49
  153. javascript/sg_resize.js +0 -266
  154. popup-builder.php +12 -423
  155. public/css/ResetFormStyle.css +141 -0
  156. public/css/SubscriptionForm.css +107 -0
  157. {style → public/css}/animate.css +0 -0
  158. public/css/fonts/FontAwesome.otf +0 -0
  159. public/css/fonts/fontawesome-webfont.eot +0 -0
  160. public/css/fonts/fontawesome-webfont.svg +480 -0
PopupBuilderInit.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \SgpbPopupExtensionRegister;
4
+
5
+ class PopupBuilderInit
6
+ {
7
+ private static $instance = null;
8
+ private $actions;
9
+ private $filters;
10
+
11
+ private function __construct()
12
+ {
13
+ $this->init();
14
+ }
15
+
16
+ private function __clone()
17
+ {
18
+
19
+ }
20
+
21
+ public static function getInstance()
22
+ {
23
+ if(!isset(self::$instance)) {
24
+ self::$instance = new self();
25
+ }
26
+ return self::$instance;
27
+ }
28
+
29
+ public function init()
30
+ {
31
+ /*Included required data*/
32
+ $this->includeData();
33
+ $this->registerHooks();
34
+ $this->actions();
35
+ $this->filters();
36
+ }
37
+
38
+ private function includeData()
39
+ {
40
+ require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
41
+ require_once(SG_POPUP_CLASSES_PATH.'Installer.php');
42
+ require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
43
+ require_once(SG_POPUP_HELPERS_PATH.'Functions.php');
44
+ require_once(SG_POPUP_HELPERS_PATH.'ScriptsIncluder.php');
45
+ require_once(SG_POPUP_HELPERS_PATH.'PopupBuilderActivePackage.php');
46
+ require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtension.php');
47
+ require_once(SG_POPUP_HELPERS_PATH.'MultipleChoiceButton.php');
48
+ require_once(SG_POPUP_CLASSES_PATH.'ConditionBuilder.php');
49
+ require_once(SG_POPUP_CLASSES_PATH.'ConditionCreator.php');
50
+ require_once(SG_POPUP_CLASSES_POPUPS_PATH.'SGPopup.php');
51
+ require_once(SG_POPUP_CLASSES_PATH.'ScriptsLoader.php');
52
+ require_once(SG_POPUP_CLASSES_PATH.'PopupGroupFilter.php');
53
+ require_once(SG_POPUP_CLASSES_PATH.'PopupChecker.php');
54
+ require_once(SG_POPUP_CLASSES_PATH.'PopupLoader.php');
55
+ require_once(SG_POPUP_CLASSES_PATH.'PopupType.php');
56
+ require_once(SG_POPUP_CLASSES_PATH.'MediaButton.php');
57
+ require_once(SG_POPUP_CLASSES_PATH.'Style.php');
58
+ require_once(SG_POPUP_CLASSES_PATH.'Javascript.php');
59
+ require_once(SG_POPUP_CLASSES_PATH.'PopupInstaller.php');
60
+ require_once(SG_POPUP_CLASSES_PATH.'RegisterPostType.php');
61
+ require_once(SG_POPUP_CLASSES_PATH.'Ajax.php');
62
+ require_once(SG_POPUP_CLASSES_PATH.'ConvertToNewVersion.php');
63
+ require_once(SG_POPUP_CLASSES_PATH.'Filters.php');
64
+ require_once(SG_POPUP_CLASSES_PATH.'Actions.php');
65
+ require_once(SG_POPUP_LIBS_PATH.'Table.php');
66
+ require_once(SG_POPUP_CLASSES_PATH.'Updates.php');
67
+ }
68
+
69
+ public function actions()
70
+ {
71
+ $this->actions = new Actions();
72
+ }
73
+
74
+ public function filters()
75
+ {
76
+ $this->filters = new Filters();
77
+ }
78
+
79
+ private function registerHooks()
80
+ {
81
+ register_activation_hook(SG_POPUP_FILE_NAME, array($this, 'activate'));
82
+ register_deactivation_hook(SG_POPUP_FILE_NAME, array($this, 'deactivate'));
83
+ }
84
+
85
+ public function activate()
86
+ {
87
+ Installer::install();
88
+ Installer::registerPlugin();
89
+ }
90
+
91
+ public function deactivate()
92
+ {
93
+ require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
94
+ $pluginName = SG_POPUP_FILE_NAME;
95
+ // remove AWeber extension from registered extensions
96
+ SgpbPopupExtensionRegister::remove($pluginName);
97
+ }
98
+ }
99
+
100
+ PopupBuilderInit::getInstance();
classes/PopupInstaller.php DELETED
@@ -1,221 +0,0 @@
1
- <?php
2
- class PopupInstaller {
3
-
4
- public static $mainTableName = "sg_popup";
5
-
6
- public static function createTables($blogId = '') {
7
-
8
- global $wpdb;
9
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
10
- $sgPopupBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup (
11
- `id` int(11) NOT NULL AUTO_INCREMENT,
12
- `type` varchar(255) NOT NULL,
13
- `title` varchar(255) NOT NULL,
14
- `options` LONGTEXT NOT NULL,
15
- PRIMARY KEY (id)
16
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
17
- $sgPopupSettingsBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup_settings (
18
- `id` int(11) NOT NULL AUTO_INCREMENT,
19
- `options` LONGTEXT NOT NULL,
20
- PRIMARY KEY (id)
21
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
22
- $optionsDefault = SgPopupGetData::getDefaultValues();
23
- $sgPopupInsertSettingsSql = $wpdb->prepare("INSERT IGNORE ". $wpdb->prefix.$blogId."sg_popup_settings (id, options) VALUES(%d,%s) ", 1, json_encode($optionsDefault['settingsParams']));
24
-
25
- $sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_image_popup (
26
- `id` int(11) NOT NULL,
27
- `url` varchar(255) NOT NULL
28
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
29
- $sgPopupHtmlBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_html_popup (
30
- `id` int(11) NOT NULL,
31
- `content` text NOT NULL
32
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
33
- $sgPopupFblikeBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_fblike_popup (
34
- `id` int(11) NOT NULL,
35
- `content` text NOT NULL,
36
- `options` text NOT NULL
37
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
38
- $sgPopupShortcodeBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_shortCode_popup (
39
- `id` int(12) NOT NULL,
40
- `url` text NOT NULL
41
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
42
-
43
- $sgPopupAddon = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup_addons (
44
- `id` int(11) NOT NULL AUTO_INCREMENT,
45
- `name` varchar(255) NOT NULL UNIQUE,
46
- `paths` TEXT NOT NULL,
47
- `type` varchar(255) NOT NULL,
48
- `options` TEXT NOT NULL,
49
- `isEvent` TINYINT UNSIGNED NOT NULL,
50
- PRIMARY KEY (id)
51
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
52
-
53
- $addonsConnectionTable = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup_addons_connection (
54
- `id` int(11) NOT NULL AUTO_INCREMENT,
55
- `popupId` int(11) NOT NULL,
56
- `extensionKey` TEXT NOT NULL,
57
- `content` TEXT NOT NULL,
58
- `extensionType` varchar(255) NOT NULL,
59
- `options` TEXT NOT NULL,
60
- PRIMARY KEY (id)
61
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
62
-
63
- $wpdb->query($sgPopupBase);
64
- $wpdb->query($sgPopupSettingsBase);
65
- $wpdb->query($sgPopupInsertSettingsSql);
66
- $wpdb->query($sgPopupImageBase);
67
- $wpdb->query($sgPopupHtmlBase);
68
- $wpdb->query($sgPopupFblikeBase);
69
- $wpdb->query($sgPopupShortcodeBase);
70
- $wpdb->query($sgPopupAddon);
71
- $wpdb->query($addonsConnectionTable);
72
-
73
- $columnInfo = $wpdb->query("SHOW COLUMNS FROM ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." LIKE 'isEvent'");
74
- if(!$columnInfo) {
75
- $alterQuery = "ALTER TABLE ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." ADD isEvent TINYINT UNSIGNED NOT NULL";
76
- $wpdb->query($alterQuery);
77
- }
78
- }
79
-
80
- public static function install() {
81
-
82
- self::createTables();
83
-
84
- self::setupInstallationsDateConfig();
85
-
86
- /*get_current_blog_id() == 1 When plugin activated inside the child of multisite instance*/
87
- if(is_multisite() && get_current_blog_id() == 1) {
88
- global $wp_version;
89
-
90
- if($wp_version > '4.6.0') {
91
- $sites = get_sites();
92
- }
93
- else {
94
- $sites = wp_get_sites();
95
- }
96
-
97
- foreach($sites as $site) {
98
-
99
- if($wp_version > '4.6.0') {
100
- $blogId = $site->blog_id."_";
101
- }
102
- else {
103
- $blogId = $site['blog_id']."_";
104
- }
105
- if($blogId != 1) {
106
- self::createTables($blogId);
107
- }
108
- }
109
- }
110
- }
111
-
112
- public static function setupInstallationsDateConfig()
113
- {
114
- $usageDays = get_option('SGPBUsageDays');
115
- if(!$usageDays) {
116
- update_option('SGPBUsageDays', 0);
117
-
118
- $timeDate = new DateTime('now');
119
- $installTime = strtotime($timeDate->format('Y-m-d H:i:s'));
120
- update_option('SGPBInstallDate', $installTime);
121
- $timeDate->modify('+'.SG_REVIEW_POPUP_PERIOD.' day');
122
-
123
- $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
124
- update_option('SGPBOpenNextTime', $timeNow);
125
- }
126
- $maxPopupCount = get_option('SGPBMaxOpenCount');
127
- if(!$maxPopupCount) {
128
- update_option('SGPBMaxOpenCount', SG_POPUP_SHOW_COUNT);
129
- }
130
- }
131
-
132
- public static function uninstallTables($blogId = '') {
133
-
134
- global $wpdb;
135
- $delete = "DELETE FROM ".$wpdb->prefix.$blogId."postmeta WHERE meta_key = 'sg_promotional_popup' ";
136
- $wpdb->query($delete);
137
-
138
- $popupTable = $wpdb->prefix.$blogId."sg_popup";
139
- $popupSql = "DROP TABLE ". $popupTable;
140
-
141
- $popupImageTable = $wpdb->prefix.$blogId."sg_image_popup";
142
- $popupImageSql = "DROP TABLE ". $popupImageTable;
143
-
144
- $popupHtmlTable = $wpdb->prefix.$blogId."sg_html_popup";
145
- $popupHtmlSql = "DROP TABLE ". $popupHtmlTable;
146
-
147
- $popupFblikeTable = $wpdb->prefix.$blogId."sg_fblike_popup";
148
- $popupFblikeSql = "DROP TABLE ". $popupFblikeTable;
149
-
150
- $popupShortcodeTable = $wpdb->prefix.$blogId."sg_shortCode_popup";
151
- $popupShortcodeSql = "DROP TABLE ". $popupShortcodeTable;
152
-
153
- $popupAddonDrop = $wpdb->prefix.$blogId."sg_popup_addons";
154
- $popupAddonSql = "DROP TABLE ". $popupAddonDrop;
155
-
156
- $popupSettingsDrop = $wpdb->prefix.$blogId."sg_popup_settings";
157
- $popupSettingsSql = "DROP TABLE ". $popupSettingsDrop;
158
-
159
- $addonsConnectionTableName = $wpdb->prefix.$blogId."sg_popup_addons_connection";
160
- $deleteAddonsConnectionTable = "DROP TABLE ". $addonsConnectionTableName;
161
-
162
- $wpdb->query($popupSql);
163
- $wpdb->query($popupImageSql);
164
- $wpdb->query($popupHtmlSql);
165
- $wpdb->query($popupFblikeSql);
166
- $wpdb->query($popupShortcodeSql);
167
- $wpdb->query($popupAddonSql);
168
- $wpdb->query($popupSettingsSql);
169
- $wpdb->query($deleteAddonsConnectionTable);
170
- }
171
-
172
- public static function deleteSgPopupOptions($blogId = '') {
173
-
174
- global $wpdb;
175
- $deleteSG = "DELETE FROM ".$wpdb->prefix.$blogId."options WHERE option_name LIKE '%SG_POPUP%'";
176
- $wpdb->query($deleteSG);
177
- }
178
-
179
- public static function uninstall() {
180
-
181
- self::removeCustomOptions();
182
-
183
- $obj = new self();
184
- self::uninstallTables();
185
- $obj->deleteSgPopupOptions();
186
-
187
- if(is_multisite()) {
188
- global $wp_version;
189
- if($wp_version > '4.6.0') {
190
- $sites = get_sites();
191
- }
192
- else {
193
- $sites = wp_get_sites();
194
- }
195
-
196
- foreach($sites as $site) {
197
-
198
- if($wp_version > '4.6.0') {
199
- $blogId = $site->blog_id."_";
200
- }
201
- else {
202
- $blogId = $site['blog_id']."_";
203
- }
204
-
205
- self::uninstallTables($blogId);
206
- $obj->deleteSgPopupOptions($blogId);
207
- }
208
- }
209
- }
210
-
211
- public static function removeCustomOptions()
212
- {
213
- delete_option('SGPBUsageDays');
214
- delete_option('SGPBOpenNextTime');
215
- delete_option('SGPBMaxOpenCount');
216
- delete_option('SGPBCloseReviewPopup');
217
- delete_option('SgpbCounter');
218
- delete_option('SGPBInstallDate');
219
- delete_option('popupPreviewId');
220
- }
221
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGFblikePopup.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/SGPopup.php');
3
-
4
- class SGFblikePopup extends SGPopup
5
- {
6
- public $content;
7
- public $fblikeOptions;
8
-
9
- public function setContent($content)
10
- {
11
- $this->content = $content;
12
- }
13
-
14
- public function getContent()
15
- {
16
- return $this->content;
17
- }
18
-
19
- public function setFblikeOptions($options)
20
- {
21
- $this->fblikeOptions = $options;
22
- }
23
-
24
- public function getFblikeOptions()
25
- {
26
- return $this->fblikeOptions;
27
- }
28
-
29
- public static function create($data, $obj = null)
30
- {
31
- $obj = new self();
32
- $options = json_decode($data['options'], true);
33
- $fblikeOptions = $options['fblikeOptions'];
34
-
35
- $obj->setFblikeOptions($fblikeOptions);
36
- $obj->setContent($data['fblike']);
37
-
38
- return parent::create($data, $obj);
39
- }
40
-
41
- public function save($data = array())
42
- {
43
-
44
- $editMode = $this->getId()?true:false;
45
-
46
- $res = parent::save($data);
47
- if ($res===false) return false;
48
-
49
- $sgFblikeContent = $this->getContent();
50
- $fblikeOptions = $this->getFblikeOptions();
51
-
52
- global $wpdb;
53
- if ($editMode) {
54
- $sgFblikeContent = stripslashes($sgFblikeContent);
55
- $sql = $wpdb->prepare("UPDATE ".$wpdb->prefix."sg_fblike_popup SET content=%s, options=%s WHERE id=%d", $sgFblikeContent, $fblikeOptions, $this->getId());
56
- $res = $wpdb->query($sql);
57
- }
58
- else {
59
-
60
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix."sg_fblike_popup (id, content, options) VALUES (%d, %s, %s)",$this->getId(),$sgFblikeContent, $fblikeOptions);
61
- $res = $wpdb->query($sql);
62
- }
63
- return $res;
64
- }
65
-
66
- protected function setCustomOptions($id)
67
- {
68
- global $wpdb;
69
- $st = $wpdb->prepare("SELECT content, options FROM ".$wpdb->prefix."sg_fblike_popup WHERE id = %d", $id);
70
- $arr = $wpdb->get_row($st,ARRAY_A);
71
- $this->setContent($arr['content']);
72
- $this->setFblikeOptions($arr['options']);
73
- }
74
-
75
- protected function getExtraRenderOptions()
76
- {
77
- $locale = $this->getSiteLocale();
78
- $options = json_decode($this->getFblikeOptions(), true);
79
- $url = $options['fblike-like-url'];
80
- $layout = $options['fblike-layout'];
81
- $shareButtonStatus = true;
82
- $closePopupStatus = 0;
83
-
84
- $popupId = (int)$this->getId();
85
- $content = $this->getContent();
86
-
87
- if(!empty($options['fblike-dont-show-share-button'])) {
88
- $shareButtonStatus = false;
89
- }
90
- if(!empty($options['fblike-close-popup-after-like'])) {
91
- $closePopupStatus = true;
92
- }
93
-
94
- $content .= "<div id=\"sg-facebook-like\">
95
- <script type=\"text/javascript\">
96
- window.fbAsyncInit = function () {
97
- FB.Event.subscribe('edge.create', function(response) {
98
- if($closePopupStatus) {
99
- jQuery.sgcolorbox.close();
100
- }
101
-
102
- });
103
- };
104
- (function(d, s, id) {
105
- var js, fjs = d.getElementsByTagName(s)[0];
106
- if (d.getElementById(id)) return;
107
- js = d.createElement(s); js.id = id;
108
- js.src = \"https://connect.facebook.net/".$locale."/sdk.js#xfbml=1&version=v2.5\";
109
- fjs.parentNode.insertBefore(js, fjs);
110
- }(document, 'script', 'facebook-jssdk'));
111
- </script>";
112
- $content .= '<div class = "sg-fb-buttons-wrapper"><div class="fb-like" data-href="'.$url.'" data-layout="'.$layout.'" data-action="like" data-show-faces="true" data-share="'.$shareButtonStatus.'"></div></div></div>';
113
- $content .= '<style>
114
- .sg-fb-buttons-wrapper{
115
- text-align: center;
116
- min-height: 25px;
117
- }
118
- #sgcboxLoadedContent iframe {
119
- max-width: none !important;
120
- }
121
- </style>';
122
- $hasShortcode = $this->hasPopupContentShortcode($content);
123
-
124
- if($hasShortcode) {
125
-
126
- $content = $this->improveContent($content);
127
- }
128
- $this->sgAddPopupContentToFooter($content, $popupId);
129
-
130
- $content = trim($content);
131
- return array('html'=>$content);
132
- }
133
-
134
- public function render()
135
- {
136
- return parent::render();
137
- }
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGHtmlPopup.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/SGPopup.php');
3
-
4
- class SGHtmlPopup extends SGPopup {
5
- public $content;
6
-
7
- public function setContent($content) {
8
- $this->content = $content;
9
- }
10
- public function getContent() {
11
- return $this->content;
12
- }
13
- public static function create($data, $obj = null) {
14
- $obj = new self();
15
-
16
- $obj->setContent($data['html']);
17
-
18
- return parent::create($data, $obj);
19
- }
20
- public function save($data = array()) {
21
-
22
- $editMode = $this->getId()?true:false;
23
-
24
- $res = parent::save($data);
25
- if ($res===false) return false;
26
-
27
- $sgHtmlPopup = $this->getContent();
28
-
29
- global $wpdb;
30
- if ($editMode) {
31
- $sgHtmlPopup = stripslashes($sgHtmlPopup);
32
- $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_html_popup SET content=%s WHERE id=%d",$sgHtmlPopup,$this->getId());
33
- $res = $wpdb->query($sql);
34
- }
35
- else {
36
-
37
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_html_popup (id, content) VALUES (%d,%s)",$this->getId(),$sgHtmlPopup);
38
- $res = $wpdb->query($sql);
39
- }
40
- return $res;
41
- }
42
-
43
- protected function setCustomOptions($id) {
44
- global $wpdb;
45
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_html_popup WHERE id = %d",$id);
46
- $arr = $wpdb->get_row($st,ARRAY_A);
47
- $this->setContent($arr['content']);
48
- }
49
-
50
- private function filterContentForAutoPlayIframe($content)
51
- {
52
- // $match array 0 => content 1 => Iframe url
53
- preg_match('/<iframe.*?src="(.*?)".*?<\/iframe>/', $content, $match);
54
-
55
- if(empty($match[1])) {
56
- return $content;
57
- }
58
- $iframeUrl = $match[1];
59
-
60
- $popupOptions = $this->getOptions();
61
- $popupOptions = json_decode($popupOptions, true);
62
-
63
- if(empty($popupOptions)) {
64
- return $content;
65
- }
66
- $popupOptions['htmlIframeUrl'] = $iframeUrl;
67
- $popupOptions = json_encode($popupOptions);
68
- $this->setOptions($popupOptions);
69
-
70
- return str_replace($iframeUrl,' ',$content);
71
- }
72
-
73
- protected function getExtraRenderOptions() {
74
- $content = trim($this->getContent());
75
- $hasShortcode = $this->hasPopupContentShortcode($content);
76
- $popupId = (int)$this->getId();
77
-
78
- if($hasShortcode) {
79
- $content = $this->improveContent($content);
80
- }
81
- $content = $this->filterContentForAutoPlayIframe($content);
82
-
83
- $this->sgAddPopupContentToFooter($content, $popupId);
84
-
85
- return array('html' => $content);
86
- }
87
-
88
- public function render() {
89
- return parent::render();
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGImagePopup.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/SGPopup.php');
3
-
4
- class SGImagePopup extends SGPopup {
5
- private $url;
6
-
7
- public function setUrl($url) {
8
- $this->url = $url;
9
- }
10
- public function getUrl() {
11
- return $this->url;
12
- }
13
- public static function create($data, $obj = null) {
14
- $obj = new self();
15
-
16
- $obj->setUrl($data['image']);
17
-
18
- parent::create($data, $obj);
19
- }
20
-
21
- public function save($data = array()) {
22
-
23
- $editMode = $this->getId()?true:false;
24
-
25
- $res = parent::save($data);
26
- if ($res===false) return false;
27
-
28
- global $wpdb;
29
- if ($editMode) {
30
- $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_image_popup SET url=%s WHERE id=%d",$this->getUrl(),$this->getId());
31
- $res = $wpdb->query($sql);
32
- }
33
- else {
34
-
35
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_image_popup (id, url) VALUES (%d,%s)",$this->getId(),$this->getUrl());
36
- $res = $wpdb->query($sql);
37
- }
38
- return $res;
39
- }
40
-
41
- public function getRemoveOptions()
42
- {
43
- return array('popup-content-padding' => 1, 'popupContentBgImage' => 1);
44
- }
45
-
46
- protected function setCustomOptions($id) {
47
- global $wpdb;
48
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_image_popup WHERE id = %d",$id);
49
- $arr = $wpdb->get_row($st,ARRAY_A);
50
- $this->setUrl($arr['url']);
51
- }
52
- protected function getExtraRenderOptions() {
53
- return array('image'=>$this->getUrl());
54
- }
55
-
56
- public function render() {
57
- return parent::render();
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGPBExtension.php DELETED
@@ -1,237 +0,0 @@
1
- <?php
2
- abstract class SGPBExtension {
3
-
4
- const SGPB_ADDON_TABLE_NAME = 'sg_popup_addons';
5
- const SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME = 'sg_popup_addons_connection';
6
-
7
- private $params = array();
8
- private $popupId;
9
- private $extensionContent;
10
- private $extensionOptions;
11
- private $postData;
12
-
13
- /**
14
- * Php magic call method using for setter and getter
15
- *
16
- * @since 1.0.0
17
- *
18
- * @param $name setter or getter name
19
- * @param array $args setter params
20
- *
21
- * @return void
22
- *
23
- */
24
- public function __call($name, $args) {
25
-
26
- $methodPrefix = substr($name, 0, 3);
27
- $methodProperty = lcfirst(substr($name,3));
28
-
29
- if ($methodPrefix=='get') {
30
- return $this->$methodProperty;
31
- }
32
- else if ($methodPrefix=='set') {
33
- $this->$methodProperty = $args[0];
34
- }
35
- }
36
-
37
- /**
38
- * Create Extension tables
39
- *
40
- * @since 2.4.6
41
- *
42
- * @param int $blogsId
43
- *
44
- * @return void
45
- *
46
- */
47
- public static function createExtensionTables($blogsId) {
48
-
49
- global $wpdb;
50
-
51
- $sgPopupAddon = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId.SGPBExtension::SGPB_ADDON_TABLE_NAME." (
52
- `id` int(11) NOT NULL AUTO_INCREMENT,
53
- `name` varchar(255) NOT NULL UNIQUE,
54
- `paths` TEXT NOT NULL,
55
- `type` varchar(255) NOT NULL,
56
- `options` TEXT NOT NULL,
57
- `isEvent` TINYINT UNSIGNED NOT NULL,
58
- PRIMARY KEY (id)
59
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
60
-
61
- $extensionDataTable = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME." (
62
- `id` int(11) NOT NULL AUTO_INCREMENT,
63
- `popupId` int(11) NOT NULL,
64
- `extensionKey` TEXT NOT NULL,
65
- `content` TEXT NOT NULL,
66
- `extensionType` varchar(255) NOT NULL,
67
- `options` TEXT NOT NULL,
68
- PRIMARY KEY (id)
69
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
70
-
71
- $columInfo = $wpdb->query("SHOW COLUMNS FROM ".$wpdb->prefix.$blogsId.SGPBExtension::SGPB_ADDON_TABLE_NAME." LIKE 'isEvent'");
72
-
73
- if(!$columInfo) {
74
- $alterQuery = "ALTER TABLE ".$wpdb->prefix.$blogsId.SGPBExtension::SGPB_ADDON_TABLE_NAME." ADD isEvent TINYINT UNSIGNED NOT NULL";
75
- $wpdb->query($alterQuery);
76
- }
77
-
78
- $wpdb->query($sgPopupAddon);
79
- $wpdb->query($extensionDataTable);
80
- }
81
-
82
- /**
83
- * Popup extensions Saved option
84
- *
85
- * @since 2.4.6
86
- *
87
- * @param int $popupId
88
- * @param string $extensionKey
89
- *
90
- * @return bool if does not exists data and Object when have saved data
91
- *
92
- */
93
- public static function getSavedOptions($popupId, $extensionKey) {
94
-
95
- global $wpdb;
96
-
97
- $prepareSql = $wpdb->prepare("SELECT options FROM ".$wpdb->prefix.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME." WHERE popupId = %d AND extensionKey = %s", $popupId, $extensionKey);
98
- $savedData = $wpdb->get_results($prepareSql, OBJECT);
99
-
100
- /*When does not have saved data*/
101
- if(empty($savedData)) {
102
- return false;
103
- }
104
-
105
- return $savedData;
106
- }
107
-
108
- /**
109
- * Exists extension options
110
- *
111
- * @since 2.4.6
112
- *
113
- * @param int $popupId
114
- * @param string $extensionKey
115
- *
116
- * @return bool if doens not exists data and Object when have saved data
117
- *
118
- */
119
- private function isExistOptionData($popupId, $extensionKey) {
120
-
121
- global $wpdb;
122
-
123
- $prepareSql = $wpdb->prepare("SELECT COUNT(*) as count FROM ".$wpdb->prefix.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME." WHERE popupId = %d AND extensionKey=%s", $popupId, $extensionKey);
124
- $arr = $wpdb->get_row($prepareSql, ARRAY_A);
125
-
126
- return $arr['count'];
127
- }
128
-
129
- public function save() {
130
-
131
- $popupId = $this->getPopupId();
132
- $popupContent = $this->getExtensionContent();
133
- $extensionOptions = $this->getExtensionOptions();
134
- if(!isset($extensionOptions)) {
135
- $extensionOptions = '';
136
- }
137
- $extensionOptions = @json_encode($extensionOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);
138
- $extensionConnectionTable = SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME;
139
- $extensionKey = static::SGPB_EXTENSION_KEY;
140
- $extensionType = static::SGPB_EXTENSION_TYPE;
141
- $saveMode = $this->isExistOptionData($popupId, $extensionKey);
142
-
143
- global $wpdb;
144
-
145
- if($saveMode == 0) {
146
- $data = array(
147
- 'popupId'=> $popupId,
148
- 'extensionKey'=> $extensionKey,
149
- 'content'=> $popupContent,
150
- 'extensionType'=> $extensionType,
151
- 'options'=> $extensionOptions
152
- );
153
- $formats = array('%d', '%s', '%s', '%s', '%s');
154
- $wpdb->insert($wpdb->prefix.$extensionConnectionTable, $data, $formats);
155
-
156
- }
157
- else {
158
- $data = array(
159
- 'content'=> $popupContent,
160
- 'options'=> $extensionOptions
161
- );
162
- $formats = array('%s', '%s');
163
- $whereFormat = array('%d', '%s');
164
- $where = array(
165
- 'popupId'=> $popupId,
166
- 'extensionKey'=> $extensionKey
167
- );
168
-
169
- $wpdb->update($wpdb->prefix.$extensionConnectionTable, $data, $where, $formats, $whereFormat);
170
- }
171
-
172
- return $data;
173
- }
174
-
175
- public function deleteOption() {
176
-
177
- global $wpdb;
178
-
179
- $popupId = $this->getPopupId();
180
- $extensionConnectionTable = SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME;
181
- $extensionKey = static::SGPB_EXTENSION_KEY;
182
-
183
- $deleteCondition = array('popupId' => $popupId, 'extensionKey' => $extensionKey);
184
-
185
- $wpdb->delete($wpdb->prefix.$extensionConnectionTable, $deleteCondition, array('%d', '%s'));
186
- }
187
-
188
- public static function deletePopupFromConnectionById($popupId) {
189
-
190
- global $wpdb;
191
-
192
- $extensionConnectionTable = SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME;
193
- $deleteCondition = array('popupId' => $popupId);
194
- $wpdb->delete($wpdb->prefix.$extensionConnectionTable, $deleteCondition, array('%d'));
195
- }
196
-
197
- public static function getExtensionsOptions($popupId, $type = 'option') {
198
-
199
- global $wpdb;
200
- $extensionData = array();
201
-
202
- $prepareSql = $wpdb->prepare("SELECT extensionKey, options FROM ".$wpdb->prefix.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME." WHERE popupId = %d AND extensionType=%s", $popupId, $type);
203
- $extensionOptions = $wpdb->get_results($prepareSql, ARRAY_A);
204
-
205
- if(empty($extensionOptions)) {
206
- return $extensionData;
207
- }
208
-
209
- foreach($extensionOptions as $extension) {
210
- $extensionData[$extension['extensionKey']] = json_decode($extension['options'], true);
211
- }
212
-
213
- return $extensionData;
214
- }
215
-
216
- public static function getPopupSavedExtensionsKeys($popupId) {
217
-
218
- global $wpdb;
219
-
220
- $prepareSql = $wpdb->prepare("SELECT extensionKey, paths FROM ".$wpdb->prefix."sg_popup_addons LEFT JOIN ".$wpdb->prefix.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME ." ON extensionKey = name and popupId = %d", $popupId);
221
- $extensionOptions = $wpdb->get_results($prepareSql, ARRAY_A);
222
-
223
- return $extensionOptions;
224
- }
225
-
226
- public static function hasPopupEvent($popupId) {
227
-
228
- global $wpdb;
229
-
230
- $prepareSql = $wpdb->prepare("SELECT count(id) as count FROM ".$wpdb->prefix.static::SGPB_ADDON_TABLE_NAME ." WHERE isEvent = 1 AND name in (SELECT extensionKey FROM ".$wpdb->prefix.SGPBExtension::SGPB_ADDON_POPUP_CONNECTION_TABLE_NAME." where popupId = %d)", $popupId);
231
- $countEvents = $wpdb->get_row($prepareSql, ARRAY_A);
232
- $count = $countEvents['count'];
233
-
234
- return $count;
235
- }
236
-
237
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGPBExtensionManager.php DELETED
@@ -1,229 +0,0 @@
1
- <?php
2
- class SGPBExtensionManager {
3
-
4
- private $managerParams = array();
5
- private $extensionKey;
6
- private $postData;
7
- private $savedOptions;
8
- private $optionsDefaultValues;
9
-
10
- public function __call($name, $args) {
11
-
12
- $methodPrefix = substr($name, 0, 3);
13
- $methodProperty = lcfirst(substr($name,3));
14
-
15
- if ($methodPrefix=='get') {
16
- return $this->$methodProperty;
17
- }
18
- else if ($methodPrefix=='set') {
19
- $this->$methodProperty = $args[0];
20
- }
21
- }
22
-
23
- public function save() {
24
-
25
- $this->extensionsSave();
26
- }
27
-
28
- public function sgBoolToChecked($var) {
29
- return ($var?'checked':'');
30
- }
31
-
32
- public function getExtensionsData($type = '') {
33
-
34
- global $wpdb;
35
- $paths = array();
36
- $where = '';
37
-
38
- if($type != '') {
39
- $where = ' WHERE type="'.$type.'"';
40
- }
41
-
42
- $prepareSql = "SELECT * FROM ". $wpdb->prefix .SGPBExtension::SGPB_ADDON_TABLE_NAME.$where;
43
- $results = $wpdb->get_results($prepareSql, ARRAY_A);
44
-
45
- if(empty($results)) {
46
- return $paths;
47
- }
48
-
49
- foreach ($results as $key => $value) {
50
-
51
- $extensionPaths = json_decode($value['paths'], true);
52
-
53
- if(!$extensionPaths) {
54
- $extensionPaths = array();
55
- }
56
-
57
- $paths[$value['name']] = $extensionPaths;
58
- }
59
-
60
- return $paths;
61
- }
62
-
63
- public function getExtensionClassName() {
64
-
65
- $extensionKey = $this->getExtensionKey();
66
- $extensionClass = "SGPB".ucfirst($extensionKey)."Extension";
67
-
68
- return $extensionClass;
69
- }
70
-
71
- public function optionsInclude($popupType) {
72
-
73
- $options = $this->getExtensionsData('option');
74
- $extensionOptions = '';
75
-
76
- foreach($options as $extensionKey => $optionData) {
77
-
78
- $this->setExtensionKey($extensionKey);
79
- $extensionClass = $this->getExtensionClassName();
80
- $appPath = $optionData['app-path'];
81
- $hasPluginDirPathApp = strrpos($appPath, WP_PLUGIN_DIR);
82
-
83
- if ($hasPluginDirPathApp === false) {
84
- $appPath = WP_PLUGIN_DIR.'/'.$appPath;
85
- }
86
- if(!file_exists($appPath.'/classes/'.$extensionClass.'.php')) {
87
- continue;
88
- }
89
- require_once($appPath.'/classes/'.$extensionClass.'.php');
90
- $extensionObj = new $extensionClass();
91
- $content = $extensionObj->includeOption($popupType);
92
- $extensionOptions .= $content;
93
-
94
- }
95
-
96
- return $extensionOptions;
97
- }
98
-
99
- public function extensionsSave() {
100
-
101
- $extensionsData = $this->getExtensionsData();
102
- $postData = $this->getPostData();
103
-
104
- foreach($extensionsData as $extensionKey => $extensionData) {
105
-
106
- $this->setExtensionKey($extensionKey);
107
- $extensionClass = $this->getExtensionClassName();
108
- $appPath = $extensionData['app-path'];
109
- $hasPluginDirPathApp = strrpos($appPath, WP_PLUGIN_DIR);
110
-
111
- if ($hasPluginDirPathApp === false) {
112
- $appPath = WP_PLUGIN_DIR.'/'.$appPath;
113
- }
114
-
115
- if(!file_exists($appPath.'/classes/'.$extensionClass.'.php')) {
116
- continue;
117
- }
118
- require_once($appPath.'/classes/'.$extensionClass.'.php');
119
- $extensionObj = new $extensionClass();
120
- $extensionObj->setPostData($postData);
121
- $extensionObj->save();
122
-
123
- }
124
- }
125
-
126
- public function setupOptionsDefaultValues() {
127
-
128
- $options = $this->getExtensionsData('option');
129
- $allOptions = array();
130
-
131
- foreach($options as $extensionKey => $optionData) {
132
-
133
- $this->setExtensionKey($extensionKey);
134
- $extensionClass = $this->getExtensionClassName();
135
- $appPath = $optionData['app-path'];
136
- $hasPluginDirPathApp = strrpos($appPath, WP_PLUGIN_DIR);
137
-
138
- if ($hasPluginDirPathApp === false) {
139
- $appPath = WP_PLUGIN_DIR.'/'.$appPath;
140
- }
141
-
142
- if(!file_exists($appPath.'/classes/'.$extensionClass.'.php')) {
143
- continue;
144
- }
145
- require_once($appPath.'/classes/'.$extensionClass.'.php');
146
- $extensionObj = new $extensionClass();
147
- $defaults = $extensionObj->getDefaultValues();
148
- $allOptions = array_merge($allOptions, $defaults);
149
-
150
- }
151
-
152
- $this->setOptionsDefaultValues($allOptions);
153
- }
154
-
155
- public function setExtensionData($popupId, $extensionKey) {
156
-
157
- $savedOptionsData = array();
158
- if(isset($popupId)) {
159
- $savedOptions = SGPBExtension::getSavedOptions($popupId, $extensionKey);
160
-
161
- if($savedOptions) {
162
- foreach($savedOptions as $key => $optionData) {
163
-
164
- $options = json_decode($optionData->options, true);
165
- $savedOptionsData = $options;
166
- }
167
- }
168
- }
169
-
170
- $this->setupOptionsDefaultValues();
171
- $this->setSavedOptions($savedOptionsData);
172
- }
173
-
174
- public function getOptionValue($optionKey, $isBool = false) {
175
-
176
- $savedOptions = $this->getSavedOptions();
177
-
178
- $defaultOptions = $this->getOptionsDefaultValues();
179
-
180
- if (isset($savedOptions[$optionKey])) {
181
- $elementValue = $savedOptions[$optionKey];
182
- }
183
- else if(!empty($savedOptions) && $isBool) {
184
- /*for checkbox elements when they does not exist in the saved data*/
185
- $elementValue = '';
186
- }
187
- else {
188
- $elementValue = $defaultOptions[$optionKey];
189
- }
190
-
191
- if($isBool) {
192
- $elementValue = $this->sgBoolToChecked($elementValue);
193
- }
194
-
195
- return $elementValue;
196
- }
197
-
198
- public function includeExtensionScripts($popupId) {
199
-
200
- $extensionKeys = SGPBExtension::getPopupSavedExtensionsKeys($popupId);
201
-
202
- foreach($extensionKeys as $extensionOptios) {
203
-
204
- $paths = json_decode($extensionOptios['paths'], true);
205
- $extensionKey = $extensionOptios['extensionKey'];
206
- if(!isset($extensionKey)) {
207
- continue;
208
- }
209
- $this->setExtensionKey($extensionKey);
210
- $extensionClass = $this->getExtensionClassName();
211
-
212
- if(!class_exists($extensionClass)) {
213
- if(!file_exists($paths['app-path'].'/classes/'.$extensionClass.'.php')) {
214
- continue;
215
- }
216
- require_once($paths['app-path'].'/classes/'.$extensionClass.'.php');
217
- }
218
- $extensionObj = new $extensionClass();
219
- $extensionObj->includeScripts($popupId);
220
-
221
- }
222
- }
223
-
224
- public function deletePopupFromConnection($popupId) {
225
-
226
- SGPBExtension::deletePopupFromConnectionById($popupId);
227
- }
228
-
229
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGPBExtensionsConnector.php DELETED
@@ -1,243 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Popup builder extensions connection
5
- *
6
- * @since 2.5.3
7
- *
8
- */
9
- class SGPBExtensionsConnector {
10
-
11
- public $activeExtensions;
12
- public $deactive;
13
- //redirect url for activation hook
14
- public $redirectUrl = '';
15
- //bool $networkWide Whether to enable the plugin for all sites in the network.
16
- public $networkWide = false;
17
- //bool $silent Prevent calling activation hooks.
18
- public $silent = false;
19
- public $prepareData;
20
-
21
- public static $POPUPEXTENSIONS = array(
22
- 'popup-builder-mailchimp/popup-builder-mailchimp.php',
23
- 'popup-builder-aweber/popup-builder-aweber.php',
24
- 'popup-builder-exit-intent/popup-builder-exit-intent.php',
25
- 'popup-builder-analytics/popup-builder-analytics.php',
26
- 'popup-builder-ad-block/popup-builder-add-block.php'
27
- );
28
-
29
- public function __construct() {
30
-
31
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
32
- if(is_multisite()) {
33
- $this->networkWide = true;
34
- }
35
- }
36
-
37
- /**
38
- * Check extensions connection
39
- *
40
- * @since 2.5.3
41
- *
42
- * @param bool $activeStatus if true check is active extension
43
- *
44
- * @return void
45
- *
46
- */
47
-
48
- private function extensionCheck($activeStatus) {
49
-
50
- $extensions = array();
51
- $allExtensions = SGPBExtensionsConnector::$POPUPEXTENSIONS;
52
-
53
- if(empty($allExtensions)) {
54
- return;
55
- }
56
-
57
- foreach($allExtensions as $extensionKey) {
58
- $isActive = is_plugin_active($extensionKey);
59
-
60
- if($isActive && $activeStatus) {
61
- $extensions[] = $extensionKey;
62
- }
63
- else if(!$isActive && !$activeStatus) {
64
- $extensions[] = $extensionKey;
65
- }
66
- }
67
-
68
- if($activeStatus) {
69
- $this->activeExtensions = $extensions;
70
- }
71
- else {
72
- $this->deactive = $extensions;
73
- }
74
-
75
- }
76
-
77
- private function packageChecker() {
78
-
79
- $originalExtension = SG_APP_POPUP_FILES.'/extensions/popup-builder-exit-intent';
80
- $passedExtension = WP_PLUGIN_DIR.'/popup-builder-exit-intent';
81
-
82
- if(file_exists($originalExtension) && file_exists($passedExtension)) {
83
- $exitIntentPackage = array('popup-builder-exit-intent/popup-builder-exit-intent.php');
84
- $this->deletePlugin($exitIntentPackage);
85
- }
86
- }
87
-
88
- /**
89
- * Current All active extensions
90
- *
91
- * @since 2.5.3
92
- *
93
- * @return array $activeExtension
94
- *
95
- */
96
-
97
- private function getActiveExtensions() {
98
-
99
- $this->extensionCheck(true);
100
- $activeExtension = $this->activeExtensions;
101
-
102
- return $activeExtension;
103
- }
104
-
105
- /**
106
- * Current all deactive extensions
107
- *
108
- * @since 2.5.3
109
- *
110
- * @return array $deactivateExtensions
111
- *
112
- */
113
-
114
- private function getDeactivatePlugins() {
115
-
116
- $this->extensionCheck(false);
117
- $deactivateExtensions = $this->deactive;
118
-
119
- return $deactivateExtensions;
120
- }
121
-
122
- private function prepareToActivate() {
123
-
124
- $this->getActiveExtensions();
125
- $this->getDeactivatePlugins();
126
- // Deactivate all active extensions
127
- $this->deactivate();
128
- $this->packageChecker();
129
- }
130
-
131
- /**
132
- * Activate all extensions
133
- *
134
- * @since 2.5.3
135
- *
136
- * @param bool status if true activate all else active only active extensions
137
- *
138
- * @return void
139
- *
140
- */
141
-
142
- public function activate($status = false) {
143
-
144
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
145
- $doActivate = $this->activeExtensions;
146
-
147
- $this->prepareToActivate();
148
-
149
- if($status) {
150
- $doActivate = SGPBExtensionsConnector::$POPUPEXTENSIONS;
151
- }
152
- if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
153
- @$this->sgRunActivatePlugin('popup-builder-exit-intent/popup-builder-exit-intent.php');
154
- }
155
- $this->doActivate($doActivate);
156
- }
157
-
158
- /**
159
- * Activate plugins
160
- *
161
- * @since 2.5.3
162
- *
163
- * @param string|array $plugins Single plugin or list of plugins.
164
- *
165
- * @return void
166
- */
167
-
168
- public function doActivate($plugins) {
169
-
170
- $redirectUrl = $this->redirectUrl;
171
- $networkWide = $this->networkWide;
172
- $silent = $this->silent;
173
-
174
- activate_plugins($plugins, $redirectUrl, $networkWide, $silent);
175
- }
176
-
177
- /**
178
- * Deactivate all extensions
179
- *
180
- * @since 2.5.3
181
- *
182
- * @return void
183
- *
184
- */
185
-
186
- public function deactivate() {
187
-
188
- $doDeActivate = $this->activeExtensions;
189
-
190
- $this->doDeactivate($doDeActivate);
191
- }
192
-
193
- /**
194
- * Deactivate plugins
195
- *
196
- * @since 2.5.3
197
- *
198
- * @param string|array $plugins Single plugin or list of plugins.
199
- *
200
- * @return void
201
- *
202
- */
203
-
204
- public function doDeactivate($plugins) {
205
-
206
- $networkWide = $this->networkWide;
207
- $silent = $this->silent;
208
-
209
- deactivate_plugins($plugins,$silent,$networkWide);
210
- }
211
-
212
- /**
213
- * Delete plugin from plugins section
214
- *
215
- * @since 2.5.3
216
- *
217
- * @param array $plugins List of plugins to delete.
218
- *
219
- * @return void
220
- *
221
- */
222
-
223
- private function deletePlugin($plugins) {
224
-
225
- delete_plugins($plugins);
226
- }
227
-
228
- public function sgRunActivatePlugin($plugin) {
229
- $current = get_option( 'active_plugins' );
230
- $plugin = plugin_basename( trim( $plugin ) );
231
-
232
- if ( !in_array( $plugin, $current ) ) {
233
- $current[] = $plugin;
234
- sort( $current );
235
- do_action( 'activate_plugin', trim( $plugin ) );
236
- update_option( 'active_plugins', $current );
237
- do_action( 'activate_' . trim( $plugin ) );
238
- do_action( 'activated_plugin', trim( $plugin) );
239
- }
240
-
241
- return null;
242
- }
243
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGPopup.php DELETED
@@ -1,515 +0,0 @@
1
- <?php
2
-
3
- abstract class SGPopup {
4
- protected $id;
5
- protected $type;
6
- protected $title;
7
- protected $width;
8
- protected $height;
9
- protected $delay;
10
- protected $effectDuration;
11
- protected $effect;
12
- protected $initialWidth;
13
- protected $initialHeight;
14
- protected $options;
15
- public static $registeredScripts = false;
16
-
17
- public function setType($type){
18
- $this->type = $type;
19
- }
20
- public function getType() {
21
- return $this->type;
22
- }
23
- public function setTitle($title){
24
- $this->title = $title;
25
- }
26
- public function getTitle() {
27
- return $this->title;
28
- }
29
- public function setId($id){
30
- $this->id = $id;
31
- }
32
- public function getId() {
33
- return $this->id;
34
- }
35
- public function setWidth($width){
36
- $this->width = $width;
37
- }
38
- public function getWidth() {
39
- return $this->width;
40
- }
41
- public function setHeight($height){
42
- $this->height = $height;
43
- }
44
- public function getHeight() {
45
- return $this->height;
46
- }
47
- public function setDelay($delay){
48
- $this->delay = $delay;
49
- }
50
- public function getDelay() {
51
- return $this->delay;
52
- }
53
- public function setEffectDuration($effectDuration){
54
- $this->effectDuration = $effectDuration;
55
- }
56
- public function getEffectDuration() {
57
- return $this->effectDuration;
58
- }
59
- public function setEffect($effect){
60
- $this->effect = $effect;
61
- }
62
- public function getEffect() {
63
- return $this->effect;
64
- }
65
- public function setInitialWidth($initialWidth){
66
- $this->initialWidth = $initialWidth;
67
- }
68
- public function getInitialWidth() {
69
- return $this->initialWidth;
70
- }
71
- public function setInitialHeight($initialHeight){
72
- $this->initialHeight = $initialHeight;
73
- }
74
- public function getInitialHeight() {
75
- return $this->initialHeight;
76
- }
77
- public function setOptions($options) {
78
- $this->options = $options;
79
- }
80
- public function getOptions() {
81
- return $this->options;
82
- }
83
- public static function findById($id) {
84
-
85
- global $wpdb;
86
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup WHERE id = %d",$id);
87
- $arr = $wpdb->get_row($st,ARRAY_A);
88
- if(!$arr) return false;
89
- return self::popupObjectFromArray($arr);
90
-
91
- }
92
-
93
- abstract protected function setCustomOptions($id);
94
-
95
- abstract protected function getExtraRenderOptions();
96
-
97
- private static function popupObjectFromArray($arr, $obj = null) {
98
-
99
- $jsonData = json_decode($arr['options'], true);
100
-
101
- $type = sgSafeStr($arr['type']);
102
-
103
- if ($obj===null) {
104
- $className = "SG".ucfirst(strtolower($type)).'Popup';
105
- /* get current popup app path */
106
- $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
107
-
108
- $popupAppPath = $paths['app-path'];
109
- if(!file_exists($popupAppPath.'/classes/'.$className.'.php')) {
110
- return false;
111
- }
112
- require_once($popupAppPath.'/classes/'.$className.'.php');
113
- $obj = new $className();
114
- }
115
-
116
- $obj->setType(sgSafeStr($type));
117
- $obj->setTitle(sgSafeStr($arr['title']));
118
- if (@$arr['id']) $obj->setId($arr['id']);
119
- $obj->setWidth(sgSafeStr(@$jsonData['width']));
120
- $obj->setHeight(sgSafeStr(@$jsonData['height']));
121
- $obj->setDelay(sgSafeStr(@$jsonData['delay']));
122
- $obj->setEffectDuration(sgSafeStr(@$jsonData['duration']));
123
- $obj->setEffect(sgSafeStr($jsonData['effect']));
124
- $obj->setInitialWidth(sgSafeStr(@$jsonData['initialWidth']));
125
- $obj->setInitialHeight(sgSafeStr(@$jsonData['initialHeight']));
126
- $obj->setOptions(sgSafeStr($arr['options']));
127
-
128
- if (@$arr['id']) $obj->setCustomOptions($arr['id']);
129
-
130
- return $obj;
131
- }
132
-
133
- public static function create($data, $obj)
134
- {
135
- self::popupObjectFromArray($data, $obj);
136
- return $obj->save();
137
- }
138
- public function save($data = array()) {
139
-
140
- $id = $this->getId();
141
- $type = $this->getType();
142
- $title = $this->getTitle();
143
- $options = $this->getOptions();
144
-
145
- global $wpdb;
146
-
147
- if($id == '') {
148
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
149
- $res = $wpdb->query($sql);
150
-
151
-
152
- if ($res) {
153
- $id = $wpdb->insert_id;
154
- $this->setId($id);
155
- }
156
- return $res;
157
-
158
- }
159
- else {
160
- $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
161
- $res = $wpdb->query($sql);
162
- if(!$wpdb->show_errors()) {
163
- $res = 1;
164
- }
165
-
166
- return $res;
167
- }
168
- }
169
- public static function findAll($orderBy = null, $limit = null, $offset = null) {
170
-
171
- global $wpdb;
172
-
173
- $query = "SELECT * FROM ". $wpdb->prefix ."sg_popup";
174
-
175
- if ($orderBy) {
176
- $query .= " ORDER BY ".$orderBy;
177
- }
178
-
179
- if ($limit) {
180
- $query .= " LIMIT ".intval($offset).','.intval($limit);
181
- }
182
-
183
- //$st = $wpdb->prepare($query, array());
184
- $popups = $wpdb->get_results($query, ARRAY_A);
185
-
186
- $arr = array();
187
- foreach ($popups as $popup) {
188
- $arr[] = self::popupObjectFromArray($popup);
189
- }
190
-
191
- return $arr;
192
- }
193
- public static function delete($id) {
194
- $pop = self::findById($id);
195
- if(empty($pop)) {
196
- return false;
197
- }
198
- $type = $pop->getType();
199
- $table = 'sg_'.$type.'_popup';
200
-
201
- if($type == 'mailchimp' || $type == 'aweber') {
202
- $table = 'sg_popup_'.$type;
203
- }
204
- if($type == 'shortcode') {
205
- $table = 'sg_shortCode_popup';
206
- }
207
- else if($type == 'ageRestriction') {
208
- $table = 'sg_age_restriction_popup';
209
- }
210
- else if($type == 'contactForm') {
211
- $table = 'sg_contact_form_popup';
212
- }
213
-
214
- global $wpdb;
215
- $wpdb->query(
216
- $wpdb->prepare(
217
- "DELETE FROM ". $wpdb->prefix ."$table WHERE id = %d"
218
- ,$id
219
- )
220
- );
221
- $wpdb->query(
222
- $wpdb->prepare(
223
- "DELETE FROM ". $wpdb->prefix ."sg_popup WHERE id = %d"
224
- ,$id
225
- )
226
- );
227
-
228
- $wpdb->query(
229
- $wpdb->prepare(
230
- "DELETE FROM ". $wpdb->prefix ."postmeta WHERE meta_value = %d and meta_key = 'wp_sg_popup'"
231
- ,$id
232
- )
233
- );
234
-
235
- return true;
236
- }
237
-
238
- public static function setPopupForPost($post_id, $popupId) {
239
- update_post_meta($post_id, 'wp_sg_popup' , $popupId);
240
- }
241
-
242
- public function getRemoveOptions() {
243
- return array();
244
- }
245
-
246
- public function improveContent($content) {
247
- $hasSameShortcode = strpos($content,'sg_popup id="'.$this->getId().'"');
248
-
249
- if(POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE && !$hasSameShortcode) {
250
- require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
251
- return SgPopupPro::sgPopupExtraSanitize($content);
252
- }
253
- return $content;
254
- }
255
-
256
- public function hasPopupContentShortcode($content) {
257
-
258
- global $shortcode_tags;
259
-
260
- if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
261
- return false;
262
- }
263
-
264
- preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
265
- $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
266
-
267
- /* If tagnames is empty it's mean content does not have shortcode */
268
- if (empty($tagnames)) {
269
- return false;
270
- }
271
- return true;
272
-
273
- }
274
-
275
- private function addPopupStyles() {
276
- $styles = '';
277
- $popupId = $this->getId();
278
- $options = $this->getOptions();
279
- $options = json_decode($options, true);
280
- $contentPadding = 0;
281
- if(empty($options)) {
282
- return '';
283
- }
284
-
285
- /*When popup z index does not exist we give to z - index max value*/
286
- if(empty($options['popup-z-index'])) {
287
- $popupZIndex = '2147483647';
288
- }
289
- else {
290
- $popupZIndex = $options['popup-z-index'];
291
- }
292
-
293
- if(!empty($options['popup-content-padding'])) {
294
- $contentPadding = $options['popup-content-padding'];
295
- }
296
-
297
- $styles .= '<style type="text/css">';
298
-
299
- $styles .= '.sg-popup-overlay-'.$popupId.',
300
- .sg-popup-content-'.$popupId.' {
301
- z-index: '.$popupZIndex.' !important;
302
- }
303
- #sg-popup-content-wrapper-'.$popupId.' {
304
- padding: '.$contentPadding.'px !important;
305
- }';
306
-
307
- /* if popup close button has delay,hide it */
308
- if ($options['closeButton'] && $options['buttonDelayValue']) {
309
- $styles .= '.sg-popup-content-'.$popupId.' #sgcboxClose {
310
- display: none !important;
311
- }';
312
- }
313
-
314
- $styles .= '</style>';
315
-
316
- echo $styles;
317
- }
318
-
319
- public function render() {
320
- /* When have popup with same id in the same page */
321
- $registryInstance = SgRegistry::getInstance();
322
- $currentPopups = $registryInstance->getCurrentPopupsId();
323
-
324
- if(true || !in_array($this->getId(), $currentPopups)) {
325
- $popupId = $this->getId();
326
- $this->addPopupStyles();
327
- $hasPopupEvent = SGPBExtension::hasPopupEvent($popupId);
328
- $eventOptions = array('customEvent' => $hasPopupEvent);
329
- $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
330
- $extraOptionsArray = $this->getExtraRenderOptions();
331
- $extensionsDataArray = SGPBExtension::getExtensionsOptions($this->getId());
332
-
333
- $registryInstance->setCurrentPopupId($this->getId());
334
-
335
- $options = json_decode($this->getOptions(),true);
336
- if(empty($options)) $options = array();
337
- $popupOptions = array_merge($parentOption, $options, $extraOptionsArray, $extensionsDataArray, $eventOptions);
338
- $sgPopupVars = 'SG_POPUP_DATA['.$this->getId().'] ='.@json_encode($popupOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE).';';
339
-
340
- return $sgPopupVars;
341
- }
342
- return '';
343
-
344
- }
345
- public static function getTotalRowCount() {
346
- global $wpdb;
347
- $res = $wpdb->get_var( "SELECT COUNT(id) FROM ". $wpdb->prefix ."sg_popup" );
348
- return $res;
349
- }
350
-
351
- public static function getPagePopupId($page,$popup) {
352
- global $wpdb;
353
- $sql = $wpdb->prepare('SELECT meta_value FROM '. $wpdb->prefix .'postmeta WHERE post_id = %d AND meta_key = %s',$page,$popup);
354
- $row = $wpdb->get_row($sql);
355
- $id = 0;
356
- if($row) {
357
- $id = (int)@$row->meta_value;
358
- }
359
- return $id;
360
- }
361
-
362
- public static function showPopupForCounrty($popupId) {
363
-
364
- $obj = SGPopup::findById($popupId);
365
-
366
- if(!$obj) {
367
- return true;
368
- }
369
-
370
- $isInArray = true;
371
- $options = json_decode($obj->getOptions(), true);
372
-
373
- $countryStatus = $options['countryStatus'];
374
- $countryIso = $options['countryIso'];
375
- $allowCountries = $options['allowCountries'];
376
- $countryIsoArray = explode(',', $countryIso);
377
-
378
- if($countryStatus) {
379
-
380
- $ip = SGFunctions::getUserIpAdress();
381
-
382
- $counrty = SGFunctions::getCountryName($ip);
383
-
384
- if($allowCountries == 'allow') {
385
- $isInArray = in_array($counrty, $countryIsoArray);
386
- }
387
-
388
- if($allowCountries == 'disallow') {
389
- $isInArray = !in_array($counrty, $countryIsoArray);
390
- }
391
- }
392
- return $isInArray;
393
- }
394
-
395
- public static function addPopupForAllPages($id = '', $selectedData = array(), $type) {
396
-
397
- global $wpdb;
398
-
399
- $insertPreapre = array();
400
- $insertQuery = 'INSERT INTO '. $wpdb->prefix .'sg_popup_in_pages(popupId, pageId, type) VALUES ';
401
-
402
- foreach ($selectedData as $value) {
403
- $insertPreapre[] .= $wpdb->prepare( "(%d,%s,%s)", $id, $value, $type);
404
- }
405
- $insertQuery .= implode( ",\n", $insertPreapre );
406
- $wpdb->query($insertQuery);
407
- }
408
-
409
- public static function removePopupFromPages($popupId, $type)
410
- {
411
- global $wpdb;
412
- /*Remove all pages and posts from the array*/
413
- self::removeFromAllPages($popupId);
414
- $query = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.'sg_popup_in_pages WHERE popupId = %d and type=%s', $popupId, $type);
415
- $wpdb->query($query);
416
- }
417
-
418
- public static function removeFromAllPages($id) {
419
- $allPages = get_option("SG_ALL_PAGES");
420
- $allPosts = get_option("SG_ALL_POSTS");
421
-
422
- if(is_array($allPages)) {
423
- $key = array_search($id, $allPages);
424
-
425
- if ($key !== false) {
426
- unset($allPages[$key]);
427
- }
428
- update_option("SG_ALL_PAGES", $allPages);
429
- }
430
- if(is_array($allPosts)) {
431
- $key = array_search($id, $allPosts);
432
-
433
- if ($key !== false) {
434
- unset($allPosts[$key]);
435
- }
436
- update_option("SG_ALL_POSTS", $allPosts);
437
- }
438
-
439
- }
440
-
441
- public static function deleteAllPagesPopup($selectedPages) {
442
- global $wpdb;
443
-
444
- $deletePrepare = array();
445
- $deleteQuery = 'DELETE FROM '. $wpdb->prefix .'sg_popup_in_pages WHERE pageId IN (';
446
-
447
- foreach ($selectedPages as $value) {
448
- $deletePrepare[] .= $wpdb->prepare("%d", $value );
449
- }
450
-
451
- $deleteQuery .= implode( ",\n", $deletePrepare ).")";
452
-
453
- $deleteRes = $wpdb->query($deleteQuery);
454
- }
455
-
456
- public static function findInAllSelectedPages($pageId, $type) {
457
- global $wpdb;
458
-
459
- $st = $wpdb->prepare('SELECT * FROM '. $wpdb->prefix .'sg_popup_in_pages WHERE pageId = %s and type=%s', $pageId, $type);
460
- $arr = $wpdb->get_results($st, ARRAY_A);
461
- if(!$arr) return false;
462
- return $arr;
463
- }
464
-
465
- /**
466
- * Add popup data to footer
467
- *
468
- * @since 2.5.2
469
- *
470
- * @param string $content popup html content
471
- * @param int $popupId popup Id
472
- *
473
- * @return void
474
- *
475
- */
476
-
477
- public function sgAddPopupContentToFooter($content, $popupId) {
478
-
479
- add_action('wp_footer', function() use ($content, $popupId){
480
- $content = apply_filters('sg_popup_content', $content, $popupId);
481
- if(empty($content)) {
482
- $content = '';
483
- }
484
- $popupContent = "<div style=\"display:none\"><div id=\"sg-popup-content-wrapper-$popupId\">$content</div></div>";
485
- echo $popupContent;
486
- }, 1);
487
- }
488
-
489
- public function getSiteLocale() {
490
-
491
- $locale = get_bloginfo('language');
492
- $locale = str_replace('-', '_', $locale);
493
-
494
- return $locale;
495
- }
496
-
497
- protected function changeDimension($dimension) {
498
-
499
- if(empty($dimension)) {
500
- return 'inherit';
501
- }
502
-
503
- $size = (int)$dimension.'px';
504
-
505
- if(strpos($dimension, '%') || strpos($dimension, 'px')) {
506
- $size = $dimension;
507
- }
508
-
509
- return $size;
510
- }
511
- }
512
-
513
- function sgSafeStr ($param) {
514
- return ($param===null?'':$param);
515
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGPopupBuilderMain.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- class SGPopupBuilderMain {
3
-
4
- public function init() {
5
-
6
- $this->filters();
7
- $this->sgpbActions();
8
- }
9
-
10
- public function sgpbActions() {
11
-
12
- add_action("admin_menu",array($this, "sgAddMenu"));
13
- }
14
-
15
- public function sgAddMenu($args) {
16
- $showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
17
- if(!$showCurrentUser) {
18
- return false;
19
- }
20
- add_menu_page("Popup Builder", "Popup Builder", "read","PopupBuilder", array($this, "sgPopupMenu"),"dashicons-welcome-widgets-menus");
21
- add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'read', "PopupBuilder", array($this, "sgPopupMenu"));
22
- add_submenu_page("PopupBuilder", "Add New", "Add New", 'read', "create-popup", array($this,"sgCreatePopup"));
23
- add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'read', "edit-popup", array($this,"sgEditPopup"));
24
- add_submenu_page("PopupBuilder", "Settings", "Settings", 'read', "popup-settings", array($this,"sgPopupSettings"));
25
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
26
- add_submenu_page("PopupBuilder", "Subscribers", "Subscribers", 'read', "subscribers", array($this,"sgSubscribers"));
27
- add_submenu_page("PopupBuilder", "Newsletter", "Newsletter", 'read', "newsletter", array($this,"sgNewsletter"));
28
- }
29
- add_submenu_page("PopupBuilder", "More plugins", "More plugins", 'read', "more-plugins", array($this,"showMorePlugins"));
30
- }
31
-
32
- public function sgPopupMenu() {
33
-
34
- require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
35
- }
36
-
37
- public function sgCreatePopup() {
38
-
39
- require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
40
- }
41
-
42
- public function sgPopupSettings() {
43
-
44
- require_once( SG_APP_POPUP_FILES . '/sg_popup_settings.php');
45
- }
46
-
47
- public function sgEditPopup() {
48
-
49
- require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
50
- }
51
-
52
- public function sgSubscribers() {
53
-
54
- require_once( SG_APP_POPUP_FILES . '/sg_subscribers.php');
55
- }
56
-
57
- public function sgNewsletter() {
58
-
59
- require_once( SG_APP_POPUP_FILES . '/sg_newsletter.php');
60
- }
61
-
62
- public function showMorePlugins() {
63
-
64
- require_once( SG_APP_POPUP_FILES . '/sg_more_plugins.php');
65
- }
66
-
67
- public function filters() {
68
-
69
- add_filter('plugin_action_links_'. POPUP_BUILDER_BASENAME, array($this, 'popupPluginActionLinks'));
70
- }
71
-
72
- public function popupPluginActionLinks($links) {
73
-
74
- $popupActionLinks = array(
75
- '<a href="' . SG_POPUP_EXTENSION_URL . '" target="_blank">Extensions</a>'
76
- );
77
-
78
- if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
79
- array_push($popupActionLinks, '<a href="' . SG_POPUP_PRO_URL . '" target="_blank">Pro</a>');
80
- }
81
-
82
- return array_merge( $links, $popupActionLinks );
83
- }
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SGShortcodePopup.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/SGPopup.php');
3
- class SGShortcodePopup extends SGPopup {
4
- private $shortcode;
5
-
6
- public function setShortcode($shortcode) {
7
- $this->shortcode = $shortcode;
8
- }
9
- public function getShortcode() {
10
- return $this->shortcode;
11
- }
12
- public static function create($data, $obj = null) {
13
- $obj = new self();
14
-
15
- $obj->setShortcode($data['shortcode']);
16
-
17
- parent::create($data, $obj);
18
- }
19
- public function save($data = array()) {
20
-
21
- $editMode = $this->getId()?true:false;
22
-
23
- $res = parent::save($data);
24
-
25
- if ($res===false) return false;
26
- global $wpdb;
27
- if ($editMode) {
28
-
29
- $sqlUp = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_shortCode_popup SET url=%s WHERE id=%d",$this->getShortcode(),$this->getId());
30
- $res = $wpdb->query($sqlUp);
31
- }
32
- else {
33
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_shortCode_popup (id, url) VALUES (%d,%s)",$this->getId(),$this->getShortcode());
34
- $res = $wpdb->query($sql);
35
- }
36
- return $res;
37
- }
38
- protected function setCustomOptions($id) {
39
- global $wpdb;
40
-
41
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_shortCode_popup WHERE id = %d",$id);
42
- $arr = $wpdb->get_row($st,ARRAY_A);
43
-
44
- $this->setShortcode($arr['url']);
45
- }
46
-
47
- protected function getExtraRenderOptions() {
48
- $popupId = (int)$this->getId();
49
- $content = do_shortcode($this->getShortcode());
50
-
51
- $this->sgAddPopupContentToFooter($content, $popupId);
52
-
53
- return array('html'=> $content);
54
- }
55
-
56
- public function render() {
57
- return parent::render();
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SgRegistry.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- /**
3
- * Singleton class
4
- *
5
- * @since 2.4.9
6
- *
7
- */
8
- class SgRegistry {
9
-
10
- private static $instance = null;
11
- private $currentPopupsId = array();
12
-
13
- protected function __construct() {
14
-
15
- }
16
-
17
- protected function __clone() {
18
-
19
- }
20
-
21
- public static function getInstance() {
22
-
23
- if (!isset(self::$instance)) {
24
- self::$instance = new SgRegistry();
25
- }
26
- return self::$instance;
27
- }
28
-
29
- public function setCurrentPopupId($popupId) {
30
-
31
- array_push($this->currentPopupsId, $popupId);
32
- }
33
-
34
- public function getCurrentPopupsId() {
35
-
36
- return $this->currentPopupsId;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/index.php DELETED
File without changes
classes/sgDataTable/SGPopupTable.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/Table.php');
3
-
4
- class SGPB_PopupsView extends SGPB_Table
5
- {
6
- public function __construct()
7
- {
8
- global $wpdb;
9
- $popupPreviewId = get_option('popupPreviewId');
10
-
11
- parent::__construct('', $popupPreviewId);
12
-
13
- $this->setRowsPerPage(SG_APP_POPUP_TABLE_LIMIT);
14
- $this->setTablename($wpdb->prefix.'sg_popup');
15
- $this->setColumns(array(
16
- 'id',
17
- 'title',
18
- 'type'
19
- ));
20
- $this->setDisplayColumns(array(
21
- 'id' => 'ID',
22
- 'count' => 'Count',
23
- 'onOff' => 'Enabled (show popup)',
24
- 'title' => 'Title',
25
- 'type' => 'Type',
26
- 'shortcode' => 'Auto shortcode',
27
- 'options' => 'Options'
28
- ));
29
- $this->setSortableColumns(array(
30
- 'id' => array('id', false),
31
- 'title' => array('title', true),
32
- $this->setInitialSort(array(
33
- 'id' => 'DESC'
34
- ))
35
- ));
36
- }
37
-
38
- public function getCurrentCounter($popupId) {
39
-
40
- $popupsCounterData = get_option('SgpbCounter');
41
- if($popupsCounterData === false) {
42
- $popupsCounterData = array();
43
- }
44
-
45
- if(empty($popupsCounterData[$popupId])) {
46
- $popupsCounterData[$popupId] = 0;
47
- }
48
-
49
- return $popupsCounterData[$popupId];
50
- }
51
-
52
- public function customizeRow(&$row)
53
- {
54
- $id = $row[0];
55
- $currentCounter = $this->getCurrentCounter($id);
56
- $ajaxNonce = wp_create_nonce("sgPopupBuilderDeactivateNonce");
57
- $isActivePopup = SgPopupGetData::isActivePopup($id);
58
-
59
- $switchButton = '<label class="sg-switch">
60
- <input class="sg-switch-checkbox" data-switch-id="'.$id.'" data-checkbox-ajaxNonce="'.$ajaxNonce.'" type="checkbox" '.$isActivePopup.'>
61
- <div class="sg-slider sg-round"></div>
62
- </label>';
63
- $type = $row[2];
64
- $editUrl = admin_url()."admin.php?page=edit-popup&id=".$id."&type=".$type."";
65
- $row[3] = "<input type='text' onfocus='this.select();' readonly value='[sg_popup id=".$id."]' class='large-text code'>";
66
- $ajaxNonce = wp_create_nonce("sgPopupBuilderDeleteNonce");
67
- $row[4] = '<a href="'.@$editUrl.'">'.__('Edit', 'sgpt').'</a>&nbsp;&nbsp;<a href="#" data-sg-popup-id="'.$id.'" data-ajaxNonce="'.$ajaxNonce.'" class="sg-js-delete-link">'.__('Delete', 'sgpt').'</a>
68
- <a href="'.admin_url().'admin-post.php?action=popup_clone&id='.$id.'" data-sg-popup-id="'.$id.'" class="sg-js-popup-clone">Clone</a>';
69
- array_splice( $row, 1, 0, $currentCounter);
70
- array_splice( $row, 2, 0, $switchButton);
71
- }
72
-
73
- public function customizeQuery(&$query)
74
- {
75
- $searchQuery = '';
76
- global $wpdb;
77
- if(isset($_POST['s']) && !empty($_POST['s']))
78
- {
79
- $searchCriteria = sanitize_title_for_query($_POST['s']);
80
- $searchQuery = " WHERE title LIKE '%$searchCriteria%' ";
81
- }
82
- $query .= $searchQuery;
83
- }
84
-
85
- public function customizeRowsData(&$popupsData)
86
- {
87
- $columnsNames = $this->getColumns();
88
- $typeKey = array_search('type', $columnsNames);
89
-
90
- foreach ($popupsData as $key => $popupData) {
91
- $type = $popupData[$typeKey];
92
- $popupId = $popupData[0];
93
- $popupPreviewId = get_option('popupPreviewId');
94
-
95
- if($popupPreviewId && $popupId == $popupPreviewId) {
96
- unset($popupsData[$key]);
97
- }
98
-
99
- $className = "SG".ucfirst(strtolower($type)).'Popup';
100
- /* get current popup app path */
101
- $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
102
-
103
- $popupAppPath = $paths['app-path'];
104
- if(!file_exists($popupAppPath.'/classes/'.$className.'.php')) {
105
- unset($popupsData[$key]);
106
- }
107
-
108
- }
109
- }
110
-
111
-
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/sgDataTable/Table.php DELETED
@@ -1,189 +0,0 @@
1
- <?php
2
-
3
- require_once(dirname(__FILE__).'/ListTable.php');
4
-
5
- class SGPB_Table extends SGPB_ListTable
6
- {
7
- protected $id = '';
8
- protected $columns = array();
9
- protected $displayColumns = array();
10
- protected $sortableColumns = array();
11
- protected $tablename = '';
12
- protected $rowsPerPage = 10;
13
- protected $initialOrder = array();
14
- private $previewPopup = false;
15
-
16
- public function __construct($id, $popupPreviewId = false)
17
- {
18
- $this->id = $id;
19
- $this->previewPopup = $popupPreviewId;
20
- parent::__construct(array(
21
- 'singular'=> 'wp_'.$id, //singular label
22
- 'plural' => 'wp_'.$id.'s', //plural label
23
- 'ajax' => false
24
- ));
25
- }
26
-
27
- public function setId($id)
28
- {
29
- $this->id = $id;
30
- }
31
-
32
- public function setRowsPerPage($rowsPerPage)
33
- {
34
- $this->rowsPerPage = $rowsPerPage;
35
- }
36
-
37
- public function setColumns($columns)
38
- {
39
- $this->columns = $columns;
40
- }
41
-
42
- public function getColumns()
43
- {
44
- return $this->columns;
45
- }
46
-
47
- public function setDisplayColumns($displayColumns)
48
- {
49
- $this->displayColumns = $displayColumns;
50
- }
51
-
52
- public function setSortableColumns($sortableColumns)
53
- {
54
- $this->sortableColumns = $sortableColumns;
55
- }
56
-
57
- public function setTablename($tablename)
58
- {
59
- $this->tablename = $tablename;
60
- }
61
-
62
- public function setInitialSort($orderableColumns)
63
- {
64
- $this->initialOrder = $orderableColumns;
65
- }
66
-
67
- public function get_columns()
68
- {
69
- return $this->displayColumns;
70
- }
71
-
72
- public function prepare_items()
73
- {
74
- global $wpdb;
75
- $table = $this->tablename;
76
-
77
- $query = "SELECT ".implode(', ', $this->columns)." FROM ".$table;
78
- $this->customizeQuery($query);
79
-
80
- $totalItems = count($wpdb->get_results($query)); //return the total number of affected rows
81
-
82
- if($this->previewPopup) {
83
- $totalItems -= 1;
84
- }
85
- $perPage = $this->rowsPerPage;
86
-
87
- $totalPages = ceil($totalItems/$perPage);
88
-
89
- $orderby = isset($_GET["orderby"]) ? sanitize_text_field($_GET["orderby"]) : 'ASC';
90
- $order = isset($_GET["order"]) ? sanitize_text_field($_GET["order"]) : '';
91
-
92
- if(isset($this->initialOrder) && empty($order)){
93
- foreach($this->initialOrder as $key=>$val){
94
- $order = $val;
95
- $orderby = $key;
96
- }
97
- }
98
-
99
- if (!empty($orderby) && !empty($order)) {
100
- if($orderby != 'id' && $orderby != 'title') {
101
- $orderby = 'id';
102
- }
103
- if($order != 'asc' && $order != 'desc') {
104
- $order = 'desc';
105
- }
106
- $query .= ' ORDER BY '.$orderby.' '.$order;
107
- }
108
-
109
- $paged = isset($_GET["paged"]) ? (int)$_GET["paged"] : '';
110
-
111
- if (empty($paged) || !is_numeric($paged) || $paged<=0) {
112
- $paged = 1;
113
- }
114
-
115
- //adjust the query to take pagination into account
116
- if(!empty($paged) && !empty($perPage)) {
117
- $offset = ($paged-1) * $perPage;
118
- $query .= ' LIMIT '.(int)$offset.','.(int)$perPage;
119
- }
120
-
121
- $this->set_pagination_args(array(
122
- "total_items" => $totalItems,
123
- "total_pages" => $totalPages,
124
- "per_page" => $perPage,
125
- ));
126
-
127
- $columns = $this->get_columns();
128
- $hidden = array();
129
- $sortable = $this->get_sortable_columns();
130
- $this->_column_headers = array($columns, $hidden, $sortable);
131
- $items = $wpdb->get_results($query, ARRAY_N);
132
- /*Remove popup data when its class does not exist.*/
133
- $this->customizeRowsData($items);
134
-
135
- $this->items = $items;
136
- }
137
-
138
- public function customizeRowsData(&$items) {
139
-
140
- }
141
-
142
- public function get_sortable_columns() {
143
- return $this->sortableColumns;
144
- }
145
-
146
- public function display_rows()
147
- {
148
- //get the records registered in the prepare_items method
149
- $records = $this->items;
150
-
151
- //get the columns registered in the get_columns and get_sortable_columns methods
152
- list($columns, $hidden) = $this->get_column_info();
153
-
154
- if (!empty($records)) {
155
- foreach($records as $rec) {
156
- echo '<tr>';
157
-
158
- $this->customizeRow($rec);
159
- for ($i = 0; $i<count($rec); $i++) {
160
- echo '<td>'.stripslashes($rec[$i]).'</td>';
161
- }
162
-
163
- echo '</tr>';
164
- }
165
- }
166
- }
167
-
168
- public function customizeRow(&$row)
169
- {
170
-
171
- }
172
-
173
- public function customizeQuery(&$query)
174
- {
175
-
176
- }
177
-
178
- public function __toString()
179
- {
180
- $this->prepare_items(); ?>
181
- <form method="post">
182
- <input type="hidden" name="page" value="my_list_test" />
183
- <?php $this->search_box('search', 'search_id'); ?>
184
- </form>
185
- <?php
186
- $this->display();
187
- return '';
188
- }
189
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
com/boot.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/config/config.php');
3
+ require_once(dirname(__FILE__).'/config/configPackage.php');
4
+
5
+ if (file_exists(SG_POPUP_CONFIG_PATH.'dataConfig.php')) {
6
+ require_once(SG_POPUP_CONFIG_PATH.'dataConfig.php');
7
+ }
8
+
9
+ require_once(SG_POPUP_CLASSES_PATH.'SGPBRequirementsChecker.php');
10
+
11
+ SGPBRequirementsChecker::init();
com/classes/Actions.php ADDED
@@ -0,0 +1,938 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \WP_Query;
4
+ use \SgpbPopupConfig;
5
+ use \SgpbDataConfig;
6
+
7
+ class Actions
8
+ {
9
+ public $customPostTypeObj;
10
+
11
+ public function __construct()
12
+ {
13
+ $this->init();
14
+ }
15
+
16
+ public function init()
17
+ {
18
+ add_action('init', array($this, 'postTypeInit'), 9999);
19
+ add_action('admin_menu', array($this, 'addSubMenu'));
20
+ add_filter('get_sample_permalink_html', array($this, 'removePostPermalink'), 1, 1);
21
+ add_action('manage_'.SG_POPUP_POST_TYPE.'_posts_custom_column' , array($this, 'popupsTableColumnsValues'), 10, 2);
22
+ add_action('media_buttons', array($this, 'popupMediaButton'));
23
+ add_action('admin_enqueue_scripts', array('sgpb\Style', 'enqueueStyles'));
24
+ add_action('admin_enqueue_scripts', array('sgpb\Javascript', 'enqueueScripts'));
25
+ add_action('add_meta_boxes', array($this, 'popupTargetMetaBox'));
26
+ add_action('add_meta_boxes', array($this, 'popupEventsMetaBox'));
27
+ add_action('add_meta_boxes', array($this, 'popupConditions'));
28
+ add_action('add_meta_boxes', array($this, 'popupBehaviorAfterSpecialEvents'));
29
+ add_action('add_meta_boxes', array($this, 'popupDesign'));
30
+ add_action('add_meta_boxes', array($this, 'popupCloseSettings'));
31
+ add_action('add_meta_boxes', array($this, 'popupDimensionSettings'));
32
+ add_action('add_meta_boxes', array($this, 'popupOptionsMetaBox'));
33
+ add_action('add_meta_boxes', array($this, 'popupOtherConditions'));
34
+ // this action for popup options saving and popup builder classes save ex from post and page
35
+ add_action('save_post', array($this, 'savePost'), 100, 3);
36
+ add_action('wp_enqueue_scripts', array($this, 'enqueuePopupBuilderScripts'));
37
+ add_action('admin_enqueue_scripts', array($this, 'adminLoadPopups'));
38
+ add_action('admin_action_popupSaveAsNew', array($this, 'popupSaveAsNew'));
39
+ add_action('dp_duplicate_post', array($this, 'popupCopyPostMetaInfo'), 10, 2);
40
+ add_filter('sgpbOtherConditions', array($this ,'conditionsSatisfy'));
41
+ add_filter(SG_POPUP_CATEGORY_TAXONOMY.'_row_actions' , array($this, 'taxonomyRowActions'), 2, 2);
42
+ add_filter('post_updated_messages', array($this, 'popupPublishedMessage'), 1, 1);
43
+ add_action('admin_post_csv_file', array($this, 'getSubscribersCsvFile'));
44
+ add_action('before_delete_post', array($this, 'deleteSubscribersWithPopup'), 1, 1);
45
+ add_shortcode('sg_popup', array($this, 'popupShortcode'));
46
+ add_filter('cron_schedules', array($this, 'cronAddMinutes'), 10, 1);
47
+ add_action('sgpb_send_newsletter', array($this, 'newsletterSendEmail'), 10, 1);
48
+ add_action('admin_post_sgpbSaveSettings', array($this, 'saveSettings'), 10, 1);
49
+ add_action('admin_init', array($this, 'disableAutosave'));
50
+ add_action('admin_init', array($this, 'userRolesCaps'));
51
+ add_action('admin_head', array($this, 'showPreviewButtonAfterPopupPublish'));
52
+ add_action('admin_notices', array($this, 'pluginNotices'));
53
+ add_action('admin_notices', array($this, 'promotionalBanner'), 10);
54
+ add_action('init', array($this, 'pluginLoaded'));
55
+ add_filter('wp_insert_post_data', array($this, 'editPublishSettings'), 100, 1);
56
+ // for change admin popup list order
57
+ add_action('pre_get_posts', array($this, 'preGetPosts'));
58
+ new Ajax();
59
+ }
60
+
61
+ public function editPublishSettings($post)
62
+ {
63
+ if (isset($post['post_type']) && $post['post_type'] == SG_POPUP_POST_TYPE) {
64
+ // force set status to publish
65
+ if (isset($post['post_status']) && ($post['post_status'] == 'draft' || $post['post_status'] == 'pending')) {
66
+ $post['post_status'] = 'publish';
67
+ }
68
+ }
69
+
70
+ return $post;
71
+ }
72
+
73
+ public function preGetPosts($query)
74
+ {
75
+ if (!is_admin() || !isset($_GET['post_type']) || $_GET['post_type'] != SG_POPUP_POST_TYPE) {
76
+ return false;
77
+ }
78
+
79
+ // change default order by id and desc
80
+ if (!isset($_GET['orderby'])) {
81
+ $query->set('orderby', 'ID');
82
+ $query->set('order', 'desc');
83
+ }
84
+
85
+ return true;
86
+ }
87
+
88
+ public function promotionalBanner()
89
+ {
90
+ global $post_type;
91
+
92
+ if (!get_option('SGPB_PROMOTIONAL_BANNER_CLOSED') && $post_type == SG_POPUP_POST_TYPE) {
93
+ require_once(SG_POPUP_VIEWS_PATH.'mainRateUsBanner.php');
94
+ }
95
+ }
96
+
97
+ public function pluginNotices()
98
+ {
99
+ $extensions = AdminHelper::getAllActiveExtensions();
100
+ $updated = get_option('sgpb_extensions_updated');
101
+
102
+ $content = '';
103
+
104
+ // if popup builder has the old version
105
+ if (!get_option('SG_POPUP_VERSION')) {
106
+ return $content;
107
+ }
108
+
109
+ $alertProblem = get_option('sgpb_alert_problems');
110
+ // for old users show alert about problems
111
+ if (!$alertProblem) {
112
+ echo AdminHelper::renderAlertProblem();
113
+ }
114
+
115
+ // Don't show the banner if there's not any extension of Popup Builder or if the user has clicked "don't show"
116
+ if (empty($extensions) || $updated) {
117
+ return $content;
118
+ }
119
+ ob_start();
120
+ ?>
121
+ <div id="welcome-panel" class="update-nag sgpb-extensions-notices">
122
+ <div class="welcome-panel-content">
123
+ <?php echo AdminHelper::renderExtensionsContent(); ?>
124
+ </div>
125
+ </div>
126
+ <?php
127
+ $content = ob_get_clean();
128
+
129
+ echo $content;
130
+ return true;
131
+ }
132
+
133
+ public function pluginLoaded()
134
+ {
135
+ $versionPopup = get_option('SG_POPUP_VERSION');
136
+ $convert = get_option('sgpbConvertToNewVersion');
137
+
138
+ if ($versionPopup && !$convert) {
139
+ update_option('sgpbConvertToNewVersion', 1);
140
+ ConvertToNewVersion::convert();
141
+ Installer::registerPlugin();
142
+ }
143
+ }
144
+
145
+ public function showPreviewButtonAfterPopupPublish()
146
+ {
147
+ if (!empty($_GET['post_type']) && $_GET['post_type'] == SG_POPUP_POST_TYPE && !isset($_GET['post'])) {
148
+ echo '<style>
149
+ #post-preview,#save-post {
150
+ display:none !important;
151
+ }
152
+ </style>';
153
+ }
154
+ }
155
+
156
+ public function popupMediaButton()
157
+ {
158
+ echo new MediaButton();
159
+ }
160
+
161
+ public function userRolesCaps()
162
+ {
163
+ $userSavedRoles = get_option('sgpb-user-roles');
164
+
165
+ if (!$userSavedRoles) {
166
+ $userSavedRoles = array('administrator');
167
+ }
168
+ else {
169
+ array_push($userSavedRoles, 'administrator');
170
+ }
171
+
172
+ foreach ($userSavedRoles as $theRole) {
173
+ $role = get_role($theRole);
174
+
175
+ $role->add_cap('read');
176
+ $role->add_cap('read_post');
177
+ $role->add_cap('read_private_sgpb_popups');
178
+ $role->add_cap('edit_sgpb_popup');
179
+ $role->add_cap('edit_sgpb_popups');
180
+ $role->add_cap('edit_others_sgpb_popups');
181
+ $role->add_cap('edit_published_sgpb_popups');
182
+ $role->add_cap('publish_sgpb_popups');
183
+ $role->add_cap('delete_sgpb_popups');
184
+ $role->add_cap('delete_published_posts');
185
+ $role->add_cap('delete_others_sgpb_popups');
186
+ $role->add_cap('delete_private_sgpb_popups');
187
+ $role->add_cap('delete_private_sgpb_popup');
188
+ $role->add_cap('delete_published_sgpb_popups');
189
+
190
+ // For popup builder sub-menus and terms
191
+ $role->add_cap('sgpb_manage_options');
192
+ $role->add_cap('manage_popup_terms');
193
+ $role->add_cap('manage_popup_categories_terms');
194
+ }
195
+
196
+ return true;
197
+ }
198
+
199
+ public function disableAutosave()
200
+ {
201
+ if (!empty($_GET['post_type']) && $_GET['post_type'] == SG_POPUP_POST_TYPE) {
202
+ wp_deregister_script('autosave');
203
+ }
204
+ }
205
+
206
+ public function popupShortcode($args, $content)
207
+ {
208
+ if (empty($args) || empty($args['id'])) {
209
+ return $content;
210
+ }
211
+
212
+ $oldShortcode = isset($args['event']) && $args['event'] === 'onload';
213
+ $isInherit = isset($args['event']) && $args['event'] == 'inherit';
214
+ $event = '';
215
+
216
+ $shortcodeContent = '';
217
+ $argsId = $popupId = (int)$args['id'];
218
+
219
+ // for old popups
220
+ if (function_exists('sgpb\sgpGetCorrectPopupId')) {
221
+ $popupId = sgpGetCorrectPopupId($popupId);
222
+ }
223
+
224
+ $popup = SGPopup::find($popupId);
225
+
226
+ $event = preg_replace('/on/', '', @$args['event']);
227
+ // when popup does not exists or popup post status it's not publish ex when popup in trash
228
+ if (empty($popup) || (!is_object($popup) && $popup != 'publish')) {
229
+ return $content;
230
+ }
231
+ $alreadySavedEvents = $popup->getEvents();
232
+ $loadableMode = $popup->getLoadableModes();
233
+
234
+ if (!isset($args['event']) && isset($args['insidepopup'])) {
235
+ unset($args['insidepopup']);
236
+ $event = 'insideclick';
237
+ }
238
+ // if no event attribute is set, or old shortcode
239
+ if (!isset($args['event']) || $oldShortcode || $isInherit) {
240
+ $loadableMode = $popup->getLoadableModes();
241
+ if (!empty($content)) {
242
+ $alreadySavedEvents = false;
243
+ }
244
+ // for old popup, after the update, there aren't any events
245
+ if (empty($alreadySavedEvents)) {
246
+ $event = '';
247
+ if (!empty($content)) {
248
+ $event = 'click';
249
+ }
250
+ if (!empty($args['event'])) {
251
+ $event = $args['event'];
252
+ }
253
+ $event = preg_replace('/on/', '', $event);
254
+ $popup->setEvents(array($event));
255
+ }
256
+ if (empty($loadableMode)) {
257
+ $loadableMode = array();
258
+ }
259
+ $loadableMode['option_event'] = true;
260
+ }
261
+ else {
262
+ $event = $args['event'];
263
+ $event = preg_replace('/on/', '', $event);
264
+ $popup->setEvents(array($event));
265
+ }
266
+
267
+ $popup->setLoadableModes($loadableMode);
268
+ $scriptsLoader = new ScriptsLoader();
269
+ $loadablePopups = array($popup);
270
+ $groupObj = new PopupGroupFilter();
271
+ $groupObj->setPopups(array($popup));
272
+ $loadablePopups = $groupObj->filter();
273
+ $scriptsLoader->setLoadablePopups($loadablePopups);
274
+ $scriptsLoader->loadToFooter();
275
+
276
+ if (!empty($content)) {
277
+ $matches = SGPopup::getPopupShortcodeMatchesFromContent($content);
278
+ if (!empty($matches)) {
279
+ foreach ($matches[0] as $key => $value) {
280
+ $attrs = shortcode_parse_atts($matches[3][$key]);
281
+ if (empty($attrs['id'])) {
282
+ continue;
283
+ }
284
+ $shortcodeContent = SGPopup::renderPopupContentShortcode($content, $attrs['id'], $attrs['event'], $attrs);
285
+ break;
286
+ }
287
+ }
288
+ }
289
+
290
+ if (isset($event) && $event != 'onload' && !empty($content)) {
291
+ $shortcodeContent = SGPopup::renderPopupContentShortcode($content, $argsId, $event, $args);
292
+ }
293
+
294
+ return do_shortcode($shortcodeContent);
295
+ }
296
+
297
+ public function deleteSubscribersWithPopup($postId)
298
+ {
299
+ global $post_type;
300
+
301
+ if ($post_type == SG_POPUP_POST_TYPE) {
302
+ AdminHelper::deleteSubscriptionPopupSubscribers($postId);
303
+ }
304
+ }
305
+
306
+ public function cronAddMinutes($schedules)
307
+ {
308
+ $schedules['sgpb_newsletter_send_every_minute'] = array(
309
+ 'interval' => SGPB_CRON_REPEAT_INTERVAL * 60,
310
+ 'display' => __('Once Every Minute', SG_POPUP_TEXT_DOMAIN)
311
+ );
312
+
313
+ return $schedules;
314
+ }
315
+
316
+ public function newsletterSendEmail()
317
+ {
318
+ global $wpdb;
319
+ $newsletterOptions = get_option('SGPB_NEWSLETTER_DATA');
320
+
321
+ if (empty($newsletterOptions)) {
322
+ wp_clear_scheduled_hook('sgpb_send_newsletter');
323
+ }
324
+ $subscriptionFormId = (int)$newsletterOptions['subscriptionFormId'];
325
+ $subscriptionFormTitle = get_the_title($subscriptionFormId);
326
+ $emailsInFlow = (int)$newsletterOptions['emailsInFlow'];
327
+ $mailSubject = $newsletterOptions['newsletterSubject'];
328
+ $fromEmail = $newsletterOptions['fromEmail'];
329
+ $emailMessage = $newsletterOptions['messageBody'];
330
+
331
+ // When email is not valid we don't continue
332
+ if (!preg_match('/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$/', $fromEmail)) {
333
+ wp_clear_scheduled_hook('sgpb_send_newsletter');
334
+ return false;
335
+ }
336
+ $sql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE status = 0 and subscriptionType = %d limit 1', $subscriptionFormId);
337
+ $result = $wpdb->get_row($sql, ARRAY_A);
338
+ $currentStateEmailId = (int)$result['id'];
339
+ $getTotalSql = $wpdb->prepare('SELECT count(*) FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE subscriptionType = %d', $subscriptionFormId);
340
+ $totalSubscribers = $wpdb->get_var($getTotalSql);
341
+
342
+ // $currentStateEmailId == 0 when all emails status = 1
343
+ if ($currentStateEmailId == 0) {
344
+ // Clear schedule hook
345
+ $headers = 'MIME-Version: 1.0'."\r\n";
346
+ $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
347
+ $successTotal = get_option('SGPB_NEWSLETTER_'.$subscriptionFormId);
348
+ if (!$successTotal) {
349
+ $successTotal = 0;
350
+ }
351
+ $failedTotal = $totalSubscribers - $successTotal;
352
+
353
+ $emailMessageCustom = 'Your mail list '.$subscriptionFormTitle.' delivered successfully!
354
+ '.$successTotal.' of the '.$totalSubscribers.' emails succeeded, '.$failedTotal.' failed.
355
+ For more details, please download log file inside the plugin.
356
+
357
+ This email was generated via Popup Builder plugin.';
358
+
359
+ wp_mail($fromEmail, $subscriptionFormTitle.' list has been successfully delivered!', $emailMessageCustom, $headers);
360
+ delete_option('SGPB_NEWSLETTER_'.$subscriptionFormId);
361
+ wp_clear_scheduled_hook('sgpb_send_newsletter');
362
+ return;
363
+ }
364
+ $getAllDataSql = $wpdb->prepare('SELECT firstName, lastName, email FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE id >= %d and subscriptionType = %s limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
365
+ $subscribers = $wpdb->get_results($getAllDataSql, ARRAY_A);
366
+
367
+ $blogInfo = get_bloginfo();
368
+ $headers = array(
369
+ 'From: "'.$blogInfo.'" <'.$fromEmail.'>' ,
370
+ 'MIME-Version: 1.0' ,
371
+ 'Content-type: text/html; charset=iso-8859-1'
372
+ );
373
+
374
+ foreach ($subscribers as $subscriber) {
375
+ $patternFirstName = '/\[First name]/';
376
+ $patternLastName = '/\[Last name]/';
377
+ $patternBlogName = '/\[Blog name]/';
378
+ $patternUserName = '/\[User name]/';
379
+
380
+ $replacementFirstName = $subscriber['firstName'];
381
+ $replacementLastName = $subscriber['lastName'];
382
+ $replacementBlogName = $newsletterOptions['blogname'];
383
+ $replacementUserName = $newsletterOptions['username'];
384
+
385
+ // Replace First name and Last name from email message
386
+ $emailMessageCustom = preg_replace($patternFirstName, $replacementFirstName, $emailMessage);
387
+ $emailMessageCustom = preg_replace($patternLastName, $replacementLastName, $emailMessageCustom);
388
+ $emailMessageCustom = preg_replace($patternBlogName, $replacementBlogName, $emailMessageCustom);
389
+ $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
390
+ $emailMessageCustom = stripslashes($emailMessageCustom);
391
+ $mailStatus = wp_mail($subscriber['email'], $mailSubject, $emailMessageCustom, $headers);
392
+
393
+ if (!$mailStatus) {
394
+ $errorLogSql = $wpdb->prepare('INSERT INTO '. $wpdb->prefix .SGPB_SUBSCRIBERS_ERROR_TABLE_NAME.' (`popupType`, `email`, `date`) VALUES (%s, %s, %s)', $subscriptionFormId, $subscriber['email'], date('Y-m-d H:i'));
395
+ $wpdb->query($errorLogSql);
396
+ continue;
397
+ }
398
+
399
+ $successCount = get_option('SGPB_NEWSLETTER_'.$subscriptionFormId);
400
+ if (!$successCount) {
401
+ update_option('SGPB_NEWSLETTER_'.$subscriptionFormId, 1);
402
+ }
403
+ else {
404
+ update_option('SGPB_NEWSLETTER_'.$subscriptionFormId, ++$successCount);
405
+ }
406
+ }
407
+
408
+ // Update the status of all the sent mails
409
+ $updateStatusQuery = $wpdb->prepare('UPDATE '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' SET status = 1 where id >= %d and subscriptionType = %d limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
410
+ $wpdb->query($updateStatusQuery);
411
+ }
412
+
413
+ public function taxonomyRowActions($actions, $row)
414
+ {
415
+ if ($row->slug == SG_RANDOM_TAXONOMY_SLUG) {
416
+ return array();
417
+ }
418
+
419
+ return $actions;
420
+ }
421
+
422
+ public function enqueuePopupBuilderScripts()
423
+ {
424
+ // for old popups
425
+ if (get_option('SG_POPUP_VERSION')) {
426
+ ConvertToNewVersion::saveCustomInserted();
427
+ }
428
+
429
+ PopupLoader::instance()->loadPopups();
430
+ }
431
+
432
+ public function adminLoadPopups($hook)
433
+ {
434
+ $allowedPages = array();
435
+ $allowedPages = apply_filters('sgpbAdminLoadedPages', $allowedPages);
436
+
437
+ if (!empty($allowedPages) && is_array($allowedPages) && in_array($hook, $allowedPages)) {
438
+ $scriptsLoader = new ScriptsLoader();
439
+ $scriptsLoader->setIsAdmin(true);
440
+ $scriptsLoader->loadToFooter();
441
+ }
442
+ }
443
+
444
+ public function postTypeInit()
445
+ {
446
+ if (isset($_POST['sgpb-is-preview']) && $_POST['sgpb-is-preview'] == 1) {
447
+ $postId = $_POST['post_ID'];
448
+ $post = get_post($postId);
449
+ $this->savePost($postId, $post, false);
450
+ }
451
+
452
+ if (isset($_GET['page']) && $_GET['page'] == 'PopupBuilder') {
453
+ echo '<span>Popup Builder plugin has been successfully updated. Please <a href="'.admin_url().'edit.php?post_type='.SG_POPUP_POST_TYPE.'">click here</a> to go to the new Dashboard of the plugin.</span>';
454
+ wp_die();
455
+ }
456
+ $this->customPostTypeObj = new RegisterPostType();
457
+ }
458
+
459
+ public function addSubMenu()
460
+ {
461
+ $this->customPostTypeObj->addSubMenu();
462
+ }
463
+
464
+ public function popupTargetMetaBox()
465
+ {
466
+ $this->customPostTypeObj->addTargetMetaBox();
467
+ }
468
+
469
+ public function popupEventsMetaBox()
470
+ {
471
+ $this->customPostTypeObj->addEventMetaBox();
472
+ }
473
+
474
+ public function popupConditions()
475
+ {
476
+ $this->customPostTypeObj->addConditionsMetaBox();
477
+ }
478
+
479
+ public function popupBehaviorAfterSpecialEvents()
480
+ {
481
+ $this->customPostTypeObj->addBehaviorAfterSpecialEventsMetaBox();
482
+ }
483
+
484
+ public function popupDesign()
485
+ {
486
+ $this->customPostTypeObj->popupDesignMetaBox();
487
+ }
488
+
489
+ public function popupCloseSettings()
490
+ {
491
+ $this->customPostTypeObj->addCloseSettingsMetaBox();
492
+ }
493
+
494
+ public function popupDimensionSettings()
495
+ {
496
+ $this->customPostTypeObj->addDimensionsSettingsMetaBox();
497
+ }
498
+
499
+ public function popupOptionsMetaBox()
500
+ {
501
+ $this->customPostTypeObj->addOptionsMetaBox();
502
+ }
503
+
504
+ public function popupOtherConditions()
505
+ {
506
+ $this->customPostTypeObj->addOtherConditions();
507
+ }
508
+
509
+ public function savePost($postId = 0, $post = array(), $update = false)
510
+ {
511
+ $postData = SGPopup::parsePopupDataFromData($_POST);
512
+ $saveMode = '';
513
+ $postData['sgpb-post-id'] = $postId;
514
+ // If preview mode
515
+ if (isset($postData['sgpb-is-preview']) && $postData['sgpb-is-preview'] == 1) {
516
+ $saveMode = '_preview';
517
+ SgpbPopupConfig::popupTypesInit();
518
+ SgpbDataConfig::init();
519
+ // published popup
520
+ if (empty($post)) {
521
+ global $post;
522
+ $postId = $post->ID;
523
+ }
524
+ if ($post->post_status != 'draft') {
525
+ $posts = array();
526
+ $popupContent = $post->post_content;
527
+
528
+ $query = new WP_Query(
529
+ array(
530
+ 'post_parent' => $postId,
531
+ 'posts_per_page' => - 1,
532
+ 'post_type' => 'revision',
533
+ 'post_status' => 'inherit'
534
+ )
535
+ );
536
+ while ($query->have_posts()) {
537
+ $query->the_post();
538
+ if (empty($posts)) {
539
+ $posts[] = $post;
540
+ }
541
+ }
542
+ if (!empty($posts[0])) {
543
+ $popup = $posts[0];
544
+ $popupContent = $popup->post_content;
545
+ }
546
+ }
547
+ }
548
+
549
+ if (!$update && !$saveMode) {
550
+ return;
551
+ }
552
+
553
+ if (empty($post)) {
554
+ $saveMode = '';
555
+ }
556
+ /* In preview mode saveMode should be true*/
557
+ if ((!empty($post) && $post->post_type == SG_POPUP_POST_TYPE) || $saveMode || (empty($post) && !$saveMode)) {
558
+ if (!empty($postData['sgpb-type'])) {
559
+ $popupType = $postData['sgpb-type'];
560
+ $popupClassName = SGPopup::getPopupClassNameFormType($popupType);
561
+ $popupClassPath = SGPopup::getPopupTypeClassPath($popupType);
562
+ require_once($popupClassPath.$popupClassName.'.php');
563
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
564
+
565
+ $popupClassName::create($postData, $saveMode, 1);
566
+ }
567
+ }
568
+ else {
569
+ $content = get_post_field('post_content', $postId);
570
+ SGPopup::deletePostCustomInsertedData($postId);
571
+ SGPopup::deletePostCustomInsertedEvents($postId);
572
+ /*We detect all the popups that were inserted as a custom ones, in the content.*/
573
+ SGPopup::savePopupsFromContentClasses($content, $post);
574
+ }
575
+ }
576
+
577
+ /**
578
+ * Check Popup is satisfy for popup condition
579
+ *
580
+ * @since 1.0.0
581
+ *
582
+ * @param array $args
583
+ *
584
+ * @return bool
585
+ *
586
+ */
587
+ public function conditionsSatisfy($args)
588
+ {
589
+ return PopupChecker::checkOtherConditionsActions($args);
590
+ }
591
+
592
+ public function popupsTableColumnsValues($column, $postId)
593
+ {
594
+ $postId = (int)$postId;// Convert to int for security reasons
595
+ $switchButton = '';
596
+ $isActive = '';
597
+ global $post_type;
598
+ if ($postId) {
599
+ $args['status'] = array('publish', 'draft', 'pending', 'private', 'trash');
600
+ $popup = SGPopup::find($postId, $args);
601
+ }
602
+
603
+ if (empty($popup) && $post_type == SG_POPUP_POST_TYPE) {
604
+ return false;
605
+ }
606
+
607
+ if ($column == 'shortcode') {
608
+ echo '<input type="text" onfocus="this.select();" readonly value="[sg_popup id='.$postId.']" class="large-text code">';
609
+ }
610
+ else if ($column == 'counter') {
611
+ $count = $popup->getPopupOpeningCountById($postId);
612
+ echo $count;
613
+ }
614
+ else if ($column == 'type') {
615
+ global $SGPB_POPUP_TYPES;
616
+ $type = $popup->getType();
617
+ if (isset($SGPB_POPUP_TYPES['typeLabels'][$type])) {
618
+ $type = $SGPB_POPUP_TYPES['typeLabels'][$type];
619
+ }
620
+ echo $type;
621
+ }
622
+ else if ($column == 'onOff') {
623
+ $popupPostStatus = get_post_status($postId);
624
+ if ($popupPostStatus == 'publish' || $popupPostStatus == 'draft') {
625
+ $isActive = $popup->getOptionValue('sgpb-is-active', true);
626
+ }
627
+ $switchButton .= '<label class="sgpb-switch">';
628
+ $switchButton .= '<input class="sg-switch-checkbox" data-switch-id="'.$postId.'" type="checkbox" '.$isActive.'>';
629
+ $switchButton .= '<div class="sgpb-slider sgpb-round"></div>';
630
+ $switchButton .= '</label>';
631
+ echo $switchButton;
632
+ }
633
+ }
634
+
635
+ /*
636
+ * This function calls the creation of a new copy of the selected post (by default preserving the original publish status)
637
+ * then redirects to the post list
638
+ */
639
+ public function popupSaveAsNew($status = '')
640
+ {
641
+ if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'popupSaveAsNew' == $_REQUEST['action']))) {
642
+ wp_die(esc_html__('No post to duplicate has been supplied!', SG_POPUP_TEXT_DOMAIN));
643
+ }
644
+ // Get the original post
645
+ $id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
646
+
647
+ check_admin_referer('duplicate-post_'.$id);
648
+
649
+ $post = get_post($id);
650
+
651
+ // Copy the post and insert it
652
+ if (isset($post) && $post != null) {
653
+ $newId = $this->popupCreateDuplicate($post, $status);
654
+ $postType = $post->post_type;
655
+
656
+ if ($status == '') {
657
+ $sendBack = wp_get_referer();
658
+ if (!$sendBack ||
659
+ strpos($sendBack, 'post.php') !== false ||
660
+ strpos($sendBack, 'post-new.php') !== false) {
661
+ if ('attachment' == $postType) {
662
+ $sendBack = admin_url('upload.php');
663
+ }
664
+ else {
665
+ $sendBack = admin_url('edit.php');
666
+ if (!empty($postType)) {
667
+ $sendBack = add_query_arg('post_type', $postType, $sendBack);
668
+ }
669
+ }
670
+ }
671
+ else {
672
+ $sendBack = remove_query_arg(array('trashed', 'untrashed', 'deleted', 'cloned', 'ids'), $sendBack);
673
+ }
674
+ // Redirect to the post list screen
675
+ wp_redirect(add_query_arg(array('cloned' => 1, 'ids' => $post->ID), $sendBack));
676
+ }
677
+ else {
678
+ // Redirect to the edit screen for the new draft post
679
+ wp_redirect(add_query_arg(array('cloned' => 1, 'ids' => $post->ID), admin_url('post.php?action=edit&post='.$newId)));
680
+ }
681
+ exit;
682
+
683
+ }
684
+ else {
685
+ wp_die(esc_html__('Copy creation failed, could not find original:', SG_POPUP_TEXT_DOMAIN).' '.htmlspecialchars($id));
686
+ }
687
+ }
688
+
689
+ /**
690
+ * Create a duplicate from a post
691
+ */
692
+ public function popupCreateDuplicate($post, $status = '', $parent_id = '')
693
+ {
694
+ $newPostStatus = (empty($status))? $post->post_status: $status;
695
+
696
+ if ($post->post_type != 'attachment') {
697
+ $title = $post->post_title;
698
+ if ($title == '') {
699
+ // empty title
700
+ $title = __('(no title) (clone)');
701
+ }
702
+ else {
703
+ $title .= ' '.__('(clone)');
704
+ }
705
+
706
+ if ('publish' == $newPostStatus || 'future' == $newPostStatus) {
707
+ // check if the user has the right capability
708
+ if (is_post_type_hierarchical($post->post_type)) {
709
+ if (!current_user_can('publish_pages')) {
710
+ $newPostStatus = 'pending';
711
+ }
712
+ }
713
+ else {
714
+ if (!current_user_can('publish_posts')) {
715
+ $newPostStatus = 'pending';
716
+ }
717
+ }
718
+ }
719
+ }
720
+
721
+ $newPostAuthor = wp_get_current_user();
722
+ $newPostAuthorId = $newPostAuthor->ID;
723
+ // check if the user has the right capability
724
+ if (is_post_type_hierarchical($post->post_type)) {
725
+ if (current_user_can('edit_others_pages')) {
726
+ $newPostAuthorId = $post->post_author;
727
+ }
728
+ }
729
+ else {
730
+ if (current_user_can('edit_others_posts')) {
731
+ $newPostAuthorId = $post->post_author;
732
+ }
733
+ }
734
+
735
+ $newPost = array(
736
+ 'menu_order' => $post->menu_order,
737
+ 'comment_status' => $post->comment_status,
738
+ 'ping_status' => $post->ping_status,
739
+ 'post_author' => $newPostAuthorId,
740
+ 'post_content' => $post->post_content,
741
+ 'post_content_filtered' => $post->post_content_filtered,
742
+ 'post_excerpt' => $post->post_excerpt,
743
+ 'post_mime_type' => $post->post_mime_type,
744
+ 'post_parent' => $newPostParent = empty($parent_id)? $post->post_parent : $parent_id,
745
+ 'post_password' => $post->post_password,
746
+ 'post_status' => $newPostStatus,
747
+ 'post_title' => $title,
748
+ 'post_type' => $post->post_type,
749
+ );
750
+
751
+ $newPost['post_date'] = $newPostDate = $post->post_date;
752
+ $newPost['post_date_gmt'] = get_gmt_from_date($newPostDate);
753
+ $newPostId = wp_insert_post(wp_slash($newPost));
754
+
755
+ // If the copy is published or scheduled, we have to set a proper slug.
756
+ if ($newPostStatus == 'publish' || $newPostStatus == 'future') {
757
+ $postName = $post->post_name;
758
+ $postName = wp_unique_post_slug($postName, $newPostId, $newPostStatus, $post->post_type, $newPostParent);
759
+
760
+ $newPost = array();
761
+ $newPost['ID'] = $newPostId;
762
+ $newPost['post_name'] = $postName;
763
+
764
+ // Update the post into the database
765
+ wp_update_post(wp_slash($newPost));
766
+ }
767
+
768
+ // If you have written a plugin which uses non-WP database tables to save
769
+ // information about a post you can hook this action to dupe that data.
770
+ if ($post->post_type == 'page' || is_post_type_hierarchical($post->post_type)) {
771
+ do_action('dp_duplicate_page', $newPostId, $post, $status);
772
+ }
773
+ else {
774
+ do_action('dp_duplicate_post', $newPostId, $post, $status);
775
+ }
776
+
777
+ delete_post_meta($newPostId, '_sgpb_original');
778
+ add_post_meta($newPostId, '_sgpb_original', $post->ID);
779
+
780
+ return $newPostId;
781
+ }
782
+
783
+ /**
784
+ * Copy the meta information of a post to another post
785
+ */
786
+ public function popupCopyPostMetaInfo($newId, $post)
787
+ {
788
+ $postMetaKeys = get_post_custom_keys($post->ID);
789
+ $metaBlacklist = '';
790
+
791
+ if (empty($postMetaKeys) || !is_array($postMetaKeys)) {
792
+ return;
793
+ }
794
+ $metaBlacklist = explode(',', $metaBlacklist);
795
+ $metaBlacklist = array_filter($metaBlacklist);
796
+ $metaBlacklist = array_map('trim', $metaBlacklist);
797
+ $metaBlacklist[] = '_edit_lock';
798
+ $metaBlacklist[] = '_edit_last';
799
+ $metaBlacklist[] = '_wp_page_template';
800
+ $metaBlacklist[] = '_thumbnail_id';
801
+
802
+ $metaBlacklist = apply_filters('duplicate_post_blacklist_filter' , $metaBlacklist);
803
+
804
+ $metaBlacklistString = '('.implode(')|(',$metaBlacklist).')';
805
+ $metaKeys = array();
806
+
807
+ if (strpos($metaBlacklistString, '*') !== false) {
808
+ $metaBlacklistString = str_replace(array('*'), array('[a-zA-Z0-9_]*'), $metaBlacklistString);
809
+
810
+ foreach ($postMetaKeys as $metaKey) {
811
+ if (!preg_match('#^'.$metaBlacklistString.'$#', $metaKey)) {
812
+ $metaKeys[] = $metaKey;
813
+ }
814
+ }
815
+ }
816
+ else {
817
+ $metaKeys = array_diff($postMetaKeys, $metaBlacklist);
818
+ }
819
+
820
+ $metaKeys = apply_filters('duplicate_post_meta_keys_filter', $metaKeys);
821
+
822
+ foreach ($metaKeys as $metaKey) {
823
+ $metaValues = get_post_custom_values($metaKey, $post->ID);
824
+ foreach ($metaValues as $metaValue) {
825
+ $metaValue = maybe_unserialize($metaValue);
826
+ add_post_meta($newId, $metaKey, $this->popupWpSlash($metaValue));
827
+ }
828
+ }
829
+ }
830
+
831
+ public function popupAddSlashesDeep($value)
832
+ {
833
+ if (function_exists('map_deep')) {
834
+ return map_deep($value, array($this, 'popupAddSlashesToStringsOnly'));
835
+ }
836
+ else {
837
+ return wp_slash($value);
838
+ }
839
+ }
840
+
841
+ public function popupAddSlashesToStringsOnly($value)
842
+ {
843
+ return is_string($value) ? addslashes($value) : $value;
844
+ }
845
+
846
+ public function popupWpSlash($value)
847
+ {
848
+ return $this->popupAddSlashesDeep($value);
849
+ }
850
+
851
+ public function removePostPermalink($args)
852
+ {
853
+ global $post_type;
854
+
855
+ if ($post_type == SG_POPUP_POST_TYPE && is_admin()) {
856
+ // hide permalink for popupbuilder post type
857
+ return '';
858
+ }
859
+
860
+ return $args;
861
+ }
862
+
863
+ // remove link ( e.g.: (View post) ), from popup updated/published message
864
+ public function popupPublishedMessage($messages)
865
+ {
866
+ global $post_type;
867
+
868
+ if ($post_type == SG_POPUP_POST_TYPE) {
869
+ // post(popup) updated
870
+ if (isset($messages['post'][1])) {
871
+ $messages['post'][1] = __('Post updated.', SG_POPUP_TEXT_DOMAIN);
872
+ }
873
+ // post(popup) published
874
+ if (isset($messages['post'][6])) {
875
+ $messages['post'][6] = __('Post published.', SG_POPUP_TEXT_DOMAIN);
876
+ }
877
+ }
878
+
879
+ return $messages;
880
+ }
881
+
882
+ public function getSubscribersCsvFile()
883
+ {
884
+ global $wpdb;
885
+
886
+ $query = AdminHelper::subscribersRelatedQuery();
887
+ if (isset($_GET['orderby']) && !empty($_GET['orderby'])) {
888
+ if (isset($_GET['order']) && !empty($_GET['order'])) {
889
+ $query .= ' ORDER BY '.esc_sql($_GET['orderby']).' '.esc_sql($_GET['order']);
890
+ }
891
+ }
892
+ $content = '';
893
+ $exportTypeQuery = '';
894
+ $rows = array('first name', 'last name', 'email', 'date', 'popup');
895
+ foreach ($rows as $value) {
896
+ $content .= $value;
897
+ if ($value != 'popup') {
898
+ $content .= ',';
899
+ }
900
+ }
901
+ $content .= "\n";
902
+ $subscribers = $wpdb->get_results($query, ARRAY_A);
903
+ foreach($subscribers as $values) {
904
+ foreach ($values as $key => $value) {
905
+ $content .= $value;
906
+ if ($key != 'subscriptionType') {
907
+ $content .= ',';
908
+ }
909
+ }
910
+ $content .= "\n";
911
+ }
912
+
913
+ header('Pragma: public');
914
+ header('Expires: 0');
915
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
916
+ header('Cache-Control: private', false);
917
+ header('Content-Type: application/octet-stream');
918
+ header('Content-Disposition: attachment; filename=subscribersList.csv;');
919
+ header('Content-Transfer-Encoding: binary');
920
+ echo $content;
921
+ }
922
+
923
+ public function saveSettings()
924
+ {
925
+ $postData = $_POST;
926
+ $deleteData = 0;
927
+
928
+ if (isset($postData['sgpb-dont-delete-data'])) {
929
+ $deleteData = 1;
930
+ }
931
+ $userRoles = @$postData['sgpb-user-roles'];
932
+
933
+ update_option('sgpb-user-roles', $userRoles);
934
+ update_option('sgpb-dont-delete-data', $deleteData);
935
+
936
+ wp_redirect(admin_url().'edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SG_POPUP_SETTINGS_PAGE);
937
+ }
938
+ }
com/classes/Ajax.php ADDED
@@ -0,0 +1,363 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \ConfigDataHelper;
4
+
5
+ class Ajax
6
+ {
7
+ private $postData;
8
+
9
+ public function __construct()
10
+ {
11
+ $this->actions();
12
+ }
13
+
14
+ public function setPostData($postData)
15
+ {
16
+ $this->postData = $postData;
17
+ }
18
+
19
+ public function getPostData()
20
+ {
21
+ return $this->postData;
22
+ }
23
+
24
+ /**
25
+ * Return ajax param form post data by key
26
+ *
27
+ * @since 1.0.0
28
+ *
29
+ * @param string $key
30
+ *
31
+ * @return string $value
32
+ */
33
+ public function getValueFromPost($key)
34
+ {
35
+ $postData = $this->getPostData();
36
+ $value = '';
37
+
38
+ if (!empty($postData[$key])) {
39
+ $value = $postData[$key];
40
+ }
41
+
42
+ return $value;
43
+ }
44
+
45
+ public function actions()
46
+ {
47
+ add_action('wp_ajax_add_condition_group_row', array($this, 'addConditionGroupRow'));
48
+ add_action('wp_ajax_add_condition_rule_row', array($this, 'addConditionRuleRow'));
49
+ add_action('wp_ajax_change_condition_rule_row', array($this, 'changeConditionRuleRow'));
50
+ add_action('wp_ajax_select2_search_data', array($this, 'select2SearchData'));
51
+ add_action('wp_ajax_sgpb_subscription_submission', array($this, 'subscriptionSubmission'));
52
+ add_action('wp_ajax_nopriv_sgpb_subscription_submission', array($this, 'subscriptionSubmission'));
53
+ add_action('wp_ajax_change_popup_status', array($this, 'changePopupStatus'));
54
+ // proStartGoldproEndGold
55
+ add_action('wp_ajax_sgpb_subscribers_delete', array($this, 'deleteSubscribers'));
56
+ add_action('wp_ajax_sgpb_add_subscribers', array($this, 'addSubscribers'));
57
+ add_action('wp_ajax_sgpb_send_newsletter', array($this, 'sendNewsletter'));
58
+ add_action('wp_ajax_sgpb_send_to_open_counter', array($this, 'addToCounter'));
59
+ add_action('wp_ajax_nopriv_sgpb_send_to_open_counter', array($this, 'addToCounter'));
60
+ add_action('wp_ajax_sgpb_send_to_open_counter', array($this, 'addToCounter'));
61
+ add_action('wp_ajax_sgpb_close_banner', array($this, 'closeMainRateUsBanner'));
62
+ /*Extension notification panel*/
63
+ add_action('wp_ajax_sgpb_dont_show_extension_panel', array($this, 'extensionNotificationPanel'));
64
+ add_action('wp_ajax_sgpb_dont_show_problem_alert', array($this, 'dontShowProblemAlert'));
65
+ }
66
+
67
+ public function dontShowProblemAlert()
68
+ {
69
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
70
+ update_option('sgpb_alert_problems', 1);
71
+ echo SGPB_AJAX_STATUS_TRUE;
72
+ wp_die();
73
+ }
74
+
75
+ public function extensionNotificationPanel()
76
+ {
77
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
78
+ update_option('sgpb_extensions_updated', 1);
79
+ echo SGPB_AJAX_STATUS_TRUE;
80
+ wp_die();
81
+ }
82
+
83
+ public function closeMainRateUsBanner()
84
+ {
85
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
86
+ update_option('SGPB_PROMOTIONAL_BANNER_CLOSED', 'SGPB_PROMOTIONAL_BANNER_CLOSED');
87
+ wp_die();
88
+ }
89
+
90
+ public function addToCounter()
91
+ {
92
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
93
+
94
+ $popupParams = $_POST['params'];
95
+ $popupId = (int)$popupParams['popupId'];
96
+ $popupsCounterData = get_option('SgpbCounter');
97
+
98
+ if ($popupsCounterData === false) {
99
+ $popupsCounterData = array();
100
+ }
101
+
102
+ if (empty($popupsCounterData[$popupId])) {
103
+ $popupsCounterData[$popupId] = 0;
104
+ }
105
+ $popupsCounterData[$popupId] += 1;
106
+
107
+ update_option('SgpbCounter', $popupsCounterData);
108
+ wp_die();
109
+ }
110
+
111
+ public function deleteSubscribers()
112
+ {
113
+ global $wpdb;
114
+
115
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
116
+
117
+ $subscribersId = array_map('sanitize_text_field', $_POST['subscribersId']);
118
+
119
+ foreach ($subscribersId as $subscriberId) {
120
+ $prepareSql = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE id = %d', $subscriberId);
121
+ $wpdb->query($prepareSql);
122
+ }
123
+ }
124
+
125
+ public function addSubscribers()
126
+ {
127
+ global $wpdb;
128
+
129
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
130
+ $status = SGPB_AJAX_STATUS_FALSE;
131
+ $firstName = sanitize_text_field($_POST['firstName']);
132
+ $lastName = sanitize_text_field($_POST['lastName']);
133
+ $email = sanitize_text_field($_POST['email']);
134
+ $date = date('Y-m-d');
135
+ $subscriptionPopupsId = array_map('sanitize_text_field', $_POST['popups']);
136
+
137
+ foreach ($subscriptionPopupsId as $subscriptionPopupId) {
138
+ $selectSql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s AND subscriptionType = %d', $email, $subscriptionPopupId);
139
+ $res = $wpdb->get_row($selectSql, ARRAY_A);
140
+ // add new subscriber
141
+ if (empty($res)) {
142
+ $sql = $wpdb->prepare('INSERT INTO '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' (firstName, lastName, email, cDate, subscriptionType) VALUES (%s, %s, %s, %s, %d) ', $firstName, $lastName, $email, $date, $subscriptionPopupId);
143
+ $res = $wpdb->query($sql);
144
+ }
145
+ // edit existing
146
+ else {
147
+ $sql = $wpdb->prepare('UPDATE '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' SET firstName = %s, lastName = %s, email = %s, cDate = %s, subscriptionType = %d WHERE id = %d', $firstName, $lastName, $email, $date, $subscriptionPopupId, $res['id']);
148
+ $wpdb->query($sql);
149
+ $res = 1;
150
+ }
151
+
152
+ if ($res) {
153
+ $status = SGPB_AJAX_STATUS_TRUE;
154
+ }
155
+ }
156
+
157
+ echo $status;
158
+ wp_die();
159
+ }
160
+
161
+ public function sendNewsletter()
162
+ {
163
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
164
+ global $wpdb;
165
+
166
+ $newsletterData = stripslashes_deep($_POST['newsletterData']);
167
+ $subscriptionFormId = (int)$newsletterData['subscriptionFormId'];
168
+
169
+ $updateStatusQuery = $wpdb->prepare('UPDATE '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' SET status = 0 WHERE subscriptionType = %d', $subscriptionFormId);
170
+ $wpdb->query($updateStatusQuery);
171
+ $newsletterData['blogname'] = get_bloginfo('name');
172
+ $newsletterData['username'] = wp_get_current_user()->user_login;
173
+ update_option('SGPB_NEWSLETTER_DATA', $newsletterData);
174
+
175
+ wp_schedule_event(time(), 'sgpb_newsletter_send_every_minute', 'sgpb_send_newsletter');
176
+ wp_die();
177
+ }
178
+
179
+ // proStartGoldproEndGold
180
+
181
+ public function changePopupStatus()
182
+ {
183
+ $popupId = (int)$_POST['popupId'];
184
+ $obj = SGPopup::find($popupId);
185
+ if (!$obj) {
186
+ wp_die(SGPB_AJAX_STATUS_FALSE);
187
+ }
188
+ $options = $obj->getOptions();
189
+ $options['sgpb-is-active'] = sanitize_text_field($_POST['popupStatus']);
190
+
191
+ unset($options['sgpb-conditions']);
192
+ update_post_meta($popupId, 'sg_popup_options', $options);
193
+
194
+ wp_die($popupId);
195
+ }
196
+
197
+ public function subscriptionSubmission()
198
+ {
199
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
200
+ $this->setPostData($_POST);
201
+ $submissionData = $this->getValueFromPost('formData');
202
+ $popupPostId = (int)$this->getValueFromPost('popupPostId');
203
+
204
+ parse_str($submissionData, $formData);
205
+
206
+ if (empty($formData)) {
207
+ echo SGPB_AJAX_STATUS_FALSE;
208
+ wp_die();
209
+ }
210
+
211
+ $hiddenChecker = sanitize_text_field($formData['sgpb-subs-hidden-checker']);
212
+
213
+ // this check is made to protect ourselves from bot
214
+ if (!empty($hiddenChecker)) {
215
+ echo 'Bot';
216
+ wp_die();
217
+ }
218
+ global $wpdb;
219
+
220
+ $status = SGPB_AJAX_STATUS_FALSE;
221
+ $date = date('Y-m-d');
222
+ $email = sanitize_email($formData['sgpb-subs-email']);
223
+ $firstName = sanitize_text_field($formData['sgpb-subs-first-name']);
224
+ $lastName = sanitize_text_field($formData['sgpb-subs-last-name']);
225
+
226
+ $subscribersTableName = $wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME;
227
+
228
+ $getSubscriberQuery = $wpdb->prepare('SELECT id FROM '.$subscribersTableName.' WHERE email = %s AND subscriptionType = %d', $email, $popupPostId);
229
+ $list = $wpdb->get_row($getSubscriberQuery, ARRAY_A);
230
+
231
+ // When subscriber does not exist we insert to subscribers table otherwise we update user info
232
+ if (empty($list['id'])) {
233
+ $sql = $wpdb->prepare('INSERT INTO '.$subscribersTableName.' (firstName, lastName, email, cDate, subscriptionType) VALUES (%s, %s, %s, %s, %d) ', $firstName, $lastName, $email, $date, $popupPostId);
234
+ $res = $wpdb->query($sql);
235
+ }
236
+ else {
237
+ $sql = $wpdb->prepare('UPDATE '.$subscribersTableName.' SET firstName = %s, lastName = %s, email = %s, cDate = %s, subscriptionType = %d WHERE id = %d', $firstName, $lastName, $email, $date, $popupPostId, $list['id']);
238
+ $wpdb->query($sql);
239
+ $res = 1;
240
+ }
241
+
242
+ if ($res) {
243
+ $status = SGPB_AJAX_STATUS_TRUE;
244
+ }
245
+
246
+ echo $status;
247
+ wp_die();
248
+ }
249
+
250
+ public function select2SearchData()
251
+ {
252
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
253
+
254
+ $postTypeName = sanitize_text_field($_POST['searchKey']);
255
+ $search = sanitize_text_field($_POST['searchTerm']);
256
+
257
+ $args = array(
258
+ 's' => $search,
259
+ 'post__in' => ! empty( $_REQUEST['include'] ) ? array_map( 'intval', $_REQUEST['include'] ) : null,
260
+ 'page' => ! empty( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : null,
261
+ 'posts_per_page' => 10,
262
+ 'post_type' => $postTypeName
263
+ );
264
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
265
+
266
+ if (empty($searchResults)) {
267
+ $results['items'] = array();
268
+ }
269
+
270
+ /*Selected custom post type convert for select2 format*/
271
+ foreach ($searchResults as $id => $name) {
272
+ $results['items'][] = array(
273
+ 'id' => $id,
274
+ 'text' => $name
275
+ );
276
+ }
277
+
278
+ echo json_encode($results);
279
+ wp_die();
280
+ }
281
+
282
+ public function addConditionGroupRow()
283
+ {
284
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
285
+ global $SGPB_DATA_CONFIG_ARRAY;
286
+
287
+ $groupId = (int)$_POST['groupId'];
288
+ $targetType = sanitize_text_field($_POST['conditionName']);
289
+ $addedObj = array();
290
+
291
+ $builderObj = new ConditionBuilder();
292
+
293
+ $builderObj->setGroupId($groupId);
294
+ $builderObj->setRuleId(SG_CONDITION_FIRST_RULE);
295
+ $builderObj->setSavedData($SGPB_DATA_CONFIG_ARRAY[$targetType]['initialData'][0]);
296
+ $builderObj->setConditionName($targetType);
297
+ $addedObj[] = $builderObj;
298
+
299
+ $creator = new ConditionCreator($addedObj);
300
+ echo $creator->render();
301
+ wp_die();
302
+ }
303
+
304
+ public function addConditionRuleRow()
305
+ {
306
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
307
+ $data = '';
308
+ global $SGPB_DATA_CONFIG_ARRAY;
309
+ $targetType = sanitize_text_field($_POST['conditionName']);
310
+ $builderObj = new ConditionBuilder();
311
+
312
+ $groupId = (int)$_POST['groupId'];
313
+ $ruleId = (int)$_POST['ruleId'];
314
+
315
+ $builderObj->setGroupId($groupId);
316
+ $builderObj->setRuleId($ruleId);
317
+ $builderObj->setSavedData($SGPB_DATA_CONFIG_ARRAY[$targetType]['initialData'][0]);
318
+ $builderObj->setConditionName($targetType);
319
+
320
+ $data .= ConditionCreator::createConditionRuleRow($builderObj);
321
+
322
+ echo $data;
323
+ wp_die();
324
+ }
325
+
326
+ public function changeConditionRuleRow()
327
+ {
328
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
329
+ $data = '';
330
+ global $SGPB_DATA_CONFIG_ARRAY;
331
+
332
+ $targetType = sanitize_text_field($_POST['conditionName']);
333
+ $builderObj = new ConditionBuilder();
334
+ $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$targetType];
335
+ $groupId = (int)$_POST['groupId'];
336
+ $ruleId = (int)$_POST['ruleId'];
337
+ $paramName = sanitize_text_field($_POST['paramName']);
338
+
339
+ $savedData = array(
340
+ 'param' => $paramName
341
+ );
342
+
343
+ if ($targetType == 'target' || $targetType == 'conditions') {
344
+ $savedData['operator'] = '==';
345
+ }
346
+ else if ($targetType == 'behavior-after-special-events') {
347
+ $savedData['operator'] = $paramName;
348
+ }
349
+
350
+ $savedData['value'] = @$conditionConfig['paramsData'][$paramName];
351
+ $savedData['hiddenOption'] = @$conditionConfig['hiddenOptionData'][$paramName];
352
+
353
+ $builderObj->setGroupId($groupId);
354
+ $builderObj->setRuleId($ruleId);
355
+ $builderObj->setSavedData($savedData);
356
+ $builderObj->setConditionName($targetType);
357
+
358
+ $data .= ConditionCreator::createConditionRuleRow($builderObj);
359
+
360
+ echo $data;
361
+ wp_die();
362
+ }
363
+ }
com/classes/ConditionBuilder.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ class ConditionBuilder
4
+ {
5
+ private $savedData = array();
6
+ private $groupId;
7
+ private $ruleId;
8
+ private $conditionName;
9
+ private $groupTotal;
10
+ private $takeValueFrom = 'param';
11
+
12
+ public function setSavedData($savedData)
13
+ {
14
+ $this->savedData = $savedData;
15
+ }
16
+
17
+ public function getSavedData()
18
+ {
19
+ return $this->savedData;
20
+ }
21
+
22
+ public function setGroupTotal($groupTotal)
23
+ {
24
+ $this->groupTotal = $groupTotal;
25
+ }
26
+
27
+ public function getGroupTotal()
28
+ {
29
+ return $this->groupTotal;
30
+ }
31
+
32
+ public function setGroupId($groupId)
33
+ {
34
+ $this->groupId = $groupId;
35
+ }
36
+
37
+ public function getGroupId()
38
+ {
39
+ return $this->groupId;
40
+ }
41
+
42
+ public function setRuleId($ruleId)
43
+ {
44
+ $this->ruleId = $ruleId;
45
+ }
46
+
47
+ public function getRuleId()
48
+ {
49
+ return $this->ruleId;
50
+ }
51
+
52
+ public function setTakeValueFrom($takeValueFrom)
53
+ {
54
+ $this->takeValueFrom = $takeValueFrom;
55
+ }
56
+
57
+ public function getTakeValueFrom()
58
+ {
59
+ return $this->takeValueFrom;
60
+ }
61
+
62
+ public function setConditionName($conditionName)
63
+ {
64
+ $this->conditionName = $conditionName;
65
+ }
66
+
67
+ public function getConditionName()
68
+ {
69
+ return $this->conditionName;
70
+ }
71
+
72
+ public static function createTargetConditionBuilder($conditionData = array())
73
+ {
74
+ $targetColumns = array();
75
+
76
+ if(empty($conditionData)) {
77
+ return $targetColumns;
78
+ }
79
+
80
+ foreach($conditionData as $groupId => $groupData) {
81
+
82
+ if(empty($groupData)) {
83
+ continue;
84
+ }
85
+
86
+ foreach($groupData as $ruleId => $ruleData) {
87
+ $builderObj = new ConditionBuilder();
88
+ $builderObj->setGroupId($groupId);
89
+ $builderObj->setRuleId($ruleId);
90
+ /*Assoc array where key option name value saved Data*/
91
+ $builderObj->setSavedData($ruleData);
92
+ $builderObj->setConditionName('target');
93
+ $builderObj->setGroupTotal(sizeof($groupData) - 1);
94
+ $targetColumns[] = $builderObj;
95
+ }
96
+ }
97
+
98
+ return $targetColumns;
99
+ }
100
+
101
+ public static function createEventsConditionBuilder($conditionData)
102
+ {
103
+ $eventsDataObj = array();
104
+
105
+ if(empty($conditionData)) {
106
+ return $eventsDataObj;
107
+ }
108
+
109
+ foreach($conditionData as $groupId => $groupData) {
110
+
111
+ if(empty($groupData)) {
112
+ continue;
113
+ }
114
+
115
+ foreach($groupData as $ruleId => $ruleData) {
116
+ $builderObj = new ConditionBuilder();
117
+ $builderObj->setGroupId($groupId);
118
+ $builderObj->setRuleId($ruleId);
119
+ /*Assoc array where key option name value saved Data*/
120
+ $builderObj->setSavedData($ruleData);
121
+ $builderObj->setConditionName('events');
122
+
123
+ $builderObj->setGroupTotal(sizeof($groupData) - 1);
124
+ $eventsDataObj[] = $builderObj;
125
+ }
126
+ }
127
+
128
+ return $eventsDataObj;
129
+ }
130
+
131
+ public static function createConditionBuilder($conditionData)
132
+ {
133
+ $eventsDataObj = array();
134
+
135
+ if(empty($conditionData)) {
136
+ return $eventsDataObj;
137
+ }
138
+
139
+ foreach($conditionData as $groupId => $groupData) {
140
+
141
+ if(empty($groupData)) {
142
+ continue;
143
+ }
144
+
145
+ foreach($groupData as $ruleId => $ruleData) {
146
+ $builderObj = new ConditionBuilder();
147
+ $builderObj->setGroupId($groupId);
148
+ $builderObj->setRuleId($ruleId);
149
+ /*Assoc array where key option name value saved Data*/
150
+ $builderObj->setSavedData($ruleData);
151
+ $builderObj->setConditionName('conditions');
152
+
153
+ $builderObj->setGroupTotal(sizeof($groupData) - 1);
154
+ $eventsDataObj[] = $builderObj;
155
+ }
156
+ }
157
+
158
+ return $eventsDataObj;
159
+ }
160
+
161
+ public static function createBehaviorAfterSpecialEventsConditionBuilder($data)
162
+ {
163
+ $dataObj = array();
164
+
165
+ if (empty($data)) {
166
+ return $dataObj;
167
+ }
168
+
169
+ foreach ($data as $groupId => $groupData) {
170
+ if (empty($groupData)) {
171
+ continue;
172
+ }
173
+
174
+ foreach ($groupData as $ruleId => $ruleData) {
175
+ $builderObj = new ConditionBuilder();
176
+ $builderObj->setGroupId($groupId);
177
+ $builderObj->setRuleId($ruleId);
178
+ $builderObj->setSavedData($ruleData);
179
+ $builderObj->setConditionName('behavior-after-special-events');
180
+ $builderObj->setGroupTotal(count($groupData) - 1);
181
+ $builderObj->setTakeValueFrom('operator');
182
+ $dataObj[] = $builderObj;
183
+ }
184
+ }
185
+
186
+ return $dataObj;
187
+ }
188
+ }
com/classes/ConditionCreator.php ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ class ConditionCreator
4
+ {
5
+ public function __construct($targetData)
6
+ {
7
+ if (!empty($targetData)) {
8
+ $this->setConditionsObj($targetData);
9
+ }
10
+ }
11
+
12
+ private $conditionsObj;
13
+ //When there is not group set groupId -1
14
+ private $prevGroupId = -1;
15
+
16
+ public function setPrevGroupId($prevGroupId)
17
+ {
18
+ $this->prevGroupId = $prevGroupId;
19
+ }
20
+
21
+ public function getPrevGroupId()
22
+ {
23
+ return $this->prevGroupId;
24
+ }
25
+
26
+ public function setConditionsObj($conditionsObj)
27
+ {
28
+ $this->conditionsObj = $conditionsObj;
29
+ }
30
+
31
+ public function getConditionsObj()
32
+ {
33
+ return $this->conditionsObj;
34
+ }
35
+
36
+ public function render()
37
+ {
38
+ $conditionsObj = $this->getConditionsObj();
39
+ $view = '';
40
+
41
+ foreach ($conditionsObj as $conditionObj) {
42
+ $currentGroupId = $conditionObj->getGroupId();
43
+ $prevGroupId = $this->getPrevGroupId();
44
+ $openGroupDiv = '';
45
+ $separator = '';
46
+ $closePrevGroupDiv = '';
47
+
48
+ if ($currentGroupId > $prevGroupId) {
49
+ if ($currentGroupId != 0) {
50
+ $closePrevGroupDiv = '</div>';
51
+ $separator = ConditionCreator::getOrRuleSeparator();
52
+ }
53
+ $openGroupDiv = '<div class="sgpb-wrapper sgpb-box-'.$conditionObj->getConditionName().' sg-target-group sg-target-group-'.$conditionObj->getGroupId().'" data-group-id="'.$currentGroupId.'">';
54
+ }
55
+
56
+ $view .= $closePrevGroupDiv;
57
+ $view .= $separator;
58
+ $view .= $openGroupDiv;
59
+ $view .= ConditionCreator::createConditionRuleRow($conditionObj);
60
+
61
+ $this->setPrevGroupId($currentGroupId);
62
+ }
63
+
64
+ $view .= '</div>';
65
+
66
+ return $view;
67
+ }
68
+
69
+ public static function getOrRuleSeparator()
70
+ {
71
+ return '<h4 class="sg-rules-or"><span>'.__('OR', SG_POPUP_TEXT_DOMAIN).'</span></h4>';
72
+ }
73
+
74
+ public static function createConditionRuleRow($conditionDataObj)
75
+ {
76
+ ob_start();
77
+ ?>
78
+ <div class="sg-target-rule sg-target-rule-<?php echo $conditionDataObj->getRuleId(); ?> sgpb-event-row" data-rule-id="<?php echo $conditionDataObj->getRuleId(); ?>">
79
+ <div class="row">
80
+ <?php
81
+ $savedData = $conditionDataObj->getSavedData();
82
+
83
+ if (!isset($savedData['value'])) {
84
+ $savedData['value'] = '';
85
+ }
86
+ ?>
87
+ <?php $idHiddenDiv = $conditionDataObj->getConditionName().'_'.$conditionDataObj->getGroupId().'_'.$conditionDataObj->getRuleId();?>
88
+ <?php foreach ($savedData as $conditionName => $conditionSavedData): ?>
89
+ <?php
90
+ $showRowStatusClass = '';
91
+ $hideStatus = self::getParamRowHideStatus($conditionDataObj, $conditionName);
92
+ $ruleElementData = self::getRuleElementData($conditionDataObj, 'param');
93
+ $ruleSavedData = $ruleElementData['saved'];
94
+
95
+ if ($conditionName == 'operator' && ($ruleSavedData == 'not_rule' || $ruleSavedData == 'select_role' || $ruleSavedData == 'select_event')) {
96
+ $hideStatus = true;
97
+ }
98
+ $showRowStatusClass = ($hideStatus) ? 'sg-hide-condition-row' : $showRowStatusClass;
99
+ ?>
100
+ <?php if ($conditionName != 'hiddenOption'): ?>
101
+ <div data-condition-name="<?php echo $conditionName;?>" class="<?php echo 'col-sm-3 sg-condition-'.$conditionName.'-wrapper'.' '.$showRowStatusClass; ?>">
102
+ <?php
103
+ if (!$hideStatus) {
104
+ echo self::createConditionElement($conditionDataObj, $conditionName);
105
+ }
106
+ ?>
107
+ </div>
108
+ <?php endif; ?>
109
+ <?php if (($conditionName == 'hiddenOption')): ?>
110
+ <?php $hiddenContent = self::getHiddenDataContent($conditionDataObj); ?>
111
+ <div class="sg-hide-condition-row"><div id="<?php echo $idHiddenDiv;?>"><?php echo $hiddenContent; ?></div></div><?php
112
+ endif; ?>
113
+ <?php endforeach;?>
114
+ <?php echo self::createConditionOperators($conditionDataObj, $idHiddenDiv); ?>
115
+ </div>
116
+ </div>
117
+ <?php
118
+ $targetOptionRow = ob_get_contents();
119
+ ob_end_clean();
120
+
121
+ return $targetOptionRow;
122
+ }
123
+
124
+ public static function createConditionOperators($conditionDataObj, $idHiddenDiv = '')
125
+ {
126
+ global $SGPB_DATA_CONFIG_ARRAY;
127
+ $groupId = $conditionDataObj->getRuleId();
128
+ $groupTotal = $conditionDataObj->getGroupTotal();
129
+
130
+ $conditionName = $conditionDataObj->getConditionName();
131
+ $operatorsHtml = '';
132
+ $conditionData = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
133
+ $eventsData = $SGPB_DATA_CONFIG_ARRAY['events'];
134
+
135
+ $operatorsData = $conditionData['operators'];
136
+ $eventButtonClasses = '';
137
+ $eventButtonWrapperClass = '';
138
+
139
+ if (empty($operatorsData)) {
140
+ return $operatorsHtml;
141
+ }
142
+
143
+ foreach ($operatorsData as $operator) {
144
+ $identificatorClass = '';
145
+ $style = '';
146
+ if (!isset($eventsData['hiddenOptionData'])) {
147
+ continue;
148
+ }
149
+ $saveData = $conditionDataObj->getSavedData();
150
+ if (empty($saveData['hiddenOption']) && $operator['name'] == 'Edit' && @$saveData["param"] != 'load') {
151
+ continue;
152
+ }
153
+ if ($operator['operator'] == 'edit') {
154
+ $identificatorClass = $idHiddenDiv;
155
+ $eventButtonClasses = 'btn btn-success btn-xs';
156
+ $eventButtonWrapperClass = 'col-sm-2 ';
157
+ }
158
+ if ($operator['operator'] == 'add') {
159
+ $eventButtonClasses = 'btn btn-primary btn-xs';
160
+ $eventButtonWrapperClass = 'col-sm-2 ';
161
+ $style = '';
162
+ //Don't show add button if it's not for last element
163
+ if ($groupId < $groupTotal) {
164
+ $style = 'style="display: none;"';
165
+ }
166
+ }
167
+ if ($operator['operator'] == 'delete') {
168
+ $eventButtonClasses = 'btn btn-danger btn-xs';
169
+ $eventButtonWrapperClass = 'col-sm-1 ';
170
+ }
171
+ if ($operator['name'] == 'Edit') {
172
+ $operator['name'] = 'Settings';
173
+ }
174
+
175
+ $operatorsHtml .= '<div class="'.$eventButtonWrapperClass.'sg-rules-'.$operator['operator'].'-button-wrapper sgpb-static-padding-top" '.$style.'>';
176
+ $operatorsHtml .= '<a href="javascript:void(0)" class="sg-rules-'.$operator['operator'].'-rule '.$eventButtonClasses.'" data-id="'.$identificatorClass.'"><span>'.__(' '.$operator['name'], SG_POPUP_TEXT_DOMAIN).'</span></a>';
177
+ $operatorsHtml .= '</div>';
178
+ }
179
+
180
+ return $operatorsHtml;
181
+ }
182
+
183
+ public static function createConditionElement($conditionDataObj, $ruleName)
184
+ {
185
+ //more code added because of the lack of abstraction
186
+ //todo: remove ASAP if possible
187
+ $sData = $conditionDataObj->getSavedData();
188
+ if ($ruleName == 'param' && in_array(
189
+ $sData['param'],
190
+ array(
191
+ 'select_behavior',
192
+ 'open-popup',
193
+ 'close-popup',
194
+ 'redirect-url'
195
+ )
196
+ )) {
197
+ $sData['param'] = 'contact-form-7';
198
+ $newObj = clone $conditionDataObj;
199
+ $newObj->setSavedData($sData);
200
+ $conditionDataObj = $newObj;
201
+ }
202
+
203
+ $element = '';
204
+
205
+ $ruleElementData = self::getRuleElementData($conditionDataObj, $ruleName);
206
+ $elementHeader = self::createRuleHeader($ruleElementData);
207
+ $field = self::createRuleField($ruleElementData);
208
+ $element .= $elementHeader;
209
+ $element .= $field;
210
+
211
+ return $element;
212
+ }
213
+
214
+ public static function createConditionField($conditionDataObj, $ruleName)
215
+ {
216
+ $ruleElementData = self::getRuleElementData($conditionDataObj, $ruleName);
217
+
218
+ return self::createRuleField($ruleElementData);
219
+ }
220
+
221
+ public static function createConditionFieldHeader($conditionDataObj, $ruleName)
222
+ {
223
+ $ruleElementData = self::getRuleElementData($conditionDataObj, $ruleName);
224
+
225
+ return self::createRuleHeader($ruleElementData);
226
+ }
227
+
228
+ public static function optionLabelSupplement($conditionDataObj, $ruleName)
229
+ {
230
+ global $SGPB_DATA_CONFIG_ARRAY;
231
+ $conditionName = $conditionDataObj->getConditionName();
232
+ $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
233
+ $attrs = $conditionConfig['attrs'][$ruleName];
234
+
235
+ if (isset($attrs['infoAttrs']['rightLabel'])) {
236
+ $labelData = $attrs['infoAttrs']['rightLabel'];
237
+ $value = $labelData['value'];
238
+ $classes = $labelData['classes'];
239
+ return '<span class="'.esc_attr($classes).'">'.$value.'</span>';
240
+ }
241
+
242
+ return '';
243
+ }
244
+
245
+ private static function getRuleElementData($conditionDataObj, $ruleName)
246
+ {
247
+ global $SGPB_DATA_CONFIG_ARRAY;
248
+ $ruleElementData = array();
249
+ $savedParam = '';
250
+ $conditionName = $conditionDataObj->getConditionName();
251
+ $saveData = $conditionDataObj->getSavedData();
252
+ $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
253
+ $rulesType = $conditionConfig['columnTypes'];
254
+ $paramsData = $conditionConfig['paramsData'];
255
+ $attrs = $conditionConfig['attrs'];
256
+
257
+ if (!empty($saveData[$ruleName])) {
258
+ $savedParam = $saveData[$ruleName];
259
+ }
260
+ else if (!empty($saveData['hiddenOption'])) {
261
+ $savedParam = @$saveData['hiddenOption'][$ruleName];
262
+ }
263
+
264
+ $ruleElementData['ruleName'] = $ruleName;
265
+ if ($ruleName == 'value') {
266
+ $ruleName = $saveData[$conditionDataObj->getTakeValueFrom()];
267
+ }
268
+
269
+ $type = $rulesType[$ruleName];
270
+ $data = $paramsData[$ruleName];
271
+
272
+ $optionAttr = $attrs[$ruleName];
273
+ $attr = array();
274
+
275
+ if (!empty($optionAttr['htmlAttrs'])) {
276
+ $attr = $optionAttr['htmlAttrs'];
277
+ }
278
+
279
+ $ruleElementData['type'] = $type;
280
+ $ruleElementData['data'] = $data;
281
+ $ruleElementData['saved'] = $savedParam;
282
+ $ruleElementData['attr'] = $attr;
283
+ $ruleElementData['conditionDataObj'] = $conditionDataObj;
284
+
285
+ return $ruleElementData;
286
+ }
287
+
288
+ private static function createRuleHeader($ruleElementData)
289
+ {
290
+ return self::createElementHeader($ruleElementData);
291
+ }
292
+
293
+ public static function createRuleField($ruleElementData)
294
+ {
295
+ $attr = array();
296
+ $type = $ruleElementData['type'];
297
+ $conditionObj = $ruleElementData['conditionDataObj'];
298
+
299
+ $name = 'sgpb-'.$conditionObj->getConditionName().'['.$conditionObj->getGroupId().']['.$conditionObj->getRuleId().']['.$ruleElementData['ruleName'].']';
300
+ $attr['name'] = $name;
301
+
302
+ if (is_array($ruleElementData['attr'])) {
303
+ $attr += $ruleElementData['attr'];
304
+ $attr['data-rule-id'] = $conditionObj->getRuleId();
305
+ }
306
+ $rowField = '';
307
+
308
+ switch($type) {
309
+
310
+ case 'select':
311
+ if (!empty($attr['multiple'])) {
312
+ $attr['name'] .= '[]';
313
+ }
314
+ $savedData = $ruleElementData['saved'];
315
+
316
+ if (empty($ruleElementData['data'])) {
317
+ $ruleElementData['data'] = $ruleElementData['saved'];
318
+ $savedData = array();
319
+
320
+ if (!empty($ruleElementData['saved'])) {
321
+ $savedData = array_keys($ruleElementData['saved']);
322
+ }
323
+ }
324
+
325
+ $rowField .= AdminHelper::createSelectBox($ruleElementData['data'], $savedData, $attr);
326
+ break;
327
+ case 'text':
328
+ case 'url':
329
+ case 'number':
330
+ $attr['type'] = $type;
331
+
332
+ //this is done to override the initial input value
333
+ if (!empty($ruleElementData['saved'])) {
334
+ $attr['value'] = esc_attr($ruleElementData['saved']);
335
+ }
336
+
337
+ $rowField .= AdminHelper::createInput($ruleElementData['data'], $ruleElementData['saved'], $attr);
338
+ break;
339
+ case 'checkbox':
340
+ $attr['type'] = $type;
341
+ $rowField .= AdminHelper::createCheckBox($ruleElementData['data'], $ruleElementData['saved'], $attr);
342
+ break;
343
+ }
344
+
345
+ return $rowField;
346
+ }
347
+
348
+ public static function createElementHeader($ruleElementData)
349
+ {
350
+ $labelAttributes = '';
351
+ $info = '';
352
+ $conditionObj = $ruleElementData['conditionDataObj'];
353
+ $conditionName = $conditionObj->getConditionName();
354
+ $ruleName = $ruleElementData['ruleName'];
355
+ global $SGPB_DATA_CONFIG_ARRAY;
356
+ $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
357
+ $conditionAttrs = $conditionConfig['attrs'];
358
+
359
+ $saveData = $conditionObj->getSavedData();
360
+ $optionTitle = $ruleName;
361
+ $titleKey = $ruleName;
362
+
363
+
364
+ if ($ruleName == 'value') {
365
+ $titleKey = $saveData[$conditionObj->getTakeValueFrom()];
366
+ }
367
+
368
+ if (!empty($conditionAttrs[$titleKey])) {
369
+ $optionAttrs = $conditionAttrs[$titleKey];
370
+ if (!empty($optionAttrs['infoAttrs'])) {
371
+ $optionTitle = $optionAttrs['infoAttrs']['label'];
372
+ if (!empty($optionAttrs['infoAttrs']['labelAttrs'])) {
373
+ $labelAttributes = AdminHelper::createAttrs($optionAttrs['infoAttrs']['labelAttrs']);
374
+ }
375
+ }
376
+ }
377
+ if (isset($optionAttrs['infoAttrs']['info']) && $optionAttrs['infoAttrs']['info']) {
378
+ $info .= '<span class="dashicons dashicons-editor-help sgpb-info-icon sgpb-info-icon-align"></span>';
379
+ $info .= '<span class="infoSelectRepeat samefontStyle sgpb-info-text">'.$optionAttrs['infoAttrs']['info'].'</span>';
380
+ }
381
+
382
+ return "<label $labelAttributes>$optionTitle</label>$info";
383
+ }
384
+
385
+ public static function getHiddenDataContent($conditionDataObj)
386
+ {
387
+ global $SGPB_DATA_CONFIG_ARRAY;
388
+ $savedData = $conditionDataObj->getSavedData();
389
+ $conditionName = $savedData['param'];
390
+ $eventsData = $SGPB_DATA_CONFIG_ARRAY['events'];
391
+ $hiddenOptions = $eventsData['hiddenOptionData'];
392
+ $ruleId = $conditionDataObj->getRuleId();
393
+ if (empty($hiddenOptions[$conditionName])) {
394
+ return __('No Data', SG_POPUP_TEXT_DOMAIN);
395
+ }
396
+
397
+ $hiddenOptionsData = $hiddenOptions[$conditionName];
398
+
399
+ $tabs = array_keys($hiddenOptionsData);
400
+ ob_start();
401
+ ?>
402
+
403
+ <div class="sgpb-wrapper">
404
+ <div class="tab">
405
+ <?php
406
+ $activeTab = '';
407
+ if (!empty($tabs[0])) {
408
+ $activeTab = $tabs[0];
409
+ }
410
+ ?>
411
+ <?php foreach ($tabs as $tab): ?>
412
+ <?php
413
+ $activeClassName = '';
414
+ if ($activeTab == $tab) {
415
+ $activeClassName = 'sgpb-active';
416
+ }
417
+ ?>
418
+ <button class="tablinks sgpb-tab-links <?php echo $activeClassName;?>" data-rule-id="<?php echo $ruleId; ?>" data-content-id="<?php echo $tab.'-'.$ruleId; ?>"><?php echo ucfirst($tab); ?></button>
419
+ <?php endforeach;?>
420
+ </div>
421
+ <?php echo self::createHiddenFields($hiddenOptionsData, $conditionDataObj, $ruleId); ?>
422
+ <div class="modal-footer">
423
+ <button type="button" class="sgpb-no-button events-option-close btn btn-default btn-sm" href="#"><?php _e('Cancel', SG_POPUP_TEXT_DOMAIN); ?></button>
424
+ <button class="btn btn-primary btn-sm sgpb-popup-option-save"><?php _e('Save', SG_POPUP_TEXT_DOMAIN); ?></button>
425
+ </div>
426
+ </div>
427
+ <?php
428
+ $hiddenPopupContent = ob_get_contents();
429
+ ob_end_clean();
430
+
431
+ return $hiddenPopupContent;
432
+ }
433
+
434
+ private static function createHiddenFields($hiddenOptionsData, $conditionDataObj, $ruleId)
435
+ {
436
+ ob_start();
437
+ ?>
438
+ <?php foreach ($hiddenOptionsData as $key => $hiddenData): ?>
439
+ <div id="<?php echo $key.'-'.$ruleId; ?>" class="sgpb-tab-content-<?php echo $ruleId;?>">
440
+ <div id="<?php echo $key; ?>" class="sgpb-tab-content-options">
441
+ <?php foreach ($hiddenData as $name => $label): ?>
442
+ <?php
443
+ $hiddenOptionsView = self::optionLabelSupplement($conditionDataObj, $name);
444
+ $colMdValue = 6;
445
+ if (!empty($hiddenOptionsView)) {
446
+ $colMdValue = 2;
447
+ }
448
+ ?>
449
+ <div class="row form-group">
450
+ <div class="col-md-6">
451
+ <?php echo self::createConditionFieldHeader($conditionDataObj, $name); ?>
452
+ </div>
453
+ <div class="col-md-<?php echo $colMdValue; ?>">
454
+ <?php echo self::createConditionField($conditionDataObj, $name); ?>
455
+ </div>
456
+ <?php if (!empty($hiddenOptionsView)): ?>
457
+ <div class="col-md-4">
458
+ <?php echo $hiddenOptionsView; ?>
459
+ </div>
460
+ <?php endif; ?>
461
+ </div>
462
+ <?php endforeach; ?>
463
+ </div>
464
+ </div>
465
+ <?php endforeach;?>
466
+ <?php
467
+ $hiddenPopupContent = ob_get_contents();
468
+ ob_end_clean();
469
+
470
+ return $hiddenPopupContent;
471
+ }
472
+
473
+ public static function hiddenSubOptionsView($parentOptionName, $conditionDataObj)
474
+ {
475
+ $subOptionsContent = '';
476
+ $subOptions = self::getHiddenOptionSubOptions($parentOptionName);
477
+ if (!empty($subOptions)) {
478
+ $subOptionsContent = self::createHiddenSubOptions($parentOptionName, $conditionDataObj, $subOptions);
479
+ }
480
+
481
+ return $subOptionsContent;
482
+ }
483
+
484
+ private static function createHiddenSubOptions($parentOptionName, $conditionDataObj, $subOptions)
485
+ {
486
+ $name = $parentOptionName;
487
+ ob_start();
488
+ ?>
489
+ <div class="row <?php echo 'sgpb-popup-hidden-content-'.$name.'-'.$conditionDataObj->getRuleId().'-wrapper'?> form-group">
490
+ <?php foreach ($subOptions as $subOption): ?>
491
+ <div class="col-md-6">
492
+ <?php echo self::createConditionFieldHeader($conditionDataObj, $subOption); ?>
493
+ </div>
494
+ <div class="col-md-6">
495
+ <?php echo self::createConditionField($conditionDataObj, $subOption); ?>
496
+ </div>
497
+ <?php echo self::hiddenSubOptionsView($subOption, $conditionDataObj)?>
498
+ <?php endforeach;?>
499
+ </div>
500
+ <?php
501
+ $hiddenPopupContent = ob_get_contents();
502
+ ob_end_clean();
503
+
504
+ return $hiddenPopupContent;
505
+ }
506
+
507
+ public static function getHiddenOptionSubOptions($optionName)
508
+ {
509
+ global $SGPB_DATA_CONFIG_ARRAY;
510
+ $childOptionNames = array();
511
+ $eventsData = $SGPB_DATA_CONFIG_ARRAY['events'];
512
+ $targetDataAttrs = $eventsData['attrs'];
513
+
514
+ if (empty($targetDataAttrs[$optionName])) {
515
+ return $childOptionNames;
516
+ }
517
+
518
+ if (empty($targetDataAttrs[$optionName]['childOptions'])) {
519
+ return $childOptionNames;
520
+ }
521
+ $childOptionNames = $targetDataAttrs[$optionName]['childOptions'];
522
+
523
+ return $childOptionNames;
524
+ }
525
+
526
+ private static function getParamRowHideStatus($conditionDataObj, $ruleName)
527
+ {
528
+ global $SGPB_DATA_CONFIG_ARRAY;
529
+ if ($ruleName == 'hiddenOption') {
530
+ return '';
531
+ }
532
+ $status = false;
533
+ $conditionName = $conditionDataObj->getConditionName();
534
+ $saveData = $conditionDataObj->getSavedData();
535
+ $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
536
+ $paramsData = $conditionConfig['paramsData'];
537
+
538
+ $ruleElementData['ruleName'] = $ruleName;
539
+ if ($ruleName == 'value') {
540
+ $ruleName = @$saveData[$conditionDataObj->getTakeValueFrom()];
541
+ }
542
+ if (is_null(@$paramsData[$ruleName])) {
543
+ $status = true;
544
+ }
545
+
546
+ return $status;
547
+ }
548
+
549
+ public function targetHeader($targetName = '')
550
+ {
551
+ global $SGPB_DATA_CONFIG_ARRAY;
552
+ $data = $SGPB_DATA_CONFIG_ARRAY[$targetName];
553
+ $columnLabels = $data['columns'];
554
+ $header = '<div class="sg-target-header-wrapper">';
555
+
556
+ foreach ($columnLabels as $key => $columnLabel) {
557
+ $header .= '<div class="sg-col-md">'.$columnLabel.'</div>';
558
+ }
559
+ $header .= '</div>';
560
+ return $header;
561
+ }
562
+ }
com/classes/ConvertToNewVersion.php ADDED
@@ -0,0 +1,727 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class ConvertToNewVersion
5
+ {
6
+ private $id;
7
+ private $content = '';
8
+ private $type;
9
+ private $title;
10
+ private $options;
11
+ private $customOptions = array();
12
+
13
+ public function setContent($content)
14
+ {
15
+ $this->content = $content;
16
+ }
17
+
18
+ public function getContent()
19
+ {
20
+ return $this->content;
21
+ }
22
+
23
+ public function setType($type)
24
+ {
25
+ if ($type == 'shortcode') {
26
+ $type = 'html';
27
+ }
28
+ $this->type = $type;
29
+ }
30
+
31
+ public function getType()
32
+ {
33
+ return $this->type;
34
+ }
35
+
36
+ public function setTitle($title)
37
+ {
38
+ $this->title = $title;
39
+ }
40
+
41
+ public function getTitle()
42
+ {
43
+ return $this->title;
44
+ }
45
+
46
+ public function setId($id)
47
+ {
48
+ $this->id = (int)$id;
49
+ }
50
+
51
+ public function getId()
52
+ {
53
+ return $this->id;
54
+ }
55
+
56
+ public function setOptions($options)
57
+ {
58
+ $this->options = $options;
59
+ }
60
+
61
+ public function getOptions()
62
+ {
63
+ return $this->options;
64
+ }
65
+
66
+ public function setCustomOptions($customOptions)
67
+ {
68
+ $this->customOptions = $customOptions;
69
+ }
70
+
71
+ public function getCustomOptions()
72
+ {
73
+ return $this->customOptions;
74
+ }
75
+
76
+ public static function convert()
77
+ {
78
+ $obj = new self();
79
+ $obj->insertDataToNew();
80
+ }
81
+
82
+ public function insertDataToNew()
83
+ {
84
+ $idsMapping = array();
85
+ Installer::install();
86
+ Installer::registerPlugin();
87
+ $popups = $this->getAllSavedPopups();
88
+ $this->convertSettings();
89
+
90
+ $arr = array();
91
+ $popupPreviewId = get_option('popupPreviewId');
92
+ foreach ($popups as $popup) {
93
+ if (empty($popup)) {
94
+ continue;
95
+ }
96
+ // we should not convert preview popup
97
+ if ($popup['id'] == $popupPreviewId) {
98
+ continue;
99
+ }
100
+
101
+ $popupObj = $this->popupObjectFromArray($popup);
102
+ $arr[] = $popupObj;
103
+ $args = array(
104
+ 'post_title' => $popupObj->getTitle(),
105
+ 'post_content' => $popupObj->getContent(),
106
+ 'post_status' => 'publish',
107
+ 'post_type' => SG_POPUP_POST_TYPE
108
+ );
109
+ $id = $popupObj->getId();
110
+ $newOptions = $this->getNewOptionsFormSavedData($popupObj);
111
+
112
+ $newPopupId = @wp_insert_post($args);
113
+ $newOptions['sgpb-post-id'] = $newPopupId;
114
+ $this->saveOtherOptions($newOptions);
115
+
116
+ update_post_meta($newPopupId, 'sg_popup_options', $newOptions);
117
+ $idsMapping[$id] = $newPopupId;
118
+ }
119
+
120
+ $this->convertCounter($idsMapping);
121
+
122
+ update_option('sgpbConvertedIds', $idsMapping);
123
+
124
+ return $arr;
125
+ }
126
+
127
+ /**
128
+ * Convert settings section saved options to new version
129
+ *
130
+ * @since 2.6.7.6
131
+ *
132
+ * @return bool
133
+ */
134
+ private function convertSettings()
135
+ {
136
+ global $wpdb;
137
+ $settings = $wpdb->get_row('SELECT options FROM '.$wpdb->prefix .'sg_popup_settings WHERE id = 1', ARRAY_A);
138
+
139
+ if (empty($settings['options'])) {
140
+ return false;
141
+ }
142
+ $settings = json_decode($settings['options'], true);
143
+
144
+ $deleteData = 0;
145
+
146
+ if (!empty($settings['tables-delete-status'])) {
147
+ $deleteData = 1;
148
+ }
149
+ $userRoles = $settings['plugin_users_role'];
150
+
151
+ if (empty($userRoles) || !is_array($userRoles)) {
152
+ $userRoles = array();
153
+ }
154
+
155
+ $userRoles = array_map(function($role) {
156
+ // it's remove sgpb_ keyword from selected values
157
+ $role = substr($role, 5, strlen($role)-1);
158
+
159
+ return $role;
160
+ }, $userRoles);
161
+
162
+ update_option('sgpb-user-roles', $userRoles);
163
+ update_option('sgpb-dont-delete-data', $deleteData);
164
+
165
+ return true;
166
+ }
167
+
168
+ private function convertCounter($idsMapping)
169
+ {
170
+ $oldCounter = get_option('SgpbCounter');
171
+
172
+ if (!$oldCounter) {
173
+ return false;
174
+ }
175
+ $newCounter = array();
176
+ foreach ($oldCounter as $key => $value) {
177
+ $newId = @$idsMapping[$key];
178
+ $newCounter[$newId] = $value;
179
+ }
180
+
181
+ update_option('SgpbCounter', $newCounter);
182
+
183
+ return true;
184
+ }
185
+
186
+
187
+ private function getAllSavedPopups()
188
+ {
189
+ global $wpdb;
190
+
191
+ $query = 'SELECT `id`, `type`, `title`, `options` from '.$wpdb->prefix.'sg_popup ORDER BY id';
192
+ $popups = $wpdb->get_results($query, ARRAY_A);
193
+
194
+ return $popups;
195
+ }
196
+
197
+ public function getNewOptionsFormSavedData($popup)
198
+ {
199
+ $options = $popup->getOptions();
200
+ $customOptions = $popup->getCustomOptions();
201
+ $options = array_merge($options, $customOptions);
202
+ // return addons event from add_connections data
203
+ $addonsEvent = $this->getAddonsEventFromPopup($popup);
204
+ if ($addonsEvent) {
205
+ $options = array_merge($options, $addonsEvent);
206
+ }
207
+ $options = $this->filterOptions($options);
208
+
209
+ $names = $this->getNamesMapping();
210
+ $newData = array();
211
+ $type = $popup->getType();
212
+
213
+ if (empty($names)) {
214
+ return $newData;
215
+ }
216
+
217
+ $newData['sgpb-type'] = $type;
218
+
219
+ foreach ($names as $oldName => $newName) {
220
+ if (isset($options[$oldName])) {
221
+ $optionName = $this->changeOldValues($oldName, $options[$oldName]);
222
+ $newData[$newName] = $optionName;
223
+ }
224
+ }
225
+ $newData['sgpb-enable-popup-overlay'] = 'on';
226
+ $newData['sgpb-show-background'] = 'on';
227
+
228
+ return $newData;
229
+ }
230
+
231
+ private function saveOtherOptions($options)
232
+ {
233
+ $popupId = (int)$options['sgpb-post-id'];
234
+
235
+ if (isset($options['sgpb-option-exit-intent-enable'])) {
236
+ $eventsInitialData = array(
237
+ array(
238
+ array(
239
+ 'param' => 'exitIntent',
240
+ 'value' => @$options['sgpb-option-exit-intent-type'],
241
+ 'hiddenOption' => array(
242
+ 'sgpb-exit-intent-expire-time' => @$options['sgpb-exit-intent-expire-time'],
243
+ 'sgpb-exit-intent-cookie-level' => @$options['sgpb-exit-intent-cookie-level'],
244
+ 'sgpb-exit-intent-soft-from-top' => @$options['sgpb-exit-intent-soft-from-top']
245
+ )
246
+ )
247
+ )
248
+ );
249
+ update_post_meta($popupId, 'sg_popup_events', $eventsInitialData);
250
+ }
251
+ else if(isset($options['sgpb-option-enable-ad-block'])) {
252
+ $eventsInitialData = array(
253
+ array(
254
+ array(
255
+ 'param' => 'AdBlock',
256
+ 'value' => $options['sgpb-popup-delay'],
257
+ 'hiddenOption' => array()
258
+ )
259
+ )
260
+ );
261
+ update_post_meta($popupId, 'sg_popup_events', $eventsInitialData);
262
+ }
263
+
264
+ // MailChimp
265
+ $mailchimpApiKey = get_option("SG_MAILCHIMP_API_KEY");
266
+
267
+ if ($mailchimpApiKey) {
268
+ update_option('SGPB_MAILCHIMP_API_KEY', $mailchimpApiKey);
269
+ }
270
+
271
+ // AWeber
272
+ $aweberAccessToken = get_option('sgAccessToken');
273
+ if ($aweberAccessToken) {
274
+ $requestTokenSecret = get_option('requestTokenSecret');
275
+ $accessTokenSecret = get_option('sgAccessTokenSecret');
276
+
277
+ update_option('sgpbRequestTokenSecret', $requestTokenSecret);
278
+ update_option('sgpbAccessTokenSecret', $accessTokenSecret);
279
+ update_option('sgpbAccessToken', $aweberAccessToken);
280
+ }
281
+
282
+ return $options;
283
+ }
284
+
285
+ /**
286
+ * Get Addons options
287
+ *
288
+ * @param obj $popup
289
+ *
290
+ * @return bool|array
291
+ */
292
+ private function getAddonsEventFromPopup($popup)
293
+ {
294
+ if (empty($popup)) {
295
+ return false;
296
+ }
297
+ $popupId = $popup->getId();
298
+ global $wpdb;
299
+
300
+ $addonsOptionSqlString = 'SELECT options FROM '.$wpdb->prefix.'sg_popup_addons_connection WHERE popupId = %d and extensionType = "option"';
301
+ $addonsSql = $wpdb->prepare($addonsOptionSqlString, $popupId);
302
+ $results = $wpdb->get_results($addonsSql, ARRAY_A);
303
+
304
+ if (empty($results)) {
305
+ return false;
306
+ }
307
+
308
+ $options = array();
309
+
310
+ // it's collect all events saved values ex Exit Intent and AdBlock
311
+ foreach ($results as $result) {
312
+ $currentOptions = json_decode($result['options'], true);
313
+
314
+ if (empty($currentOptions)) {
315
+ continue;
316
+ }
317
+ $options = array_merge($options, $currentOptions);
318
+ }
319
+
320
+ return $options;
321
+ }
322
+
323
+ /**
324
+ * Filter and change some related values for new version
325
+ *
326
+ * @param array $options
327
+ *
328
+ * @return array $options
329
+ */
330
+ private function filterOptions($options)
331
+ {
332
+ if (@$options['effect'] != 'No effect') {
333
+ $options['sgpb-open-animation'] = 'on';
334
+ }
335
+
336
+ if (isset($options['isActiveStatus']) && $options['isActiveStatus'] == 'off') {
337
+ $options['isActiveStatus'] = '';
338
+ }
339
+
340
+ if (empty($options['sgTheme3BorderColor'])) {
341
+ $options['sgTheme3BorderColor'] = '#000000';
342
+ }
343
+
344
+ if (@$options['popupContentBackgroundRepeat'] != 'no-repeat' && $options['popupContentBackgroundSize'] == 'auto') {
345
+ $options['popupContentBackgroundSize'] = 'repeat';
346
+ }
347
+ $themeNumber = 1;
348
+
349
+ if (isset($options['theme'])) {
350
+ $themeNumber = preg_replace('/[^0-9]/', '', $options['theme']);
351
+ }
352
+
353
+ if (isset($options['aweber-success-behavior']) && $options['aweber-success-behavior'] == 'redirectToUrl') {
354
+ $options['aweber-success-behavior'] = 'redirectToURL';
355
+ }
356
+ // if there is saved any extension option we do deactivate that popup
357
+ if (isset($options['option-exit-intent-enable']) || isset($options['option-enable-ad-block'])) {
358
+ $options['isActiveStatus'] = '';
359
+ }
360
+
361
+ if (isset($options['popup-content-padding'])) {
362
+ // add theme default padding to content padding
363
+ switch ($themeNumber) {
364
+ case 1:
365
+ $options['popup-content-padding'] += 7;
366
+ break;
367
+ case 4:
368
+ case 6:
369
+ $options['popup-content-padding'] += 12;
370
+ break;
371
+ case 2:
372
+ case 3:
373
+ $options['popup-content-padding'] += 0;
374
+ break;
375
+ case 5:
376
+ $options['popup-content-padding'] += 5;
377
+ break;
378
+ }
379
+ }
380
+
381
+ switch ($themeNumber) {
382
+ case 1:
383
+ $buttonImageWidth = 21;
384
+ $buttonImageHeight = 21;
385
+ break;
386
+ case 2:
387
+ $buttonImageWidth = 20;
388
+ $buttonImageHeight = 20;
389
+ break;
390
+ case 3:
391
+ $buttonImageWidth = 38;
392
+ $buttonImageHeight = 19;
393
+ break;
394
+ case 5:
395
+ $buttonImageWidth = 17;
396
+ $buttonImageHeight = 17;
397
+ break;
398
+ case 6:
399
+ $buttonImageWidth = 30;
400
+ $buttonImageHeight = 30;
401
+ break;
402
+ default:
403
+ $buttonImageWidth = 0;
404
+ $buttonImageHeight = 0;
405
+ }
406
+
407
+ $options['sgpb-button-image-width'] = $buttonImageWidth;
408
+ $options['sgpb-button-image-height'] = $buttonImageHeight;
409
+
410
+ return $options;
411
+ }
412
+
413
+ public function changeOldValues($optionName, $optionValue)
414
+ {
415
+ if ($optionName == 'theme') {
416
+ $themeNumber = preg_replace('/[^0-9]/', '', $optionValue);
417
+ $optionValue = 'sgpb-theme-'.$themeNumber;
418
+ }
419
+
420
+ return $optionValue;
421
+ }
422
+
423
+ private function popupObjectFromArray($arr)
424
+ {
425
+ global $wpdb;
426
+
427
+ $options = json_decode($arr['options'], true);
428
+ $type = $arr['type'];
429
+
430
+ if (empty($type)) {
431
+ return false;
432
+ }
433
+
434
+ $this->setId($arr['id']);
435
+ $this->setType($type);
436
+ $this->setTitle($arr['title']);
437
+ $this->setContent('');
438
+
439
+ switch ($type) {
440
+ case 'image':
441
+ $query = $wpdb->prepare('SELECT `url` FROM '.$wpdb->prefix.'sg_image_popup WHERE id = %d', $arr['id']);
442
+ $result = $wpdb->get_row($query, ARRAY_A);
443
+
444
+ if (!empty($result['url'])) {
445
+ $options['image-url'] = $result['url'];
446
+ }
447
+ break;
448
+ case 'html':
449
+ $query = $wpdb->prepare('SELECT `content` FROM '.$wpdb->prefix.'sg_html_popup WHERE id = %d', $arr['id']);
450
+ $result = $wpdb->get_row($query, ARRAY_A);
451
+
452
+ if (!empty($result['content'])) {
453
+ $this->setContent($result['content']);
454
+ }
455
+ break;
456
+ case 'fblike':
457
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_fblike_popup WHERE id = %d', $arr['id']);
458
+ $result = $wpdb->get_row($query, ARRAY_A);
459
+
460
+ if (!empty($result['content'])) {
461
+ $this->setContent($result['content']);
462
+ }
463
+ $customOptions = $result['options'];
464
+ $customOptions = json_decode($customOptions, true);
465
+
466
+ if (!empty($options)) {
467
+ $this->setCustomOptions($customOptions);
468
+ }
469
+ break;
470
+ case 'shortcode':
471
+ $query = $wpdb->prepare('SELECT `url` FROM '.$wpdb->prefix.'sg_shortCode_popup WHERE id = %d', $arr['id']);
472
+ $result = $wpdb->get_row($query, ARRAY_A);
473
+
474
+ if (!empty($result['url'])) {
475
+ $this->setContent($result['url']);
476
+ }
477
+ break;
478
+ case 'mailchimp':
479
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_popup_mailchimp WHERE id = %d', $arr['id']);
480
+ $result = $wpdb->get_row($query, ARRAY_A);
481
+
482
+ if (!empty($result['content'])) {
483
+ $this->setContent($result['content']);
484
+ }
485
+
486
+ $customOptions = $result['options'];
487
+ $customOptions = json_decode($customOptions, true);
488
+
489
+ if (!empty($options)) {
490
+ $this->setCustomOptions($customOptions);
491
+ }
492
+ break;
493
+ case 'aweber':
494
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_popup_aweber WHERE id = %d', $arr['id']);
495
+ $result = $wpdb->get_row($query, ARRAY_A);
496
+
497
+ if (!empty($result['content'])) {
498
+ $this->setContent($result['content']);
499
+ }
500
+
501
+ $customOptions = $result['options'];
502
+ $customOptions = json_decode($customOptions, true);
503
+
504
+ if (!empty($options)) {
505
+ $this->setCustomOptions($customOptions);
506
+ }
507
+ break;
508
+ }
509
+
510
+ $this->setOptions($options);
511
+
512
+ return $this;
513
+ }
514
+
515
+ public function getNamesMapping()
516
+ {
517
+ $names = array(
518
+ 'type' => 'sgpb-type',
519
+ 'delay' => 'sgpb-popup-delay',
520
+ 'isActiveStatus' => 'sgpb-is-active',
521
+ 'image-url' => 'sgpb-image-url',
522
+ 'theme' => 'sgpb-popup-themes',
523
+ 'effect' => 'sgpb-open-animation-effect',
524
+ 'duration' => 'sgpb-open-animation-speed',
525
+ 'popupOpenSound' => 'sgpb-open-sound',
526
+ 'popupOpenSoundFile' => 'sgpb-sound-url',
527
+ 'popup-dimension-mode' => 'sgpb-popup-dimension-mode',
528
+ 'popup-responsive-dimension-measure' => 'sgpb-responsive-dimension-measure',
529
+ 'width' => 'sgpb-width',
530
+ 'height' => 'sgpb-height',
531
+ 'maxWidth' => 'sgpb-max-width',
532
+ 'maxHeight' => 'sgpb-max-height',
533
+ 'escKey' => 'sgpb-esc-key',
534
+ 'closeButton' => 'sgpb-enable-close-button',
535
+ 'buttonDelayValue' => 'sgpb-close-button-delay',
536
+ 'scrolling' => 'sgpb-enable-content-scrolling',
537
+ 'disable-page-scrolling' => 'sgpb-disable-page-scrolling',
538
+ 'overlayClose' => 'sgpb-overlay-click',
539
+ 'contentClick' => 'sgpb-content-click',
540
+ 'content-click-behavior' => 'sgpb-content-click-behavior',
541
+ 'click-redirect-to-url' => 'sgpb-click-redirect-to-url',
542
+ 'redirect-to-new-tab' => 'sgpb-redirect-to-new-tab',
543
+ 'reopenAfterSubmission' => 'sgpb-reopen-after-form-submission',
544
+ 'repeatPopup' => 'sgpb-show-popup-same-user',
545
+ 'popup-appear-number-limit' => 'sgpb-show-popup-same-user-count',
546
+ 'onceExpiresTime' => 'sgpb-show-popup-same-user-expiry',
547
+ 'save-cookie-page-level' => 'sgpb-show-popup-same-user-page-level',
548
+ 'popupContentBgImage' => 'sgpb-show-background',
549
+ 'popupContentBackgroundSize' => 'sgpb-background-image-mode',
550
+ 'popupContentBgImageUrl' => 'sgpb-background-image',
551
+ 'sgOverlayColor' => 'sgpb-overlay-color',
552
+ 'sg-content-background-color' => 'sgpb-background-color',
553
+ 'popup-background-opacity' => 'sgpb-content-opacity',
554
+ 'opacity' => 'sgpb-overlay-opacity',
555
+ 'sgOverlayCustomClasss' => 'sgpb-overlay-custom-class',
556
+ 'sgContentCustomClasss' => 'sgpb-content-custom-class',
557
+ 'popup-z-index' => 'sgpb-popup-z-index',
558
+ 'popup-content-padding' => 'sgpb-content-padding',
559
+ 'popupFixed' => 'sgpb-popup-fixed',
560
+ 'fixedPostion' => 'sgpb-popup-fixed-position',
561
+ 'sgpb-open-animation' => 'sgpb-open-animation',
562
+ 'theme-close-text' => 'sgpb-button-text',
563
+ 'sgTheme3BorderRadius' => 'sgpb-border-radius',
564
+ 'sgTheme3BorderColor' => 'sgpb-border-color',
565
+ 'fblike-like-url' => 'sgpb-fblike-like-url',
566
+ 'fblike-layout' => 'sgpb-fblike-layout',
567
+ 'fblike-dont-show-share-button' => 'sgpb-fblike-dont-show-share-button',
568
+ 'sgpb-button-image-width' => 'sgpb-button-image-width',
569
+ 'sgpb-button-image-height' => 'sgpb-button-image-height'
570
+ );
571
+
572
+ // Exit Intent extension names
573
+ $names['option-exit-intent-enable'] = 'sgpb-option-exit-intent-enable';
574
+ $names['option-exit-intent-type'] = 'sgpb-option-exit-intent-type';
575
+ $names['option-exit-intent-expire-time'] = 'sgpb-exit-intent-expire-time';
576
+ $names['option-exit-intent-cookie-level'] = 'sgpb-exit-intent-cookie-level';
577
+ $names['option-exit-intent-soft-from-top'] = 'sgpb-exit-intent-soft-from-top';
578
+
579
+ // Adblock extension names
580
+ $names['option-enable-ad-block'] = 'sgpb-option-enable-ad-block';
581
+
582
+ // MailChimp extension names
583
+ $names['mailchimp-list-id'] = 'sgpb-mailchimp-lists';
584
+ $names['mailchimp-double-optin'] = 'sgpb-enable-double-optin';
585
+ $names['mailchimp-only-required'] = 'sgpb-show-required-fields';
586
+ $names['mailchimp-form-aligment'] = 'sgpb-mailchimp-form-align';
587
+ $names['mailchimp-label-aligment'] = 'sgpb-mailchimp-label-alignment';
588
+ $names['mailchimp-indicates-required-fields'] = 'sgpb-enable-asterisk-label';
589
+ $names['mailchimp-asterisk-label'] = 'sgpb-mailchimp-asterisk-label';
590
+ $names['mailchimp-required-error-message'] = 'sgpb-mailchimp-required-message';
591
+ $names['mailchimp-email-validate-message'] = 'sgpb-mailchimp-email-message';
592
+ $names['mailchimp-email-label'] = 'sgpb-mailchimp-email-label';
593
+ $names['mailchimp-error-message'] = 'sgpb-mailchimp-error-message';
594
+ $names['mailchimp-show-form-to-top'] = 'sgpb-mailchimp-show-form-to-top';
595
+ $names['mailchimp-label-color'] = 'sgpb-mailchimp-label-color';
596
+ $names['mailchimp-input-width'] = 'sgpb-mailchimp-input-width';
597
+ $names['mailchimp-input-height'] = 'sgpb-mailchimp-input-height';
598
+ $names['mailchimp-input-border-radius'] = 'sgpb-mailchimp-border-radius';
599
+ $names['mailchimp-input-border-width'] = 'sgpb-mailchimp-border-width';
600
+ $names['mailchimp-input-border-color'] = 'sgpb-mailchimp-border-color';
601
+ $names['mailchimp-input-bg-color'] = 'sgpb-mailchimp-background-color';
602
+ $names['sgpb-mailchimp-input-color'] = 'sgpb-mailchimp-input-color';
603
+ $names['mailchimp-submit-title'] = 'sgpb-mailchimp-submit-title';
604
+ $names['mailchimp-submit-width'] = 'sgpb-mailchimp-submit-width';
605
+ $names['mailchimp-submit-height'] = 'sgpb-mailchimp-submit-height';
606
+ $names['mailchimp-submit-border-width'] = 'sgpb-mailchimp-submit-border-width';
607
+ $names['mailchimp-submit-border-radius'] = 'sgpb-mailchimp-submit-border-radius';
608
+ $names['mailchimp-submit-border-color'] = 'sgpb-mailchimp-submit-border-color';
609
+ $names['mailchimp-submit-button-bgcolor'] = 'sgpb-mailchimp-submit-background-color';
610
+ $names['mailchimp-submit-color'] = 'sgpb-mailchimp-submit-color';
611
+ $names['mailchimp-success-behavior'] = 'sgpb-mailchimp-success-behavior';
612
+ $names['mailchimp-success-message'] = 'sgpb-mailchimp-success-message';
613
+ $names['mailchimp-success-redirect-url'] = 'sgpb-mailchimp-success-redirect-URL';
614
+ $names['mailchimp-success-redirect-new-tab'] = 'sgpb-mailchimp-success-redirect-new-tab';
615
+ $names['mailchimp-success-popups-list'] = 'sgpb-mailchimp-success-popup';
616
+ $names['mailchimp-close-popup-already-subscribed'] = 'sgpb-mailchimp-close-popup-already-subscribed';
617
+
618
+ // AWeber extension
619
+ $names['sg-aweber-list'] = 'sgpb-aweber-list';
620
+ $names['sg-aweber-webform'] = 'sgpb-aweber-signup-form';
621
+ $names['aweber-custom-invalid-email-message'] = 'sgpb-aweber-invalid-email';
622
+ $names['aweber-invalid-email'] = 'sgpb-aweber-invalid-email-message';
623
+ $names['aweber-already-subscribed-message'] = 'sgpb-aweber-custom-subscribed-message';
624
+ $names['aweber-required-message'] = 'sgpb-aweber-required-message';
625
+ $names['aweber-validate-email-message'] = 'sgpb-aweber-validate-email-message';
626
+ $names['aweber-success-behavior'] = 'sgpb-aweber-success-behavior';
627
+ $names['aweber-success-message'] = 'sgpb-aweber-success-message';
628
+ $names['aweber-success-redirect-url'] = 'sgpb-aweber-success-redirect-URL';
629
+ $names['aweber-success-redirect-new-tab'] = 'sgpb-aweber-success-redirect-new-tab';
630
+ $names['aweber-success-popups-list'] = 'sgpb-aweber-success-popup';
631
+
632
+ return $names;
633
+ }
634
+
635
+ public static function saveCustomInserted()
636
+ {
637
+ global $post;
638
+ if (empty($post)) {
639
+ return false;
640
+ }
641
+
642
+ $postId = $post->ID;
643
+ if (get_option('sgpbSaveOldData'.$postId)) {
644
+ return false;
645
+ }
646
+
647
+ update_option('sgpbSaveOldData'.$postId, 1);
648
+
649
+ add_filter('sgpbConvertedPopupId', 'sgpb\sgpGetCorrectPopupId', 10, 1);
650
+ self::saveMetaboxPopup($postId);
651
+ $content = get_post_field('post_content', $postId);
652
+ SGPopup::deletePostCustomInsertedData($postId);
653
+ SGPopup::deletePostCustomInsertedEvents($postId);
654
+ // We detect all the popups that were inserted as a custom ones, in the content.
655
+ SGPopup::savePopupsFromContentClasses($content, $post);
656
+ }
657
+
658
+ public static function saveMetaboxPopup($postId)
659
+ {
660
+ $selectedPost = get_post_meta($postId, 'sg_promotional_popup', true);
661
+
662
+ if (empty($selectedPost)) {
663
+ return false;
664
+ }
665
+ global $SGPB_DATA_CONFIG_ARRAY;
666
+
667
+ $postType = get_post_type($postId);
668
+ $postTitle = get_the_title($postId);
669
+ $popupId = sgpGetCorrectPopupId($selectedPost);
670
+ $popupTargetParam = $postType.'_selected';
671
+
672
+ if (!get_post_meta($popupId, 'sg_popup_events')) {
673
+ update_post_meta($popupId, 'sg_popup_events', array($SGPB_DATA_CONFIG_ARRAY['events']['initialData']));
674
+ }
675
+
676
+ $savedTarget = get_post_meta($popupId, 'sg_popup_target');
677
+ if (empty($savedTarget[0]['sgpb-target'][0])) {
678
+ $savedTarget['sgpb-target'][] = array(array('param' => $popupTargetParam, 'operator' => '==', 'value' => array($postId => $postTitle)));
679
+ $savedTarget['sgpb-conditions'][] = $SGPB_DATA_CONFIG_ARRAY['conditions']['initialData'];
680
+
681
+ update_post_meta($popupId, 'sg_popup_target', $savedTarget, true);
682
+ return true;
683
+ }
684
+ $targets = $savedTarget[0]['sgpb-target'][0];
685
+ $targetExists = false;
686
+
687
+ foreach ($targets as $key => $target) {
688
+ if ($key == 0 && $target['param'] == 'not_rule') {
689
+ $target['param'] = $popupTargetParam;
690
+ $savedTarget[0]['sgpb-target'][0][$key]['param'] = $popupTargetParam;
691
+ }
692
+ if ($target['param'] == $popupTargetParam) {
693
+ $targetExists = true;
694
+ $targetValue = array();
695
+ if (!empty($target['value'])) {
696
+ $targetValue = $target['value'];
697
+ }
698
+
699
+ $targetValue[$postId] = $postTitle;
700
+ $savedTarget[0]['sgpb-target'][0][$key]['value'] = $targetValue;
701
+ break;
702
+ }
703
+ }
704
+
705
+ if (!$targetExists) {
706
+ $savedTargetsLength = count($savedTarget[0]['sgpb-target'][0]);
707
+ $savedTarget[0]['sgpb-target'][0][$savedTargetsLength] = array('param' => $popupTargetParam, 'operator' => '==', 'value' => array($postId => $postTitle));
708
+ }
709
+
710
+ delete_post_meta($postId, 'sg_promotional_popup');
711
+ delete_post_meta($popupId, 'sg_popup_target');
712
+ update_post_meta($popupId, 'sg_popup_target', $savedTarget[0], true);
713
+
714
+ return true;
715
+ }
716
+ }
717
+
718
+ function sgpGetCorrectPopupId($popupId)
719
+ {
720
+ $convertedIds = get_option('sgpbConvertedIds');
721
+
722
+ if (empty($convertedIds) || empty($convertedIds[$popupId])) {
723
+ return $popupId;
724
+ }
725
+
726
+ return $convertedIds[$popupId];
727
+ }
com/classes/Filters.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class Filters
5
+ {
6
+ public function __construct()
7
+ {
8
+ $this->init();
9
+ }
10
+
11
+ public function init()
12
+ {
13
+ add_filter('admin_url', array($this, 'addNewPostUrl'), 10, 2);
14
+ add_filter('admin_menu', array($this, 'removeAddNewSubmenu'), 10, 2);
15
+ add_filter('manage_'.SG_POPUP_POST_TYPE.'_posts_columns', array($this, 'popupsTableColumns'));
16
+ add_filter('post_row_actions', array($this, 'quickRowLinksManager'), 10, 2);
17
+ add_filter('sgpbPopupRenderOptions', array($this, 'renderOptions'), 10, 1);
18
+ add_filter('sgpbAdminJs', array($this, 'adminJsFilter'), 1, 1);
19
+ add_filter('sgpbAdminCssFiles', array($this, 'sgpbAdminCssFiles'), 1, 1);
20
+ add_filter('sgpbPopupContentLoadToPage', array($this, 'filterPopupContent'), 10, 1);
21
+ add_filter('the_content', array($this, 'clearContentPreviewMode'), 10, 1);
22
+ add_filter('posts_where' , array($this, 'excludePostsToShow'), 10, 1);
23
+ add_filter('preview_post_link', array($this, 'editPopupPreviewLink'), 10, 2);
24
+ add_filter('upgrader_pre_download', array($this, 'maybeShortenEddFilename'), 10, 4);
25
+ add_filter('sgpbSavedPostData', array($this, 'savedPostData'), 10, 1);
26
+ }
27
+
28
+ public function savedPostData($postData)
29
+ {
30
+ // for old popups here we change already saved old popup id
31
+ if (isset($postData['sgpb-mailchimp-success-popup'])) {
32
+ // sgpGetCorrectPopupId it's a temporary function and it will be removed in future
33
+ if (function_exists(__NAMESPACE__.'\sgpGetCorrectPopupId')) {
34
+ $postData['sgpb-mailchimp-success-popup'] = sgpGetCorrectPopupId($postData['sgpb-mailchimp-success-popup']);
35
+ }
36
+ }
37
+ // for old popups here we change already saved old popup id
38
+ if (isset($postData['sgpb-aweber-success-popup'])) {
39
+ if (function_exists(__NAMESPACE__.'\sgpGetCorrectPopupId')) {
40
+ $postData['sgpb-aweber-success-popup'] = sgpGetCorrectPopupId($postData['sgpb-aweber-success-popup']);
41
+ }
42
+ }
43
+
44
+ return $postData;
45
+ }
46
+
47
+ public function removeAddNewSubmenu()
48
+ {
49
+ //we don't need the default add new, since we are using our custom page for it
50
+ $page = remove_submenu_page(
51
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
52
+ 'post-new.php?post_type='.SG_POPUP_POST_TYPE
53
+ );
54
+ }
55
+
56
+ public function maybeShortenEddFilename($return, $package)
57
+ {
58
+ if (strpos($package, SG_POPUP_STORE_URL) !== false) {
59
+ add_filter('wp_unique_filename', array($this, 'shortenEddFilename'), 100, 2);
60
+ }
61
+ return $return;
62
+ }
63
+
64
+ public function shortenEddFilename($filename, $ext)
65
+ {
66
+ $filename = substr($filename, 0, 20).$ext;
67
+ remove_filter('wp_unique_filename', array($this, 'shortenEddFilename'), 10);
68
+ return $filename;
69
+ }
70
+
71
+ public function editPopupPreviewLink($previewLink, $post)
72
+ {
73
+ if (get_option('theme_switched') === false) {
74
+ if (!empty($post) && $post->post_type == SG_POPUP_POST_TYPE) {
75
+ return home_url()."?popup_preview_id=".$post->ID;
76
+ }
77
+ }
78
+
79
+ return $previewLink;
80
+ }
81
+
82
+ public function excludePostsToShow($where)
83
+ {
84
+ if (is_admin()) {
85
+ if (!function_exists('get_current_screen')) {
86
+ return $where;
87
+ }
88
+
89
+ $screen = get_current_screen();
90
+ if (empty($screen)) {
91
+ return $where;
92
+ }
93
+
94
+ $postType = $screen->post_type;
95
+ if ($postType == SG_POPUP_POST_TYPE &&
96
+ $screen instanceof \WP_Screen &&
97
+ $screen->id === 'edit-popupbuilder') {
98
+ $activePopupsQuery = SGPopup::getActivePopupsQueryString();
99
+ $where .= $activePopupsQuery;
100
+ }
101
+ }
102
+
103
+ return $where;
104
+ }
105
+
106
+ public function clearContentPreviewMode($content)
107
+ {
108
+ global $post_type;
109
+
110
+ if (is_preview() && $post_type == SG_POPUP_POST_TYPE) {
111
+ $content = '';
112
+ }
113
+
114
+ return $content;
115
+ }
116
+
117
+ public function filterPopupContent($content)
118
+ {
119
+ preg_match_all('/<iframe.*?src="(.*?)".*?<\/iframe>/', $content, $matches);
120
+ /*$finalContent = '';*/
121
+ // $matches[0] array contain iframes stings
122
+ // $matches[1] array contain iframes URLs
123
+ if (empty($matches) && empty($matches[0]) && empty($matches[1])) {
124
+ return $content;
125
+ }
126
+ $urls = $matches[1];
127
+
128
+ foreach ($matches[0] as $key => $iframe) {
129
+ if (empty($urls[$key])) {
130
+ continue;
131
+ }
132
+
133
+ $pos = strpos($iframe, $urls[$key]);
134
+
135
+ if ($pos === false) {
136
+ continue;
137
+ }
138
+
139
+ $content = str_replace(' src="'.$urls[$key].'"', ' src="" data-attr-src="'.esc_attr($urls[$key]).'"', $content);
140
+ }
141
+
142
+ return do_shortcode($content);
143
+ }
144
+
145
+ public function renderOptions($options = array())
146
+ {
147
+ if (isset($options['sgpb-button-image'])) {
148
+ $options['sgpb-button-image'] = AdminHelper::convertImageToData($options['sgpb-button-image']);
149
+ }
150
+
151
+ return $options;
152
+ }
153
+
154
+ public function addNewPostUrl($url, $path)
155
+ {
156
+ if ($path == 'post-new.php?post_type='.SG_POPUP_POST_TYPE) {
157
+ $url = str_replace('post-new.php?post_type='.SG_POPUP_POST_TYPE, 'edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SG_POPUP_POST_TYPE, $url);
158
+ }
159
+
160
+ return $url;
161
+ }
162
+
163
+ public function popupsTableColumns($columns)
164
+ {
165
+ unset($columns['date']);
166
+
167
+ $additionalItems = array();
168
+ $additionalItems['counter'] = __('Show count', SG_POPUP_TEXT_DOMAIN);
169
+ $additionalItems['onOff'] = __('Enabled (show popup)', SG_POPUP_TEXT_DOMAIN);
170
+ $additionalItems['type'] = __('Type', SG_POPUP_TEXT_DOMAIN);
171
+ $additionalItems['shortcode'] = __('Shortcode', SG_POPUP_TEXT_DOMAIN);
172
+
173
+ return $columns + $additionalItems;
174
+ }
175
+
176
+ /**
177
+ * Function to add/hide links from popups dataTable row
178
+ */
179
+ public function quickRowLinksManager($actions, $post)
180
+ {
181
+ global $post_type;
182
+
183
+ if ($post_type != SG_POPUP_POST_TYPE) {
184
+ return $actions;
185
+ }
186
+ // remove quick edit link
187
+ unset($actions['inline hide-if-no-js']);
188
+ // remove view link
189
+ unset($actions['view']);
190
+
191
+ $actions['clone'] = '<a href="'.$this->popupGetClonePostLink($post->ID , 'display', false).'" title="';
192
+ $actions['clone'] .= esc_attr__("Clone this item", SG_POPUP_TEXT_DOMAIN);
193
+ $actions['clone'] .= '">'. esc_html__('Clone', SG_POPUP_TEXT_DOMAIN).'</a>';
194
+
195
+ return $actions;
196
+ }
197
+
198
+ /**
199
+ * Retrieve duplicate post link for post.
200
+ *
201
+ * @param int $id Optional. Post ID.
202
+ * @param string $context Optional, default to display. How to write the '&', defaults to '&amp;'.
203
+ * @return string
204
+ */
205
+ public function popupGetClonePostLink($id = 0, $context = 'display')
206
+ {
207
+ if (!$post = get_post($id)) {
208
+ return;
209
+ }
210
+ $actionName = "popupSaveAsNew";
211
+
212
+ if ('display' == $context) {
213
+ $action = '?action='.$actionName.'&amp;post='.$post->ID;
214
+ } else {
215
+ $action = '?action='.$actionName.'&post='.$post->ID;
216
+ }
217
+
218
+ $postTypeObject = get_post_type_object($post->post_type);
219
+
220
+ if (!$postTypeObject) {
221
+ return;
222
+ }
223
+
224
+ return wp_nonce_url(apply_filters('popupGetClonePostLink', admin_url("admin.php".$action), $post->ID, $context), 'duplicate-post_' . $post->ID);
225
+ }
226
+
227
+ /* media button scripts */
228
+ public function adminJsFilter($jsFiles)
229
+ {
230
+ $allowToShow = MediaButton::allowToShow();
231
+ if ($allowToShow) {
232
+ $jsFiles['jsFiles'][] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'select2.min.js');
233
+ $jsFiles['jsFiles'][] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
234
+ $jsFiles['jsFiles'][] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'Popup.js');
235
+ $jsFiles['jsFiles'][] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js');
236
+ $jsFiles['jsFiles'][] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'MediaButton.js');
237
+
238
+ $jsFiles['localizeData'][] = array(
239
+ 'handle' => 'Popup.js',
240
+ 'name' => 'sgpbPublicUrl',
241
+ 'data' => SG_POPUP_PUBLIC_URL
242
+ );
243
+
244
+ $jsFiles['localizeData'][] = array(
245
+ 'handle' => 'MediaButton.js',
246
+ 'name' => 'mediaButtonParams',
247
+ 'data' => array(
248
+ 'currentPostType' => get_post_type(),
249
+ 'popupBuilderPostType' => SG_POPUP_POST_TYPE
250
+ )
251
+ );
252
+ }
253
+
254
+ return $jsFiles;
255
+ }
256
+
257
+ /* media button styles */
258
+ public function sgpbAdminCssFiles($cssFiles)
259
+ {
260
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
261
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
262
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
263
+
264
+ return $cssFiles;
265
+ }
266
+ }
com/classes/Installer.php ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \SgpbPopupExtensionRegister;
4
+
5
+ class Installer
6
+ {
7
+ public static function createTables($tables, $blogId = '')
8
+ {
9
+ global $wpdb;
10
+ if (empty($tables)) {
11
+ return false;
12
+ }
13
+
14
+ foreach ($tables as $table) {
15
+ $createTable = 'CREATE TABLE IF NOT EXISTS ';
16
+ $createTable .= $wpdb->prefix.$blogId;
17
+ $createTable .= $table;
18
+ $wpdb->query($createTable);
19
+ }
20
+
21
+ return true;
22
+ }
23
+
24
+ private static function getAllNeededTables()
25
+ {
26
+ $tables = array();
27
+ global $SGPB_POPUP_TYPES;
28
+ $popupTypes = $SGPB_POPUP_TYPES['typeName'];
29
+
30
+ if (empty($popupTypes)) {
31
+ return $tables;
32
+ }
33
+
34
+ foreach ($popupTypes as $popupTypeKey => $popupTypeLevel) {
35
+ if (SGPB_POPUP_PKG >= $popupTypeLevel) {
36
+ $className = ucfirst($popupTypeKey).'Popup';
37
+
38
+ if (file_exists(SG_POPUP_CLASSES_POPUPS_PATH.$className.'.php')) {
39
+
40
+ require_once(SG_POPUP_CLASSES_POPUPS_PATH.$className.'.php');
41
+
42
+ $className = __NAMESPACE__.'\\'.$className;
43
+
44
+ $popupTables = $className::getTablesSql();
45
+
46
+ if (empty($popupTables)) {
47
+ continue;
48
+ }
49
+
50
+ foreach ($popupTables as $tableSql) {
51
+ $tables[] = $tableSql;
52
+ }
53
+ }
54
+ }
55
+
56
+ }
57
+
58
+ return $tables;
59
+ }
60
+
61
+ public static function install()
62
+ {
63
+ $tables = self::getAllNeededTables();
64
+ $filteredTables = apply_filters('sgpbTablesInstall', $tables);
65
+
66
+ if (get_option('sgpb-dont-delete-data') === false) {
67
+ // Initial option insert
68
+ update_option('sgpb-dont-delete-data', 1);
69
+ }
70
+
71
+ self::createTables($filteredTables);
72
+
73
+ // get_current_blog_id() == 1 When plugin activated inside the child of multisite instance
74
+ if (is_multisite() && get_current_blog_id() == 1) {
75
+ global $wp_version;
76
+
77
+ if ($wp_version > '4.6.0') {
78
+ $sites = get_sites();
79
+ }
80
+ else {
81
+ $sites = wp_get_sites();
82
+ }
83
+
84
+ foreach ($sites as $site) {
85
+
86
+ if ($wp_version > '4.6.0') {
87
+ $blogId = $site->blog_id.'_';
88
+ }
89
+ else {
90
+ $blogId = $site['blog_id'].'_';
91
+ }
92
+ // blog Id 1 for multisite main site
93
+ if ($blogId != 1) {
94
+ self::createTables($filteredTables, $blogId);
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ public static function uninstall()
101
+ {
102
+ delete_option('sgpb-user-roles');
103
+
104
+ // When don't delete data if don't delete data option was unchecked
105
+ if (!get_option('sgpb-dont-delete-data')) {
106
+ return false;
107
+ }
108
+ delete_option('sgpb-dont-delete-data');
109
+
110
+ // Trigger popup data delete action
111
+ do_action('sgpbDeletePopupData');
112
+
113
+ self::deletePopups();
114
+ self::deleteCustomTerms(SG_POPUP_CATEGORY_TAXONOMY);
115
+ self::deleteCustomTables();
116
+
117
+ if (is_multisite()) {
118
+ global $wp_version;
119
+ if ($wp_version > '4.6.0') {
120
+ $sites = get_sites();
121
+ }
122
+ else {
123
+ $sites = wp_get_sites();
124
+ }
125
+
126
+ foreach ($sites as $site) {
127
+ if ($wp_version > '4.6.0') {
128
+ $blogId = $site->blog_id.'_';
129
+ }
130
+ else {
131
+ $blogId = $site['blog_id'].'_';
132
+ }
133
+ self::deleteCustomTables($blogId);
134
+ }
135
+ }
136
+
137
+ return true;
138
+ }
139
+
140
+ /**
141
+ * Delete Taxonomy by name
142
+ *
143
+ * @since 1.0.0
144
+ *
145
+ * @param string $taxonomy
146
+ *
147
+ * @return void
148
+ */
149
+ public static function deleteCustomTerms($taxonomy)
150
+ {
151
+ global $wpdb;
152
+
153
+ $customTermsQuery = 'SELECT t.name, t.term_id
154
+ FROM '.$wpdb->terms . ' AS t
155
+ INNER JOIN ' . $wpdb->term_taxonomy . ' AS tt
156
+ ON t.term_id = tt.term_id
157
+ WHERE tt.taxonomy = "'.$taxonomy.'"';
158
+
159
+ $terms = $wpdb->get_results($customTermsQuery);
160
+
161
+ foreach ($terms as $term) {
162
+ if (empty($term)) {
163
+ continue;
164
+ }
165
+ wp_delete_term($term->term_id, $taxonomy);
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Delete all popup builder post types posts
171
+ *
172
+ * @since 1.0.0
173
+ *
174
+ * @return void
175
+ *
176
+ */
177
+ private static function deletePopups()
178
+ {
179
+ $popups = get_posts(
180
+ array(
181
+ 'post_type' => SG_POPUP_POST_TYPE,
182
+ 'post_status' => array(
183
+ 'publish',
184
+ 'pending',
185
+ 'draft',
186
+ 'auto-draft',
187
+ 'future',
188
+ 'private',
189
+ 'inherit',
190
+ 'trash'
191
+ )
192
+ )
193
+ );
194
+
195
+ foreach ($popups as $popup) {
196
+ if (empty($popup)) {
197
+ continue;
198
+ }
199
+ wp_delete_post($popup->ID, true);
200
+ }
201
+ }
202
+
203
+ private static function deleteCustomTables($blogId = '')
204
+ {
205
+ $allTableNames = self::getAllTableNames();
206
+
207
+ if (empty($allTableNames)) {
208
+ return false;
209
+ }
210
+ global $wpdb;
211
+
212
+ foreach ($allTableNames as $tableName) {
213
+ $deleteTable = $wpdb->prefix.$blogId.$tableName;
214
+ $deleteTableSql = 'DROP TABLE '.$deleteTable;
215
+
216
+ $wpdb->query($deleteTableSql);
217
+ }
218
+
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * It's acquire all popup types installed table names
224
+ *
225
+ * @since 1.0.0
226
+ *
227
+ * @return array $popup types table names
228
+ *
229
+ */
230
+ private static function getAllTableNames()
231
+ {
232
+ $tables = array();
233
+ global $SGPB_POPUP_TYPES;
234
+ $popupTypes = $SGPB_POPUP_TYPES['typeName'];
235
+
236
+ if (empty($popupTypes)) {
237
+ return $tables;
238
+ }
239
+
240
+ foreach ($popupTypes as $popupTypeKey => $popupTypeLevel) {
241
+ if (SGPB_POPUP_PKG >= $popupTypeLevel) {
242
+ $className = ucfirst($popupTypeKey).'Popup';
243
+
244
+ if (file_exists(SG_POPUP_CLASSES_POPUPS_PATH.$className.'.php')) {
245
+
246
+ require_once(SG_POPUP_CLASSES_POPUPS_PATH.$className.'.php');
247
+
248
+ $className = __NAMESPACE__.'\\'.$className;
249
+
250
+ $popupTables = $className::getTableNames();
251
+
252
+ if (empty($popupTables)) {
253
+ continue;
254
+ }
255
+
256
+ foreach ($popupTables as $tableName) {
257
+ $tables[] = $tableName;
258
+ }
259
+ }
260
+ }
261
+
262
+ }
263
+
264
+ return $tables;
265
+ }
266
+
267
+ public static function registerPlugin()
268
+ {
269
+ $pluginName = SG_POPUP_FILE_NAME;
270
+ $classPath = SG_POPUP_EXTENSION_PATH.'/SgpbPopupExtension.php';
271
+ $className = 'SgpbPopupExtension';
272
+ $options = array();
273
+
274
+ if (SGPB_POPUP_PKG != SGPB_POPUP_PKG_FREE) {
275
+ $options = array(
276
+ 'licence' => array(
277
+ 'key' => SG_POPUP_KEY,
278
+ 'storeURL' => SG_POPUP_STORE_URL,
279
+ 'file' => WP_PLUGIN_DIR.'/'.SG_POPUP_FILE_NAME,
280
+ 'itemId' => SGPB_ITEM_ID,
281
+ 'itemName' => __('Popup Builder', SG_POPUP_TEXT_DOMAIN),
282
+ 'autor' => SG_POPUP_AUTHOR,
283
+ 'boxLabel' => __('Popup Builder License', SG_POPUP_TEXT_DOMAIN)
284
+ )
285
+ );
286
+ }
287
+
288
+ @SgpbPopupExtensionRegister::register($pluginName, $classPath, $className, $options);
289
+ }
290
+ }
com/classes/Javascript.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ /**
5
+ * Popup Builder Style
6
+ *
7
+ * @since 2.5.6
8
+ *
9
+ * detect and include popup styles to the admin pages
10
+ *
11
+ */
12
+ class Javascript
13
+ {
14
+ public static function enqueueScripts($hook)
15
+ {
16
+ global $post;
17
+ global $post_type;
18
+ $pageName = $hook;
19
+ $scripts = array();
20
+ $currentPostType = @$post->post_type;
21
+ // in some themes global $post returns null
22
+ if (empty($currentPostType)) {
23
+ $currentPostType = $post_type;
24
+ }
25
+ if($hook == 'popupbuilder_page_popupbuilder') {
26
+ $pageName = 'popupType';
27
+ }
28
+ else if(($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
29
+ $pageName = 'editpage';
30
+ }
31
+ else if($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
32
+ $pageName = 'popupspage';
33
+ }
34
+ else if ($hook == 'popupbuilder_page_subscribers') {
35
+ $pageName = 'subscribers';
36
+ }
37
+
38
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
39
+
40
+ if(!$registeredPlugins) {
41
+ return;
42
+ }
43
+ $registeredPlugins = json_decode($registeredPlugins, true);
44
+
45
+ if(empty($registeredPlugins)) {
46
+ return;
47
+ }
48
+
49
+ wp_enqueue_media();
50
+
51
+ foreach($registeredPlugins as $pluginName => $pluginData) {
52
+
53
+ if (!is_plugin_active($pluginName)) {
54
+ continue;
55
+ }
56
+
57
+ if (empty($pluginData['classPath']) || empty($pluginData['className'])) {
58
+ continue;
59
+ }
60
+
61
+ if (!file_exists($pluginData['classPath'])) {
62
+ continue;
63
+ }
64
+
65
+ require_once($pluginData['classPath']);
66
+
67
+ if (!class_exists($pluginData['className'])) {
68
+ continue;
69
+ }
70
+
71
+ $classObj = new $pluginData['className']();
72
+ $extensionInterface = 'SgpbIPopupExtension';
73
+
74
+ if(!$classObj instanceof $extensionInterface) {
75
+ continue;
76
+ }
77
+ $scriptData = $classObj->getScripts($pageName , array());
78
+
79
+ $scripts[] = $scriptData;
80
+ }
81
+
82
+ if(empty($scripts)) {
83
+ return;
84
+ }
85
+
86
+ foreach($scripts as $script) {
87
+ if(empty($script['jsFiles'])) {
88
+ continue;
89
+ }
90
+
91
+ foreach($script['jsFiles'] as $jsFile) {
92
+
93
+ if(empty($jsFile['folderUrl'])) {
94
+ wp_enqueue_script($jsFile['filename']);
95
+ continue;
96
+ }
97
+
98
+ $dirUrl = $jsFile['folderUrl'];
99
+ $dep = (!empty($jsFile['dep'])) ? $jsFile['dep'] : '';
100
+ $ver = (!empty($jsFile['ver'])) ? $jsFile['ver'] : '';
101
+ $inFooter = (!empty($jsFile['inFooter'])) ? $jsFile['inFooter'] : '';
102
+
103
+ ScriptsIncluder::registerScript($jsFile['filename'], array(
104
+ 'dirUrl'=> $dirUrl,
105
+ 'dep' => $dep,
106
+ 'ver' => $ver,
107
+ 'inFooter' => $inFooter
108
+ )
109
+ );
110
+ ScriptsIncluder::enqueueScript($jsFile['filename']);
111
+ }
112
+
113
+ if(empty($script['localizeData'])) {
114
+ continue;
115
+ }
116
+
117
+ $localizeDatas = $script['localizeData'];
118
+
119
+ foreach($localizeDatas as $localizeData) {
120
+ ScriptsIncluder::localizeScript($localizeData['handle'], $localizeData['name'], $localizeData['data']);
121
+ }
122
+ }
123
+ }
124
+ }
com/classes/MediaButton.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class MediaButton
5
+ {
6
+ public function __toString()
7
+ {
8
+ return $this->render();
9
+ }
10
+
11
+ public static function allowToShow()
12
+ {
13
+ global $pagenow, $typenow;
14
+
15
+ $allowToShow = false;
16
+ $pages = array(
17
+ 'page.php',
18
+ 'post-new.php',
19
+ 'post-edit.php',
20
+ 'widgets.php'
21
+ );
22
+
23
+ $checkPage = in_array(
24
+ $pagenow,
25
+ $pages
26
+ );
27
+
28
+ // for show in plugins page when package is pro
29
+ if (SGPB_POPUP_PKG !== SGPB_POPUP_PKG_FREE) {
30
+ array_push($pages, 'post.php');
31
+ }
32
+
33
+ return ($pages && $typenow != 'download');
34
+ }
35
+
36
+ private function allowToShowJsVariable()
37
+ {
38
+ return get_post_type() == SG_POPUP_POST_TYPE;
39
+ }
40
+
41
+ public function render()
42
+ {
43
+ $output = $this->mediaButton();
44
+ $output .= $this->insertJsVariable();
45
+
46
+ return $output;
47
+ }
48
+
49
+ private function insertJsVariable()
50
+ {
51
+ if (!$this->allowToShowJsVariable()){
52
+ return '';
53
+ }
54
+
55
+ $buttonTitle = __('Insert custom JS variable', SG_POPUP_TEXT_DOMAIN);
56
+ require_once(SG_POPUP_VIEWS_PATH.'jsVariableView.php');
57
+
58
+ $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
59
+ $output = '<a data-id="sgpb-js-variable-wrapper" href="javascript:void(0);" class="button sgpb-insert-js-variable" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
60
+
61
+ return $output;
62
+ }
63
+
64
+ private function mediaButton()
65
+ {
66
+ $allowToShow = MediaButton::allowToShow();
67
+ if (!$allowToShow) {
68
+ $output = '';
69
+ return $output;
70
+ }
71
+
72
+ require_once(SG_POPUP_VIEWS_PATH.'mediaButton.php');
73
+ $showCurrentUser = AdminHelper::showMenuForCurrentUser();
74
+
75
+ if (!$showCurrentUser) {
76
+ return '';
77
+ }
78
+ $buttonTitle = __('Insert popup', SG_POPUP_TEXT_DOMAIN);
79
+
80
+ $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
81
+ $output = '<a data-id="sgpb-hidden-media-popup" href="javascript:void(0);" class="button sgpb-insert-media-button-js" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
82
+
83
+ return $output;
84
+ }
85
+ }
com/classes/PopupChecker.php ADDED
@@ -0,0 +1,666 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \DateTime;
4
+ use \DateTimeZone;
5
+ use \ConfigDataHelper;
6
+
7
+ /**
8
+ * Popup checker class to check if the popup must be loaded on the current page
9
+ *
10
+ * @since 1.0.0
11
+ *
12
+ */
13
+ class PopupChecker
14
+ {
15
+ private static $instance;
16
+ private $popup;
17
+ private $post;
18
+
19
+ public static function instance()
20
+ {
21
+ if (!isset(self::$instance)) {
22
+ self::$instance = new self;
23
+ }
24
+
25
+ return self::$instance;
26
+ }
27
+
28
+ public function setPopup($popup)
29
+ {
30
+ $this->popup = $popup;
31
+ }
32
+
33
+ public function getPopup()
34
+ {
35
+ return $this->popup;
36
+ }
37
+
38
+ public function setPost($post)
39
+ {
40
+ $this->post = $post;
41
+ }
42
+
43
+ public function getPost()
44
+ {
45
+ return $this->post;
46
+ }
47
+
48
+ /**
49
+ * It checks whether popup should be loaded on the current page.
50
+ *
51
+ * @since 1.0.0
52
+ *
53
+ * @param int $popupId popup id
54
+ * @param object $post page post data
55
+ *
56
+ * @return bool
57
+ *
58
+ */
59
+ public function isLoadable($popup, $post)
60
+ {
61
+ $this->setPopup($popup);
62
+ $this->setPost($post);
63
+
64
+ $popupOptions = $popup->getOptions();
65
+ $isActive = $popup->getOptionValue('sgpb-is-active', true);
66
+ $saveMode = $popup->getSaveMode();
67
+ $allowToLoad = $this->allowToLoad();
68
+
69
+ if ($saveMode) {
70
+ $allowToLoad['option_event'] = false;
71
+ return $allowToLoad;
72
+ }
73
+
74
+ if (isset($popupOptions['sgpb-is-active'])) {
75
+ $isActive = $popupOptions['sgpb-is-active'];
76
+ }
77
+
78
+ if (!$isActive) {
79
+ $allowToLoad['option_event'] = false;
80
+ }
81
+
82
+ return $allowToLoad;
83
+ }
84
+
85
+ /**
86
+ * Decides whether popup data should be loaded or not
87
+ *
88
+ * @since 1.0.0
89
+ *
90
+ * @return array
91
+ *
92
+ */
93
+ private function allowToLoad()
94
+ {
95
+ $isCustomInserted = $this->isCustomInserted();
96
+ $insertedModes = array(
97
+ 'attr_event' => false,
98
+ 'option_event' => false
99
+ );
100
+
101
+ if ($isCustomInserted) {
102
+ $insertedModes['attr_event'] = true;
103
+ }
104
+
105
+ $target = $this->divideTargetData();
106
+ $isPostInForbidden = $this->isPostInForbidden($target);
107
+
108
+ if ($isPostInForbidden) {
109
+ return $insertedModes;
110
+ }
111
+ $isPermissive = $this->isPermissive($target);
112
+ //If permissive for current page check conditions
113
+ if ($isPermissive) {
114
+ $conditions = $this->divideConditionsData();
115
+ $isSatisfyForConditions = $this->isSatisfyForConditions($conditions);
116
+
117
+ if ($isSatisfyForConditions === false) {
118
+ return $insertedModes;
119
+ }
120
+ if ($this->isSatisfyForOtherConditions() === false) {
121
+ return $insertedModes;
122
+ }
123
+ $insertedModes['option_event'] = $isPermissive;
124
+ }
125
+
126
+ return $insertedModes;
127
+ }
128
+
129
+ /**
130
+ * check is Satisfy popup conditions
131
+ *
132
+ * @since 1.0.0
133
+ *
134
+ * @param array $conditions assoc array
135
+ *
136
+ * @return bool
137
+ *
138
+ */
139
+ private function isSatisfyForConditions($conditions)
140
+ {
141
+ // proStartSilver
142
+ $forbiddenConditions = $conditions['forbidden'];
143
+ if (!empty($forbiddenConditions)) {
144
+ foreach ($forbiddenConditions as $forbiddenCondition) {
145
+ $isForbiddenConditions = $this->isSatisfyForConditionsOptions($forbiddenCondition);
146
+ //If $isForbiddenConditions popup does not open
147
+ if ($isForbiddenConditions) {
148
+ return false;
149
+ }
150
+ }
151
+ }
152
+ $permissiveOptions = $conditions['permissive'];
153
+ if (!empty($permissiveOptions)) {
154
+ foreach ($permissiveOptions as $permissiveOption) {
155
+ $isPermissiveConditions = $this->isSatisfyForConditionsOptions($permissiveOption);
156
+
157
+ if ($isPermissiveConditions === false) {
158
+ return $isPermissiveConditions;
159
+ }
160
+ }
161
+ }
162
+ // proEndSilver
163
+ return true;
164
+ }
165
+
166
+ private function isSatisfyForConditionsOptions($option)
167
+ {
168
+ global $post;
169
+ $paramName = $option['param'];
170
+ $defaultStatus = false;
171
+
172
+ // proStartSilver
173
+ if ($paramName == 'select_role') {
174
+ return true;
175
+ }
176
+
177
+ if ($paramName == 'groups_devices' && !empty($option['value'])) {
178
+
179
+ if (is_array($option['value'])) {
180
+ $device = Functions::getUserDevice();
181
+ if (in_array($device, $option['value'])) {
182
+ return true;
183
+ }
184
+ }
185
+ }
186
+ // proEndSilver
187
+
188
+ // proStartPlatinum
189
+ else if ($paramName == 'groups_countries' && !empty($option['value'])) {
190
+ if (is_array($option['value'])) {
191
+ $ipAddress = Functions::getIpAddress();
192
+ $country = Functions::getCountryName($ipAddress);
193
+
194
+ if (in_array($country, $option['value'])) {
195
+ return true;
196
+ }
197
+ }
198
+
199
+ }
200
+ // proEndPlatinum
201
+ // proStartSilver
202
+ else if ($paramName == 'groups_user_role' && !empty($option['value'])) {
203
+ $userStatus = is_user_logged_in();
204
+
205
+ if ($userStatus) {
206
+ return true;
207
+ }
208
+ }
209
+
210
+ if (!$defaultStatus && do_action('isAllowedForConditions', $option, $post)) {
211
+ $defaultStatus = true;
212
+ }
213
+ // proEndSilver
214
+
215
+ return $defaultStatus;
216
+ }
217
+
218
+ /**
219
+ * Check is popup inserted via short code or class attribute
220
+ *
221
+ * @since 1.0.0
222
+ *
223
+ * @param
224
+ *
225
+ * @return bool
226
+ *
227
+ */
228
+ private function isCustomInserted()
229
+ {
230
+ $customInsertData = $this->getCustomInsertedData();
231
+ $popup = $this->getPopup();
232
+ // When popup object is empty it's mean popup is not custom inserted
233
+ if (empty($popup)) {
234
+ return false;
235
+ }
236
+ $popupId = $popup->getId();
237
+
238
+ return in_array($popupId, $customInsertData);
239
+ }
240
+
241
+ /**
242
+ * Should load data in the current page
243
+ *
244
+ * @since 1.0.0
245
+ *
246
+ * @param array $target popup saved target data
247
+ *
248
+ * @return bool $isPermissive true => allow false => don't allow
249
+ *
250
+ */
251
+ private function isPermissive($target)
252
+ {
253
+ $isPermissive = false;
254
+
255
+ if (empty($target['permissive'])) {
256
+ $isPermissive = false;
257
+ return $isPermissive;
258
+ }
259
+
260
+ foreach ($target['permissive'] as $targetData) {
261
+ if ($this->isSatisfyForParam($targetData)) {
262
+ $isPermissive = true;
263
+ break;
264
+ }
265
+ }
266
+
267
+ return $isPermissive;
268
+ }
269
+
270
+ /**
271
+ * Check whether the target data disallows loading the popup data on the current page
272
+ *
273
+ * @since 1.0.0
274
+ *
275
+ * @param array $target popup saved target data
276
+ *
277
+ * @return bool $isForbidden true => don't allow false => allow
278
+ *
279
+ */
280
+ private function isPostInForbidden($target)
281
+ {
282
+ $isForbidden = false;
283
+
284
+ if (empty($target['forbidden'])) {
285
+ return $isForbidden;
286
+ }
287
+
288
+ foreach ($target['forbidden'] as $targetData) {
289
+ if ($this->isSatisfyForParam($targetData)) {
290
+ $isForbidden = true;
291
+ break;
292
+ }
293
+ }
294
+
295
+ return $isForbidden;
296
+ }
297
+
298
+ /**
299
+ * Check whether the current page is corresponding to the saved target data
300
+ *
301
+ * @since 1.0.0
302
+ *
303
+ * @param array $targetData popup saved target data
304
+ *
305
+ * @return bool $isSatisfy
306
+ *
307
+ */
308
+ private function isSatisfyForParam($targetData)
309
+ {
310
+ $isSatisfy = false;
311
+ $postId = get_queried_object_id();
312
+
313
+ if (empty($targetData['param'])) {
314
+ return $isSatisfy;
315
+ }
316
+
317
+ $post = $this->getPost();
318
+ if (isset($post) && empty($postId)) {
319
+ $postId = $post->ID;
320
+ }
321
+
322
+ if (strpos($targetData['param'], '_all')) {
323
+ $endIndex = strpos($targetData['param'], '_all');
324
+ $postType = substr($targetData['param'], 0, $endIndex);
325
+ $currentPostType = get_post_type($postId);
326
+
327
+ if ($postType == $currentPostType) {
328
+ $isSatisfy = true;
329
+ }
330
+ }
331
+ else if (strpos($targetData['param'], '_selected')) {
332
+ $values = array();
333
+
334
+ if (!empty($targetData['value'])) {
335
+ $values = array_keys($targetData['value']);
336
+ }
337
+
338
+ if (in_array($postId, $values)) {
339
+ $isSatisfy = true;
340
+ }
341
+ }
342
+ else if ($targetData['param'] == 'post_type' && !empty($targetData['value'])) {
343
+ $selectedCustomPostTypes = array_values($targetData['value']);
344
+ $currentPostType = get_post_type($postId);
345
+
346
+ if (in_array($currentPostType, $selectedCustomPostTypes)) {
347
+ $isSatisfy = true;
348
+ }
349
+ }
350
+ else if ($targetData['param'] == 'post_category' && !empty($targetData['value'])) {
351
+ $values = $targetData['value'];
352
+ $currentPostCategories = get_the_category($postId);
353
+
354
+ foreach ($currentPostCategories as $categoryName) {
355
+ if (in_array($categoryName->term_id, $values)) {
356
+ $isSatisfy = true;
357
+ break;
358
+ }
359
+
360
+ }
361
+ }
362
+ else if ($targetData['param'] == 'page_type' && !empty($targetData['value'])) {
363
+ $postTypes = $targetData['value'];
364
+ foreach ($postTypes as $postType) {
365
+
366
+ if ($postType == 'is_home_page') {
367
+ if (is_front_page() && is_home()) {
368
+ // Default homepage
369
+ $isSatisfy = true;
370
+ break;
371
+ } else if ( is_front_page() ) {
372
+ // static homepage
373
+ $isSatisfy = true;
374
+ break;
375
+ }
376
+ }
377
+ else if ($postType()) {
378
+ $isSatisfy = true;
379
+ break;
380
+ }
381
+ }
382
+ }
383
+ else if ($targetData['param'] == 'page_template' && !empty($targetData['value'])) {
384
+ $currentPageTemplate = basename(get_page_template());
385
+ if (in_array($currentPageTemplate, $targetData['value'])) {
386
+ $isSatisfy = true;
387
+ }
388
+ }
389
+ else if ($targetData['param'] == 'post_tags') {
390
+ if (has_tag()) {
391
+ $isSatisfy = true;
392
+ }
393
+ }
394
+ else if ($targetData['param'] == 'post_tags_ids') {
395
+ $tagsObj = wp_get_post_tags($postId);
396
+ $selectedTags = array_values($targetData['value']);
397
+
398
+ foreach ($tagsObj as $tagObj) {
399
+ if (in_array($tagObj->slug, $selectedTags)) {
400
+ $isSatisfy = true;
401
+ break;
402
+ }
403
+ }
404
+ }
405
+
406
+
407
+ if (!$isSatisfy && do_action('isAllowedForTarget', $targetData, $post)) {
408
+ $isSatisfy = true;
409
+ }
410
+
411
+ return $isSatisfy;
412
+ }
413
+
414
+ /**
415
+ * Divide conditions data to Permissive and Forbidden
416
+ *
417
+ * @since 1.0.0
418
+ *
419
+ * @return array $popupTargetData
420
+ *
421
+ */
422
+ private function divideConditionsData()
423
+ {
424
+ $popup = $this->getPopup();
425
+ $conditions = $popup->getConditions();
426
+ $conditions = $this->divideIntoPermissiveAndForbidden($conditions);
427
+
428
+ return $conditions;
429
+ }
430
+ /**
431
+ * Divide target data to Permissive and Forbidden
432
+ *
433
+ * @since 1.0.0
434
+ *
435
+ * @return array $popupTargetData
436
+ *
437
+ */
438
+ public function divideTargetData()
439
+ {
440
+ $popup = $this->getPopup();
441
+ $targetData = $popup->getTarget();
442
+ return $this->divideIntoPermissiveAndForbidden($targetData);
443
+ }
444
+
445
+ /**
446
+ * Divide the Popup target data into Permissive And Forbidden assoc array
447
+ *
448
+ * @since 1.0.0
449
+ *
450
+ * @param array $postMetaData popup saved target data
451
+ *
452
+ * @return array $postMetaDivideData
453
+ *
454
+ */
455
+ public function divideIntoPermissiveAndForbidden($targetData)
456
+ {
457
+ $permissive = array();
458
+ $forbidden = array();
459
+
460
+ if (!empty($targetData)) {
461
+ foreach ($targetData as $data) {
462
+ if (empty($data['operator'])) {
463
+ break;
464
+ }
465
+
466
+ if ($data['operator'] == '==') {
467
+ $permissive[] = $data;
468
+ }
469
+ else {
470
+ $forbidden[] = $data;
471
+ }
472
+ }
473
+ }
474
+
475
+ $postMetaDivideData = array(
476
+ 'permissive' => $permissive,
477
+ 'forbidden' => $forbidden
478
+ );
479
+
480
+ return $postMetaDivideData;
481
+ }
482
+
483
+ /**
484
+ * Get custom inserted data
485
+ *
486
+ * @since 1.0.0
487
+ *
488
+ * @return array $insertedData
489
+ */
490
+ public function getCustomInsertedData()
491
+ {
492
+ $post = $this->getPost();
493
+ $insertedData = array();
494
+
495
+ if (isset($post)) {
496
+ $insertedData = SGPopup::getCustomInsertedDataByPostId($this->getPost()->ID);
497
+ }
498
+
499
+ return $insertedData;
500
+ }
501
+
502
+ /**
503
+ * Check Popup conditions
504
+ *
505
+ * @since 1.0.0
506
+ *
507
+ * @return array
508
+ *
509
+ */
510
+ private function isSatisfyForOtherConditions()
511
+ {
512
+ $popup = $this->getPopup();
513
+ $popupOptions = $popup->getOptions();
514
+ $popupId = $popup->getId();
515
+
516
+ $dontAlowOpenPopup = apply_filters('sgpbOtherConditions', array('id' => $popupId, 'popupOptions' => $popupOptions));
517
+
518
+ return $dontAlowOpenPopup;
519
+ }
520
+
521
+ public static function checkUserStatus($savedStatus)
522
+ {
523
+ $equalStatus = true;
524
+
525
+ /*When current user status and saved options does not matched popup must not open*/
526
+ if (is_user_logged_in() != (int)$savedStatus) {
527
+ $equalStatus = false;
528
+ }
529
+
530
+ return $equalStatus;
531
+ }
532
+
533
+ public static function popupInSchedule($popupOptions)
534
+ {
535
+ $scheduleStartWeeks = $popupOptions['sgpb-schedule-weeks'];
536
+ $outInSchedule = false;
537
+
538
+ $scheduleStartTime = $popupOptions['sgpb-schedule-start-time'];
539
+ $scheduleEndTime = $popupOptions['sgpb-schedule-end-time'];
540
+
541
+ $currentWeekDayName = date('D');
542
+ if (in_array($currentWeekDayName, $scheduleStartWeeks)) {
543
+
544
+ $timezone = get_option('timezone_string');
545
+ if (!$timezone) {
546
+ $timezone = SG_POPUP_DEFAULT_TIME_ZONE;
547
+ }
548
+
549
+ $date = new DateTime('now', new DateTimeZone($timezone));
550
+ $currentHour = $date->format('H:i');
551
+
552
+ $currentHour = strtotime($currentHour);
553
+ $startTime = strtotime($scheduleStartTime);
554
+ $endTime = strtotime($scheduleEndTime);
555
+
556
+ if (empty($scheduleEndTime)) {
557
+ $endTime = strtotime('23:59:59');
558
+ }
559
+
560
+ if ($currentHour >= $startTime && $currentHour <= $endTime) {
561
+ return true;
562
+ }
563
+ }
564
+
565
+ return $outInSchedule;
566
+ }
567
+
568
+ public static function popupInTimeRange($popupOptions)
569
+ {
570
+ $finishDate = false;
571
+
572
+ $startDate = strtotime($popupOptions['sgpb-popup-start-timer']);
573
+
574
+ if (!empty($popupOptions['sgpb-popup-end-timer'])) {
575
+ $finishDate = strtotime($popupOptions['sgpb-popup-end-timer']);
576
+ }
577
+
578
+ $timezone = ConfigDataHelper::getPopupDefaultTimeZone();
579
+ $timeDate = new DateTime('now', new DateTimeZone($timezone));
580
+ $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
581
+
582
+ if ($finishDate != false && $timeNow > $startDate && $timeNow < $finishDate) {
583
+ return true;
584
+ }
585
+ else if ($finishDate == false && $timeNow > $startDate) {
586
+ return true;
587
+ }
588
+
589
+ return false;
590
+ }
591
+
592
+ public static function checkOtherConditionsActions($args)
593
+ {
594
+ if (empty($args['id']) || empty($args['popupOptions'])) {
595
+ return false;
596
+ }
597
+
598
+ $popupOptions = $args['popupOptions'];
599
+
600
+ // proStartSilver
601
+ //User status check
602
+ if (!empty($popupOptions['sgpb-user-status'])) {
603
+ $restrictUserStatus = PopupChecker::checkUserStatus($popupOptions['sgpb-loggedin-user']);
604
+
605
+ if ($restrictUserStatus === false) {
606
+ return $restrictUserStatus;
607
+ }
608
+ }
609
+
610
+ //schedule checking
611
+ if (!empty($popupOptions['sgpb-schedule-status'])) {
612
+ $isInSchedule = PopupChecker::popupInSchedule($popupOptions);
613
+
614
+ if ($isInSchedule === false) {
615
+ return $isInSchedule;
616
+ }
617
+ }
618
+
619
+ /*Date range checking*/
620
+ if (!empty($popupOptions['sgpb-popup-timer-status'])) {
621
+ $inTimeRange = PopupChecker::popupInTimeRange($popupOptions);
622
+
623
+ if ($inTimeRange === false) {
624
+ return $inTimeRange;
625
+ }
626
+ }
627
+ // proEndSilver
628
+
629
+ // proStartPlatinum
630
+ if (!empty($popupOptions['sgpb-popup-country-status'])) {
631
+ $ipAddress = Functions::getIpAddress();
632
+
633
+ $country = Functions::getCountryName($ipAddress);
634
+ $countriesIso = $popupOptions['sgpb-countries-iso'];
635
+ $allowCountries = $popupOptions['sgpb-allow-countries'];
636
+ $countriesIsoArray = explode(',', $countriesIso);
637
+
638
+ if ($allowCountries == 'allow') {
639
+ $isInArray = in_array($country, $countriesIsoArray);
640
+ if ($isInArray === false) {
641
+ return $isInArray;
642
+ }
643
+ }
644
+ if ($allowCountries == 'disallow') {
645
+ $isInArray = in_array($country, $countriesIsoArray);
646
+ if ($isInArray === true) {
647
+ return false;
648
+ }
649
+ }
650
+ }
651
+ // proEndPlatinum
652
+
653
+ // checking by popup type
654
+ if (!empty($popupOptions['sgpb-type'])) {
655
+ $popupClassName = SGPopup::getPopupClassNameFormType($popupOptions['sgpb-type']);
656
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
657
+
658
+ if (method_exists($popupClassName, 'allowToOpen')) {
659
+ $allowToOpen = $popupClassName::allowToOpen($popupOptions);
660
+ return $allowToOpen;
661
+ }
662
+ }
663
+
664
+ return true;
665
+ }
666
+ }
com/classes/PopupGroupFilter.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class PopupGroupFilter
5
+ {
6
+ private $popups = array();
7
+ private $popupGroups = array();
8
+ private $hasSubPopups = array('subscription', 'contactForm');
9
+
10
+ public function getHasSubPopups()
11
+ {
12
+ return apply_filters('sgpbHasSubPopups', $this->hasSubPopups);
13
+ }
14
+
15
+ public function setGroups($popupGroups)
16
+ {
17
+ $this->popupGroups = $popupGroups;
18
+ }
19
+
20
+ public function getGroups()
21
+ {
22
+ return $this->popupGroups;
23
+ }
24
+
25
+ public function insertGroup($groupName,$group)
26
+ {
27
+ $this->popupGroups[$groupName] = $group;
28
+ }
29
+
30
+ public function setPopups($popups)
31
+ {
32
+ $this->popups = $popups;
33
+ }
34
+
35
+ public function getPopups()
36
+ {
37
+ return $this->popups;
38
+ }
39
+
40
+ public function filter()
41
+ {
42
+ $splitedGroups = $this->splitToGroups();
43
+
44
+ // When does not have any groups, then there is no need do filter
45
+ if (empty($splitedGroups)) {
46
+ return $this->filteredResults();
47
+ }
48
+ $groups = $this->filterGroups();
49
+
50
+ if (empty($groups)) {
51
+ return $this->filteredResults();
52
+ }
53
+ $unionPopups = $this->unionGroups();
54
+
55
+ if (empty($unionPopups)) {
56
+ return $this->filteredResults();
57
+ }
58
+ $this->extendPopups();
59
+
60
+ return $this->filteredResults();
61
+ }
62
+
63
+ private function filteredResults()
64
+ {
65
+ $popups = $this->getPopups();
66
+
67
+ if (empty($popups)) {
68
+ return $popups;
69
+ }
70
+ $filteredResults = $this->filterByOrder();
71
+
72
+ return $filteredResults;
73
+ }
74
+
75
+ public function filterByOrder()
76
+ {
77
+ $popups = $this->getPopups();
78
+ $popupsByKeyOrder = array();
79
+
80
+ foreach ($popups as $popup) {
81
+ if (!$popup instanceof SGPopup) {
82
+ continue;
83
+ }
84
+ $orderId = $popup->getOptionValue('sgpb-popup-order');
85
+ $popupsByKeyOrder[$orderId][] = $popup;
86
+ }
87
+ krsort($popupsByKeyOrder);
88
+ $orderPopups = array();
89
+ foreach ($popupsByKeyOrder as $value) {
90
+ $size = sizeof($value);
91
+ if ($size == 1) {
92
+ $orderPopups[] = $value[0];
93
+ continue;
94
+ }
95
+
96
+ foreach ($value as $insideValue) {
97
+ $orderPopups[] = $insideValue;
98
+ }
99
+
100
+ }
101
+ $orderPopups = array_values($orderPopups);
102
+
103
+ $this->setPopups($orderPopups);
104
+
105
+ return $orderPopups;
106
+ }
107
+
108
+ public function splitToGroups()
109
+ {
110
+ $popups = $this->getPopups();
111
+ $groups = array();
112
+ $randomPopups = SGPopup::getPopupsByTermSlug(SG_RANDOM_TAXONOMY_SLUG);
113
+
114
+ if (empty($popups)) {
115
+ return $popups;
116
+ }
117
+
118
+ foreach ($popups as $popup) {
119
+ if (in_array($popup->getId(), $randomPopups)) {
120
+ $groups['randomPopups'][] = $popup;
121
+ }
122
+ }
123
+ $staticPopups = $popups;
124
+
125
+ if (!empty($groups['randomPopups'])) {
126
+ $staticPopups = array();
127
+ $randomPopupIds = array_map(function ($randomPopup) {
128
+ return $randomPopup->getId();
129
+ }, $groups['randomPopups']);
130
+ foreach ($popups as $popup) {
131
+ if (empty($popup)) {
132
+ continue;
133
+ }
134
+ if (!in_array($popup->getId(), $randomPopupIds)) {
135
+ $staticPopups[] = $popup;
136
+ }
137
+ }
138
+ }
139
+
140
+ $groups['staticPopups'] = $staticPopups;
141
+
142
+ $this->setGroups($groups);
143
+
144
+ return $popups;
145
+ }
146
+
147
+ private function filterGroups()
148
+ {
149
+ $groups = $this->getGroups();
150
+
151
+ if (!empty($groups['randomPopups'])) {
152
+ $groups = $this->filterRandomPopups($groups);
153
+ }
154
+
155
+ $this->setGroups($groups);
156
+
157
+ return $groups;
158
+ }
159
+
160
+ private function filterRandomPopups($groups)
161
+ {
162
+ $randomPopups = $groups['randomPopups'];
163
+ $randomPopupKey = array_rand($randomPopups, 1);
164
+ $randomPopup = $randomPopups[$randomPopupKey];
165
+ // $randomPopup converted to array
166
+ $groups['randomPopups'] = array($randomPopup);
167
+
168
+ return $groups;
169
+ }
170
+
171
+ public function unionGroups()
172
+ {
173
+ $groups = $this->getGroups();
174
+ $popups = array();
175
+
176
+ $groupsPopups = array_values($groups);
177
+ foreach ($groupsPopups as $groupsPopup) {
178
+ $popups = array_merge($popups, $groupsPopup);
179
+ }
180
+
181
+ $this->setPopups($popups);
182
+
183
+ return $popups;
184
+ }
185
+
186
+ private function extendPopups()
187
+ {
188
+ $popups = $this->getPopups();
189
+ $insidePopups = array();
190
+
191
+ if (empty($popups)) {
192
+ return $popups;
193
+ }
194
+
195
+ $hasSubPopups = $this->getHasSubPopups();
196
+
197
+ foreach ($popups as $popup) {
198
+ if (empty($popup)) {
199
+ continue;
200
+ }
201
+ $popupType = $popup->getType();
202
+ $insidePopups = $popup->popupShortcodesInsidePopup();
203
+ if (!empty($insidePopups)) {
204
+ $popups = array_merge($popups, $insidePopups);
205
+ }
206
+
207
+ $subPopups = $popup->getSubPopupObj();
208
+
209
+ if (!empty($subPopups)) {
210
+ $popups = array_merge($popups, $subPopups);
211
+ }
212
+ }
213
+
214
+ $this->setPopups($popups);
215
+
216
+ return $popups;
217
+ }
218
+ }
com/classes/PopupInstaller.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ class PopupInstaller
4
+ {
5
+
6
+ }
com/classes/PopupLoader.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \WP_Query;
4
+
5
+ class PopupLoader
6
+ {
7
+ private static $instance;
8
+ private $loadablePopups = array();
9
+ private $loadablePopupsIds = array();
10
+
11
+ private function __construct()
12
+ {
13
+ require_once(ABSPATH.'wp-admin/includes/plugin.php');
14
+ }
15
+
16
+ public static function instance() {
17
+
18
+ if (!isset(self::$instance)) {
19
+ self::$instance = new self;
20
+ }
21
+
22
+ return self::$instance;
23
+ }
24
+
25
+ public function setLoadablePopupsIds($loadablePopupsIds)
26
+ {
27
+ $this->loadablePopupsIds = $loadablePopupsIds;
28
+ }
29
+
30
+ public function getLoadablePopupsIds()
31
+ {
32
+ return $this->loadablePopupsIds;
33
+ }
34
+
35
+ public function addLoadablePopup($popupObj)
36
+ {
37
+ $this->loadablePopups[] = $popupObj;
38
+ }
39
+
40
+ public function setLoadablePopups($loadablePopups)
41
+ {
42
+ $this->loadablePopups = $loadablePopups;
43
+ }
44
+
45
+ public function getLoadablePopups()
46
+ {
47
+ return $this->loadablePopups;
48
+ }
49
+
50
+ public function addPopupFromUrl($popupsToLoad)
51
+ {
52
+ if (isset($_GET['sg_popup_id'])) {
53
+ $getterId = (int)$_GET['sg_popup_id'];
54
+
55
+ if (function_exists('sgpb\sgpGetCorrectPopupId')) {
56
+ $getterId = sgpGetCorrectPopupId($getterId);
57
+ }
58
+
59
+ $popupFromUrl = SGPopup::find($getterId);
60
+ if (!empty($popupFromUrl) && get_post_status($getterId) == 'publish') {
61
+ global $SGPB_DATA_CONFIG_ARRAY;
62
+ $defaultEvent = array();
63
+ $customDelay = $popupFromUrl->getOptionValue('sgpb-popup-delay');
64
+ $defaultEvent[] = $SGPB_DATA_CONFIG_ARRAY['events']['initialData'][0];
65
+ $defaultEvent[0]['value'] = 0;
66
+ if ($customDelay) {
67
+ $defaultEvent[0]['value'] = $customDelay;
68
+ }
69
+ $popupFromUrl->setEvents($defaultEvent);
70
+ $popupsToLoad[] = $popupFromUrl;
71
+ }
72
+ }
73
+
74
+ return $popupsToLoad;
75
+ }
76
+
77
+ public function loadPopups()
78
+ {
79
+ $foundPopup = array();
80
+ $popupPreviewArgs = array();
81
+ if (is_preview()) {
82
+ global $post;
83
+ $foundPopup = $post;
84
+ }
85
+ // for the first time, when new wordpress with not changed theme
86
+ if (isset($_GET['popup_preview_id'])) {
87
+ $foundPopup = get_post($_GET['popup_preview_id']);
88
+ $popupPreviewArgs = array('preview' => true);
89
+ }
90
+ if (!empty($foundPopup)) {
91
+ global $SGPB_DATA_CONFIG_ARRAY;
92
+ if ($post->post_type == SG_POPUP_POST_TYPE) {
93
+ $targets = array($SGPB_DATA_CONFIG_ARRAY['target']['initialData']);
94
+
95
+ // for any targets preview popup should open
96
+ if (!empty($targets[0][0])) {
97
+ $targets[0][0]['param'] = 'post_all';
98
+ }
99
+
100
+ $popup = SGPopup::find($post);
101
+ if (is_object($popup)) {
102
+ $popup->setTarget($targets);
103
+ }
104
+ }
105
+ if ($foundPopup->post_type == SG_POPUP_POST_TYPE) {
106
+ $popup = SGPopup::find($foundPopup, $popupPreviewArgs);
107
+
108
+ $popup->setEvents($SGPB_DATA_CONFIG_ARRAY['events']['initialData'][0]);
109
+ $this->addLoadablePopup($popup);
110
+ $this->doGroupFiltersPopups();
111
+ $popups = $this->getLoadablePopups();
112
+
113
+ $scriptsLoader = new ScriptsLoader();
114
+ $scriptsLoader->setLoadablePopups($popups);
115
+ $scriptsLoader->loadToFooter();
116
+ return;
117
+ }
118
+ }
119
+
120
+ $popupBuilderPosts = new WP_Query(
121
+ array(
122
+ 'post_type' => SG_POPUP_POST_TYPE,
123
+ 'posts_per_page' => - 1
124
+ )
125
+ );
126
+ // We check all the popups one by one to realize whether they might be loaded or not.
127
+ while ($popupBuilderPosts->have_posts()) {
128
+ $popupBuilderPosts->next_post();
129
+ $popupPost = $popupBuilderPosts->post;
130
+ $popup = SGPopup::find($popupPost);
131
+ if (empty($popup)) {
132
+ continue;
133
+ }
134
+ if ($popup->allowToLoad() || (is_preview() && get_post_type() == SG_POPUP_POST_TYPE)) {
135
+ $this->addLoadablePopup($popup);
136
+ }
137
+ }
138
+
139
+
140
+ $this->doGroupFiltersPopups();
141
+ $popups = $this->getLoadablePopups();
142
+
143
+ $scriptsLoader = new ScriptsLoader();
144
+ $scriptsLoader->setLoadablePopups($popups);
145
+ $scriptsLoader->loadToFooter();
146
+ }
147
+
148
+ private function doGroupFiltersPopups()
149
+ {
150
+ $popups = $this->getLoadablePopups();
151
+ $popups = $this->addPopupFromUrl($popups);
152
+ $groupObj = new PopupGroupFilter();
153
+ $groupObj->setPopups($popups);
154
+ $popups = $groupObj->filter();
155
+ $this->setLoadablePopups($popups);
156
+ }
157
+ }
com/classes/PopupType.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ class PopupType
4
+ {
5
+ private $available = false;
6
+ private $name = '';
7
+ private $accessLevel = 1;
8
+
9
+ public function setName($name)
10
+ {
11
+ $this->name = $name;
12
+ }
13
+ public function getName()
14
+ {
15
+ return $this->name;
16
+ }
17
+
18
+ public function setAvailable($available)
19
+ {
20
+ $this->available = $available;
21
+ }
22
+
23
+ public function isAvailable()
24
+ {
25
+ return $this->available;
26
+ }
27
+
28
+ public function setAccessLevel($accessLevel)
29
+ {
30
+ $this->accessLevel = $accessLevel;
31
+ }
32
+
33
+ public function getAccessLevel()
34
+ {
35
+ return $this->accessLevel;
36
+ }
37
+ }
com/classes/RegisterPostType.php ADDED
@@ -0,0 +1,584 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \SgpbDataConfig;
4
+ use \SgpbPopupConfig;
5
+
6
+ class RegisterPostType
7
+ {
8
+ private $popupTypeObj;
9
+ private $popupType;
10
+ private $popupId;
11
+
12
+ public function setPopupType($popupType)
13
+ {
14
+ $this->popupType = $popupType;
15
+ }
16
+
17
+ public function getPopupType()
18
+ {
19
+ return $this->popupType;
20
+ }
21
+
22
+ public function setPopupId($popupId)
23
+ {
24
+ $this->popupId = $popupId;
25
+ }
26
+
27
+ public function getPopupId()
28
+ {
29
+ return $this->popupId;
30
+ }
31
+
32
+ public function __construct()
33
+ {
34
+ if (!AdminHelper::showMenuForCurrentUser()) {
35
+ return false;
36
+ }
37
+ // its need here to an apply filters for add popup types needed data
38
+ SgpbPopupConfig::popupTypesInit();
39
+ $this->init();
40
+ // Call init data configs apply filters
41
+ SgpbDataConfig::init();
42
+
43
+ return true;
44
+ }
45
+
46
+ public function setPopupTypeObj($popupTypeObj)
47
+ {
48
+ $this->popupTypeObj = $popupTypeObj;
49
+ }
50
+
51
+ public function getPopupTypeObj()
52
+ {
53
+ return $this->popupTypeObj;
54
+ }
55
+
56
+ public function getPostTypeArgs()
57
+ {
58
+ $labels = $this->getPostTypeLabels();
59
+
60
+ $args = array(
61
+ 'labels' => $labels,
62
+ 'description' => __('Description.', 'your-plugin-textdomain'),
63
+ // Exclude_from_search
64
+ 'public' => true,
65
+ 'has_archive' => true,
66
+ // Where to show the post type in the admin menu
67
+ 'show_ui' => true,
68
+ 'query_var' => false,
69
+ 'rewrite' => array('slug' => SG_POPUP_POST_TYPE),
70
+ 'map_meta_cap' => true,
71
+ 'capability_type' => array('sgpb_popup', 'sgpb_popups'),
72
+ 'menu_position' => 10,
73
+ 'supports' => apply_filters('sgpbPostTypeSupport', array('title', 'editor')),
74
+ 'menu_icon' => 'dashicons-menu-icon-sgpb'
75
+ );
76
+
77
+ if (is_admin()) {
78
+ $args['capability_type'] = 'post';
79
+ }
80
+
81
+ return $args;
82
+ }
83
+
84
+ public function getPostTypeLabels()
85
+ {
86
+ $labels = array(
87
+ 'name' => _x('Popups', 'post type general name', SG_POPUP_TEXT_DOMAIN),
88
+ 'singular_name' => _x('Popup', 'post type singular name', SG_POPUP_TEXT_DOMAIN),
89
+ 'menu_name' => _x('Popup Builder', 'admin menu', SG_POPUP_TEXT_DOMAIN),
90
+ 'name_admin_bar' => _x('Popup', 'add new on admin bar', SG_POPUP_TEXT_DOMAIN),
91
+ 'add_new' => _x('Add New', 'Popup', SG_POPUP_TEXT_DOMAIN),
92
+ 'add_new_item' => __('Add New Popup', SG_POPUP_TEXT_DOMAIN),
93
+ 'new_item' => __('New Popup', SG_POPUP_TEXT_DOMAIN),
94
+ 'edit_item' => __('Edit Popup', SG_POPUP_TEXT_DOMAIN),
95
+ 'view_item' => __('View Popup', SG_POPUP_TEXT_DOMAIN),
96
+ 'all_items' => __('All Popups', SG_POPUP_TEXT_DOMAIN),
97
+ 'search_items' => __('Search Popups', SG_POPUP_TEXT_DOMAIN),
98
+ 'parent_item_colon' => __('Parent Popups:', SG_POPUP_TEXT_DOMAIN),
99
+ 'not_found' => __('No popups found.', SG_POPUP_TEXT_DOMAIN),
100
+ 'not_found_in_trash' => __('No popups found in Trash.', SG_POPUP_TEXT_DOMAIN)
101
+ );
102
+
103
+ return $labels;
104
+ }
105
+
106
+ public function registerTaxonomy()
107
+ {
108
+ $labels = array(
109
+ 'name' => _x('Categories', 'taxonomy general name', SG_POPUP_TEXT_DOMAIN),
110
+ 'singular_name' => _x('Categories', 'taxonomy singular name', SG_POPUP_TEXT_DOMAIN),
111
+ 'search_items' => __('Search Categories', SG_POPUP_TEXT_DOMAIN),
112
+ 'popular_items' => __('Popular Categories', SG_POPUP_TEXT_DOMAIN),
113
+ 'all_items' => __('All Categories', SG_POPUP_TEXT_DOMAIN),
114
+ 'parent_item' => null,
115
+ 'parent_item_colon' => null,
116
+ 'edit_item' => __('Edit Category', SG_POPUP_TEXT_DOMAIN),
117
+ 'update_item' => __('Update Category', SG_POPUP_TEXT_DOMAIN),
118
+ 'add_new_item' => __('Add New Category', SG_POPUP_TEXT_DOMAIN),
119
+ 'new_item_name' => __('New Category Name', SG_POPUP_TEXT_DOMAIN),
120
+ 'separate_items_with_commas' => __('Separate Categories with commas', SG_POPUP_TEXT_DOMAIN),
121
+ 'add_or_remove_items' => __('Add or remove Categories', SG_POPUP_TEXT_DOMAIN),
122
+ 'choose_from_most_used' => __('Choose from the most used Categories', SG_POPUP_TEXT_DOMAIN),
123
+ 'not_found' => __('No Categories found.', SG_POPUP_TEXT_DOMAIN),
124
+ 'menu_name' => __('Categories', SG_POPUP_TEXT_DOMAIN),
125
+ );
126
+
127
+ $args = array(
128
+ 'hierarchical' => true,
129
+ 'labels' => $labels,
130
+ 'show_ui' => true,
131
+ 'show_admin_column' => true,
132
+ 'sort' => 12,
133
+ 'update_count_callback' => '_update_post_term_count',
134
+ 'query_var' => true,
135
+ 'capabilities' => array(
136
+ 'manage_terms' => 'manage_popup_categories_terms',
137
+ 'edit_terms' => 'manage_popup_categories_terms',
138
+ 'assign_terms' => 'manage_popup_categories_terms',
139
+ 'delete_terms' => 'manage_popup_categories_terms'
140
+ )
141
+ );
142
+
143
+ register_taxonomy(SG_POPUP_CATEGORY_TAXONOMY, SG_POPUP_POST_TYPE, $args);
144
+ register_taxonomy_for_object_type(SG_POPUP_CATEGORY_TAXONOMY, SG_POPUP_POST_TYPE);
145
+
146
+ if (SGPB_POPUP_PKG >= SGPB_POPUP_PKG_SILVER) {
147
+ wp_insert_term(
148
+ __('Random popups', SG_POPUP_TEXT_DOMAIN),
149
+ SG_POPUP_CATEGORY_TAXONOMY, // the taxonomy
150
+ array(
151
+ 'description' => __('Random popups', SG_POPUP_TEXT_DOMAIN),
152
+ 'slug' => SG_RANDOM_TAXONOMY_SLUG,
153
+ 'parent' => '',
154
+ 'can_disable_terms' => false,
155
+ )
156
+ );
157
+ }
158
+ }
159
+
160
+ public function postTypeSupportForPopupTypes($supports)
161
+ {
162
+ $popupType = $this->getPopupTypeName();
163
+ $typePath = $this->getPopupTypePathFormPopupType($popupType);
164
+ $popupClassName = $this->getPopupClassNameFromPopupType($popupType);
165
+
166
+ if (!file_exists($typePath.$popupClassName.'.php')) {
167
+ return $supports;
168
+ }
169
+
170
+ require_once($typePath.$popupClassName.'.php');
171
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
172
+
173
+ // We need to remove wyswyg editor for some popup types and that’s why we are doing this check.
174
+ if (method_exists($popupClassName, 'getPopupTypeSupports')) {
175
+ $supports = $popupClassName::getPopupTypeSupports();
176
+ }
177
+
178
+ return $supports;
179
+ }
180
+
181
+ public function init()
182
+ {
183
+ add_filter('sgpbPostTypeSupport', array($this, 'postTypeSupportForPopupTypes'), 1, 1);
184
+ $postType = SG_POPUP_POST_TYPE;
185
+ $args = $this->getPostTypeArgs();
186
+
187
+ register_post_type($postType, $args);
188
+
189
+ $this->createPopupObjFromPopupType();
190
+ $this->registerTaxonomy();
191
+ }
192
+
193
+ private function createPopupObjFromPopupType()
194
+ {
195
+ $popupId = 0;
196
+
197
+ if (!empty($_GET['post'])) {
198
+ $popupId = (int)$_GET['post'];
199
+ }
200
+
201
+ $popupType = $this->getPopupTypeName();
202
+ $this->setPopupType($popupType);
203
+ $this->setPopupId($popupId);
204
+
205
+ $this->createPopupObj();
206
+ }
207
+
208
+ private function getPopupTypeName()
209
+ {
210
+ $popupType = 'html';
211
+
212
+ /*
213
+ * First, we try to find the popup type with the post id then,
214
+ * if the post id doesn't exist, we try to find it with $_GET['sgpb_type']
215
+ */
216
+ if (!empty($_GET['post'])) {
217
+ $popupId = $_GET['post'];
218
+ $popupOptionsData = SGPopup::getPopupOptionsById($popupId);
219
+ if (!empty($popupOptionsData['sgpb-type'])) {
220
+ $popupType = $popupOptionsData['sgpb-type'];
221
+ }
222
+ }
223
+ else if (!empty($_GET['sgpb_type'])) {
224
+ $popupType = $_GET['sgpb_type'];
225
+ }
226
+
227
+ return $popupType;
228
+ }
229
+
230
+ private function getPopupClassNameFromPopupType($popupType)
231
+ {
232
+ $popupName = ucfirst(strtolower($popupType));
233
+ $popupClassName = $popupName.'Popup';
234
+
235
+ return $popupClassName;
236
+ }
237
+
238
+ private function getPopupTypePathFormPopupType($popupType)
239
+ {
240
+ global $SGPB_POPUP_TYPES;
241
+ $typePath = '';
242
+
243
+ if (!empty($SGPB_POPUP_TYPES['typePath'][$popupType])) {
244
+ $typePath = $SGPB_POPUP_TYPES['typePath'][$popupType];
245
+ }
246
+
247
+ return $typePath;
248
+ }
249
+
250
+ public function createPopupObj()
251
+ {
252
+ $popupId = $this->getPopupId();
253
+ $popupType = $this->getPopupType();
254
+ $typePath = $this->getPopupTypePathFormPopupType($popupType);
255
+ $popupClassName = $this->getPopupClassNameFromPopupType($popupType);
256
+
257
+ if (!file_exists($typePath.$popupClassName.'.php')) {
258
+ die(__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
259
+ }
260
+ require_once($typePath.$popupClassName.'.php');
261
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
262
+ $popupTypeObj = new $popupClassName();
263
+ $popupTypeObj->setId($popupId);
264
+ $this->setPopupTypeObj($popupTypeObj);
265
+
266
+ $popupTypeMainView = $popupTypeObj->getPopupTypeMainView();
267
+ $popupTypeViewData = $popupTypeObj->getPopupTypeOptionsView();
268
+
269
+ if (!empty($popupTypeMainView)) {
270
+ add_action('add_meta_boxes', array($this, 'popupTypeMain'));
271
+ }
272
+ if (!empty($popupTypeViewData)) {
273
+ add_action('add_meta_boxes', array($this, 'popupTypeOptions'));
274
+ }
275
+ }
276
+
277
+ public function popupTypeMain()
278
+ {
279
+ $popupTypeObj = $this->getPopupTypeObj();
280
+ $optionsView = $popupTypeObj->getPopupTypeMainView();
281
+ add_meta_box(
282
+ 'popupTypeMainView',
283
+ __($optionsView['metaboxTitle'], SG_POPUP_TEXT_DOMAIN),
284
+ array($this, 'popupTypeMainView'),
285
+ SG_POPUP_POST_TYPE,
286
+ 'normal',
287
+ 'high'
288
+ );
289
+ }
290
+
291
+ public function popupTypeOptions()
292
+ {
293
+ $popupTypeObj = $this->getPopupTypeObj();
294
+ $optionsView = $popupTypeObj->getPopupTypeOptionsView();
295
+ add_meta_box(
296
+ 'popupTypeOptionsView',
297
+ __($optionsView['metaboxTitle'], SG_POPUP_TEXT_DOMAIN),
298
+ array($this, 'popupTypeOptionsView'),
299
+ SG_POPUP_POST_TYPE,
300
+ 'normal',
301
+ 'high'
302
+ );
303
+ }
304
+
305
+ public function addSubMenu()
306
+ {
307
+ add_submenu_page(
308
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
309
+ __('Add New', SG_POPUP_TEXT_DOMAIN),
310
+ __('Add New', SG_POPUP_TEXT_DOMAIN),
311
+ 'sgpb_manage_options',
312
+ SG_POPUP_POST_TYPE,
313
+ array($this, 'popupTypesPage')
314
+ );
315
+
316
+ add_submenu_page(
317
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
318
+ __('Subscribers', SG_POPUP_TEXT_DOMAIN),
319
+ __('Subscribers', SG_POPUP_TEXT_DOMAIN),
320
+ 'sgpb_manage_options',
321
+ 'subscribers',
322
+ array($this, 'subscribersPage')
323
+ );
324
+
325
+ add_submenu_page(
326
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
327
+ __('Newsletter', SG_POPUP_TEXT_DOMAIN),
328
+ __('Newsletter', SG_POPUP_TEXT_DOMAIN),
329
+ 'sgpb_manage_options',
330
+ SG_POPUP_NEWSLETTER_PAGE,
331
+ array($this, 'newsletter')
332
+ );
333
+
334
+ add_submenu_page(
335
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
336
+ __('Settings', SG_POPUP_TEXT_DOMAIN),
337
+ __('Settings', SG_POPUP_TEXT_DOMAIN),
338
+ 'manage_options',
339
+ SG_POPUP_SETTINGS_PAGE,
340
+ array($this, 'settings')
341
+ );
342
+ }
343
+
344
+ public function addTargetMetaBox()
345
+ {
346
+ add_meta_box(
347
+ 'targetMetaboxView',
348
+ __('Popup Display Rules', SG_POPUP_TEXT_DOMAIN),
349
+ array($this, 'targetMetaboxView'),
350
+ SG_POPUP_POST_TYPE,
351
+ 'normal',
352
+ 'low'
353
+ );
354
+ }
355
+
356
+ public function addEventMetaBox()
357
+ {
358
+ add_meta_box(
359
+ 'eventsMetaboxView',
360
+ __('Popup Events', SG_POPUP_TEXT_DOMAIN),
361
+ array($this, 'eventsMetaboxView'),
362
+ SG_POPUP_POST_TYPE,
363
+ 'normal',
364
+ 'low'
365
+ );
366
+ }
367
+
368
+ public function addConditionsMetaBox()
369
+ {
370
+ $prolabel = '';
371
+ $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupConditionsSection');
372
+ if (!$conditionsCanBeUsed) {
373
+ $prolabel .= '<a href="'.SG_POPUP_PRO_URL.'" target="_blank" class="sgpb-pro-label-metabox">';
374
+ $prolabel .= __('Upgrade to PRO', SG_POPUP_TEXT_DOMAIN).'</a>';
375
+ }
376
+ add_meta_box(
377
+ 'conditionsMetaboxView',
378
+ __('Popup Conditions', SG_POPUP_TEXT_DOMAIN).$prolabel,
379
+ array($this, 'conditionsView'),
380
+ SG_POPUP_POST_TYPE,
381
+ 'normal',
382
+ 'low'
383
+ );
384
+ }
385
+
386
+ public function addBehaviorAfterSpecialEventsMetaBox()
387
+ {
388
+ add_meta_box(
389
+ 'behaviorAfterSpecialEventsMetaboxView',
390
+ __('Behavior After Special Events', SG_POPUP_TEXT_DOMAIN),
391
+ array($this, 'behaviorAfterSpecialEventsView'),
392
+ SG_POPUP_POST_TYPE,
393
+ 'normal',
394
+ 'low'
395
+ );
396
+ }
397
+
398
+ public function popupDesignMetaBox()
399
+ {
400
+ add_meta_box(
401
+ 'popupDesignMetaBoxView',
402
+ __('Design', SG_POPUP_TEXT_DOMAIN),
403
+ array($this, 'popupDesignMetaBoxView'),
404
+ SG_POPUP_POST_TYPE,
405
+ 'normal',
406
+ 'low'
407
+ );
408
+ }
409
+
410
+ public function addCloseSettingsMetaBox()
411
+ {
412
+ if (Functions::getPopupTypeToAllowToShowMetabox() != 'ageRestriction') {
413
+ add_meta_box(
414
+ 'closeSettings',
415
+ __('Close Settings', SG_POPUP_TEXT_DOMAIN),
416
+ array($this, 'closeSettings'),
417
+ SG_POPUP_POST_TYPE,
418
+ 'normal',
419
+ 'low'
420
+ );
421
+ }
422
+ }
423
+
424
+ public function addDimensionsSettingsMetaBox()
425
+ {
426
+ add_meta_box(
427
+ 'spgdimension',
428
+ __('Dimensions', SG_POPUP_TEXT_DOMAIN),
429
+ array($this, 'dimensionsSettings'),
430
+ SG_POPUP_POST_TYPE,
431
+ 'normal',
432
+ 'low'
433
+ );
434
+ }
435
+
436
+ public function addOptionsMetaBox()
437
+ {
438
+ add_meta_box(
439
+ 'optionsMetaboxView',
440
+ __('Popup Options', SG_POPUP_TEXT_DOMAIN),
441
+ array($this, 'optionsMetaboxView'),
442
+ SG_POPUP_POST_TYPE,
443
+ 'normal',
444
+ 'low'
445
+ );
446
+ }
447
+
448
+ public function addOtherConditions()
449
+ {
450
+ $prolabel = '';
451
+ $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupOtherConditionsSection');
452
+ if (!$conditionsCanBeUsed) {
453
+ $prolabel .= '<a href="'.SG_POPUP_PRO_URL.'" target="_blank" class="sgpb-pro-label-metabox">';
454
+ $prolabel .= __('Upgrade to PRO', SG_POPUP_TEXT_DOMAIN).'</a>';
455
+ }
456
+ add_meta_box(
457
+ 'otherConditionsMetaBoxView',
458
+ __('Popup other Conditions',
459
+ SG_POPUP_TEXT_DOMAIN).$prolabel,
460
+ array($this, 'otherConditionsView'),
461
+ SG_POPUP_POST_TYPE,
462
+ 'normal',
463
+ 'low'
464
+ );
465
+ }
466
+
467
+ public function targetMetaboxView()
468
+ {
469
+ $popupTypeObj = $this->getPopupTypeObj();
470
+ if (file_exists(SG_POPUP_VIEWS_PATH.'targetView.php')) {
471
+ require_once(SG_POPUP_VIEWS_PATH.'targetView.php');
472
+ }
473
+ }
474
+
475
+ public function eventsMetaboxView()
476
+ {
477
+ $popupTypeObj = $this->getPopupTypeObj();
478
+ if (file_exists(SG_POPUP_VIEWS_PATH.'eventsView.php')) {
479
+ require_once(SG_POPUP_VIEWS_PATH.'eventsView.php');
480
+ }
481
+ }
482
+
483
+ public function conditionsView()
484
+ {
485
+ $popupTypeObj = $this->getPopupTypeObj();
486
+ if (file_exists(SG_POPUP_VIEWS_PATH.'conditionsView.php')) {
487
+ require_once(SG_POPUP_VIEWS_PATH.'conditionsView.php');
488
+ }
489
+ }
490
+
491
+ public function behaviorAfterSpecialEventsView()
492
+ {
493
+ $popupTypeObj = $this->getPopupTypeObj();
494
+ if (file_exists(SG_POPUP_VIEWS_PATH.'behaviorAfterSpecialEventsView.php')) {
495
+ require_once(SG_POPUP_VIEWS_PATH.'behaviorAfterSpecialEventsView.php');
496
+ }
497
+ }
498
+
499
+ public function popupDesignMetaBoxView()
500
+ {
501
+ $popupTypeObj = $this->getPopupTypeObj();
502
+ if (file_exists(SG_POPUP_VIEWS_PATH.'popupDesignView.php')) {
503
+ require_once(SG_POPUP_VIEWS_PATH.'popupDesignView.php');
504
+ }
505
+ }
506
+
507
+ public function closeSettings()
508
+ {
509
+ $popupTypeObj = $this->getPopupTypeObj();
510
+ if (file_exists(SG_POPUP_VIEWS_PATH.'closeSettingsView.php')) {
511
+ require_once(SG_POPUP_VIEWS_PATH.'closeSettingsView.php');
512
+ }
513
+ }
514
+
515
+ public function popupTypesPage()
516
+ {
517
+ if (file_exists(SG_POPUP_VIEWS_PATH.'popupTypes.php')) {
518
+ require_once(SG_POPUP_VIEWS_PATH.'popupTypes.php');
519
+ }
520
+ }
521
+
522
+ public function subscribersPage()
523
+ {
524
+ if (file_exists(SG_POPUP_VIEWS_PATH.'subscribers.php')) {
525
+ require_once(SG_POPUP_VIEWS_PATH . 'subscribers.php');
526
+ }
527
+ }
528
+
529
+ public function settings()
530
+ {
531
+ if (file_exists(SG_POPUP_VIEWS_PATH.'settings.php')) {
532
+ require_once(SG_POPUP_VIEWS_PATH.'settings.php');
533
+ }
534
+ }
535
+
536
+ public function newsletter()
537
+ {
538
+ if (file_exists(SG_POPUP_VIEWS_PATH.'newsletter.php')) {
539
+ require_once(SG_POPUP_VIEWS_PATH.'newsletter.php');
540
+ }
541
+ }
542
+
543
+ public function optionsMetaboxView()
544
+ {
545
+ $popupTypeObj = $this->getPopupTypeObj();
546
+ if (file_exists(SG_POPUP_VIEWS_PATH.'optionsView.php')) {
547
+ require_once(SG_POPUP_VIEWS_PATH.'optionsView.php');
548
+ }
549
+ }
550
+
551
+ public function dimensionsSettings()
552
+ {
553
+ $popupTypeObj = $this->getPopupTypeObj();
554
+ if (file_exists(SG_POPUP_VIEWS_PATH.'dimensionsView.php')) {
555
+ require_once(SG_POPUP_VIEWS_PATH.'dimensionsView.php');
556
+ }
557
+ }
558
+
559
+ public function otherConditionsView()
560
+ {
561
+ $popupTypeObj = $this->getPopupTypeObj();
562
+ if (file_exists(SG_POPUP_VIEWS_PATH.'otherConditionsView.php')) {
563
+ require_once(SG_POPUP_VIEWS_PATH.'otherConditionsView.php');
564
+ }
565
+ }
566
+
567
+ public function popupTypeOptionsView()
568
+ {
569
+ $popupTypeObj = $this->getPopupTypeObj();
570
+ $optionsView = $popupTypeObj->getPopupTypeOptionsView();
571
+ if (file_exists($optionsView['filePath'])) {
572
+ require_once($optionsView['filePath']);
573
+ }
574
+ }
575
+
576
+ public function popupTypeMainView()
577
+ {
578
+ $popupTypeObj = $this->getPopupTypeObj();
579
+ $optionsView = $popupTypeObj->getPopupTypeMainView();
580
+ if (file_exists($optionsView['filePath'])) {
581
+ require_once($optionsView['filePath']);
582
+ }
583
+ }
584
+ }
helpers/Helper_functions.php → com/classes/SGPBRequirementsChecker.php RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
- class HelperFunctions {
3
-
4
- private function checkPhpVersion() {
 
 
 
5
 
 
 
6
  if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
7
  wp_die('Popup Builder plugin requires PHP version >= '.SG_POPUP_MINIMUM_PHP_VERSION.' version required. You server using PHP version = '.PHP_VERSION);
8
  }
9
  }
 
10
 
11
- public static function checkRequirements() {
12
-
13
- $helperObj = new self();
14
- $helperObj->checkPhpVersion();
15
- }
16
- }
1
  <?php
2
+ class SGPBRequirementsChecker
3
+ {
4
+ public static function init()
5
+ {
6
+ self::checkPhpVersion();
7
+ }
8
 
9
+ public static function checkPhpVersion()
10
+ {
11
  if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
12
  wp_die('Popup Builder plugin requires PHP version >= '.SG_POPUP_MINIMUM_PHP_VERSION.' version required. You server using PHP version = '.PHP_VERSION);
13
  }
14
  }
15
+ }
16
 
 
 
 
 
 
 
com/classes/ScriptsLoader.php ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace sgpb;
4
+
5
+ // load popups data's from popups object
6
+ class ScriptsLoader
7
+ {
8
+ // all loadable popups objects
9
+ private $loadablePopups = array();
10
+ private $isAdmin = false;
11
+
12
+ public function setLoadablePopups($loadablePopups)
13
+ {
14
+ $this->loadablePopups = $loadablePopups;
15
+ }
16
+
17
+ public function getLoadablePopups()
18
+ {
19
+ return apply_filters('sgpbLoadablePopups', $this->loadablePopups);
20
+ }
21
+
22
+ public function setIsAdmin($isAdmin)
23
+ {
24
+ $this->isAdmin = $isAdmin;
25
+ }
26
+
27
+ public function getIsAdmin()
28
+ {
29
+ return $this->isAdmin;
30
+ }
31
+
32
+ // load popup scripts and styles and add popup data to the footer
33
+ public function loadToFooter()
34
+ {
35
+ $popups = $this->getLoadablePopups();
36
+
37
+ if (empty($popups)) {
38
+ return false;
39
+ }
40
+
41
+ if ($this->getIsAdmin()) {
42
+ $this->loadToAdmin();
43
+ return true;
44
+ }
45
+
46
+ global $post;
47
+ if (empty($post)) {
48
+ return false;
49
+ }
50
+ $postId = $post->ID;
51
+
52
+ foreach ($popups as $popup) {
53
+ $popupId = $popup->getId();
54
+
55
+ $extraOptions = $popup->getExtraRenderOptions();
56
+ $events = $popup->getPopupAllEvents($postId, $popupId);
57
+
58
+ $events = json_encode($events);
59
+
60
+ $popupOptions = $popup->getOptions();
61
+ $popupOptions = apply_filters('sgpbPopupRenderOptions', $popupOptions);
62
+
63
+ $popupOptions = array_merge($popupOptions, $extraOptions);
64
+
65
+ $popupOptions = AdminHelper::serializeData($popupOptions);
66
+ $popupOptions = htmlspecialchars($popupOptions);
67
+
68
+ $popupContent = apply_filters('sgpbPopupContentLoadToPage', $popup->getPopupTypeContent());
69
+
70
+ add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
71
+ $footerPopupContent = '<div style="position:absolute;top: -999999999999999999999px;">
72
+ <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.$popupId.'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
73
+ <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
74
+ </div>
75
+ </div>';
76
+
77
+ echo $footerPopupContent;
78
+ });
79
+ }
80
+ $this->includeScripts();
81
+ $this->includeStyles();
82
+ }
83
+
84
+ public function loadToAdmin()
85
+ {
86
+ $popups = $this->getLoadablePopups();
87
+
88
+ foreach ($popups as $popup) {
89
+ $popupId = $popup->getId();
90
+
91
+ $extraOptions = $popup->getExtraRenderOptions();
92
+ $events = array();
93
+
94
+ $events = json_encode($events);
95
+
96
+ $popupOptions = $popup->getOptions();
97
+ $popupOptions = apply_filters('sgpbPopupRenderOptions', $popupOptions);
98
+
99
+ $popupOptions = array_merge($popupOptions, $extraOptions);
100
+
101
+ $popupOptions = AdminHelper::serializeData($popupOptions);
102
+ $popupOptions = htmlspecialchars($popupOptions);
103
+
104
+ $popupContent = apply_filters('sgpbPopupContentLoadToPage', $popup->getPopupTypeContent());
105
+
106
+ add_action('admin_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
107
+ $footerPopupContent = '<div style="position:absolute;top: -999999999999999999999px;">
108
+ <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.$popupId.'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
109
+ <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
110
+ </div>
111
+ </div>';
112
+
113
+ echo $footerPopupContent;
114
+ });
115
+ }
116
+ $this->includeScripts();
117
+ $this->includeStyles();
118
+
119
+ }
120
+
121
+ private function includeScripts()
122
+ {
123
+ global $post;
124
+ $popups = $this->getLoadablePopups();
125
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
126
+
127
+ if (!$registeredPlugins) {
128
+ return;
129
+ }
130
+ $registeredPlugins = json_decode($registeredPlugins, true);
131
+
132
+ if (empty($registeredPlugins)) {
133
+ return;
134
+ }
135
+
136
+ foreach ($registeredPlugins as $pluginName => $pluginData) {
137
+
138
+ if (!is_plugin_active($pluginName)) {
139
+ continue;
140
+ }
141
+
142
+ if (empty($pluginData['classPath']) || empty($pluginData['className'])) {
143
+ continue;
144
+ }
145
+
146
+ if (!file_exists($pluginData['classPath'])) {
147
+ continue;
148
+ }
149
+
150
+ require_once($pluginData['classPath']);
151
+
152
+ $classObj = new $pluginData['className']();
153
+ $extensionInterface = 'SgpbIPopupExtension';
154
+
155
+ if (!$classObj instanceof $extensionInterface) {
156
+ continue;
157
+ }
158
+
159
+ $scriptData = $classObj->getFrontendScripts(
160
+ $post, array(
161
+ 'popups' => $popups
162
+ )
163
+ );
164
+
165
+ $scripts[] = $scriptData;
166
+ }
167
+
168
+ if (empty($scripts)) {
169
+ return;
170
+ }
171
+
172
+ foreach ($scripts as $script) {
173
+ if (empty($script['jsFiles'])) {
174
+ continue;
175
+ }
176
+
177
+ foreach ($script['jsFiles'] as $jsFile) {
178
+
179
+ if (empty($jsFile['folderUrl'])) {
180
+ wp_enqueue_script(@$jsFile['filename']);
181
+ continue;
182
+ }
183
+
184
+ $dirUrl = $jsFile['folderUrl'];
185
+ $dep = (!empty($jsFile['dep'])) ? $jsFile['dep'] : '';
186
+ $ver = (!empty($jsFile['ver'])) ? $jsFile['ver'] : '';
187
+ $inFooter = (!empty($jsFile['inFooter'])) ? $jsFile['inFooter'] : '';
188
+
189
+ ScriptsIncluder::registerScript($jsFile['filename'], array(
190
+ 'dirUrl' => $dirUrl,
191
+ 'dep' => $dep,
192
+ 'ver' => $ver,
193
+ 'inFooter' => $inFooter
194
+ )
195
+ );
196
+ ScriptsIncluder::enqueueScript($jsFile['filename']);
197
+ }
198
+
199
+ if (empty($script['localizeData'])) {
200
+ continue;
201
+ }
202
+
203
+ $localizeData = $script['localizeData'];
204
+
205
+ if (!empty($localizeData[0])) {
206
+ foreach ($localizeData as $valueData) {
207
+ if (empty($valueData)) {
208
+ continue;
209
+
210
+ }
211
+
212
+ ScriptsIncluder::localizeScript($valueData['handle'], $valueData['name'], $valueData['data']);
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ private function includeStyles()
219
+ {
220
+ global $post;
221
+ $styles = array();
222
+ $popups = $this->getLoadablePopups();
223
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
224
+
225
+ if (!$registeredPlugins) {
226
+ return;
227
+ }
228
+ $registeredPlugins = json_decode($registeredPlugins, true);
229
+
230
+ if (empty($registeredPlugins)) {
231
+ return;
232
+ }
233
+
234
+ foreach ($registeredPlugins as $pluginName => $pluginData) {
235
+
236
+ if (!is_plugin_active($pluginName)) {
237
+ continue;
238
+ }
239
+
240
+ if (empty($pluginData['classPath']) || empty($pluginData['className'])) {
241
+ continue;
242
+ }
243
+
244
+ if (!file_exists($pluginData['classPath'])) {
245
+ continue;
246
+ }
247
+
248
+ require_once($pluginData['classPath']);
249
+
250
+ $classObj = new $pluginData['className']();
251
+ $extensionInterface = 'SgpbIPopupExtension';
252
+
253
+ if (!$classObj instanceof $extensionInterface) {
254
+ continue;
255
+ }
256
+
257
+ $scriptData = $classObj->getFrontendStyles(
258
+ $post , array(
259
+ 'popups' => $popups
260
+ )
261
+ );
262
+
263
+ $styles[] = $scriptData;
264
+ }
265
+
266
+ if (empty($styles)) {
267
+ return;
268
+ }
269
+
270
+ foreach ($styles as $style) {
271
+
272
+ if (empty($style['cssFiles'])) {
273
+ continue;
274
+ }
275
+
276
+ foreach ($style['cssFiles'] as $cssFile) {
277
+
278
+ if (empty($cssFile['folderUrl'])) {
279
+ ScriptsIncluder::enqueueStyle($cssFile['filename']);
280
+ continue;
281
+ }
282
+
283
+ $dirUrl = $cssFile['folderUrl'];
284
+ $dep = (!empty($cssFile['dep'])) ? $cssFile['dep'] : '';
285
+ $ver = (!empty($cssFile['ver'])) ? $cssFile['ver'] : '';
286
+ $inFooter = (!empty($cssFile['inFooter'])) ? $cssFile['inFooter'] : '';
287
+
288
+ ScriptsIncluder::registerStyle($cssFile['filename'], array(
289
+ 'dirUrl' => $dirUrl,
290
+ 'dep' => $dep,
291
+ 'ver' => $ver,
292
+ 'inFooter' => $inFooter
293
+ )
294
+ );
295
+ ScriptsIncluder::enqueueStyle($cssFile['filename']);
296
+ }
297
+ }
298
+ }
299
+ }
com/classes/Style.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ /**
5
+ * Popup Builder Style
6
+ *
7
+ * @since 2.5.6
8
+ *
9
+ * detect and include popup styles to the admin pages
10
+ *
11
+ */
12
+ class Style
13
+ {
14
+ public static function enqueueStyles($hook)
15
+ {
16
+ global $post;
17
+ global $post_type;
18
+ $pageName = $hook;
19
+ $styles = array();
20
+ $currentPostType = @$post->post_type;
21
+ // in some themes global $post returns null
22
+ if (empty($currentPostType)) {
23
+ $currentPostType = $post_type;
24
+ }
25
+
26
+ if ($hook == 'popupbuilder_page_popupbuilder') {
27
+ $pageName = 'popupType';
28
+ }
29
+ else if (($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
30
+ $pageName = 'editpage';
31
+ }
32
+ else if ($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
33
+ $pageName = 'popupspage';
34
+ }
35
+ else if ($hook == 'popupbuilder_page_subscribers') {
36
+ $pageName = 'subscribers';
37
+ }
38
+
39
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
40
+
41
+ if (!$registeredPlugins) {
42
+ return;
43
+ }
44
+ $registeredPlugins = json_decode($registeredPlugins, true);
45
+
46
+ if (empty($registeredPlugins)) {
47
+ return;
48
+ }
49
+
50
+ foreach ($registeredPlugins as $pluginName => $pluginData) {
51
+
52
+ if (!is_plugin_active($pluginName)) {
53
+ continue;
54
+ }
55
+
56
+ if (empty($pluginData['classPath']) || empty($pluginData['className'])) {
57
+ continue;
58
+ }
59
+
60
+ if (!file_exists($pluginData['classPath'])) {
61
+ continue;
62
+ }
63
+
64
+ require_once($pluginData['classPath']);
65
+
66
+ if (!class_exists($pluginData['className'])) {
67
+ continue;
68
+ }
69
+
70
+ $classObj = new $pluginData['className']();
71
+ $extensionInterface = 'SgpbIPopupExtension';
72
+
73
+ if (!$classObj instanceof $extensionInterface) {
74
+ continue;
75
+ }
76
+
77
+ $styleData = $classObj->getStyles($pageName , array());
78
+ if (!empty($styleData['cssFiles'])) {
79
+ $styles[] = $styleData;
80
+ }
81
+ }
82
+
83
+ if (empty($styles)) {
84
+ return;
85
+ }
86
+
87
+ foreach ($styles as $style) {
88
+
89
+ if (empty($style['cssFiles'])) {
90
+ continue;
91
+ }
92
+
93
+ foreach ($style['cssFiles'] as $cssFile) {
94
+
95
+ if (empty($cssFile['folderUrl'])) {
96
+ ScriptsIncluder::enqueueStyle($cssFile['filename']);
97
+ continue;
98
+ }
99
+
100
+ $dirUrl = $cssFile['folderUrl'];
101
+ $dep = (!empty($cssFile['dep'])) ? $cssFile['dep'] : '';
102
+ $ver = (!empty($cssFile['ver'])) ? $cssFile['ver'] : '';
103
+ $inFooter = (!empty($cssFile['inFooter'])) ? $cssFile['inFooter'] : '';;
104
+
105
+ ScriptsIncluder::registerStyle($cssFile['filename'], array(
106
+ 'dirUrl'=> $dirUrl,
107
+ 'dep' => $dep,
108
+ 'ver' => $ver,
109
+ 'inFooter' => $inFooter
110
+ )
111
+ );
112
+ ScriptsIncluder::enqueueStyle($cssFile['filename']);
113
+ }
114
+ }
115
+
116
+ if ($hook == SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_POST_TYPE) {
117
+ ScriptsIncluder::enqueueStyle('popupAdminStyles.css');
118
+ }
119
+ }
120
+ }
com/classes/Updates.php ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ if (!class_exists('sgpb\EDD_SL_Plugin_Updater')) {
5
+ // load our custom updater if it doesn't already exist
6
+ require_once(SG_POPUP_LIBS_PATH .'EDD_SL_Plugin_Updater.php');
7
+ }
8
+
9
+ class Updates
10
+ {
11
+ private $licenses = array();
12
+
13
+ public function setLicenses($licenses)
14
+ {
15
+ $this->licenses = $licenses;
16
+ }
17
+
18
+ public function getLicenses()
19
+ {
20
+ return $this->licenses;
21
+ }
22
+
23
+ public function __construct()
24
+ {
25
+ $this->init();
26
+ }
27
+
28
+ public function setRegisterdExtensionsLicenses()
29
+ {
30
+ $registered = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
31
+ $registered = json_decode($registered, true);
32
+
33
+ if (empty($registered)) {
34
+ return false;
35
+ }
36
+ $licenses = array();
37
+ foreach ($registered as $register) {
38
+
39
+ if (empty($register['options']['licence'])) {
40
+ continue;
41
+ }
42
+
43
+ $licenses[] = $register['options']['licence'];
44
+ }
45
+
46
+ $this->setLicenses($licenses);
47
+
48
+ return true;
49
+ }
50
+
51
+ private function init()
52
+ {
53
+ $this->setRegisterdExtensionsLicenses();
54
+ $licenses = $this->getLicenses();
55
+
56
+ if (empty($licenses)) {
57
+ return false;
58
+ }
59
+ add_action('admin_menu', array($this, 'menu'), 22);
60
+ add_action('admin_init', array($this, 'sgpbActivateLicense'));
61
+ add_action('admin_notices', array($this, 'sgpbAdminNotices'));
62
+
63
+ $licenses = $this->getLicenses();
64
+
65
+ foreach ($licenses as $license) {
66
+ $key = $license['key'];
67
+ $storeURL = $license['storeURL'];
68
+ $pluginMainFilePath = $license['file'];
69
+ $licenseKey = trim(get_option('sgpb-license-key-'.$key));
70
+ $status = get_option('sgpb-license-status-'.$key);
71
+
72
+ if ($status == false || $status != 'valid') {
73
+ continue;
74
+ }
75
+
76
+ $version = @constant('SG_VERSION_'.$key);
77
+ $sgpbUpdater = new EDD_SL_Plugin_Updater($storeURL, $pluginMainFilePath, array(
78
+ 'version' => $version, // current version number
79
+ 'license' => $licenseKey, // license key (used get_option above to retrieve from DB)
80
+ 'item_id' => $license['itemId'], // id of this plugin
81
+ 'author' => $license['autor'], // author of this plugin
82
+ 'url' => home_url(),
83
+ 'beta' => false // set to true if you wish customers to receive update notifications of beta releases
84
+ ));
85
+ }
86
+
87
+ return true;
88
+ }
89
+
90
+ public function menu()
91
+ {
92
+ add_submenu_page('edit.php?post_type='.SG_POPUP_POST_TYPE, __('License', SG_POPUP_TEXT_DOMAIN), __('License', SG_POPUP_TEXT_DOMAIN), 'sgpb_manage_options', SGPB_POPUP_LICENSE, array($this, 'pluginLicense'));
93
+ }
94
+
95
+ public function sanitizeLicense($new)
96
+ {
97
+ $old = get_option('sgpb-license-key-'.$this->licenseKey);
98
+
99
+ if ($old && $old != $new) {
100
+ delete_option('sgpb-license-status-'.$this->licenseKey); // new license has been entered, so must reactivate
101
+ }
102
+ update_option('sgpb-license-key-'.$this->licenseKey, $new);
103
+
104
+ return $new;
105
+ }
106
+
107
+ public function pluginLicense()
108
+ {
109
+ require_once(SG_POPUP_VIEWS_PATH.'license.php');
110
+ }
111
+
112
+ public function sgpbActivateLicense()
113
+ {
114
+ $licenses = $this->getLicenses();
115
+
116
+ foreach ($licenses as $license) {
117
+ $key = $license['key'];
118
+ $itemId = $license['itemId'];
119
+ $itemName = $license['itemName'];
120
+ $storeURL = $license['storeURL'];
121
+ $this->licenseKey = $key;
122
+
123
+ if (isset($_POST['sgpb-license-key-'.$key])) {
124
+ $this->sanitizeLicense($_POST['sgpb-license-key-'.$key]);
125
+ }
126
+
127
+ // listen for our activate button to be clicked
128
+ if (isset($_POST['sgpb-license-activate-'.$key])) {
129
+ // run a quick security check
130
+ if (!check_admin_referer('sgpb_nonce', 'sgpb_nonce')) {
131
+ return; // get out if we didn't click the Activate button
132
+ }
133
+ // retrieve the license from the database
134
+ $license = trim(get_option('sgpb-license-key-'.$key));
135
+ // data to send in our API request
136
+ $apiParams = array(
137
+ 'edd_action' => 'activate_license',
138
+ 'license' => $license,
139
+ 'item_id' => $itemId, // The ID of the item in EDD
140
+ 'url' => home_url()
141
+ );
142
+ // Call the custom API.
143
+ $response = wp_remote_post($storeURL, array('timeout' => 15, 'sslverify' => false, 'body' => $apiParams));
144
+ // make sure the response came back okay
145
+ if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
146
+ $errorMessage = $response->get_error_message();
147
+ $message = (is_wp_error($response) && ! empty($errorMessage)) ? $errorMessage : __('An error occurred, please try again.', SG_POPUP_TEXT_DOMAIN);
148
+ }
149
+ else {
150
+ $licenseData = json_decode(wp_remote_retrieve_body($response));
151
+ if (false === $licenseData->success) {
152
+ switch ($licenseData->error) {
153
+ case 'expired' :
154
+ $message = sprintf(
155
+ __('Your license key expired on %s.', SG_POPUP_TEXT_DOMAIN),
156
+ date_i18n(get_option('date_format'), strtotime($licenseData->expires, current_time('timestamp')))
157
+ );
158
+ break;
159
+ case 'revoked' :
160
+ $message = __('Your license key has been disabled.', SG_POPUP_TEXT_DOMAIN);
161
+ break;
162
+ case 'missing' :
163
+ $message = __('Invalid license.', SG_POPUP_TEXT_DOMAIN);
164
+ break;
165
+ case 'invalid' :
166
+ case 'site_inactive' :
167
+ $message = __('Your license is not active for this URL.',SG_POPUP_TEXT_DOMAIN);
168
+ break;
169
+ case 'item_name_mismatch' :
170
+ $message = sprintf(__('This appears to be an invalid license key for %s.', SG_POPUP_TEXT_DOMAIN), $itemName);
171
+ break;
172
+ case 'no_activations_left' :
173
+ $message = __('Invalid license key for current site.', SG_POPUP_TEXT_DOMAIN);
174
+ break;
175
+ default :
176
+ $message = __('An error occurred, please try again.', SG_POPUP_TEXT_DOMAIN);
177
+ break;
178
+ }
179
+ }
180
+ }
181
+ // Check if anything passed on a message constituting a failure
182
+ if (!empty($message)) {
183
+ $baseUrl = admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE);
184
+ $redirect = add_query_arg(array('sl_activation' => 'false', 'message' => urlencode($message)), $baseUrl);
185
+ wp_redirect($redirect);
186
+ exit();
187
+ }
188
+ // $licenseData->license will be either "valid" or "invalid"
189
+ update_option('sgpb-license-status-'.$key, $licenseData->license);
190
+ wp_redirect(admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE));
191
+ exit();
192
+ }
193
+
194
+ if (isset($_POST['sgpb-license-deactivate'.$key])) {
195
+ $license = trim(get_option('sgpb-license-key-'.$key));
196
+ // data to send in our API request
197
+ $apiParams = array(
198
+ 'edd_action' => 'deactivate_license',
199
+ 'license' => $license,
200
+ 'item_id' => $itemId, // The ID of the item in EDD
201
+ 'url' => home_url()
202
+ );
203
+
204
+ // Send the remote request
205
+ $response = wp_remote_post($storeURL, array('body' => $apiParams, 'timeout' => 15, 'sslverify' => false));
206
+ if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
207
+ $errorMessage = $response->get_error_message();
208
+ $message = (is_wp_error($response) && ! empty($errorMessage)) ? $errorMessage : __('An error occurred, please try again.', SG_POPUP_TEXT_DOMAIN);
209
+ $baseUrl = admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE);
210
+ $redirect = add_query_arg(array('message' => urlencode($message)), $baseUrl);
211
+ wp_redirect($redirect);
212
+ exit();
213
+ }
214
+ else {
215
+ $status = false;
216
+ $licenseData = json_decode(wp_remote_retrieve_body($response));
217
+ if (isset($licenseData->success)) {
218
+ $status = $licenseData->success;
219
+ }
220
+ update_option('sgpb-license-status-'.$key, $status);
221
+ wp_redirect(admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE));
222
+ exit();
223
+ }
224
+ }
225
+ }
226
+ }
227
+
228
+ public function sgpbAdminNotices()
229
+ {
230
+ if (isset($_GET['sl_activation']) && !empty($_GET['message'])) {
231
+ switch ($_GET['sl_activation']) {
232
+ case 'false':
233
+ $message = urldecode($_GET['message']);
234
+ ?>
235
+ <div class="error">
236
+ <p><?php echo $message; ?></p>
237
+ </div>
238
+ <?php
239
+ break;
240
+ case 'true':
241
+ break;
242
+ }
243
+ }
244
+ }
245
+ }
246
+
247
+ new Updates();
com/classes/dataTable/Subscribers.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(SG_POPUP_CLASSES_PATH.'/Ajax.php');
4
+ require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
5
+
6
+ use sgpb\SGPopup;
7
+ use sgpb\AdminHelper;
8
+ use sgpbDataTable\SGPBTable;
9
+
10
+ class Subscribers extends SGPBTable
11
+ {
12
+ public function __construct()
13
+ {
14
+ global $wpdb;
15
+ parent::__construct('');
16
+
17
+ $this->setRowsPerPage(SGPB_APP_POPUP_TABLE_LIMIT);
18
+ $this->setTablename($wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME);
19
+ $this->setColumns(array(
20
+ $this->tablename.'.id',
21
+ 'firstName',
22
+ 'lastName',
23
+ 'email',
24
+ 'cDate',
25
+ $wpdb->prefix.SGPB_POSTS_TABLE_NAME.'.post_title AS subscriptionType'
26
+ ));
27
+ $this->setDisplayColumns(array(
28
+ 'bulk'=>'<input class="subs-bulk" type="checkbox" autocomplete="off">',
29
+ 'id' => 'ID',
30
+ 'firstName' => __('First name', SG_POPUP_TEXT_DOMAIN),
31
+ 'lastName' => __('Last name', SG_POPUP_TEXT_DOMAIN),
32
+ 'email' => __('Email', SG_POPUP_TEXT_DOMAIN),
33
+ 'cDate' => __('Date', SG_POPUP_TEXT_DOMAIN),
34
+ 'subscriptionType' => __('Popup', SG_POPUP_TEXT_DOMAIN)
35
+ ));
36
+ $this->setSortableColumns(array(
37
+ 'id' => array('id', false),
38
+ 'firstName' => array('firstName', true),
39
+ 'lastName' => array('lastName', true),
40
+ 'email' => array('email', true),
41
+ 'cDate' => array('cDate', true),
42
+ 'subscriptionType' => array('subscriptionType', true),
43
+ $this->setInitialSort(array(
44
+ 'id' => 'DESC'
45
+ ))
46
+ ));
47
+ }
48
+
49
+ public function customizeRow(&$row)
50
+ {
51
+ $row[6] = $row[5];
52
+ $row[5] = $row[4];
53
+ $row[4] = $row[3];
54
+ $row[3] = $row[2];
55
+ $row[2] = $row[1];
56
+ $row[1] = $row[0];
57
+
58
+ // show date more user friendly
59
+ $row[5] = date('d F Y', strtotime($row[5]));
60
+
61
+ $id = $row[0];
62
+ $row[0] = '<input type="checkbox" class="subs-delete-checkbox" data-delete-id="'.esc_attr($id).'">';
63
+ }
64
+
65
+ public function customizeQuery(&$query)
66
+ {
67
+ $query = AdminHelper::subscribersRelatedQuery($query);
68
+ }
69
+ }
com/classes/extension/SgpbIPopupExtension.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ interface SgpbIPopupExtension
3
+ {
4
+ /*It's Admin scripts*/
5
+ public function getScripts($page, $data);
6
+ public function getStyles($page, $data);
7
+ /*It's frontend scripts*/
8
+ public function getFrontendScripts($page, $data);
9
+ public function getFrontendStyles($page, $data);
10
+ }
com/classes/extension/SgpbPopupExtension.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(SG_POPUP_EXTENSION_PATH.'SgpbIPopupExtension.php');
3
+ use sgpb\AdminHelper;
4
+
5
+ class SgpbPopupExtension implements SgpbIPopupExtension
6
+ {
7
+ public function getNewsletterPageKey()
8
+ {
9
+ return SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_NEWSLETTER_PAGE;
10
+ }
11
+
12
+ public function getSettingsPageKey()
13
+ {
14
+ return SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_SETTINGS_PAGE;
15
+ }
16
+
17
+ public function getScripts($pageName, $data)
18
+ {
19
+ $jsFiles = array();
20
+ $localizeData = array();
21
+ $translatedData = ConfigDataHelper::getJsLocalizedData();
22
+ $newsletterPage = $this->getNewsletterPageKey();
23
+ $settingsPage = $this->getSettingsPageKey();
24
+
25
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'ExtensionsNotification.js');
26
+ $localizeData[] = array(
27
+ 'handle' => 'ExtensionsNotification.js',
28
+ 'name' => 'SGPB_JS_EXTENSIONS_PARAMS',
29
+ 'data' => array(
30
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
31
+ )
32
+ );
33
+
34
+ $allowPages = array(
35
+ 'popupType',
36
+ 'editpage',
37
+ 'popupspage',
38
+ $newsletterPage,
39
+ $settingsPage
40
+ );
41
+
42
+ if ($pageName == $newsletterPage) {
43
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Newsletter.js');
44
+ }
45
+
46
+ if (in_array($pageName, $allowPages)) {
47
+ $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
48
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
49
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
50
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'jquery.datetimepicker.full.min.js');
51
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'bootstrap.min.js');
52
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgPopupRangeSlider.js');
53
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Backend.js');
54
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js');
55
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js');
56
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Banner.js');
57
+
58
+ $localizeData[] = array(
59
+ 'handle' => 'Backend.js',
60
+ 'name' => 'SGPB_JS_PARAMS',
61
+ 'data' => array(
62
+ 'url' => admin_url('admin-ajax.php'),
63
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
64
+ )
65
+ );
66
+
67
+ $localizeData[] = array(
68
+ 'handle' => 'sgpbSelect2.js',
69
+ 'name' => 'SGPB_JS_PACKAGES',
70
+ 'data' => array(
71
+ 'packages' => array(
72
+ 'current' => SGPB_POPUP_PKG,
73
+ 'free' => SGPB_POPUP_PKG_FREE,
74
+ 'silver' => SGPB_POPUP_PKG_SILVER,
75
+ 'gold' => SGPB_POPUP_PKG_GOLD,
76
+ 'platinum' => SGPB_POPUP_PKG_PLATINUM
77
+ )
78
+ )
79
+ );
80
+
81
+ $localizeData[] = array(
82
+ 'handle' => 'Banner.js',
83
+ 'name' => 'SGPB_JS_PARAMS',
84
+ 'data' => array(
85
+ 'url' => admin_url('admin-ajax.php'),
86
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
87
+ )
88
+ );
89
+
90
+ $localizeData[] = array(
91
+ 'handle' => 'Backend.js',
92
+ 'name' => 'SGPB_JS_LOCALIZATION',
93
+ 'data' => $translatedData
94
+ );
95
+
96
+ $localizeData[] = array(
97
+ 'handle' => 'Popup.js',
98
+ 'name' => 'sgpbPublicUrl',
99
+ 'data' => SG_POPUP_PUBLIC_URL
100
+ );
101
+ }
102
+ else if ($pageName == 'subscribers') {
103
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
104
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
105
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Subscribers.js');
106
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Banner.js');
107
+
108
+ $localizeData[] = array(
109
+ 'handle' => 'Subscribers.js',
110
+ 'name' => 'SGPB_JS_PARAMS',
111
+ 'data' => array(
112
+ 'url' => admin_url('admin-ajax.php'),
113
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE),
114
+ 'packages' => array(
115
+ 'current' => SGPB_POPUP_PKG,
116
+ 'silver' => SGPB_POPUP_PKG_SILVER,
117
+ 'gold' => SGPB_POPUP_PKG_GOLD,
118
+ 'platinum' => SGPB_POPUP_PKG_PLATINUM
119
+ )
120
+ )
121
+ );
122
+
123
+ $localizeData[] = array(
124
+ 'handle' => 'sgpbSelect2.js',
125
+ 'name' => 'SGPB_JS_PACKAGES',
126
+ 'data' => array(
127
+ 'packages' => array(
128
+ 'current' => SGPB_POPUP_PKG,
129
+ 'free' => SGPB_POPUP_PKG_FREE,
130
+ 'silver' => SGPB_POPUP_PKG_SILVER,
131
+ 'gold' => SGPB_POPUP_PKG_GOLD,
132
+ 'platinum' => SGPB_POPUP_PKG_PLATINUM
133
+ )
134
+ )
135
+ );
136
+
137
+ $localizeData[] = array(
138
+ 'handle' => 'Subscribers.js',
139
+ 'name' => 'SGPB_JS_ADMIN_URL',
140
+ 'data' => array(
141
+ 'url' => SG_POPUP_ADMIN_URL.'admin-post.php',
142
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
143
+ )
144
+ );
145
+
146
+ $localizeData[] = array(
147
+ 'handle' => 'Subscribers.js',
148
+ 'name' => 'SGPB_JS_LOCALIZATION',
149
+ 'data' => $translatedData
150
+ );
151
+
152
+ $localizeData[] = array(
153
+ 'handle' => 'Banner.js',
154
+ 'name' => 'SGPB_JS_PARAMS',
155
+ 'data' => array(
156
+ 'url' => admin_url('admin-ajax.php'),
157
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
158
+ )
159
+ );
160
+ }
161
+
162
+ $scriptData = array(
163
+ 'jsFiles' => apply_filters('sgpbAdminJsFiles', $jsFiles),
164
+ 'localizeData' => apply_filters('sgpbAdminJsLocalizedData', $localizeData)
165
+ );
166
+
167
+ $scriptData = apply_filters('sgpbAdminJs', $scriptData);
168
+
169
+ return $scriptData;
170
+ }
171
+
172
+ public function getStyles($pageName, $data)
173
+ {
174
+ $cssFiles = array();
175
+ $newsletterPage = $this->getNewsletterPageKey();
176
+ $settingsPage = $this->getSettingsPageKey();
177
+
178
+ $allowPages = array(
179
+ 'popupType',
180
+ 'editpage',
181
+ 'popupspage',
182
+ $newsletterPage,
183
+ $settingsPage
184
+ );
185
+
186
+ if (in_array($pageName, $allowPages)) {
187
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'jquery.dateTimePicker.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
188
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
189
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
190
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
191
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgPopupRangeSlider.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
192
+ $cssFiles[] = array('folderUrl' => '', 'filename' => 'wp-color-picker');
193
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'animate.css');
194
+ }
195
+ else if ($pageName == 'subscribers') {
196
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
197
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
198
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
199
+ }
200
+
201
+ $cssData = array(
202
+ 'cssFiles' => apply_filters('sgpbAdminCssFiles', $cssFiles)
203
+ );
204
+ return $cssData;
205
+ }
206
+
207
+ public function getFrontendScripts($page, $popupObjs)
208
+ {
209
+ $jsFiles = array();
210
+ $localizeData = array();
211
+ $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
212
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js');
213
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js', 'dep' => array('Popup.js'));
214
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilder.js', 'dep' => array('jquery'));
215
+ if (SGPB_POPUP_PKG >= SGPB_POPUP_PKG_SILVER) {
216
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilderProFunctionality.js', 'dep' => array('jquery'));
217
+ }
218
+
219
+ $localizeData[] = array(
220
+ 'handle' => 'PopupBuilder.js',
221
+ 'name' => 'SGPB_POPUP_PARAMS',
222
+ 'data' => array(
223
+ 'popupTypeAgeRestriction' => SGPB_POPUP_TYPE_AGE_RESTRICTION,
224
+ 'defaultThemeImages' => array(
225
+ 1 => AdminHelper::defaultButtonImage('sgpb-theme-1'),
226
+ 2 => AdminHelper::defaultButtonImage('sgpb-theme-2'),
227
+ 3 => AdminHelper::defaultButtonImage('sgpb-theme-3'),
228
+ 5 => AdminHelper::defaultButtonImage('sgpb-theme-5'),
229
+ 6 => AdminHelper::defaultButtonImage('sgpb-theme-6')
230
+ ),
231
+ 'homePageUrl' => get_home_url().'/',
232
+ 'isPreview' => is_preview(),
233
+ 'convertedIdsReverse' => AdminHelper::getReverseConvertIds(),
234
+ 'dontShowPopupExpireTime' => SGPB_DONT_SHOW_POPUP_EXPIRY
235
+ )
236
+ );
237
+ $localizeData[] = array(
238
+ 'handle' => 'PopupBuilder.js',
239
+ 'name' => 'SGPB_JS_PACKAGES',
240
+ 'data' => array(
241
+ 'packages' => array(
242
+ 'current' => SGPB_POPUP_PKG,
243
+ 'free' => SGPB_POPUP_PKG_FREE,
244
+ 'silver' => SGPB_POPUP_PKG_SILVER,
245
+ 'gold' => SGPB_POPUP_PKG_GOLD,
246
+ 'platinum' => SGPB_POPUP_PKG_PLATINUM
247
+ )
248
+ )
249
+ );
250
+
251
+ $localizeData[] = array(
252
+ 'handle' => 'Popup.js',
253
+ 'name' => 'sgpbPublicUrl',
254
+ 'data' => SG_POPUP_PUBLIC_URL
255
+ );
256
+
257
+ $localizeData[] = array(
258
+ 'handle' => 'Popup.js',
259
+ 'name' => 'SGPB_JS_PARAMS',
260
+ 'data' => array(
261
+ 'ajaxUrl' => admin_url('admin-ajax.php'),
262
+ 'nonce' => wp_create_nonce(SG_AJAX_NONCE)
263
+ )
264
+ );
265
+
266
+ $scriptData = array(
267
+ 'jsFiles' => apply_filters('sgpbFrontendJsFiles', $jsFiles),
268
+ 'localizeData' => apply_filters('sgpbFrontendJsLocalizedData', $localizeData)
269
+ );
270
+
271
+ $scriptData = apply_filters('sgpbFrontendJs', $scriptData);
272
+
273
+ return $scriptData;
274
+ }
275
+
276
+ public function getFrontendStyles($page, $data)
277
+ {
278
+ $cssFiles = array();
279
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'theme.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
280
+ $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'animate.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
281
+
282
+ $cssData = array(
283
+ 'cssFiles' => apply_filters('sgpbFrontendCssFiles', $cssFiles)
284
+ );
285
+
286
+ return $cssData;
287
+ }
288
+ }
com/classes/extension/SgpbPopupExtensionRegister.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SgpbPopupExtensionRegister
3
+ {
4
+ public static function register($pluginName, $classPath, $className, $options = array())
5
+ {
6
+ $registeredData = array();
7
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
8
+
9
+ if(!empty($registeredPlugins)) {
10
+ $registeredData = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
11
+ }
12
+
13
+ if (!empty($registeredData)) {
14
+ $registeredData = json_decode($registeredData, true);
15
+ }
16
+
17
+ if(empty($registeredData)) {
18
+ $registeredData = array();
19
+ }
20
+
21
+ if(empty($classPath) || empty($className)) {
22
+ if(!empty($registeredData[$pluginName])) {
23
+ /*Delete the plugin from the registered plugins' list if the class name or the class path is empty.*/
24
+ unset($registeredData[$pluginName]);
25
+ update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
26
+ }
27
+
28
+ return;
29
+ }
30
+ $pluginData['classPath'] = $classPath;
31
+ $pluginData['className'] = $className;
32
+ $pluginData['options'] = $options;
33
+
34
+ $registeredData[$pluginName] = $pluginData;
35
+ $registeredData = json_encode($registeredData);
36
+
37
+ update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
38
+ }
39
+
40
+ public static function remove($pluginName)
41
+ {
42
+ $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
43
+
44
+ if (!$registeredPlugins) {
45
+ return false;
46
+ }
47
+
48
+ $registeredData = json_decode($registeredPlugins, true);
49
+
50
+ if(empty($registeredData)) {
51
+ return false;
52
+ }
53
+
54
+ if (empty($registeredData[$pluginName])) {
55
+ return false;
56
+ }
57
+ unset($registeredData[$pluginName]);
58
+ $registeredData = json_encode($registeredData);
59
+
60
+ update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
61
+
62
+ return true;
63
+ }
64
+ }
com/classes/popups/FblikePopup.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ require_once(dirname(__FILE__).'/SGPopup.php');
4
+
5
+ class FblikePopup extends SGPopup
6
+ {
7
+ public function getOptionValue($optionName, $forceDefaultValue = false)
8
+ {
9
+ return parent::getOptionValue($optionName, $forceDefaultValue);
10
+ }
11
+
12
+ public function getPopupTypeOptionsView()
13
+ {
14
+ return array(
15
+ 'filePath' => SG_POPUP_TYPE_OPTIONS_PATH.'facebook.php',
16
+ 'metaboxTitle' => 'Facebook Options'
17
+ );
18
+ }
19
+
20
+ private function getScripts()
21
+ {
22
+ /*get WordPress localization name*/
23
+ $locale = $this->getSiteLocale();
24
+ ob_start();
25
+ ?>
26
+ <script>
27
+ jQuery(window).on('sgpbDidOpen', function (e) {
28
+ var sgpbOldCB = window.fbAsyncInit;
29
+ window.fbAsyncInit = function () {
30
+ if (typeof sgpbOldCB === 'function') {
31
+ sgpbOldCB();
32
+ }
33
+ FB.init({
34
+ appId: <?php echo SGPB_FACEBOOK_APP_ID;?>
35
+ });
36
+ };
37
+ (function(d, s, id) {
38
+ var js, fjs = d.getElementsByTagName(s)[0];
39
+ if (d.getElementById(id)) return;
40
+ js = d.createElement(s); js.id = id;
41
+ js.src = 'https://connect.facebook.net/<?php echo $locale;?>/all.js#xfbml=1&version=v2.11&appId=<?php echo SGPB_FACEBOOK_APP_ID;?>';
42
+ fjs.parentNode.insertBefore(js, fjs);
43
+ }(document, 'script', 'facebook-jssdk'));
44
+ });
45
+ </script>
46
+ <?php
47
+ $scripts = ob_get_contents();
48
+ ob_get_clean();
49
+
50
+ return $scripts;
51
+ }
52
+
53
+ private function getButtonConfig($shareUrl, $layout, $shareButtonStatus)
54
+ {
55
+ ob_start();
56
+ ?>
57
+ <div class='sg-fb-buttons-wrapper sgpb-fb-wrapper-<?php echo $layout;?>'>
58
+ <div class="fb-like"
59
+ data-href="<?php echo $shareUrl; ?>"
60
+ data-layout="<?php echo $layout; ?>"
61
+ data-action="like"
62
+ data-size="small"
63
+ data-show-faces="true"
64
+ data-share="<?php echo $shareButtonStatus; ?>">
65
+ </div>
66
+ </div>
67
+ <?php
68
+ $buttonConfig = ob_get_contents();
69
+ ob_get_clean();
70
+
71
+ return $buttonConfig;
72
+ }
73
+
74
+ private function getFblikeContent()
75
+ {
76
+ $options = $this->getOptions();
77
+ $shareUrl = $options['sgpb-fblike-like-url'];
78
+ $layout = $options['sgpb-fblike-layout'];
79
+ $shareButtonStatus = true;
80
+ if (!empty($options['sgpb-fblike-dont-show-share-button'])) {
81
+ $shareButtonStatus = false;
82
+ }
83
+
84
+ $scripts = $this->getScripts();
85
+ $buttonConfig = $this->getButtonConfig($shareUrl, $layout, $shareButtonStatus);
86
+ ob_start();
87
+ ?>
88
+ <div id="sg-facebook-like">
89
+ <div id="fb-root"></div>
90
+ <?php echo $buttonConfig; ?>
91
+ <?php echo $scripts; ?>
92
+ </div>
93
+ <?php
94
+ $content = ob_get_contents();
95
+ ob_get_clean();
96
+
97
+ return $content;
98
+ }
99
+
100
+ public function getPopupTypeContent()
101
+ {
102
+ $fbLikeContent = $this->getFblikeContent();
103
+ $popupContent = $this->getContent();
104
+ $popupContent .= $fbLikeContent;
105
+
106
+ return $popupContent;
107
+ }
108
+
109
+ public function getExtraRenderOptions()
110
+ {
111
+ return array();
112
+ }
113
+ }
com/classes/popups/HtmlPopup.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ require_once(dirname(__FILE__).'/SGPopup.php') ;
4
+ class HtmlPopup extends SGPopup {
5
+
6
+ public function __construct() {
7
+ add_filter('sgpbFrontendJsFiles', array($this, 'popupFrontJsFilter'),1,1);
8
+ add_filter('sgpbAdminJsFiles', array($this, 'popupAdminJsFilter'),1,1);
9
+ }
10
+
11
+ public function popupFrontJsFilter($jsFiles)
12
+ {
13
+ return $jsFiles;
14
+ }
15
+
16
+ public function popupAdminJsFilter($jsFiles)
17
+ {
18
+ return $jsFiles;
19
+ }
20
+
21
+ public function getOptionValue($optionName, $forceDefaultValue = false)
22
+ {
23
+ return parent::getOptionValue($optionName, $forceDefaultValue);
24
+ }
25
+
26
+ public function getPopupTypeOptionsView()
27
+ {
28
+ return array();
29
+ }
30
+
31
+ public function getPopupTypeMainView()
32
+ {
33
+ return array();
34
+ }
35
+
36
+ public function getPopupTypeContent()
37
+ {
38
+ $htmlContent = '';
39
+ $popupContent = $this->getContent();
40
+
41
+ $htmlContent .= '<div class="sgpb-main-html-content-wrapper">';
42
+ $htmlContent .= $popupContent;
43
+ $htmlContent .= '</div>';
44
+ return $htmlContent;
45
+ }
46
+
47
+ public function getExtraRenderOptions()
48
+ {
49
+ return array();
50
+ }
51
+ }
com/classes/popups/ImagePopup.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ require_once(dirname(__FILE__).'/SGPopup.php');
4
+
5
+ class ImagePopup extends SGPopup
6
+ {
7
+ public function popupFrontJsFilter($jsFiles)
8
+ {
9
+ return $jsFiles;
10
+ }
11
+
12
+ public function popupAdminJsFilter($jsFiles)
13
+ {
14
+ return $jsFiles;
15
+ }
16
+
17
+ public function getOptionValue($optionName, $forceDefaultValue = false)
18
+ {
19
+ return parent::getOptionValue($optionName, $forceDefaultValue);
20
+ }
21
+
22
+ public function getPopupTypeOptionsView()
23
+ {
24
+ return array();
25
+ }
26
+
27
+ public function getRemoveOptions()
28
+ {
29
+ // Where 1 mean this options must not show for this popup type
30
+ $removeOptions = array(
31
+ 'sgpb-reopen-after-form-submission' => 1
32
+ );
33
+
34
+ return $removeOptions;
35
+ }
36
+
37
+ public function getPopupTypeMainView()
38
+ {
39
+ return array(
40
+ 'filePath' => SG_POPUP_TYPE_MAIN_PATH.'image.php',
41
+ 'metaboxTitle' => 'Image Popup Main Options'
42
+ );
43
+ }
44
+
45
+ /**
46
+ * It returns what the current post supports (for example: title, editor, etc...)
47
+ *
48
+ * @since 1.0.0
49
+ *
50
+ * @return array
51
+ */
52
+ public static function getPopupTypeSupports()
53
+ {
54
+ return array('title');
55
+ }
56
+
57
+ public function getPopupTypeContent()
58
+ {
59
+ $imageContent = '';
60
+ $popupOptions = $this->getOptions();
61
+
62
+ $image = $popupOptions['sgpb-image-url'];
63
+ $maxWidth = $popupOptions['sgpb-max-width'];
64
+ $maxHeight = $popupOptions['sgpb-max-height'];
65
+
66
+ $styles = '';
67
+
68
+ if ($maxWidth) {
69
+ $styles .= 'max-width: '.$maxWidth.'px;';
70
+ }
71
+ if ($maxHeight) {
72
+ $styles .= 'max-height: '.$maxHeight.'px;';
73
+ }
74
+ if ($styles) {
75
+ $styles = ' style="'.$styles.'"';
76
+ }
77
+
78
+ $imageContent .= '<div class="sgpb-main-image-content-wrapper">';
79
+ $imageContent .= '<img src="'.esc_attr($image).'"'.$styles.'>';
80
+ $imageContent .= '</div>';
81
+
82
+ return $imageContent;
83
+ }
84
+
85
+ public function getExtraRenderOptions()
86
+ {
87
+ return array();
88
+ }
89
+ }
com/classes/popups/PopupData.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class PopupData
5
+ {
6
+ private static $popupData = array();
7
+
8
+ private function __construct()
9
+ {
10
+ }
11
+
12
+ public static function getPopupDataById($popupId, $saveMode = '')
13
+ {
14
+ if (!isset(self::$popupData[$popupId])) {
15
+ self::$popupData[$popupId] = SGPopup::getSavedData($popupId, $saveMode);
16
+ }
17
+
18
+ return self::$popupData[$popupId];
19
+ }
20
+ }
com/classes/popups/SGPopup.php ADDED
@@ -0,0 +1,1495 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \ConfigDataHelper;
4
+ use \WP_Post;
5
+
6
+ abstract class SGPopup
7
+ {
8
+ protected $type;
9
+
10
+ private $sanitizedData;
11
+ private $postData = array();
12
+ private $id;
13
+ private $title;
14
+ private $content;
15
+ private $target;
16
+ private $conditions;
17
+ private $events = array();
18
+ private $options;
19
+ private $loadableModes;
20
+ private $saveMode = '';
21
+
22
+
23
+ public function setId($id)
24
+ {
25
+ $this->id = $id;
26
+ }
27
+
28
+ public function getId()
29
+ {
30
+ return (int)$this->id;
31
+ }
32
+
33
+ public function setTitle($title)
34
+ {
35
+ $this->title = $title;
36
+ }
37
+
38
+ public function getTitle()
39
+ {
40
+ return $this->title;
41
+ }
42
+
43
+ public function setType($type)
44
+ {
45
+ $this->type = $type;
46
+ }
47
+
48
+ public function getType()
49
+ {
50
+ return $this->type;
51
+ }
52
+
53
+ public function setTarget($target)
54
+ {
55
+ $this->target = $target;
56
+ }
57
+
58
+ public function getTarget()
59
+ {
60
+ return $this->target;
61
+ }
62
+
63
+ public function setEvents($events)
64
+ {
65
+ $this->events = $events;
66
+ }
67
+
68
+ public function getEvents()
69
+ {
70
+ return $this->events;
71
+ }
72
+
73
+ public function setConditions($conditions)
74
+ {
75
+ $this->conditions = $conditions;
76
+ }
77
+
78
+ public function getConditions()
79
+ {
80
+ return $this->conditions;
81
+ }
82
+
83
+ public function setOptions($options)
84
+ {
85
+ $this->options = $options;
86
+ }
87
+
88
+ public function getOptions()
89
+ {
90
+ return $this->options;
91
+ }
92
+
93
+ public function setLoadableModes($loadableModes)
94
+ {
95
+ $this->loadableModes = $loadableModes;
96
+ }
97
+
98
+ public function getLoadableModes()
99
+ {
100
+ return $this->loadableModes;
101
+ }
102
+
103
+ public function setSaveMode($saveMode)
104
+ {
105
+ $this->saveMode = $saveMode;
106
+ }
107
+
108
+ public function getSaveMode()
109
+ {
110
+ return $this->saveMode;
111
+ }
112
+
113
+ public function setContent($content)
114
+ {
115
+ $this->content = $content;
116
+ }
117
+
118
+ public function getPopupAllEvents($postId, $popupId)
119
+ {
120
+ $events = array();
121
+
122
+ $loadableModes = $this->getLoadableModes();
123
+
124
+ if (@$loadableModes['attr_event']) {
125
+ $customEvents = SGPopup::getPostPopupCustomEvent($postId, $popupId);
126
+ $events = array_merge($events, $customEvents);
127
+ }
128
+
129
+ if (@$loadableModes['option_event'] || is_null($loadableModes)) {
130
+ $optionEvents = $this->getEvents();
131
+ if (empty($optionEvents)) {
132
+ return $events;
133
+ }
134
+ $events = array_merge($events, $optionEvents);
135
+ }
136
+
137
+ return $events;
138
+ }
139
+
140
+ public function getContent()
141
+ {
142
+ return wpautop($this->content);
143
+ }
144
+
145
+ public function setPostData($postData)
146
+ {
147
+ $this->postData = apply_filters('sgpbSavedPostData', $postData);
148
+ }
149
+
150
+ public function getPostData()
151
+ {
152
+ return $this->postData;
153
+ }
154
+
155
+ public function getPopupTypeContent()
156
+ {
157
+ return $this->getContent();
158
+ }
159
+
160
+ public function insertIntoSanitizedData($sanitizedData)
161
+ {
162
+ if (!empty($sanitizedData)) {
163
+ $this->sanitizedData[$sanitizedData['name']] = $sanitizedData['value'];
164
+ }
165
+ }
166
+
167
+ abstract public function getExtraRenderOptions();
168
+
169
+ public function setSanitizedData($sanitizedData)
170
+ {
171
+ $this->sanitizedData = $sanitizedData;
172
+ }
173
+
174
+ public function getSanitizedData()
175
+ {
176
+ return $this->sanitizedData;
177
+ }
178
+
179
+ /**
180
+ * Find popup and create this object
181
+ *
182
+ * @since 1.0.0
183
+ *
184
+ * @param object|int $popup
185
+ *
186
+ * @return object|false $obj
187
+ */
188
+ public static function find($popup, $args = array())
189
+ {
190
+ // If the popup is object get data from object otherwise we find needed data from WordPress functions
191
+ if ($popup instanceof WP_Post) {
192
+ $status = $popup->post_status;
193
+ $title = $popup->post_title;
194
+ $popupContent = $popup->post_content;
195
+ $popupId = $popup->ID;
196
+ }
197
+ else {
198
+ $popupId = $popup;
199
+ $popupPost = get_post($popupId);
200
+ if (empty($popupPost)) {
201
+ return false;
202
+ }
203
+ $title = get_the_title($popupId);
204
+ $status = get_post_status($popupId);
205
+ $popupContent = $popupPost->post_content;
206
+ }
207
+ $allowedStatus = array('publish');
208
+
209
+ if (!empty($args['status'])) {
210
+ $allowedStatus = $args['status'];
211
+ }
212
+
213
+ if (!isset($args['checkActivePopupType']) && !in_array($status, $allowedStatus)) {
214
+ return $status;
215
+ }
216
+
217
+ $saveMode = '';
218
+ global $post;
219
+ if ((is_preview() && $post->ID == $popupId) || isset($args['preview'])) {
220
+ $saveMode = '_preview';
221
+ }
222
+ if (isset($args['insidePopup']) && $args['insidePopup'] == 'on') {
223
+ $saveMode = '';
224
+ }
225
+
226
+ require_once(dirname(__FILE__).'/PopupData.php');
227
+ $savedData = PopupData::getPopupDataById($popupId, $saveMode);
228
+
229
+ if (empty($savedData)) {
230
+ return false;
231
+ }
232
+
233
+ $type = $savedData['sgpb-type'];
234
+
235
+ $popupClassName = self::getPopupClassNameFormType($type);
236
+ $typePath = self::getPopupTypeClassPath($type);
237
+ if (!file_exists($typePath.$popupClassName.'.php')) {
238
+ return false;
239
+ }
240
+ require_once($typePath.$popupClassName.'.php');
241
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
242
+
243
+ $obj = new $popupClassName();
244
+ $obj->setId($popupId);
245
+ $obj->setType($type);
246
+ $obj->setTitle($title);
247
+ $obj->setContent($popupContent);
248
+
249
+ if (!empty($savedData['sgpb-target'][0])) {
250
+ $obj->setTarget($savedData['sgpb-target'][0]);
251
+ }
252
+ unset($savedData['sgpb-target']);
253
+ if (!empty($savedData['sgpb-events'][0])) {
254
+ $events = self::shapeEventsToOneArray($savedData['sgpb-events'][0]);
255
+ $obj->setEvents($events);
256
+ }
257
+ unset($savedData['sgpb-events']);
258
+ if (!empty($savedData['sgpb-conditions'][0])) {
259
+ $obj->setConditions($savedData['sgpb-conditions'][0]);
260
+ }
261
+ unset($savedData['sgpb-conditions']);
262
+
263
+ $obj->setOptions($savedData);
264
+
265
+ return $obj;
266
+ }
267
+
268
+ private static function shapeEventsToOneArray($events)
269
+ {
270
+ $eventsData = array();
271
+ if (!empty($events)) {
272
+ foreach ($events as $event) {
273
+ if (empty($event['hiddenOption'])) {
274
+ $eventsData[] = $event;
275
+ continue;
276
+ }
277
+ $hiddenOptions = $event['hiddenOption'];
278
+ unset($event['hiddenOption']);
279
+ $eventsData[] = $event + $hiddenOptions;
280
+ }
281
+ }
282
+
283
+ return $eventsData;
284
+ }
285
+
286
+ public static function getPopupClassNameFormType($type)
287
+ {
288
+ $popupName = ucfirst(strtolower($type));
289
+ $popupClassName = $popupName.'Popup';
290
+
291
+ return $popupClassName;
292
+ }
293
+
294
+ public static function getPopupTypeClassPath($type)
295
+ {
296
+ global $SGPB_POPUP_TYPES;
297
+ $typePaths = $SGPB_POPUP_TYPES['typePath'];
298
+
299
+ if (empty($typePaths[$type])) {
300
+ return SG_POPUP_CLASSES_POPUPS_PATH;
301
+ }
302
+
303
+ return $typePaths[$type];
304
+ }
305
+
306
+ public function sanitizeValueByType($value, $type)
307
+ {
308
+ switch ($type) {
309
+ case 'string':
310
+ $sanitizedValue = htmlspecialchars($value);
311
+ break;
312
+ case 'text':
313
+ $sanitizedValue = htmlspecialchars($value);
314
+ break;
315
+ case 'array':
316
+ $sanitizedValue = $this->recursiveSanitizeTextField($value);
317
+ break;
318
+ case 'email':
319
+ $sanitizedValue = sanitize_email($value);
320
+ break;
321
+ case "checkbox":
322
+ $sanitizedValue = sanitize_text_field($value);
323
+ break;
324
+ case 'sgpb':
325
+ $sanitizedValue = $this->recursiveHtmlSpecialchars($value);
326
+ break;
327
+ default:
328
+ $sanitizedValue = sanitize_text_field($value);
329
+ break;
330
+ }
331
+
332
+ return $sanitizedValue;
333
+ }
334
+
335
+ public function recursiveSanitizeTextField($array)
336
+ {
337
+ if (!is_array($array)) {
338
+ return $array;
339
+ }
340
+
341
+ foreach ($array as $key => &$value) {
342
+ if (is_array($value)) {
343
+ $value = $this->recursiveSanitizeTextField($value);
344
+ }
345
+ else {
346
+ /*get simple field type and do sanitization*/
347
+ $defaultData = $this->getDefaultDataByName($key);
348
+ if (empty($defaultData['type'])) {
349
+ $defaultData['type'] = 'string';
350
+ }
351
+ $value = $this->sanitizeValueByType($value, $defaultData['type']);
352
+ }
353
+ }
354
+
355
+ return $array;
356
+ }
357
+
358
+ public function recursiveHtmlSpecialchars($array)
359
+ {
360
+ if (!is_array($array)) {
361
+ return $array;
362
+ }
363
+
364
+ foreach ($array as $key => &$value) {
365
+ if (is_array($value)) {
366
+ $value = $this->recursiveHtmlSpecialchars($value);
367
+ }
368
+ else {
369
+ $value = htmlspecialchars($value);
370
+ }
371
+ }
372
+
373
+ return $array;
374
+ }
375
+
376
+ public static function parsePopupDataFromData($data)
377
+ {
378
+ $popupData = array();
379
+
380
+ foreach ($data as $key => $value) {
381
+ if (strpos($key, 'sgpb') === 0) {
382
+ $popupData[$key] = $value;
383
+ }
384
+ }
385
+
386
+ return $popupData;
387
+ }
388
+
389
+ public static function create($data = array(), $saveMode = '', $firstTime = 0)
390
+ {
391
+ $obj = new static();
392
+ $obj->setSaveMode($saveMode);
393
+ $additionalData = $obj->addAdditionalSettings($data, $obj);
394
+ $data = array_merge($data, $additionalData);
395
+
396
+ foreach ($data as $name => $value) {
397
+ if (strpos($name, 'sgpb') === 0) {
398
+ $defaultData = $obj->getDefaultDataByName($name);
399
+ if (empty($defaultData['type'])) {
400
+ $defaultData['type'] = 'string';
401
+ }
402
+ $sanitizedValue = $obj->sanitizeValueByType($value, $defaultData['type']);
403
+ $obj->insertIntoSanitizedData(array('name' => $name,'value' => $sanitizedValue));
404
+ }
405
+ }
406
+
407
+ $result = $obj->save();
408
+
409
+ if ($result) {
410
+ return $obj;
411
+ }
412
+
413
+ return $result;
414
+ }
415
+
416
+ public function save()
417
+ {
418
+ $data = $this->getSanitizedData();
419
+ $popupId = $data['sgpb-post-id'];
420
+
421
+ $this->setId($popupId);
422
+
423
+ if (!empty($data['sgpb-target'])) {
424
+ $this->setTarget($data['sgpb-target']);
425
+ /*remove from popup options because it's useless to save it twice*/
426
+ unset($data['sgpb-target']);
427
+ }
428
+ if (!empty($data['sgpb-conditions'])) {
429
+ $this->setConditions($data['sgpb-conditions']);
430
+ unset($data['sgpb-conditions']);
431
+ }
432
+ if (!empty($data['sgpb-events'])) {
433
+ $this->setEvents($data['sgpb-events']);
434
+
435
+ unset($data['sgpb-events']);
436
+ }
437
+
438
+ $this->setOptions($data);
439
+
440
+ $targets = $this->targetSave();
441
+ $events = $this->eventsSave();
442
+ $options = $this->popupOptionsSave();
443
+
444
+ return ($targets && $events && $options);
445
+ }
446
+
447
+ private function targetSave()
448
+ {
449
+ global $SGPB_DATA_CONFIG_ARRAY;
450
+ $saveMode = $this->getSaveMode();
451
+ $popupId = $this->getId();
452
+ $targetData = $this->getTarget();
453
+ $conditionsData = $this->getConditions();
454
+
455
+ $targetConfig = $SGPB_DATA_CONFIG_ARRAY['target'];
456
+ $paramsData = $targetConfig['paramsData'];
457
+ $attrs = $targetConfig['attrs'];
458
+ $popupTarget = array();
459
+
460
+ foreach ($targetData as $groupId => $groupData) {
461
+ foreach ($groupData as $ruleId => $ruleData) {
462
+
463
+ if (empty($ruleData['value']) && !is_null($paramsData[$ruleData['param']])) {
464
+ $targetData[$groupId][$ruleId]['value'] = '';
465
+ }
466
+
467
+ if (isset($ruleData['value']) && is_array($ruleData['value'])) {
468
+
469
+ $valueAttrs = $attrs[$ruleData['param']]['htmlAttrs'];
470
+ $postType = $valueAttrs['data-value-param'];
471
+ $isNotPostType = '';
472
+ if (isset($valueAttrs['isNotPostType'])) {
473
+ $isNotPostType = $valueAttrs['isNotPostType'];
474
+ }
475
+
476
+ if (empty($valueAttrs['isNotPostType'])) {
477
+ $isNotPostType = false;
478
+ }
479
+
480
+ /*
481
+ * $isNotPostType => false must search inside post types post
482
+ * $isNotPostType => true must save array data
483
+ * */
484
+ if (!$isNotPostType) {
485
+ $args = array(
486
+ 'post__in' => array_values($ruleData['value']),
487
+ 'posts_per_page' => 10,
488
+ 'post_type' => $postType
489
+ );
490
+
491
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
492
+
493
+ $targetData[$groupId][$ruleId]['value'] = $searchResults;
494
+ }
495
+ }
496
+ }
497
+ }
498
+
499
+ $popupTarget['sgpb-target'] = $targetData;
500
+ $popupTarget['sgpb-conditions'] = $conditionsData;
501
+
502
+ $alreadySavedTargets = get_post_meta($popupId, 'sg_popup_target'.$saveMode, true);
503
+ if ($alreadySavedTargets === $popupTarget) {
504
+ return true;
505
+ }
506
+
507
+ return update_post_meta($popupId, 'sg_popup_target'.$saveMode, $popupTarget);
508
+ }
509
+
510
+ private function eventsSave()
511
+ {
512
+ global $SGPB_DATA_CONFIG_ARRAY;
513
+
514
+ $eventsData = $this->getEvents();
515
+ $popupId = $this->getId();
516
+ $saveMode = $this->getSaveMode();
517
+ $popupEvents = array();
518
+ $eventsFromPopup = array();
519
+
520
+ foreach ($eventsData as $groupId => $groupData) {
521
+ $currentRuleData = array();
522
+ foreach ($groupData as $ruleId => $ruleData) {
523
+
524
+ $hiddenOptions = array();
525
+ $currentData = array();
526
+ foreach ($ruleData as $name => $value) {
527
+ if ($name == 'param' || $name == 'value') {
528
+ $currentData[$name] = $value;
529
+ }
530
+ else {
531
+ $hiddenOptions[$name] = $value;
532
+ }
533
+ }
534
+ $currentData['hiddenOption'] = $hiddenOptions;
535
+ $currentRuleData[$ruleId] = $currentData;
536
+ }
537
+ $eventsFromPopup[$groupId] = $currentRuleData;
538
+ }
539
+
540
+ $popupEvents['formPopup'] = $eventsFromPopup;
541
+
542
+ $alreadySavedEvents = get_post_meta($popupId, 'sg_popup_events'.$saveMode, true);
543
+ if ($alreadySavedEvents === $eventsFromPopup) {
544
+ return true;
545
+ }
546
+
547
+ if ($saveMode) {
548
+ $eventsFromPopup[] = $SGPB_DATA_CONFIG_ARRAY['events']['initialData'];
549
+ }
550
+
551
+ return update_post_meta($popupId, 'sg_popup_events'.$saveMode, $eventsFromPopup);
552
+ }
553
+
554
+ private function popupOptionsSave()
555
+ {
556
+ $popupOptions = $this->getOptions();
557
+
558
+ //special code added for "Behavior After Special Events" section
559
+ //todo: remove in the future if possible
560
+ $specialBehaviors = $popupOptions['sgpb-behavior-after-special-events'];
561
+ if (!empty($specialBehaviors) && is_array($specialBehaviors)) {
562
+ foreach ($specialBehaviors as $groupId => $groupRow) {
563
+ foreach ($groupRow as $ruleId => $ruleRow) {
564
+ if (!empty($ruleRow['operator']) && $ruleRow['operator'] == 'open-popup') {
565
+ $args = array(
566
+ 'post__in' => array($ruleRow['value']),
567
+ 'posts_per_page' => 10,
568
+ 'post_type' => SG_POPUP_POST_TYPE
569
+ );
570
+
571
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
572
+ $popupOptions['sgpb-behavior-after-special-events'][$groupId][$ruleId]['value'] = $searchResults;
573
+ }
574
+ }
575
+ }
576
+ }
577
+
578
+ $popupId = $this->getId();
579
+ $saveMode = $this->getSaveMode();
580
+
581
+ $alreadySavedOptions = get_post_meta($popupId, 'sg_popup_options'.$saveMode, true);
582
+ if ($alreadySavedOptions === $popupOptions) {
583
+ return true;
584
+ }
585
+
586
+ return update_post_meta($popupId, 'sg_popup_options'.$saveMode, $popupOptions);
587
+ }
588
+
589
+ public function getOptionValue($optionName, $forceDefaultValue = false)
590
+ {
591
+ require_once(dirname(__FILE__).'/PopupData.php');
592
+ $savedData = PopupData::getPopupDataById($this->getId());
593
+ $this->setPostData($savedData);
594
+
595
+ return $this->getOptionValueFromSavedData($optionName, $forceDefaultValue);
596
+ }
597
+
598
+ public function getOptionValueFromSavedData($optionName, $forceDefaultValue = false)
599
+ {
600
+ $defaultData = $this->getDefaultDataByName($optionName);
601
+ $savedData = $this->getPostData();
602
+
603
+ $optionValue = null;
604
+
605
+ if (empty($defaultData['type'])) {
606
+ $defaultData['type'] = 'string';
607
+ }
608
+
609
+ if (!empty($savedData)) { //edit mode
610
+ if (isset($savedData[$optionName])) { //option exists in the database
611
+ $optionValue = $savedData[$optionName];
612
+ }
613
+ /* if it's a checkbox, it may not exist in the db
614
+ * if we don't care about it's existance, return empty string
615
+ * otherwise, go for it's default value
616
+ */
617
+ else if ($defaultData['type'] == 'checkbox' && !$forceDefaultValue) {
618
+ $optionValue = '';
619
+ }
620
+ }
621
+
622
+ if ($optionValue === null && !empty($defaultData['defaultValue'])) {
623
+ $optionValue = $defaultData['defaultValue'];
624
+ }
625
+
626
+ if ($defaultData['type'] == 'checkbox') {
627
+ $optionValue = $this->boolToChecked($optionValue);
628
+ }
629
+
630
+ if ($defaultData['type'] == 'number' && $optionValue == 0) {
631
+ $optionValue = 0;
632
+ }
633
+
634
+ return $optionValue;
635
+ }
636
+
637
+ public static function getSavedData($popupId, $saveMode = '')
638
+ {
639
+ $popupSavedData = array();
640
+ $events = self::getEventsDataById($popupId, $saveMode);
641
+ $targetData = self::getTargetDataById($popupId, $saveMode);
642
+
643
+ if (!empty($events)) {
644
+ $popupSavedData['sgpb-events'] = self::getEventsDataById($popupId, $saveMode);
645
+ }
646
+ if (!empty($targetData)) {
647
+ $popupSavedData['sgpb-target'] = $targetData['sgpb-target'];
648
+ $popupSavedData['sgpb-conditions'] = $targetData['sgpb-conditions'];
649
+ }
650
+
651
+ $popupSavedData += self::getPopupOptionsById($popupId, $saveMode);
652
+
653
+ return $popupSavedData;
654
+ }
655
+
656
+ public static function getEventsDataById($popupId, $saveMode = '')
657
+ {
658
+ $eventsData = array();
659
+ if (get_post_meta($popupId, 'sg_popup_events'.$saveMode)) {
660
+ $eventsData = get_post_meta($popupId, 'sg_popup_events'.$saveMode, true);
661
+ }
662
+
663
+ return $eventsData;
664
+ }
665
+
666
+ public static function getTargetDataById($popupId, $saveMode = '')
667
+ {
668
+ $targetData = array();
669
+
670
+ if (get_post_meta($popupId, 'sg_popup_target'.$saveMode)) {
671
+ $targetData = get_post_meta($popupId, 'sg_popup_target'.$saveMode, true);
672
+ }
673
+
674
+ return $targetData;
675
+ }
676
+
677
+ public static function getPopupOptionsById($popupId, $saveMode = '')
678
+ {
679
+ $optionsData = array();
680
+ if (get_post_meta($popupId, 'sg_popup_options'.$saveMode)) {
681
+ $optionsData = get_post_meta($popupId, 'sg_popup_options'.$saveMode, true);
682
+ }
683
+
684
+ return $optionsData;
685
+ }
686
+
687
+ public function getDefaultDataByName($optionName)
688
+ {
689
+ global $SGPB_OPTIONS;
690
+ if (empty($SGPB_OPTIONS)) {
691
+ return array();
692
+ }
693
+
694
+ foreach ($SGPB_OPTIONS as $option) {
695
+ if ($option['name'] == $optionName) {
696
+ return $option;
697
+ }
698
+ }
699
+
700
+ return array();
701
+ }
702
+
703
+ /**
704
+ * Get option default option value
705
+ *
706
+ * @param string $optionName
707
+ *
708
+ * @since 1.0.0
709
+ *
710
+ * @return string
711
+ *
712
+ */
713
+ public function getOptionDefaultValue($optionName)
714
+ {
715
+ // return config data array by name
716
+ $optionData = $this->getDefaultDataByName($optionName);
717
+
718
+ if (empty($optionData)) {
719
+ return '';
720
+ }
721
+
722
+ return $optionData['defaultValue'];
723
+ }
724
+
725
+ /**
726
+ * Changing default options form changing options by name
727
+ *
728
+ * @since 1.0.0
729
+ *
730
+ * @param array $defaultOptions
731
+ * @param array $changingOptions
732
+ *
733
+ * @return array $defaultOptions
734
+ */
735
+ public function changeDefaultOptionsByNames($defaultOptions, $changingOptions)
736
+ {
737
+ if (empty($defaultOptions) || empty($changingOptions)) {
738
+ return $defaultOptions;
739
+ }
740
+ $changingOptionsNames = array_keys($changingOptions);
741
+
742
+ foreach ($defaultOptions as $key => $defaultOption) {
743
+ $defaultOptionName = $defaultOption['name'];
744
+ if (in_array($defaultOptionName, $changingOptionsNames)) {
745
+ $defaultOptions[$key] = $changingOptions[$defaultOptionName];
746
+ }
747
+ }
748
+
749
+ return $defaultOptions;
750
+ }
751
+
752
+ /**
753
+ * Returns separate popup types Free or Pro
754
+ *
755
+ * @since 2.5.6
756
+ *
757
+ * @return array $popupTypesObj
758
+ */
759
+ public static function getPopupTypes()
760
+ {
761
+ global $SGPB_POPUP_TYPES;
762
+ $popupTypesObj = array();
763
+ $popupTypes = $SGPB_POPUP_TYPES['typeName'];
764
+
765
+ foreach ($popupTypes as $popupType => $level) {
766
+
767
+ if (empty($level)) {
768
+ $level = SGPB_POPUP_PKG_FREE;
769
+ }
770
+
771
+ $popupTypeObj = new PopupType();
772
+ $popupTypeObj->setName($popupType);
773
+ $popupTypeObj->setAccessLevel($level);
774
+
775
+ if (SGPB_POPUP_PKG >= $level) {
776
+ $popupTypeObj->setAvailable(true);
777
+ }
778
+ $popupTypesObj[] = $popupTypeObj;
779
+ }
780
+
781
+ return $popupTypesObj;
782
+ }
783
+
784
+ public static function savePopupsFromContentClasses($content, $post)
785
+ {
786
+ $postId = $post->ID;
787
+ $clickClassIds = self::getStringNextNumbersByReg($content, 'sg-popup-id-');
788
+ $targetData = array();
789
+ $eventsData = array();
790
+
791
+ if (!empty($clickClassIds)) {
792
+ foreach ($clickClassIds as $id) {
793
+ $id = apply_filters('sgpbConvertedPopupId', $id);
794
+ if (empty($eventsData[$postId][$id])) {
795
+ $eventsData[$postId][$id] = array('click');
796
+ }
797
+ else {
798
+ $eventsData[$postId][$id][] = 'click';
799
+ }
800
+
801
+ if (empty($targetData[$postId])) {
802
+ $targetData[$postId] = array($id);
803
+ }
804
+ else {
805
+ $targetData[$postId][] = $id;
806
+ }
807
+ }
808
+ }
809
+
810
+ $iframeClassIs = self::getStringNextNumbersByReg($content, 'sg-iframe-popup-');
811
+
812
+ if (!empty($iframeClassIs)) {
813
+ foreach ($iframeClassIs as $id) {
814
+ $id = apply_filters('sgpbConvertedPopupId', $id);
815
+ $popupObj = self::find($id);
816
+
817
+ if (empty($popupObj)) {
818
+ continue;
819
+ }
820
+
821
+ // this event should work only for iframe popup type
822
+ if ($popupObj->getType() != 'iframe') {
823
+ continue;
824
+ }
825
+
826
+ if (empty($eventsData[$postId][$id])) {
827
+ $eventsData[$postId][$id] = array('iframe');
828
+ }
829
+ else {
830
+ $eventsData[$postId][$id][] = 'iframe';
831
+ }
832
+
833
+ if (empty($targetData[$postId])) {
834
+ $targetData[$postId] = array($id);
835
+ }
836
+ else {
837
+ $targetData[$postId][] = $id;
838
+ }
839
+ }
840
+ }
841
+
842
+ $confirmClassIds = self::getStringNextNumbersByReg($content, 'sg-confirm-popup-');
843
+
844
+ if (!empty($confirmClassIds)) {
845
+ foreach ($confirmClassIds as $id) {
846
+ $id = apply_filters('sgpbConvertedPopupId', $id);
847
+ if (empty($eventsData[$postId][$id])) {
848
+ $eventsData[$postId][$id] = array('confirm');
849
+ }
850
+ else {
851
+ $eventsData[$postId][$id][] = 'confirm';
852
+ }
853
+
854
+ if (empty($targetData[$postId])) {
855
+ $targetData[$postId] = array($id);
856
+ }
857
+ else {
858
+ $targetData[$postId][] = $id;
859
+ }
860
+ }
861
+ }
862
+
863
+ $hoverClassIds = self::getStringNextNumbersByReg($content, 'sg-popup-hover-');
864
+
865
+ if (!empty($hoverClassIds)) {
866
+ foreach ($hoverClassIds as $id) {
867
+ $id = apply_filters('sgpbConvertedPopupId', $id);
868
+ if (empty($eventsData[$postId][$id])) {
869
+ $eventsData[$postId][$id] = array('hover');
870
+ }
871
+ else {
872
+ $eventsData[$postId][$id][] = 'hover';
873
+ }
874
+
875
+ if (empty($targetData[$postId])) {
876
+ $targetData[$postId] = array($id);
877
+ }
878
+ else {
879
+ $targetData[$postId][] = $id;
880
+ }
881
+ }
882
+ }
883
+
884
+ self::saveToTargetFromPage($targetData);
885
+ self::saveToEventsFromPage($eventsData);
886
+ }
887
+
888
+ public static function getStringNextNumbersByReg($content, $key)
889
+ {
890
+ $result = array();
891
+ preg_match_all("/(?<=$key)(\d+)/", $content, $ids);
892
+
893
+ if (!empty($ids[0])) {
894
+ $result = $ids[0];
895
+ }
896
+
897
+ return $result;
898
+ }
899
+
900
+ private static function saveToTargetAndEvents($popupsShortcodsInPostPage, $postId)
901
+ {
902
+ if (empty($popupsShortcodsInPostPage)) {
903
+ return false;
904
+ }
905
+ $customEvents = array();
906
+ $customPopups = array();
907
+
908
+ foreach ($popupsShortcodsInPostPage as $shortcodesData) {
909
+ $popupId = apply_filters('sgpbConvertedPopupId', $shortcodesData['id']);
910
+
911
+ $args = array(
912
+ 'post_type' => SG_POPUP_POST_TYPE,
913
+ 'post__in' => array($popupId)
914
+ );
915
+ $postById = ConfigDataHelper::getPostTypeData($args);
916
+ //When target data does not exist
917
+ if (empty($postById)) {
918
+ continue;
919
+ }
920
+
921
+ // collect custom inserted popups
922
+ if (empty($customPopups[$postId])) {
923
+ $customPopups[$postId] = array($popupId);
924
+ }
925
+ else {
926
+ $customPopups[$postId][] = $popupId;
927
+ }
928
+
929
+ // collect custom inserted popups events
930
+ if (empty($shortcodesData['event'])) {
931
+ $eventName = 'onload';
932
+ }
933
+ else {
934
+ $eventName = $shortcodesData['event'];
935
+ }
936
+
937
+ if ($eventName == 'onload') {
938
+ $eventName = 'attr'.$eventName;
939
+ }
940
+ $currentEventData = array(
941
+ 'param' => $eventName
942
+ );
943
+
944
+ if (empty($customEvents[$postId][$popupId])) {
945
+ $customEvents[$postId][$popupId] = array($currentEventData);
946
+ }
947
+ else {
948
+ $customEvents[$postId][$popupId][] = $currentEventData;
949
+ }
950
+ }
951
+
952
+ self::saveToTargetFromPage($customPopups);
953
+ self::saveToEventsFromPage($customEvents);
954
+
955
+ return true;
956
+ }
957
+
958
+ public static function getPostPopupCustomEvent($postId, $popupId)
959
+ {
960
+ $events = array();
961
+
962
+ $customEventsData = self::getCustomInsertedPopupEventsByPostId($postId);
963
+
964
+ if (!empty($customEventsData[$popupId])) {
965
+ $events = $customEventsData[$popupId];
966
+ }
967
+
968
+ return $events;
969
+ }
970
+
971
+ /**
972
+ * Save popup to custom events from pages
973
+ *
974
+ * @since 1.0.0
975
+ *
976
+ * @param array $customEvents
977
+ *
978
+ * @return bool
979
+ *
980
+ */
981
+ public static function saveToEventsFromPage($customEvents)
982
+ {
983
+ if (empty($customEvents)) {
984
+ return false;
985
+ }
986
+
987
+ foreach ($customEvents as $postId => $popupsData) {
988
+ $savedCustomEvents = self::getCustomInsertedPopupEventsByPostId($postId);
989
+ $result = AdminHelper::arrayMergeSameKeys($popupsData, $savedCustomEvents);
990
+
991
+ if (!$result) {
992
+ return $result;
993
+ }
994
+ update_post_meta($postId, 'sgpb_popup_events_custom', $result);
995
+ }
996
+
997
+ return true;
998
+ }
999
+
1000
+ public static function getCustomInsertedPopupEventsByPostId($postId)
1001
+ {
1002
+ $eventsData = array();
1003
+ $postMetaData = get_post_meta($postId, 'sgpb_popup_events_custom', true);
1004
+
1005
+ if (!empty($postMetaData)) {
1006
+ $eventsData = $postMetaData;
1007
+ }
1008
+
1009
+ return $eventsData;
1010
+ }
1011
+
1012
+ /**
1013
+ * Save popup to custom targets from pages
1014
+ *
1015
+ * @since 1.0.0
1016
+ *
1017
+ * @param array $customPopups
1018
+ *
1019
+ * @return void
1020
+ *
1021
+ */
1022
+ public static function saveToTargetFromPage($customPopups)
1023
+ {
1024
+ if (!empty($customPopups)) {
1025
+ foreach ($customPopups as $postId => $popups) {
1026
+ $alreadySavedPopups = self::getCustomInsertedDataByPostId($postId);
1027
+ $popups = array_merge($popups, $alreadySavedPopups);
1028
+ update_post_meta($postId, 'sg_popup_target_custom', $popups);
1029
+ }
1030
+ }
1031
+ }
1032
+
1033
+ /**
1034
+ * Get popup custom targes form saved data
1035
+ *
1036
+ * @since 1.0.0
1037
+ *
1038
+ * @param int $postId
1039
+ *
1040
+ * @return array $postData
1041
+ */
1042
+ public static function getCustomInsertedDataByPostId($postId)
1043
+ {
1044
+ $postData = array();
1045
+ $postMetaData = get_post_meta($postId, 'sg_popup_target_custom');
1046
+
1047
+ if (!empty($postMetaData[0])) {
1048
+ $postData = $postMetaData[0];
1049
+ }
1050
+
1051
+ return $postData;
1052
+ }
1053
+
1054
+ public static function getPopupShortcodeMatchesFromContent($content)
1055
+ {
1056
+ $result = false;
1057
+ $pattern = get_shortcode_regex();
1058
+
1059
+ if (preg_match_all('/'.$pattern.'/s', $content, $matches)
1060
+ && !empty($matches)
1061
+ && is_array($matches)
1062
+ && array_key_exists( 2, $matches )
1063
+ && in_array('sg_popup', $matches[2])
1064
+ )
1065
+ {
1066
+ $result = $matches;
1067
+ }
1068
+
1069
+ return $result;
1070
+ }
1071
+
1072
+ public static function renderPopupContentShortcode($content, $popupId, $event, $args)
1073
+ {
1074
+ ob_start();
1075
+ $wrap = 'a';
1076
+
1077
+ if (!empty($args['wrap'])) {
1078
+ if ($args['wrap'] == $wrap) {
1079
+ $args['href'] = 'javascript:void(0)';
1080
+ }
1081
+ $wrap = $args['wrap'];
1082
+ }
1083
+ unset($args['wrap']);
1084
+ unset($args['event']);
1085
+ unset($args['id']);
1086
+ $attr = AdminHelper::createAttrs($args);
1087
+ ?>
1088
+ <<?php echo $wrap; ?>
1089
+ class="sg-show-popup <?php echo 'sgpb-popup-id-'.$popupId; ?>"
1090
+ data-sgpbpopupid="<?php echo esc_attr($popupId); ?>"
1091
+ data-popup-event="<?php echo $event; ?>"
1092
+ <?php echo $attr; ?>>
1093
+ <?php echo $content; ?>
1094
+ </<?php echo $wrap; ?>>
1095
+ <?php
1096
+
1097
+ $shortcodeContent = ob_get_contents();
1098
+ ob_get_clean();
1099
+
1100
+ return $shortcodeContent;
1101
+ }
1102
+
1103
+ private static function collectInsidePopupShortcodes($content)
1104
+ {
1105
+ $pattern = get_shortcode_regex();
1106
+ $options = array();
1107
+ if (preg_match_all('/'.$pattern.'/s', $content, $matches)
1108
+ && !empty($matches)
1109
+ && is_array($matches)
1110
+ && array_key_exists( 2, $matches )
1111
+ && in_array('sg_popup', $matches[2])
1112
+ )
1113
+ {
1114
+ foreach ($matches[0] as $key => $value) {
1115
+ //return current shortcode all attrs as assoc array
1116
+ $attrs = shortcode_parse_atts($matches[3][$key]);
1117
+ $currentAttrs = array();
1118
+ if (!empty($attrs['id'])) {
1119
+ $currentAttrs['id'] = $attrs['id'];
1120
+ }
1121
+ if (!empty($attrs['insidepopup'])) {
1122
+ $currentAttrs['insidepopup'] = $attrs['insidepopup'];
1123
+ }
1124
+ if (empty($attrs['insidepopup']) || (!empty($attrs['insidepopup']) && $attrs['insidepopup'] != 'on')) {
1125
+ continue;
1126
+ }
1127
+
1128
+ $options[$currentAttrs['id']] = $value;
1129
+ }
1130
+ }
1131
+
1132
+ return $options;
1133
+ }
1134
+
1135
+ /**
1136
+ * Collect all popups by taxonomy slug
1137
+ *
1138
+ * @since 1.0.0
1139
+ *
1140
+ * @param string $popupTermSlug category slug name
1141
+ *
1142
+ * @return array $popupIds random popups id
1143
+ *
1144
+ */
1145
+ public static function getPopupsByTermSlug($popupTermSlug)
1146
+ {
1147
+ $popupIds = array();
1148
+ // proStartSilverproEndSilver
1149
+ return $popupIds;
1150
+ }
1151
+
1152
+ public function boolToChecked($var)
1153
+ {
1154
+ return ($var?'checked':'');
1155
+ }
1156
+
1157
+ /**
1158
+ * Delete custom inserted data
1159
+ *
1160
+ * @since 1.0.0
1161
+ *
1162
+ * @param int $postId current post page id
1163
+ *
1164
+ * @return void
1165
+ *
1166
+ */
1167
+ public static function deletePostCustomInsertedData($postId)
1168
+ {
1169
+ delete_post_meta($postId, 'sg_popup_target_custom');
1170
+ }
1171
+
1172
+ /**
1173
+ * Delete custom inserted events
1174
+ *
1175
+ * @since 1.0.0
1176
+ *
1177
+ * @param int $postId current post page id
1178
+ *
1179
+ * @return void
1180
+ *
1181
+ */
1182
+ public static function deletePostCustomInsertedEvents($postId)
1183
+ {
1184
+ delete_post_meta($postId, 'sgpb_popup_events_custom');
1185
+ }
1186
+
1187
+ /**
1188
+ * If popup Type does not have getPopupTypeOptions method
1189
+ * it's tell popup does not have custom options
1190
+ *
1191
+ * @since 1.0.0
1192
+ *
1193
+ * @return bool
1194
+ *
1195
+ */
1196
+ public function getPopupTypeOptionsView()
1197
+ {
1198
+ return false;
1199
+ }
1200
+
1201
+ /**
1202
+ * If popup Type does not have getPopupTypeOptions method
1203
+ * it's tell popup does not have custom options
1204
+ *
1205
+ * @since 1.0.0
1206
+ *
1207
+ * @return bool
1208
+ *
1209
+ */
1210
+ public function getPopupTypeMainView()
1211
+ {
1212
+ return false;
1213
+ }
1214
+
1215
+ /**
1216
+ * Remove popup option from admin view by option name
1217
+ *
1218
+ * @since 1.0.0
1219
+ *
1220
+ * @return array $removedOptions
1221
+ *
1222
+ */
1223
+ public function getRemoveOptions()
1224
+ {
1225
+ $removeOptions = array();
1226
+
1227
+ return $removeOptions;
1228
+ }
1229
+
1230
+ public static function createPopupTypeObjById($popupId)
1231
+ {
1232
+ global $SGPB_POPUP_TYPES;
1233
+ $typePath = '';
1234
+ $popupOptionsData = SGPopup::getPopupOptionsById($popupId);
1235
+ if (empty($popupOptionsData)) {
1236
+ return false;
1237
+ }
1238
+ $popupType = $popupOptionsData['sgpb-type'];
1239
+ $popupName = ucfirst(strtolower($popupType));
1240
+ $popupClassName = $popupName.'Popup';
1241
+
1242
+ if (!empty($SGPB_POPUP_TYPES['typePath'][$popupType])) {
1243
+ $typePath = $SGPB_POPUP_TYPES['typePath'][$popupType];
1244
+ }
1245
+
1246
+ if (!file_exists($typePath.$popupClassName.'.php')) {
1247
+ wp_die(__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
1248
+ }
1249
+ require_once($typePath.$popupClassName.'.php');
1250
+
1251
+ $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
1252
+ $popupTypeObj = new $popupClassName();
1253
+ $popupTypeObj->setId($popupId);
1254
+
1255
+ return $popupTypeObj;
1256
+ }
1257
+
1258
+ /**
1259
+ * if child class does not have this function we call parent function to not get any errors
1260
+ *
1261
+ * @since 1.0.0
1262
+ *
1263
+ * @return array
1264
+ *
1265
+ */
1266
+ public static function getTablesSql()
1267
+ {
1268
+ return array();
1269
+ }
1270
+
1271
+ /**
1272
+ * if child class does not have this function we call parent function to not get any errors
1273
+ *
1274
+ * @since 1.0.0
1275
+ *
1276
+ * @return array
1277
+ *
1278
+ */
1279
+ public static function getTableNames()
1280
+ {
1281
+ return array();
1282
+ }
1283
+
1284
+ /**
1285
+ *
1286
+ * Get WordPress localization name
1287
+ *
1288
+ * @since 1.0.0
1289
+ *
1290
+ * @return string
1291
+ *
1292
+ */
1293
+ public function getSiteLocale()
1294
+ {
1295
+ $locale = get_bloginfo('language');
1296
+ $locale = str_replace('-', '_', $locale);
1297
+
1298
+ return $locale;
1299
+ }
1300
+
1301
+ public function addAdditionalSettings($postData = array(), $obj = null)
1302
+ {
1303
+ return array();
1304
+ }
1305
+
1306
+ public function allowToLoad()
1307
+ {
1308
+ global $post;
1309
+
1310
+ $popupChecker = PopupChecker::instance();
1311
+ $loadableModes = $popupChecker->isLoadable($this, $post);
1312
+ $this->setLoadableModes($loadableModes);
1313
+
1314
+ return ($loadableModes['attr_event'] || $loadableModes['option_event']);
1315
+ }
1316
+
1317
+ public static function getAllPopups($filters = array())
1318
+ {
1319
+ $args = array(
1320
+ 'post_type' => SG_POPUP_POST_TYPE
1321
+ );
1322
+ $allPopups = array();
1323
+ $allPostData = ConfigDataHelper::getQueryDataByArgs($args);
1324
+
1325
+ if (empty($allPostData)) {
1326
+ return $allPopups;
1327
+ }
1328
+
1329
+ foreach ($allPostData->posts as $postData) {
1330
+ if (empty($postData)) {
1331
+ continue;
1332
+ }
1333
+
1334
+ $popup = self::find($postData->ID);
1335
+ if (empty($popup)) {
1336
+ continue;
1337
+ }
1338
+ if (isset($filters['type'])) {
1339
+ if ($popup->getType() != $filters['type']) {
1340
+ continue;
1341
+ }
1342
+ }
1343
+ $allPopups[] = $popup;
1344
+ }
1345
+
1346
+ return $allPopups;
1347
+ }
1348
+
1349
+ public function getPopupsIdAndTitle()
1350
+ {
1351
+ $allPopups = SGPopup::getAllPopups();
1352
+ $popupIdTitles = array();
1353
+
1354
+ if (empty($allPopups)) {
1355
+ return $popupIdTitles;
1356
+ }
1357
+ $currentPopupId = $this->getId();
1358
+
1359
+ foreach ($allPopups as $popup) {
1360
+ if (empty($popup)) {
1361
+ continue;
1362
+ }
1363
+ $id = $popup->getId();
1364
+
1365
+ if ($id == $currentPopupId) {
1366
+ continue;
1367
+ }
1368
+
1369
+ $title = $popup->getTitle();
1370
+ $type = $popup->getType();
1371
+
1372
+ $popupIdTitles[$id] = $title.' - '.$type;
1373
+ }
1374
+
1375
+ return $popupIdTitles;
1376
+ }
1377
+
1378
+ public function getSubPopupObj()
1379
+ {
1380
+ $subPopups = array();
1381
+ $options = $this->getOptions();
1382
+
1383
+ $specialBehaviors = @$options['sgpb-behavior-after-special-events'];
1384
+ if (!empty($specialBehaviors) && is_array($specialBehaviors)) {
1385
+ foreach ($specialBehaviors as $behavior) {
1386
+ foreach ($behavior as $row) {
1387
+ if (!empty($row['param']) && $row['param'] == SGPB_CONTACT_FORM_7_BEHAVIOR_KEY) {
1388
+ if (!empty($row['operator']) && $row['operator'] == 'open-popup') {
1389
+ if (!empty($row['value'])) {
1390
+ $popupId = key($row['value']);
1391
+ $subPopupObj = self::find((int)$popupId);
1392
+ if (!empty($subPopupObj) && ($subPopupObj instanceof SGPopup)) {
1393
+ $subPopupObj->setEvents(array('param' => 'click', 'value' => ''));
1394
+ $subPopups[] = $subPopupObj;
1395
+ }
1396
+ }
1397
+ }
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+
1403
+ return $subPopups;
1404
+ }
1405
+
1406
+ public static function doInsideShortcode($insideShortcode)
1407
+ {
1408
+ return do_shortcode($insideShortcode);
1409
+ }
1410
+
1411
+ public function popupShortcodesInsidePopup()
1412
+ {
1413
+ $popups = array();
1414
+ $args = array('insidePopup' => 'on');
1415
+ $popupContent = $this->getContent();
1416
+ $parentTarget = $this->getTarget();
1417
+ $insidePopupShortcodes = self::collectInsidePopupShortcodes($popupContent);
1418
+ if (empty($insidePopupShortcodes)) {
1419
+ return $popups;
1420
+ }
1421
+ foreach ($insidePopupShortcodes as $insidePopupId => $insidePopupShortcode) {
1422
+ $insidePopupId = (int)$insidePopupId;
1423
+ if (!$insidePopupId) {
1424
+ continue;
1425
+ }
1426
+ // true = find inside popup
1427
+ $insidePopup = self::find($insidePopupId, $args);
1428
+ if (empty($insidePopup) || $insidePopup == 'trash') {
1429
+ continue;
1430
+ }
1431
+ $events = array('insideclick');
1432
+ $insidePopup->setEvents($events);
1433
+ $popups[$insidePopupId] = $insidePopup;
1434
+ }
1435
+
1436
+ $popupContent = self::doInsideShortcode($popupContent);
1437
+ $this->setContent($popupContent);
1438
+
1439
+ return $popups;
1440
+ }
1441
+
1442
+ public function getPopupOpeningCountById($popupId)
1443
+ {
1444
+ global $wpdb;
1445
+
1446
+ $allCount = 0;
1447
+ $popupsCounterData = get_option('SgpbCounter');
1448
+ $popupCountFromAnalyticsData = 0;
1449
+ $tableName = $wpdb->prefix.'sgpb_analytics';
1450
+ if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") == $tableName) {
1451
+ $popupCountFromAnalyticsData = $this->getAnalyticsDataByPopupId($popupId);
1452
+ }
1453
+ if (isset($popupsCounterData[$popupId])) {
1454
+ $allCount += $popupsCounterData[$popupId];
1455
+ }
1456
+ $allCount += $popupCountFromAnalyticsData;
1457
+
1458
+ return $allCount;
1459
+ }
1460
+
1461
+ public function getAnalyticsDataByPopupId($popupId)
1462
+ {
1463
+ global $wpdb;
1464
+ // 7, 12, 13 => exclude close, subscription success, contact success events
1465
+ $stmt = $wpdb->prepare('SELECT COUNT(*) FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (12, 13)', $popupId);
1466
+ $popupAnalyticsData = $wpdb->get_var($stmt);
1467
+
1468
+ return $popupAnalyticsData;
1469
+ }
1470
+
1471
+ public static function getActivePopupsQueryString()
1472
+ {
1473
+ $activePopupsQuery = '';
1474
+ $args = array(
1475
+ 'post_type' => SG_POPUP_POST_TYPE,
1476
+ 'post_status' => array('trash', 'publish')
1477
+ );
1478
+ $allPostData = ConfigDataHelper::getQueryDataByArgs($args);
1479
+ $args['checkActivePopupType'] = true;
1480
+ $allPopups = $allPostData->posts;
1481
+ foreach ($allPopups as $post) {
1482
+ $id = $post->ID;
1483
+ $popup = self::find($id, $args);
1484
+ if (empty($popup)) {
1485
+ $activePopupsQuery .= $id.', ';
1486
+ }
1487
+ }
1488
+ if ($activePopupsQuery != '') {
1489
+ $activePopupsQuery = ' AND ID NOT IN ('.$activePopupsQuery.')';
1490
+ $activePopupsQuery = str_replace(', )', ') ', $activePopupsQuery);
1491
+ }
1492
+
1493
+ return $activePopupsQuery;
1494
+ }
1495
+ }
com/classes/popups/SubscriptionPopup.php ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ require_once(dirname(__FILE__).'/SGPopup.php');
4
+
5
+ class SubscriptionPopup extends SGPopup
6
+ {
7
+ private $data;
8
+
9
+ public function __construct()
10
+ {
11
+ add_filter('sgpbFrontendJsFiles', array($this, 'frontJsFilter'), 1, 1);
12
+ add_filter('sgpbFrontendCssFiles', array($this, 'frontCssFilter'), 1, 1);
13
+ add_filter('sgpbAdminJsFiles', array($this, 'adminJsFilter'), 1, 1);
14
+ add_filter('sgpbAdminCssFiles', array($this, 'adminCssFilter'), 1, 1);
15
+ }
16
+
17
+ public function setData($data)
18
+ {
19
+ $this->data = $data;
20
+ }
21
+
22
+ public function getData()
23
+ {
24
+ return $this->data;
25
+ }
26
+
27
+ public static function getTablesSql()
28
+ {
29
+ $tablesSql = array();
30
+
31
+ $tablesSql[] = SGPB_SUBSCRIBERS_TABLE_NAME.' (
32
+ `id` int(12) NOT NULL AUTO_INCREMENT,
33
+ `firstName` varchar(255),
34
+ `lastName` varchar(255),
35
+ `email` varchar(255),
36
+ `subscriptionType` int(12),
37
+ `cDate` date,
38
+ `status` varchar(255),
39
+ PRIMARY KEY (id)
40
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
41
+
42
+ $tablesSql[] = SGPB_SUBSCRIBERS_ERROR_TABLE_NAME.' (
43
+ `id` int(12) NOT NULL AUTO_INCREMENT,
44
+ `firstName` varchar(255),
45
+ `popupType` varchar(255),
46
+ `email` varchar(255),
47
+ `date` varchar(255),
48
+ PRIMARY KEY (id)
49
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
50
+
51
+ return $tablesSql;
52
+ }
53
+
54
+ /**
55
+ * Return Subscription popup type need all table names
56
+ *
57
+ * @since 1.0.0
58
+ *
59
+ * @return array $table names
60
+ *
61
+ */
62
+ public static function getTableNames()
63
+ {
64
+ $tableNames = array(
65
+ SGPB_SUBSCRIBERS_TABLE_NAME,
66
+ SGPB_SUBSCRIBERS_ERROR_TABLE_NAME
67
+ );
68
+
69
+ return $tableNames;
70
+ }
71
+
72
+ public function frontJsFilter($jsFiles)
73
+ {
74
+ $jsFiles[] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'Subscription.js');
75
+ $jsFiles[] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'Validate.js');
76
+
77
+ return $jsFiles;
78
+ }
79
+
80
+ public function adminJsFilter($jsFiles)
81
+ {
82
+ $jsFiles[] = array('folderUrl' => SG_POPUP_JS_URL, 'filename' => 'Subscription.js');
83
+
84
+ return $jsFiles;
85
+ }
86
+
87
+ public function adminCssFilter($cssFiles)
88
+ {
89
+ $cssFiles[] = array(
90
+ 'folderUrl' => SG_POPUP_CSS_URL,
91
+ 'filename' => 'ResetFormStyle.css'
92
+ );
93
+ $cssFiles[] = array(
94
+ 'folderUrl' => SG_POPUP_CSS_URL,
95
+ 'filename' => 'SubscriptionForm.css'
96
+ );
97
+
98
+ return $cssFiles;
99
+ }
100
+
101
+ public function frontCssFilter($cssFiles)
102
+ {
103
+ $cssFiles[] = array(
104
+ 'folderUrl' => SG_POPUP_CSS_URL,
105
+ 'filename' => 'ResetFormStyle.css',
106
+ 'inFooter' => true
107
+ );
108
+ $cssFiles[] = array(
109
+ 'folderUrl' => SG_POPUP_CSS_URL,
110
+ 'filename' => 'SubscriptionForm.css',
111
+ 'inFooter' => true
112
+ );
113
+
114
+ return $cssFiles;
115
+ }
116
+
117
+ public function addAdditionalSettings($postData = array(), $obj = null)
118
+ {
119
+ $this->setData($postData);
120
+ $postData['sgpb-subs-fields'] = $this->createFormFieldsData();
121
+
122
+ return $postData;
123
+ }
124
+
125
+ public function setSubsFormData($formId)
126
+ {
127
+ $savedData = array();
128
+
129
+ if (!empty($formId)) {
130
+ $savedData = SGPopup::getSavedData($formId);
131
+ }
132
+
133
+ $this->setData($savedData);
134
+ }
135
+
136
+ private function getFieldValue($optionName)
137
+ {
138
+ $optionValue = '';
139
+ $postData = $this->getData();
140
+
141
+ if (!empty($postData[$optionName])) {
142
+ return $postData[$optionName];
143
+ }
144
+
145
+ $defaultData = $this->getDefaultDataByName($optionName);
146
+
147
+ // when Saved data does not exist we try find inside default values
148
+ if (empty($postData) && !empty($defaultData)) {
149
+ return $defaultData['defaultValue'];
150
+ }
151
+
152
+ return $optionValue;
153
+ }
154
+
155
+ /**
156
+ * Create form fields data
157
+ *
158
+ * @since 1.0.0
159
+ *
160
+ * @return array $formData
161
+ */
162
+ public function createFormFieldsData()
163
+ {
164
+ $formData = array();
165
+ $inputStyles = array();
166
+ $submitStyles = array();
167
+ $postData = $this->getData();
168
+ $emailPlaceholder = $this->getFieldValue('sgpb-subs-email-placeholder');
169
+ if ($this->getFieldValue('sgpb-subs-text-width')) {
170
+ $inputWidth = $this->getFieldValue('sgpb-subs-text-width');
171
+ $inputStyles['width'] = AdminHelper::getCSSSafeSize($inputWidth);
172
+ }
173
+ if ($this->getFieldValue('sgpb-subs-text-height')) {
174
+ $inputHeight = $this->getFieldValue('sgpb-subs-text-height');
175
+ $inputStyles['height'] = AdminHelper::getCSSSafeSize($inputHeight);
176
+ }
177
+ if ($this->getFieldValue('sgpb-subs-text-border-width')) {
178
+ $inputBorderWidth = $this->getFieldValue('sgpb-subs-text-border-width');
179
+ $inputStyles['border-width'] = AdminHelper::getCSSSafeSize($inputBorderWidth);
180
+ }
181
+ if ($this->getFieldValue('sgpb-subs-text-border-color')) {
182
+ $inputStyles['border-color'] = $this->getFieldValue('sgpb-subs-text-border-color');
183
+ }
184
+ if ($this->getFieldValue('sgpb-subs-text-bg-color')) {
185
+ $inputStyles['background-color'] = $this->getFieldValue('sgpb-subs-text-bg-color');
186
+ }
187
+ if ($this->getFieldValue('sgpb-subs-text-color')) {
188
+ $inputStyles['color'] = $this->getFieldValue('sgpb-subs-text-color');
189
+ }
190
+ $inputStyles['autocomplete'] = 'off';
191
+
192
+ if ($this->getFieldValue('sgpb-subs-btn-width')) {
193
+ $submitWidth = $this->getFieldValue('sgpb-subs-btn-width');
194
+ $submitStyles['width'] = AdminHelper::getCSSSafeSize($submitWidth);
195
+ }
196
+ if ($this->getFieldValue('sgpb-subs-btn-height')) {
197
+ $submitHeight = $this->getFieldValue('sgpb-subs-btn-height');
198
+ $submitStyles['height'] = AdminHelper::getCSSSafeSize($submitHeight);
199
+ }
200
+ if ($this->getFieldValue('sgpb-subs-btn-bg-color')) {
201
+ $submitStyles['background-color'] = $this->getFieldValue('sgpb-subs-btn-bg-color');
202
+ }
203
+ if ($this->getFieldValue('sgpb-subs-btn-text-color')) {
204
+ $submitStyles['color'] = $this->getFieldValue('sgpb-subs-btn-text-color');
205
+ }
206
+ $submitStyles['text-transform'] = 'none !important';
207
+
208
+ $formData['email'] = array(
209
+ 'isShow' => true,
210
+ 'attrs' => array(
211
+ 'type' => 'email',
212
+ 'data-required' => true,
213
+ 'name' => 'sgpb-subs-email',
214
+ 'placeholder' => $emailPlaceholder,
215
+ 'class' => 'js-subs-text-inputs js-subs-email-input',
216
+ 'data-error-message-class' => 'sgpb-subs-email-error-message'
217
+ ),
218
+ 'style' => $inputStyles,
219
+ 'errorMessageBoxStyles' => $inputStyles['width']
220
+ );
221
+
222
+ $firstNamePlaceholder = $this->getFieldValue('sgpb-subs-first-placeholder');
223
+ $firstNameRequired = (!empty($postData['sgpb-subs-first-name-required'])) ? true : false;
224
+ $isShow = ($this->getFieldValue('sgpb-subs-first-name-status')) ? true : false;
225
+
226
+ $formData['first-name'] = array(
227
+ 'isShow' => $isShow,
228
+ 'attrs' => array(
229
+ 'type' => 'text',
230
+ 'data-required' => $firstNameRequired,
231
+ 'name' => 'sgpb-subs-first-name',
232
+ 'placeholder' => $firstNamePlaceholder,
233
+ 'class' => 'js-subs-text-inputs js-subs-first-name-input',
234
+ 'data-error-message-class' => 'sgpb-subs-first-name-error-message'
235
+ ),
236
+ 'style' => $inputStyles,
237
+ 'errorMessageBoxStyles' => $inputStyles['width']
238
+ );
239
+
240
+ $lastNamePlaceholder = $this->getFieldValue('sgpb-subs-last-placeholder');
241
+ $lastNameRequired = (!empty($postData['sgpb-subs-last-name-required'])) ? true : false;
242
+ $isShow = ($this->getFieldValue('sgpb-subs-last-name-status')) ? true : false;
243
+
244
+ $formData['last-name'] = array(
245
+ 'isShow' => $isShow,
246
+ 'attrs' => array(
247
+ 'type' => 'text',
248
+ 'data-required' => $lastNameRequired,
249
+ 'name' => 'sgpb-subs-last-name',
250
+ 'placeholder' => $lastNamePlaceholder,
251
+ 'class' => 'js-subs-text-inputs js-subs-last-name-input',
252
+ 'data-error-message-class' => 'sgpb-subs-last-name-error-message'
253
+ ),
254
+ 'style' => $inputStyles,
255
+ 'errorMessageBoxStyles' => $inputStyles['width']
256
+ );
257
+
258
+ /* GDPR checkbox */
259
+ $gdprLabel = $this->getFieldValue('sgpb-subs-gdpr-label');
260
+ $gdprRequired = ($this->getFieldValue('sgpb-subs-gdpr-status')) ? true : false;
261
+ $isShow = ($this->getFieldValue('sgpb-subs-gdpr-status')) ? true : false;
262
+
263
+ $formData['gdpr'] = array(
264
+ 'isShow' => $isShow,
265
+ 'attrs' => array(
266
+ 'type' => 'checkbox',
267
+ 'data-required' => $gdprRequired,
268
+ 'name' => 'sgpb-subs-gdpr',
269
+ 'class' => 'js-subs-gdpr-inputs js-subs-gdpr-label',
270
+ 'id' => 'sgpb-gdpr-field-label',
271
+ 'data-error-message-class' => 'sgpb-gdpr-error-message'
272
+ ),
273
+ 'style' => array('width' => $inputWidth),
274
+ 'label' => $gdprLabel,
275
+ 'text' => $this->getFieldValue('sgpb-subs-gdpr-text'),
276
+ 'errorMessageBoxStyles' => $inputStyles['width']
277
+ );
278
+ /* GDPR checkbox */
279
+
280
+ $hiddenChecker['position'] = 'absolute';
281
+ // For protected bots and spams
282
+ $hiddenChecker['left'] = '-5000px';
283
+ $hiddenChecker['padding'] = '0';
284
+ $formData['hidden-checker'] = array(
285
+ 'isShow' => false,
286
+ 'attrs' => array(
287
+ 'type' => 'hidden',
288
+ 'data-required' => false,
289
+ 'name' => 'sgpb-subs-hidden-checker',
290
+ 'value' => '',
291
+ 'class' => 'js-subs-text-inputs js-subs-last-name-input'
292
+ ),
293
+ 'style' => $hiddenChecker
294
+ );
295
+
296
+ $submitTitle = $this->getFieldValue('sgpb-subs-btn-title');
297
+ $progressTitle = $this->getFieldValue('sgpb-subs-btn-progress-title');
298
+ $formData['submit'] = array(
299
+ 'isShow' => true,
300
+ 'attrs' => array(
301
+ 'type' => 'submit',
302
+ 'name' => 'sgpb-subs-submit',
303
+ 'value' => $submitTitle,
304
+ 'data-title' => $submitTitle,
305
+ 'data-progress-title' => $progressTitle,
306
+ 'class' => 'js-subs-submit-btn'
307
+ ),
308
+ 'style' => $submitStyles
309
+ );
310
+
311
+ return $formData;
312
+ }
313
+
314
+ /**
315
+ * Create validation obj for jQuery validate
316
+ *
317
+ * @since 1.0.0
318
+ *
319
+ * @param array $subsFields
320
+ * @param array $validationMessages
321
+ *
322
+ * @return string
323
+ */
324
+ private function createValidateObj($subsFields, $validationMessages)
325
+ {
326
+ $validateObj = '';
327
+
328
+ if (empty($subsFields)) {
329
+ return $validateObj;
330
+ }
331
+
332
+ $rules = 'rules: { ';
333
+ $validateObj = 'var sgpbSubsValidateObj = { ';
334
+ foreach ($subsFields as $subsField) {
335
+
336
+ if (empty($subsField['attrs'])) {
337
+ continue;
338
+ }
339
+
340
+ $attrs = $subsField['attrs'];
341
+ $type = 'text';
342
+ $name = '';
343
+ $required = false;
344
+
345
+ if (!empty($attrs['type'])) {
346
+ $type = $attrs['type'];
347
+ }
348
+ if (!empty($attrs['name'])) {
349
+ $name = $attrs['name'];
350
+ }
351
+ if (!empty($attrs['data-required'])) {
352
+ $required = $attrs['data-required'];
353
+ }
354
+
355
+ if ($type == 'email') {
356
+ $rules .= '"'.$name.'": {required: true, email: true},';
357
+ continue;
358
+ }
359
+
360
+ if (!$required) {
361
+ continue;
362
+ }
363
+
364
+ $rules .= '"'.$name.'" : "required",';
365
+
366
+ }
367
+ $rules = rtrim($rules, ',');
368
+
369
+ $rules .= '},';
370
+ $validateObj .= $rules;
371
+ $validateObj .= '};';
372
+ $validateObj .= 'jQuery.extend(jQuery.validator.messages, { ';
373
+ $validateObj .= 'required: "'.$validationMessages['requiredMessage'].'"';
374
+ $validateObj .= ' });';
375
+
376
+ return $validateObj;
377
+ }
378
+
379
+ private function getSubscriptionValidationScripts($validateObj)
380
+ {
381
+ $script = '<script type="text/javascript">';
382
+ $script .= $validateObj;
383
+ $script .= '</script>';
384
+
385
+ return $script;
386
+ }
387
+
388
+ public function getFormCustomStyles($styleData)
389
+ {
390
+ $placeholderColor = $styleData['placeholderColor'];
391
+ $formBackgroundColor = $this->getFieldValue('sgpb-subs-form-bg-color');
392
+ $formPadding = $this->getFieldValue('sgpb-subs-form-padding');
393
+ $formBackgroundOpacity = $this->getFieldValue('sgpb-subs-form-bg-opacity');
394
+ $popupId = $this->getId();
395
+ if (isset($styleData['formBackgroundOpacity'])) {
396
+ $formBackgroundOpacity = $styleData['formBackgroundOpacity'];
397
+ }
398
+ if (isset($styleData['formColor'])) {
399
+ $formBackgroundColor = $styleData['formColor'];
400
+ }
401
+ if (isset($styleData['formPadding'])) {
402
+ $formPadding = $styleData['formPadding'];
403
+ }
404
+ $formBackgroundColor = AdminHelper::hexToRgba($formBackgroundColor, $formBackgroundOpacity);
405
+
406
+ ob_start();
407
+ ?>
408
+ <style type="text/css">
409
+ .sgpb-subs-form-<?php echo $popupId; ?> {background-color: <?php echo $formBackgroundColor; ?>;padding: <?php echo $formPadding.'px'; ?>}
410
+ .sgpb-subs-form-<?php echo $popupId; ?> .js-subs-text-inputs::-webkit-input-placeholder {color: <?php echo $placeholderColor; ?>;font-weight: lighter;}
411
+ .sgpb-subs-form-<?php echo $popupId; ?> .js-subs-text-inputs::-moz-placeholder {color:<?php echo $placeholderColor; ?>;font-weight: lighter;}
412
+ .sgpb-subs-form-<?php echo $popupId; ?> .js-subs-text-inputs:-ms-input-placeholder {color:<?php echo $placeholderColor; ?>;font-weight: lighter;} /* ie */
413
+ .sgpb-subs-form-<?php echo $popupId; ?> .js-subs-text-inputs:-moz-placeholder {color:<?php echo $placeholderColor; ?>;font-weight: lighter;}
414
+ </style>
415
+ <?php
416
+ $styles = ob_get_contents();
417
+ ob_get_clean();
418
+
419
+ return $styles;
420
+ }
421
+
422
+ public function getOptionValue($optionName, $forceDefaultValue = false)
423
+ {
424
+ return parent::getOptionValue($optionName, $forceDefaultValue);
425
+ }
426
+
427
+ public function getPopupTypeOptionsView()
428
+ {
429
+ $optionsViewData = array(
430
+ 'filePath' => SG_POPUP_TYPE_OPTIONS_PATH . 'subscription.php',
431
+ 'metaboxTitle' => 'Subscription Options'
432
+ );
433
+
434
+ return $optionsViewData;
435
+ }
436
+
437
+ private function getSubscriptionForm($subsFields)
438
+ {
439
+ $popupId = $this->getId();
440
+ $form = '<div class="sgpb-subs-form-'.$popupId.' sgpb-subscription-form">';
441
+ $form .= $this->getFormMessages();
442
+ $form .= Functions::renderForm($subsFields);
443
+ $form .= '</div>';
444
+
445
+ return $form;
446
+ }
447
+
448
+ private function getFormMessages()
449
+ {
450
+ $successMessage = $this->getOptionValue('sgpb-subs-success-message');
451
+ $errorMessage = $this->getOptionValue('sgpb-subs-error-message');
452
+ ob_start();
453
+ ?>
454
+ <div class="subs-form-messages sgpb-alert sgpb-alert-success sg-hide-element">
455
+ <p><?php echo $successMessage; ?></p>
456
+ </div>
457
+ <div class="subs-form-messages sgpb-alert sgpb-alert-danger sg-hide-element">
458
+ <p><?php echo $errorMessage; ?></p>
459
+ </div>
460
+ <?php
461
+ $messages = ob_get_contents();
462
+ ob_end_clean();
463
+
464
+ return $messages;
465
+ }
466
+
467
+ public function getPopupTypeContent()
468
+ {
469
+ $popupContent = $this->getContent();
470
+ $popupOptions = $this->getOptions();
471
+ $subsFields = $this->getOptionValue('sgpb-subs-fields');
472
+ $subsRequiredMessages = '';
473
+ if (!empty($popupOptions['sgpb-subs-validation-message'])) {
474
+ $subsRequiredMessages = $popupOptions['sgpb-subs-validation-message'];
475
+ }
476
+
477
+ if (empty($subsFields)) {
478
+ return $popupContent;
479
+ }
480
+
481
+ $validationMessages = array(
482
+ 'requiredMessage' => $subsRequiredMessages
483
+ );
484
+
485
+ $styleData = array(
486
+ 'placeholderColor' => $popupOptions['sgpb-subs-text-placeholder-color'],
487
+ 'formColor' => $popupOptions['sgpb-subs-form-bg-color'],
488
+ 'formPadding' => $popupOptions['sgpb-subs-form-padding'],
489
+ 'formBackgroundOpacity' => $popupOptions['sgpb-subs-form-bg-opacity']
490
+ );
491
+
492
+ $validateScript = $this->createValidateObj($subsFields, $validationMessages);
493
+ $popupContent .= $this->getSubscriptionForm($subsFields);
494
+ $popupContent .= $this->getSubscriptionValidationScripts($validateScript);
495
+ $popupContent .= $this->getFormCustomStyles($styleData);
496
+
497
+ return $popupContent;
498
+ }
499
+
500
+ public function getSubPopupObj()
501
+ {
502
+ $options = $this->getOptions();
503
+ $subPopups = parent::getSubPopupObj();
504
+ if ($options['sgpb-subs-success-behavior'] == 'openPopup') {
505
+ $subPopupId = (!empty($options['sgpb-subs-success-popup'])) ? (int)$options['sgpb-subs-success-popup']: null;
506
+
507
+ if (empty($subPopupId)) {
508
+ return $subPopups;
509
+ }
510
+
511
+ $subPopupObj = SGPopup::find($subPopupId);
512
+ if (!empty($subPopupObj) && ($subPopupObj instanceof SGPopup)) {
513
+ // We remove all events because this popup will be open after successful subscription
514
+ $subPopupObj->setEvents(array('param' => 'click', 'value' => ''));
515
+ $subPopups[] = $subPopupObj;
516
+ }
517
+ }
518
+
519
+ return $subPopups;
520
+ }
521
+
522
+ public function getExtraRenderOptions()
523
+ {
524
+ return array();
525
+ }
526
+
527
+ public static function getSubscribersCount()
528
+ {
529
+ global $wpdb;
530
+ $count = $wpdb->get_var('SELECT COUNT(*) FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME);
531
+
532
+ return (int)$count;
533
+ }
534
+
535
+ public static function getAllSubscriptions()
536
+ {
537
+ $popupArgs = array();
538
+ $popupArgs['type'] = 'subscription';
539
+ $allPopups = SGPopup::getAllPopups($popupArgs);
540
+
541
+ return $allPopups;
542
+ }
543
+
544
+ public static function getAllSubscriptionForms()
545
+ {
546
+ $subsFormList = array();
547
+ $subscriptionForms = self::getAllSubscriptions();
548
+
549
+ foreach ($subscriptionForms as $subscriptionForm) {
550
+ $title = $subscriptionForm->getTitle();
551
+ $id = $subscriptionForm->getId();
552
+ if ($title == '') {
553
+ $title = '('.__('no title', SG_POPUP_TEXT_DOMAIN).')';
554
+ }
555
+ $subsFormList[$id] = $title;
556
+ }
557
+
558
+ return $subsFormList;
559
+ }
560
+
561
+ public static function getAllSubscribersDate()
562
+ {
563
+ $subsDateList = array();
564
+ global $wpdb;
565
+ $subscriptionPopups = $wpdb->get_results('SELECT id, cDate FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME, ARRAY_A);
566
+
567
+ foreach ($subscriptionPopups as $subscriptionForm) {
568
+ $id = $subscriptionForm['id'];
569
+ $date = substr($subscriptionForm['cDate'], 0, 7);
570
+ $subsDateList[$id]['date-value'] = $date;
571
+ $subsDateList[$id]['date-title'] = AdminHelper::getFormattedDate($date);
572
+ }
573
+
574
+ return $subsDateList;
575
+ }
576
+ }
com/config/config.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SgpbPopupConfig
3
+ {
4
+ public static function addDefine($name, $value)
5
+ {
6
+ if (!defined($name)) {
7
+ define($name, $value);
8
+ }
9
+ }
10
+
11
+ public static function init()
12
+ {
13
+ self::addDefine('SGPB_POPUP_FREE_MIN_VERSION', '3.0.2');
14
+ self::addDefine('SGPB_POPUP_PRO_MIN_VERSION', '4.0');
15
+
16
+ self::addDefine('SGPB_POPUP_PKG_FREE', 1);
17
+ self::addDefine('SGPB_POPUP_PKG_SILVER', 2);
18
+ self::addDefine('SGPB_POPUP_PKG_GOLD', 3);
19
+ self::addDefine('SGPB_POPUP_PKG_PLATINUM', 4);
20
+ self::addDefine('SG_POPUP_PRO_URL', 'https://popup-builder.com/#prices');
21
+ self::addDefine('SG_POPUP_TICKET_URL', 'https://sygnoos.ladesk.com/submit_ticket');
22
+ self::addDefine('SG_POPUP_RATE_US_URL', 'https://wordpress.org/support/plugin/popup-builder/reviews/?filter=5');
23
+ self::addDefine('SG_POPUP_AD_BLOCK_URL', 'https://popup-builder.com/downloads/adblock/');
24
+ self::addDefine('SG_POPUP_ANALYTICS_URL', 'https://popup-builder.com/downloads/analytics/');
25
+ self::addDefine('SG_POPUP_EXIT_INTENT_URL', 'https://popup-builder.com/downloads/exit-intent/');
26
+ self::addDefine('SG_POPUP_MAILCHIMP_URL', 'https://popup-builder.com/downloads/mailchimp/');
27
+ self::addDefine('SG_POPUP_AWEBER_URL', 'https://popup-builder.com/downloads/aweber/');
28
+ self::addDefine('SG_POPUP_ADMIN_URL', admin_url());
29
+ self::addDefine('SG_POPUP_BUILDER_URL', plugins_url().'/'.SG_POPUP_FOLDER_NAME.'/');
30
+ self::addDefine('SG_POPUP_BUILDER_PATH', WP_PLUGIN_DIR.'/'.SG_POPUP_FOLDER_NAME.'/');
31
+ self::addDefine('SG_POPUP_COM_PATH', SG_POPUP_BUILDER_PATH.'com/');
32
+ self::addDefine('SG_POPUP_CONFIG_PATH', SG_POPUP_COM_PATH.'config/');
33
+ self::addDefine('SG_POPUP_PUBLIC_PATH', SG_POPUP_BUILDER_PATH.'public/');
34
+ self::addDefine('SG_POPUP_CLASSES_PATH', SG_POPUP_COM_PATH.'classes/');
35
+ self::addDefine('SG_POPUP_DATA_TABLES_PATH', SG_POPUP_CLASSES_PATH.'dataTable/');
36
+ self::addDefine('SG_POPUP_CLASSES_POPUPS_PATH', SG_POPUP_CLASSES_PATH.'popups/');
37
+ self::addDefine('SG_POPUP_EXTENSION_PATH', SG_POPUP_CLASSES_PATH.'extension/');
38
+ self::addDefine('SG_POPUP_LIBS_PATH', SG_POPUP_COM_PATH.'libs/');
39
+ self::addDefine('SG_POPUP_HELPERS_PATH', SG_POPUP_COM_PATH.'helpers/');
40
+ self::addDefine('SG_POPUP_JS_PATH', SG_POPUP_PUBLIC_PATH.'js/');
41
+ self::addDefine('SG_POPUP_CSS_PATH', SG_POPUP_PUBLIC_PATH.'css/');
42
+ self::addDefine('SG_POPUP_VIEWS_PATH', SG_POPUP_PUBLIC_PATH.'views/');
43
+ self::addDefine('SG_POPUP_TYPE_OPTIONS_PATH', SG_POPUP_VIEWS_PATH.'options/');
44
+ self::addDefine('SG_POPUP_TYPE_MAIN_PATH', SG_POPUP_VIEWS_PATH.'main/');
45
+ self::addDefine('SG_POPUP_PUBLIC_URL', SG_POPUP_BUILDER_URL.'public/');
46
+ self::addDefine('SG_POPUP_JS_URL', SG_POPUP_PUBLIC_URL.'js/');
47
+ self::addDefine('SG_POPUP_CSS_URL', SG_POPUP_PUBLIC_URL.'css/');
48
+ self::addDefine('SG_POPUP_IMG_URL', SG_POPUP_PUBLIC_URL.'img/');
49
+ self::addDefine('SG_POPUP_SOUND_URL', SG_POPUP_PUBLIC_URL.'sound/');
50
+ self::addDefine('SG_POPUP_DEFAULT_TIME_ZONE', 'UTC');
51
+ self::addDefine('SG_POPUP_CATEGORY_TAXONOMY', 'popup-categories');
52
+ self::addDefine('SG_RANDOM_TAXONOMY_SLUG', 'randompopupslug');
53
+ self::addDefine('SG_POPUP_MINIMUM_PHP_VERSION', '5.3.3');
54
+ self::addDefine('SG_POPUP_POST_TYPE', 'popupbuilder');
55
+ self::addDefine('SG_POPUP_NEWSLETTER_PAGE', 'newsletter');
56
+ self::addDefine('SG_POPUP_SETTINGS_PAGE', 'settings');
57
+ self::addDefine('SGPB_POPUP_LICENSE', 'license');
58
+ self::addDefine('SGPB_FILTER_REPEAT_INTERVAL', 50);
59
+ self::addDefine('SG_POPUP_TEXT_DOMAIN', 'popupBuilder');
60
+ self::addDefine('SG_POPUP_STORE_URL', 'https://popup-builder.com/');
61
+ // for popup builder license version
62
+ self::addDefine('SG_VERSION_POPUP_BUILDER', 4.0);
63
+ self::addDefine('SG_POPUP_AUTHOR', 'Sygnoos');
64
+ self::addDefine('SG_POPUP_KEY', 'POPUP_BUILDER');
65
+ self::addDefine('SG_AJAX_NONCE', 'popupBuilderAjaxNonce');
66
+ self::addDefine('SG_CONDITION_FIRST_RULE', 0);
67
+ self::addDefine('SGPB_AJAX_STATUS_FALSE', 0);
68
+ self::addDefine('SGPB_AJAX_STATUS_TRUE', 1);
69
+ self::addDefine('SG_COUNTDOWN_COUNTER_SECONDS_SHOW', 1);
70
+ self::addDefine('SG_COUNTDOWN_COUNTER_SECONDS_HIDE', 2);
71
+ self::addDefine('SGPB_SUBSCRIBERS_TABLE_NAME', 'sgpb_subscribers');
72
+ self::addDefine('SGPB_POSTS_TABLE_NAME', 'posts');
73
+ self::addDefine('SGPB_APP_POPUP_TABLE_LIMIT', 15);
74
+ self::addDefine('SGPB_SUBSCRIBERS_ERROR_TABLE_NAME', 'sgpb_subscription_error_log');
75
+ self::addDefine('SGPB_CRON_REPEAT_INTERVAL', 1);
76
+ self::addDefine('SGPB_FACEBOOK_APP_ID', 1725074220856984);
77
+ self::addDefine('SGPB_POPUP_TYPE_AGE_RESTRICTION', 'ageRestriction');
78
+ self::addDefine('SGPB_POPUP_DEFAULT_SOUND', 'popupOpenSound.wav');
79
+ self::addDefine('SGPB_POPUP_EXTENSIONS_PATH', SG_POPUP_COM_PATH.'extensions/');
80
+ self::addDefine('SGPB_DONT_SHOW_POPUP_EXPIRY', 365);
81
+ self::addDefine('SGPB_CONTACT_FORM_7_BEHAVIOR_KEY', 'contact-form-7');
82
+ self::popupTypesInit();
83
+ }
84
+
85
+ public static function popupTypesInit()
86
+ {
87
+ global $SGPB_POPUP_TYPES;
88
+
89
+ $SGPB_POPUP_TYPES['typeName'] = apply_filters('sgpbAddPopupType', array(
90
+ 'image' => SGPB_POPUP_PKG_FREE,
91
+ 'html' => SGPB_POPUP_PKG_FREE,
92
+ 'fblike' => SGPB_POPUP_PKG_FREE,
93
+ 'subscription' => SGPB_POPUP_PKG_FREE,
94
+ 'iframe' => SGPB_POPUP_PKG_SILVER,
95
+ 'video' => SGPB_POPUP_PKG_SILVER,
96
+ SGPB_POPUP_TYPE_AGE_RESTRICTION => SGPB_POPUP_PKG_GOLD,
97
+ 'countdown' => SGPB_POPUP_PKG_GOLD,
98
+ 'social' => SGPB_POPUP_PKG_GOLD,
99
+ 'contactForm' => SGPB_POPUP_PKG_GOLD
100
+ ));
101
+
102
+ $SGPB_POPUP_TYPES['typePath'] = apply_filters('sgpbAddPopupTypePath', array(
103
+ 'image' => SG_POPUP_CLASSES_POPUPS_PATH,
104
+ 'html' => SG_POPUP_CLASSES_POPUPS_PATH,
105
+ 'fblike' => SG_POPUP_CLASSES_POPUPS_PATH,
106
+ 'iframe' => SG_POPUP_CLASSES_POPUPS_PATH,
107
+ 'video' => SG_POPUP_CLASSES_POPUPS_PATH,
108
+ 'ageRestriction' => SG_POPUP_CLASSES_POPUPS_PATH,
109
+ 'countdown' => SG_POPUP_CLASSES_POPUPS_PATH,
110
+ 'social' => SG_POPUP_CLASSES_POPUPS_PATH,
111
+ 'subscription' => SG_POPUP_CLASSES_POPUPS_PATH,
112
+ 'contactForm' => SG_POPUP_CLASSES_POPUPS_PATH
113
+ ));
114
+
115
+ $SGPB_POPUP_TYPES['typeLabels'] = apply_filters('sgpbAddPopupTypeLabels', array(
116
+ 'image' => __('Image', SG_POPUP_TEXT_DOMAIN),
117
+ 'html' => __('HTML', SG_POPUP_TEXT_DOMAIN),
118
+ 'fblike' => __('Facebook', SG_POPUP_TEXT_DOMAIN),
119
+ 'iframe' => __('Iframe', SG_POPUP_TEXT_DOMAIN),
120
+ 'video' => __('Video', SG_POPUP_TEXT_DOMAIN),
121
+ 'ageRestriction' => __('Restriction', SG_POPUP_TEXT_DOMAIN),
122
+ 'countdown' => __('Countdown', SG_POPUP_TEXT_DOMAIN),
123
+ 'social' => __('Social', SG_POPUP_TEXT_DOMAIN),
124
+ 'subscription' => __('Subscription', SG_POPUP_TEXT_DOMAIN),
125
+ 'contactForm' => __('Contact form', SG_POPUP_TEXT_DOMAIN)
126
+ ));
127
+ }
128
+ }
129
+
130
+ SgpbPopupConfig::init();
com/config/configPackage.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit();
4
+ }
5
+
6
+ define('SG_POPUP_VERSION', '3.0.2');
7
+ define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
+ define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php ADDED
@@ -0,0 +1,790 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(SG_POPUP_HELPERS_PATH.'ConfigDataHelper.php');
3
+ use sgpb\PopupBuilderActivePackage;
4
+ class SgpbDataConfig
5
+ {
6
+ public static function init()
7
+ {
8
+ self::addFilters();
9
+ self::conditionInit();
10
+ self::popupDefaultOptions();
11
+ }
12
+
13
+ public static function conditionInit()
14
+ {
15
+ global $SGPB_DATA_CONFIG_ARRAY;
16
+
17
+ /*Target condition config*/
18
+ $targetData = array('param' => 'Pages', 'operator' => 'Is not', 'value' => 'Value');
19
+ $targetElementTypes = array(
20
+ 'param' => 'select',
21
+ 'operator' => 'select',
22
+ 'value' => 'select',
23
+ 'post_selected' => 'select',
24
+ 'page_selected' => 'select',
25
+ 'post_type' => 'select',
26
+ 'post_category' => 'select',
27
+ 'page_type' => 'select',
28
+ 'page_template' => 'select',
29
+ 'post_tags_ids' => 'select'
30
+ );
31
+
32
+ $targetParams = array(
33
+ 'not_rule' => __('Select rule', SG_POPUP_TEXT_DOMAIN),
34
+ 'Post' => array(
35
+ 'post_all' => __('All posts', SG_POPUP_TEXT_DOMAIN),
36
+ 'post_selected' => __('Selected posts', SG_POPUP_TEXT_DOMAIN),
37
+ 'post_type' => __('Post type', SG_POPUP_TEXT_DOMAIN),
38
+ 'post_category' => __('Post category', SG_POPUP_TEXT_DOMAIN)
39
+ ),
40
+ 'Page' => array(
41
+ 'page_all' => __('All pages', SG_POPUP_TEXT_DOMAIN),
42
+ 'page_selected' => __('Selected pages', SG_POPUP_TEXT_DOMAIN),
43
+ 'page_type' => __('Page type', SG_POPUP_TEXT_DOMAIN),
44
+ 'page_template' => __('Page template', SG_POPUP_TEXT_DOMAIN)
45
+ ),
46
+ 'Tags' => array(
47
+ 'post_tags' => __('All tags', SG_POPUP_TEXT_DOMAIN),
48
+ 'post_tags_ids' => __('Selected tags', SG_POPUP_TEXT_DOMAIN)
49
+ )
50
+ );
51
+
52
+ $targetOperators = array(
53
+ array('operator' => 'add', 'name' => __('Add', SG_POPUP_TEXT_DOMAIN)),
54
+ array('operator' => 'delete', 'name' => __('Delete', SG_POPUP_TEXT_DOMAIN))
55
+ );
56
+
57
+ $targetDataOperator = array(
58
+ '==' => __('Is', SG_POPUP_TEXT_DOMAIN),
59
+ '!=' => __('Is not', SG_POPUP_TEXT_DOMAIN)
60
+ );
61
+
62
+ $targetInitialData = array(
63
+ array('param' => 'not_rule', 'operator' => '==', 'value' => '')
64
+ );
65
+
66
+ $targetDataParams['param'] = apply_filters('sgPopupTargetParams', $targetParams);
67
+ $targetDataParams['operator'] = apply_filters('sgPopupTargetOperator', $targetDataOperator);
68
+ $targetDataParams['post_selected'] = apply_filters('sgPopupTargetPostData', array());
69
+ $targetDataParams['page_selected'] = apply_filters('sgPopupTargetPageSelected', array());
70
+ $targetDataParams['post_type'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getAllCustomPostTypes());
71
+ $targetDataParams['post_category'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getPostsAllCategories());
72
+ $targetDataParams['page_type'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getPageTypes());
73
+ $targetDataParams['page_template'] = apply_filters('sgPopupPageTemplates', array());
74
+ $targetDataParams['post_tags_ids'] = apply_filters('sgPopupTags', ConfigDataHelper::getAllTags());
75
+ $targetDataParams['not_rule'] = null;
76
+ $targetDataParams['post_all'] = null;
77
+ $targetDataParams['page_all'] = null;
78
+ $targetDataParams['post_tags'] = null;
79
+
80
+ $targetAttrs = array(
81
+ 'param' => array(
82
+ 'htmlAttrs' => array(
83
+ 'class' => 'js-sg-select2 js-select-basic',
84
+ 'data-select-class' => 'js-select-basic',
85
+ 'data-select-type' => 'basic',
86
+ 'autocomplete' => 'off'
87
+ ),
88
+ 'infoAttrs' => array(
89
+ 'label' => 'Display rule',
90
+ 'info' => __('Specify where the popup should be shown on your site.', SG_POPUP_TEXT_DOMAIN)
91
+ )
92
+
93
+ ),
94
+ 'operator' => array(
95
+ 'htmlAttrs' => array(
96
+ 'class' => 'js-sg-select2 js-select-basic',
97
+ 'data-select-class' => 'js-select-basic',
98
+ 'data-select-type' => 'basic'
99
+ ),
100
+ 'infoAttrs' => array(
101
+ 'label' => 'Is or is not',
102
+ 'info' => __('Allow or Disallow popup showing for the selected rule.', SG_POPUP_TEXT_DOMAIN)
103
+ )
104
+ ),
105
+ 'post_selected' => array(
106
+ 'htmlAttrs' => array(
107
+ 'class' => 'js-sg-select2 js-select-ajax',
108
+ 'data-select-class' => 'js-select-ajax',
109
+ 'data-select-type' => 'ajax',
110
+ 'data-value-param' => 'post',
111
+ 'multiple' => 'multiple'
112
+ ),
113
+ 'infoAttrs' => array(
114
+ 'label' => 'Select Your Posts',
115
+ 'info' => __('Select your specific posts where the popup should be shown.', SG_POPUP_TEXT_DOMAIN)
116
+ )
117
+ ),
118
+ 'page_selected' => array(
119
+ 'htmlAttrs' => array(
120
+ 'class' => 'js-sg-select2 js-select-ajax',
121
+ 'data-select-class' => 'js-select-ajax',
122
+ 'data-select-type' => 'ajax',
123
+ 'data-value-param' => 'page',
124
+ 'multiple' => 'multiple'
125
+ ),
126
+ 'infoAttrs' => array(
127
+ 'label' => 'Select Your Pages',
128
+ 'info' => __('Select the pages on your site where the specific popup will be shown.', SG_POPUP_TEXT_DOMAIN)
129
+ )
130
+ ),
131
+ 'post_type' => array(
132
+ 'htmlAttrs' => array(
133
+ 'class' => 'js-sg-select2 js-select-ajax',
134
+ 'data-select-class' => 'js-select-ajax',
135
+ 'data-select-type' => 'multiple',
136
+ 'data-value-param' => 'postTypes',
137
+ 'isNotPostType' => true,
138
+ 'multiple' => 'multiple'
139
+ ),
140
+ 'infoAttrs' => array(
141
+ 'label' => 'Select Your post types',
142
+ 'info' => __('Specify the post types on your site to show the popup.', SG_POPUP_TEXT_DOMAIN)
143
+ )
144
+ ),
145
+ 'post_category' => array(
146
+ 'htmlAttrs' => array(
147
+ 'class' => 'js-sg-select2 js-select-ajax',
148
+ 'data-select-class' => 'js-select-ajax',
149
+ 'data-select-type' => 'multiple',
150
+ 'data-value-param' => 'postCategories',
151
+ 'isNotPostType' => true,
152
+ 'multiple' => 'multiple'
153
+ ),
154
+ 'infoAttrs' => array(
155
+ 'label' => 'Select post categories',
156
+ 'info' => __('Select the post categories on which the popup should be shown.', SG_POPUP_TEXT_DOMAIN)
157
+ )
158
+ ),
159
+ 'page_type' => array(
160
+ 'htmlAttrs' => array(
161
+ 'class' => 'js-sg-select2 js-select-ajax',
162
+ 'data-select-class' => 'js-select-ajax',
163
+ 'data-select-type' => 'multiple',
164
+ 'data-value-param' => 'postCategories',
165
+ 'isNotPostType' => true,
166
+ 'multiple' => 'multiple'
167
+ ),
168
+ 'infoAttrs' => array(
169
+ 'label' => 'Select specific page types',
170
+ 'info' => __('Specify the page types where the popup will be shown.', SG_POPUP_TEXT_DOMAIN)
171
+ )
172
+ ),
173
+ 'page_template' => array(
174
+ 'htmlAttrs' => array(
175
+ 'class' => 'js-sg-select2 js-select-ajax',
176
+ 'data-select-class' => 'js-select-ajax',
177
+ 'data-select-type' => 'multiple',
178
+ 'data-value-param' => 'pageTemplate',
179
+ 'isNotPostType' => true,
180
+ 'multiple' => 'multiple'
181
+ ),
182
+ 'infoAttrs' => array(
183
+ 'label' => 'Select page template',
184
+ 'info' => __('Select the page templates on which the popup will be shown.', SG_POPUP_TEXT_DOMAIN)
185
+ )
186
+ ),
187
+ 'post_tags_ids' => array(
188
+ 'htmlAttrs' => array(
189
+ 'class' => 'js-sg-select2 js-select-ajax',
190
+ 'data-select-class' => 'js-select-ajax',
191
+ 'data-select-type' => 'multiple',
192
+ 'data-value-param' => 'postTags',
193
+ 'isNotPostType' => true,
194
+ 'multiple' => 'multiple'
195
+ ),
196
+ 'infoAttrs' => array(
197
+ 'label' => 'Select tags',
198
+ 'info' => __('Select the tags on your site for popup showing', SG_POPUP_TEXT_DOMAIN)
199
+ )
200
+ )
201
+ );
202
+
203
+ $popupTarget['columns'] = apply_filters('sgPopupTargetColumns', $targetData);
204
+ $popupTarget['columnTypes'] = apply_filters('sgPopupTargetTypes', $targetElementTypes);
205
+ $popupTarget['paramsData'] = apply_filters('sgPopupTargetData', $targetDataParams);
206
+ $popupTarget['initialData'] = apply_filters('sgPopupTargetInitialData', $targetInitialData);
207
+ $popupTarget['operators'] = apply_filters('sgPopupTargetOperators', $targetOperators);
208
+ $popupTarget['attrs'] = apply_filters('sgPopupTargetAttrs', $targetAttrs);
209
+
210
+ $SGPB_DATA_CONFIG_ARRAY['target'] = $popupTarget;
211
+
212
+ /*Target condition config*/
213
+
214
+ /*
215
+ *
216
+ * Events data
217
+ *
218
+ **/
219
+ $eventsData = array('param' => 'Event name', 'value' => 'Delay');
220
+ $hiddenOptionData = array();
221
+
222
+ $eventsRowTypes = array(
223
+ 'param' => 'select',
224
+ 'value' => 'text',
225
+ 'load' => 'number',
226
+ 'onScroll' => 'number',
227
+ 'inactivity' => 'number',
228
+ 'repetitive' => 'checkbox',
229
+ 'repetitivePeriod' => 'text',
230
+ );
231
+
232
+ $params = array(
233
+ 'load' => 'On load',
234
+ 'inactivity'=>'Inactivity',
235
+ 'onScroll'=> 'On scroll'
236
+ );
237
+
238
+ $hiddenOptionData['load'] = array(
239
+ 'options' => array(
240
+ 'repetitive' => 'Repetitive popup'
241
+ )
242
+ );
243
+
244
+ $onLoadData = 0;
245
+ $inactivityData = 0;
246
+ $onScroll = 0;
247
+
248
+ $eventsDataParams['param'] = $params;
249
+ $eventsDataParams['load'] = $onLoadData;
250
+ $eventsDataParams['onScroll'] = $onScroll;
251
+ $eventsDataParams['inactivity'] = $inactivityData;
252
+ /*Hidden params data*/
253
+ $eventsDataParams['repetitive'] = '';
254
+ $eventsDataParams['repetitivePeriod'] = 0;
255
+
256
+ $eventOperators = array(
257
+ array('operator' => 'add', 'name' => 'Add'),
258
+ array('operator' => 'edit', 'name' => 'Edit'),
259
+ array('operator' => 'delete', 'name' => 'Delete')
260
+ );
261
+
262
+ $eventsInitialData = array(
263
+ array('param' => 'load', 'value' => '')
264
+ );
265
+
266
+ $eventsAttrs = array(
267
+ 'param' => array(
268
+ 'htmlAttrs' => array(
269
+ 'class' => 'js-sg-select2 js-select-basic sgpb-selectbox-settings',
270
+ 'data-select-class' => 'js-select-basic',
271
+ 'data-select-type' => 'basic'
272
+ ),
273
+ 'infoAttrs' => array(
274
+ 'label' => 'Event',
275
+ 'info' => __('Select when the popup should appear on the page.', SG_POPUP_TEXT_DOMAIN)
276
+ )
277
+ ),
278
+ 'operator' => array(
279
+ 'htmlAttrs' => array(
280
+ 'class' => 'js-sg-select2 js-select-basic',
281
+ 'data-select-class' => 'js-select-basic',
282
+ 'data-select-type' => 'basic'
283
+ ),
284
+ 'infoAttrs' => array(
285
+ 'label' => 'Select operator',
286
+ 'info' => __('This is info', SG_POPUP_TEXT_DOMAIN)
287
+ )
288
+ ),
289
+ 'load' => array(
290
+ 'htmlAttrs' => array('class' => 'js-sg-onload-text', 'placeholder' => __('default custom delay will be used', SG_POPUP_TEXT_DOMAIN), 'min' => 0),
291
+ 'infoAttrs' => array(
292
+ 'label' => 'Delay',
293
+ 'info' => __('Specify how long the popup appearance should be delayed after loading the page (in sec).', SG_POPUP_TEXT_DOMAIN)
294
+ )
295
+ ),
296
+ 'onScroll' => array(
297
+ 'htmlAttrs' => array('class' => 'js-sg-onScroll-text', 'min' => 0),
298
+ 'infoAttrs' => array(
299
+ 'label' => 'After x percent',
300
+ 'info' => __('Specify the part of the page, in percentages, where the popup should appear after scrolling.', SG_POPUP_TEXT_DOMAIN)
301
+ )
302
+ ),
303
+ 'inactivity' => array(
304
+ 'htmlAttrs' => array('class' => 'js-sg-inactivity-text', 'min' => 0),
305
+ 'infoAttrs' => array(
306
+ 'label' => 'Delay',
307
+ 'info' => __('Show the popup after some time of inactivity. The popup will appear if a user does nothing for some specific time mentioned.', SG_POPUP_TEXT_DOMAIN)
308
+ )
309
+ ),
310
+ 'repetitive' => array(
311
+ 'htmlAttrs' => array(
312
+ 'class' => 'sgpb-popup-option sgpb-popup-accordion',
313
+ 'data-name' => 'repetitive',
314
+ 'autocomplete' => 'off'
315
+ ),
316
+ 'infoAttrs' => array(
317
+ 'label' => 'Repetitive open popup',
318
+ 'info' => __('If this option is enabled the same popup will open up after every X seconds you have defined (after closing it).', SG_POPUP_TEXT_DOMAIN)
319
+ ),
320
+ 'childOptions' => array('repetitivePeriod')
321
+ ),
322
+ 'repetitivePeriod' => array(
323
+ 'htmlAttrs' => array(
324
+ 'class' => 'sgpb-popup-option',
325
+ 'autocomplete' => 'off'
326
+ ),
327
+ 'infoAttrs' => array(
328
+ 'label' => 'period',
329
+ 'info' => __('This is info', SG_POPUP_TEXT_DOMAIN)
330
+ )
331
+ )
332
+ );
333
+
334
+ $popupEvents['columns'] = apply_filters('sgPopupEventColumns', $eventsData);
335
+ $popupEvents['columnTypes'] = apply_filters('sgPopupEventTypes', $eventsRowTypes);
336
+ $popupEvents['paramsData'] = apply_filters('sgPopupEventsData', $eventsDataParams);
337
+ $popupEvents['initialData'] = apply_filters('sgPopupEventsInitialData', $eventsInitialData);
338
+ $popupEvents['operators'] = apply_filters('sgPopupEventOperators', $eventOperators);
339
+ $popupEvents['hiddenOptionData'] = apply_filters('sgEventsHiddenData', $hiddenOptionData);
340
+ $popupEvents['attrs'] = apply_filters('sgPopupEventAttrs', $eventsAttrs);
341
+
342
+ $SGPB_DATA_CONFIG_ARRAY['events'] = $popupEvents;
343
+
344
+ /*Target condition config*/
345
+ $targetData = array('param' => 'Pages', 'operator' => 'Is not', 'value' => 'Value');
346
+ $targetElementTypes = array(
347
+ 'param' => 'select',
348
+ 'operator' => 'select',
349
+ 'value' => 'select',
350
+ 'groups_user_role' => 'select',
351
+ 'select_role' => 'select',
352
+ 'groups_countries' => 'select',
353
+ 'groups_devices' => 'select'
354
+ );
355
+
356
+ $targetParams = array(
357
+ 'select_role' => __('Select role', SG_POPUP_TEXT_DOMAIN),
358
+ 'Groups' => array(
359
+ 'groups_user_role' => __('User status', SG_POPUP_TEXT_DOMAIN),
360
+ 'groups_countries' => __('Countries', SG_POPUP_TEXT_DOMAIN),
361
+ 'groups_devices' => __('Devices', SG_POPUP_TEXT_DOMAIN)
362
+ )
363
+ );
364
+
365
+ $targetOperators = array(
366
+ array('operator' => 'add', 'name' => __('Add', SG_POPUP_TEXT_DOMAIN)),
367
+ array('operator' => 'delete', 'name' => __('Delete', SG_POPUP_TEXT_DOMAIN))
368
+ );
369
+
370
+ $targetDataOperator = array(
371
+ '==' => __('Is', SG_POPUP_TEXT_DOMAIN),
372
+ '!=' => __('Is not', SG_POPUP_TEXT_DOMAIN)
373
+ );
374
+
375
+ $targetInitialData = array(
376
+ array('param' => 'select_role', 'operator' => '==', 'value' => '')
377
+ );
378
+
379
+ $userStatus = array(
380
+ 'loggedIn' => __('logged in', SG_POPUP_TEXT_DOMAIN)
381
+ );
382
+ $userStatusCanBeUsed = PopupBuilderActivePackage::canUseSection('userStatus');
383
+ if (!$userStatusCanBeUsed) {
384
+ unset($targetParams['Groups']['groups_user_role']);
385
+ $userStatus = array();
386
+ }
387
+
388
+ $targetDataParams['param'] = apply_filters('sgPopupTargetParams', $targetParams);
389
+ $targetDataParams['operator'] = apply_filters('sgPopupTargetOperator', $targetDataOperator);
390
+ $targetDataParams['select_role'] = null;
391
+ $targetDataParams['groups_user_role'] = apply_filters('sgPopupConditionsUserStatus', $userStatus);
392
+ $targetDataParams['groups_countries'] = apply_filters('sgPopupConditionsCountries', ConfigDataHelper::countriesIsoData());
393
+ $targetDataParams['groups_devices'] = apply_filters('sgPopupConditionsDevices', ConfigDataHelper::getDevices());
394
+
395
+ $targetAttrs = array(
396
+ 'param' => array(
397
+ 'htmlAttrs' => array(
398
+ 'class' => 'js-sg-select2 js-select-basic sgpb-selectbox-settings',
399
+ 'data-select-class' => 'js-select-basic',
400
+ 'data-select-type' => 'basic',
401
+ 'autocomplete' => 'off'
402
+ ),
403
+ 'infoAttrs' => array(
404
+ 'label' => 'Condition',
405
+ 'info' => __('Target visitors to show the popup by different conditions.', SG_POPUP_TEXT_DOMAIN)
406
+ )
407
+ ),
408
+ 'operator' => array(
409
+ 'htmlAttrs' => array(
410
+ 'class' => 'js-sg-select2 js-select-basic',
411
+ 'data-select-class' => 'js-select-basic',
412
+ 'data-select-type' => 'basic'
413
+ ),
414
+ 'infoAttrs' => array(
415
+ 'label' => 'Page operator',
416
+ 'info' => __('Allow or Disallow popup showing for the selected conditions.', SG_POPUP_TEXT_DOMAIN)
417
+ )
418
+ ),
419
+ 'groups_user_role' => array(
420
+ 'htmlAttrs' => array(
421
+ 'class' => 'js-sg-select2 js-select-basic',
422
+ 'data-select-class' => 'js-select-basic',
423
+ 'data-select-type' => 'basic'
424
+ ),
425
+ 'infoAttrs' => array(
426
+ 'label' => 'Select user role',
427
+ 'info' => __('Set up the popup to allow it for logged-in or logged-out users.', SG_POPUP_TEXT_DOMAIN)
428
+ )
429
+ ),
430
+ 'groups_countries' => array(
431
+ 'htmlAttrs' => array(
432
+ 'class' => 'js-sg-select2 js-select-basic',
433
+ 'data-select-class' => 'js-select-basic',
434
+ 'data-select-type' => 'basic',
435
+ 'multiple' => 'multiple'
436
+ ),
437
+ 'infoAttrs' => array(
438
+ 'label' => 'Select countries',
439
+ 'info' => __('Select the countries for which the popup will be shown or hidden.', SG_POPUP_TEXT_DOMAIN)
440
+ )
441
+ ),
442
+ 'groups_devices' => array(
443
+ 'htmlAttrs' => array(
444
+ 'class' => 'js-sg-select2 js-select-basic',
445
+ 'data-select-class' => 'js-select-basic',
446
+ 'data-select-type' => 'basic',
447
+ 'multiple' => 'multiple'
448
+ ),
449
+ 'infoAttrs' => array(
450
+ 'label' => 'Select user devices',
451
+ 'info' => __('Select the device for which the popup will be available.', SG_POPUP_TEXT_DOMAIN)
452
+ )
453
+ )
454
+ );
455
+
456
+ $popupConditions['columns'] = apply_filters('sgPopupConditionsColumns', $targetData);
457
+ $popupConditions['columnTypes'] = apply_filters('sgPopupConditionsTypes', $targetElementTypes);
458
+ $popupConditions['paramsData'] = apply_filters('sgPopupConditionsData', $targetDataParams);
459
+ $popupConditions['initialData'] = apply_filters('sgPopupConditionsInitialData', $targetInitialData);
460
+ $popupConditions['operators'] = apply_filters('sgPopupConditionsOperators', $targetOperators);
461
+ $popupConditions['attrs'] = apply_filters('sgPopupConditionsAttrs', $targetAttrs);
462
+
463
+ $SGPB_DATA_CONFIG_ARRAY['conditions'] = $popupConditions;
464
+
465
+ $SGPB_DATA_CONFIG_ARRAY['behavior-after-special-events'] = self::getBehaviorAfterSpecialEventsConfig();
466
+ /*Target condition config*/
467
+ }
468
+
469
+ public static function allExtensionsKeys()
470
+ {
471
+ $keys = array();
472
+
473
+ $keys[] = array(
474
+ 'label' => __('AdBlock', SG_POPUP_TEXT_DOMAIN),
475
+ 'pluginKey' => 'popupbuilder-adblock/PopupBuilderAdBlock.php',
476
+ 'key' => 'sgpbAdBlock',
477
+ 'url' => SG_POPUP_AD_BLOCK_URL
478
+ );
479
+ $keys[] = array(
480
+ 'label' => __('Analytics', SG_POPUP_TEXT_DOMAIN),
481
+ 'pluginKey' => 'popupbuilder-analytics/PopupBuilderAnalytics.php',
482
+ 'key' => 'sgpbAnalitics',
483
+ 'url' => SG_POPUP_ANALYTICS_URL
484
+ );
485
+ $keys[] = array(
486
+ 'label' => __('Exit Intent',SG_POPUP_TEXT_DOMAIN),
487
+ 'pluginKey' => 'popupbuilder-exit-intent/PopupBuilderExitIntent.php',
488
+ 'key' => 'sgpbExitIntent',
489
+ 'url' => SG_POPUP_EXIT_INTENT_URL
490
+ );
491
+ $keys[] = array(
492
+ 'label' => __('MailChimp', SG_POPUP_TEXT_DOMAIN),
493
+ 'pluginKey' => 'popupbuilder-mailchimp/PopupBuilderMailchimp.php',
494
+ 'key' => 'sgpbMailchimp',
495
+ 'url' => SG_POPUP_MAILCHIMP_URL
496
+ );
497
+ $keys[] = array(
498
+ 'label' => __('AWeber', SG_POPUP_TEXT_DOMAIN),
499
+ 'pluginKey' => 'popupbuilder-aweber/PopupBuilderAWeber.php',
500
+ 'key' => 'sgpbAWeber',
501
+ 'url' => SG_POPUP_AWEBER_URL
502
+ );
503
+
504
+ return apply_filters('sgpbExtensionsKeys', $keys);
505
+ }
506
+
507
+ private static function getBehaviorAfterSpecialEventsConfig()
508
+ {
509
+ $columns = array(
510
+ 'param' => 'Event',
511
+ 'operator' => 'Behavior',
512
+ 'value' => 'Value'
513
+ );
514
+
515
+ $columnTypes = array(
516
+ 'param' => 'select',
517
+ 'operator' => 'select',
518
+ 'value' => 'select',
519
+ 'select_event' => 'select',
520
+ 'select_behavior' => 'select',
521
+ 'redirect-url' => 'url',
522
+ 'open-popup' => 'select',
523
+ 'close-popup' => 'number'
524
+ );
525
+
526
+ $params = array(
527
+ 'param' => array(
528
+ 'select_event' => __('Select event', SG_POPUP_TEXT_DOMAIN),
529
+ __('Special events', SG_POPUP_TEXT_DOMAIN) => array(
530
+ SGPB_CONTACT_FORM_7_BEHAVIOR_KEY => __('Contact Form 7 submission', SG_POPUP_TEXT_DOMAIN)
531
+ )
532
+ ),
533
+ 'operator' => array(
534
+ 'select_behavior' => __('Select behavior', SG_POPUP_TEXT_DOMAIN),
535
+ __('Behaviors', SG_POPUP_TEXT_DOMAIN) => array(
536
+ 'redirect-url' => __('Redirect to url', SG_POPUP_TEXT_DOMAIN),
537
+ 'open-popup' => __('Open another popup', SG_POPUP_TEXT_DOMAIN),
538
+ 'close-popup' => __('Close current popup', SG_POPUP_TEXT_DOMAIN)
539
+ )
540
+ ),
541
+ 'redirect-url' => '',
542
+ 'open-popup' => array(),
543
+ 'close-popup' => '',
544
+ 'select_event' => null,
545
+ 'select_behavior' => null
546
+ );
547
+
548
+ $initialData = array(
549
+ array(
550
+ 'param' => 'select_event',
551
+ 'operator' => ''
552
+ )
553
+ );
554
+
555
+ $attrs = array(
556
+ 'param' => array(
557
+ 'htmlAttrs' => array(
558
+ 'class' => 'js-sg-select2 js-select-basic',
559
+ 'data-select-class' => 'js-select-basic',
560
+ 'data-select-type' => 'basic'
561
+ ),
562
+ 'infoAttrs' => array(
563
+ 'label' => __('Event', SG_POPUP_TEXT_DOMAIN),
564
+ 'info' => __('Select the special event you want to catch.', SG_POPUP_TEXT_DOMAIN)
565
+ )
566
+ ),
567
+ 'operator' => array(
568
+ 'htmlAttrs' => array(
569
+ 'class' => 'js-sg-select2 js-select-basic',
570
+ 'data-select-class' => 'js-select-basic',
571
+ 'data-select-type' => 'basic'
572
+ ),
573
+ 'infoAttrs' => array(
574
+ 'label' => __('Behavior', SG_POPUP_TEXT_DOMAIN),
575
+ 'info' => __('Select what should happen after the special event.', SG_POPUP_TEXT_DOMAIN)
576
+ )
577
+ ),
578
+ 'redirect-url' => array(
579
+ 'htmlAttrs' => array(
580
+ 'class' => 'sg-full-width',
581
+ 'placeholder' => 'https://www.example.com',
582
+ 'required' => 'required'
583
+ ),
584
+ 'infoAttrs' => array(
585
+ 'label' => __('URL', SG_POPUP_TEXT_DOMAIN),
586
+ 'info' => __('Enter the URL of the page should be redirected to.', SG_POPUP_TEXT_DOMAIN)
587
+ )
588
+ ),
589
+ 'open-popup' => array(
590
+ 'htmlAttrs' => array(
591
+ 'class' => 'js-sg-select2 js-select-ajax',
592
+ 'data-select-class' => 'js-select-ajax',
593
+ 'data-select-type' => 'ajax',
594
+ 'data-value-param' => SG_POPUP_POST_TYPE,
595
+ 'required' => 'required'
596
+ ),
597
+ 'infoAttrs' => array(
598
+ 'label' => __('Select popup', SG_POPUP_TEXT_DOMAIN),
599
+ 'info' => __('Select the popup that should be opened.', SG_POPUP_TEXT_DOMAIN)
600
+ )
601
+ ),
602
+ 'close-popup' => array(
603
+ 'htmlAttrs' => array(
604
+ 'class' => 'sg-full-width',
605
+ 'required' => 'required',
606
+ 'value' => 0,
607
+ 'min' => 0
608
+ ),
609
+ 'infoAttrs' => array(
610
+ 'label' => __('Delay', SG_POPUP_TEXT_DOMAIN),
611
+ 'info' => __('After how many seconds the popup should close.', SG_POPUP_TEXT_DOMAIN)
612
+ )
613
+ )
614
+ );
615
+
616
+ $config = array();
617
+ $config['columns'] = apply_filters('sgPopupSpecialEventsColumns', $columns);
618
+ $config['columnTypes'] = apply_filters('sgPopupSpecialEventsColumnTypes', $columnTypes);
619
+ $config['paramsData'] = apply_filters('sgPopupSpecialEventsParams', $params);
620
+ $config['initialData'] = apply_filters('sgPopupSpecialEventsInitialData', $initialData);
621
+ $config['attrs'] = apply_filters('sgPopupSpecialEventsAttrs', $attrs);
622
+ $config['operators'] = apply_filters('sgPopupSpecialEventsOperators', array());
623
+
624
+ return $config;
625
+ }
626
+
627
+ public static function popupDefaultOptions()
628
+ {
629
+ global $SGPB_OPTIONS;
630
+ global $SGPB_DATA_CONFIG_ARRAY;
631
+
632
+ $targetDefaultValue = array($SGPB_DATA_CONFIG_ARRAY['target']['initialData']);
633
+
634
+ $eventsDefaultData = array($SGPB_DATA_CONFIG_ARRAY['events']['initialData']);
635
+ $conditionsDefaultData = array($SGPB_DATA_CONFIG_ARRAY['conditions']['initialData']);
636
+ $specialEventsDefaultData = array($SGPB_DATA_CONFIG_ARRAY['behavior-after-special-events']['initialData']);
637
+
638
+ $options = array();
639
+
640
+ $options[] = array('name' => 'sgpb-target', 'type' => 'array', 'defaultValue' => $targetDefaultValue);
641
+ $options[] = array('name' => 'sgpb-events', 'type' => 'array', 'defaultValue' => $eventsDefaultData);
642
+ $options[] = array('name' => 'sgpb-conditions', 'type' => 'array', 'defaultValue' => $conditionsDefaultData, 'min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER);
643
+ $options[] = array('name' => 'sgpb-behavior-after-special-events', 'type' => 'array', 'defaultValue' => $specialEventsDefaultData);
644
+ $options[] = array('name' => 'sgpb-type', 'type' => 'text', 'defaultValue' => 'html');
645
+ $options[] = array('name' => 'sgpb-esc-key', 'type' => 'checkbox', 'defaultValue' => 'on');
646
+ $options[] = array('name' => 'sgpb-enable-close-button', 'type' => 'checkbox', 'defaultValue' => 'on');
647
+ $options[] = array('name' => 'sgpb-enable-content-scrolling', 'type' => 'checkbox', 'defaultValue' => 'on');
648
+ $options[] = array('name' => 'sgpb-overlay-click', 'type' => 'checkbox', 'defaultValue' => 'on');
649
+ $options[] = array('name' => 'sgpb-content-click', 'type' => 'checkbox', 'defaultValue' => '');
650
+ $options[] = array('name' => 'sgpb-content-click-behavior', 'type' => 'text', 'defaultValue' => 'close');
651
+ $options[] = array('name' => 'sgpb-click-redirect-to-url', 'type' => 'text', 'defaultValue' => '');
652
+ $options[] = array('name' => 'sgpb-redirect-to-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
653
+ $options[] = array('name' => 'sgpb-copy-to-clipboard-text', 'type' => 'text', 'defaultValue' => '');
654
+ $options[] = array('name' => 'sgpb-disable-popup-closing', 'type' => 'checkbox', 'defaultValue' => '', 'min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER);
655
+ $options[] = array('name' => 'sgpb-popup-dimension-mode', 'type' => 'text', 'defaultValue' => 'responsiveMode');
656
+ $options[] = array('name' => 'sgpb-popup-dimension-mode', 'type' => 'text', 'defaultValue' => '100');
657
+ $options[] = array('name' => 'sgpb-width', 'type' => 'text', 'defaultValue' => '640px');
658
+ $options[] = array('name' => 'sgpb-height', 'type' => 'text', 'defaultValue' => '480px');
659
+ $options[] = array('name' => 'sgpb-max-width', 'type' => 'text', 'defaultValue' => '');
660
+ $options[] = array('name' => 'sgpb-max-height', 'type' => 'text', 'defaultValue' => '');
661
+ $options[] = array('name' => 'sgpb-min-width', 'type' => 'text', 'defaultValue' => '120');
662
+ $options[] = array('name' => 'sgpb-min-height', 'type' => 'text', 'defaultValue' => '');
663
+ $options[] = array('name' => 'sgpb-schedule-status', 'type' => 'checkbox', 'defaultValue' => '');
664
+ $options[] = array('name' => 'sgpb-schedule-weeks', 'type' => 'array', 'defaultValue' => '');
665
+ $options[] = array('name' => 'sgpb-schedule-start-time', 'type' => 'text', 'defaultValue' => '');
666
+ $options[] = array('name' => 'sgpb-schedule-end-time', 'type' => 'text', 'defaultValue' => '');
667
+ $options[] = array('name' => 'sgpb-popup-timer-status', 'type' => 'checkbox', 'defaultValue' => '');
668
+ $options[] = array('name' => 'sgpb-popup-start-timer', 'type' => 'text', 'defaultValue' => '');
669
+ $options[] = array('name' => 'sgpb-popup-end-timer', 'type' => 'text', 'defaultValue' => '');
670
+ $options[] = array('name' => 'sgpb-popup-fixed', 'type' => 'checkbox', 'defaultValue' => '');
671
+ $options[] = array('name' => 'sgpb-popup-fixed-position', 'type' => 'text', 'defaultValue' => '');
672
+ $options[] = array('name' => 'sgpb-popup-delay', 'type' => 'text', 'defaultValue' => '0');
673
+ $options[] = array('name' => 'sgpb-popup-order', 'type' => 'text', 'defaultValue' => '0');
674
+ $options[] = array('name' => 'sgpb-disable-page-scrolling', 'type' => 'checkbox', 'defaultValue' => '');
675
+ $options[] = array('name' => 'sgpb-content-padding', 'type' => 'text', 'defaultValue' => 7);
676
+ $options[] = array('name' => 'sgpb-popup-z-index', 'type' => 'text', 'defaultValue' => 9999);
677
+ $options[] = array('name' => 'sgpb-content-custom-class', 'type' => 'text', 'defaultValue' => 'sg-popup-content');
678
+ $options[] = array('name' => 'sgpb-auto-close', 'type' => 'checkbox', 'defaultValue' => '', 'min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER);
679
+ $options[] = array('name' => 'sgpb-auto-close-time', 'type' => 'number', 'defaultValue' => 0);
680
+ $options[] = array('name' => 'sgpb-reopen-after-form-submission', 'type' => 'checkbox', 'defaultValue' => '');
681
+ $options[] = array('name' => 'sgpb-open-sound', 'type' => 'checkbox', 'defaultValue' => '');
682
+ $options[] = array('name' => 'sgpb-sound-url', 'type' => 'text', 'defaultValue' => SG_POPUP_SOUND_URL.SGPB_POPUP_DEFAULT_SOUND);
683
+ $options[] = array('name' => 'sgpb-open-animation', 'type' => 'checkbox', 'defaultValue' => '');
684
+ $options[] = array('name' => 'sgpb-open-animation-speed', 'type' => 'text', 'defaultValue' => 1);
685
+ $options[] = array('name' => 'sgpb-popup-themes', 'type' => 'text', 'defaultValue' => 'sgpb-theme-1');
686
+ $options[] = array('name' => 'sgpb-enable-popup-overlay', 'type' => 'checkbox', 'defaultValue' => 'on', 'min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER);
687
+ $options[] = array('name' => 'sgpb-overlay-custom-class', 'type' => 'text', 'defaultValue' => 'sgpb-popup-overlay');
688
+ $options[] = array('name' => 'sgpb-overlay-color', 'type' => 'text', 'defaultValue' => '');
689
+ $options[] = array('name' => 'sgpb-background-color', 'type' => 'text', 'defaultValue' => '');
690
+ $options[] = array('name' => 'sgpb-overlay-opacity', 'type' => 'text', 'defaultValue' => 0.8);
691
+ $options[] = array('name' => 'sgpb-content-opacity', 'type' => 'text', 'defaultValue' => 0.8);
692
+ $options[] = array('name' => 'sgpb-iframe-url', 'type' => 'text', 'defaultValue' => '');
693
+ $options[] = array('name' => 'sgpb-iframe-invalid-url', 'type' => 'text', 'defaultValue' => __('Invalid URL.', SG_POPUP_TEXT_DOMAIN));
694
+ $options[] = array('name' => 'sgpb-iframe-protocol-warning', 'type' => 'text', 'defaultValue' => __('This url may not work, as it is HTTP and you are running HTTPS.', SG_POPUP_TEXT_DOMAIN));
695
+ $options[] = array('name' => 'sgpb-iframe-same-origin-warning', 'type' => 'text', 'defaultValue' => __('This url may not work, as it doesn\'t allow embedding in iframes.', SG_POPUP_TEXT_DOMAIN));
696
+ $options[] = array('name' => 'sgpb-background-image', 'type' => 'text', 'defaultValue' => '');
697
+ $options[] = array('name' => 'sgpb-show-background', 'type' => 'checkbox', 'defaultValue' => '');
698
+ $options[] = array('name' => 'sgpb-background-image-mode', 'type' => 'text', 'defaultValue' => 'no-repeat');
699
+ $options[] = array('name' => 'sgpb-image-url', 'type' => 'text', 'defaultValue' => '');
700
+ $options[] = array('name' => 'sgpb-close-button-delay', 'type' => 'number', 'defaultValue' => 0);
701
+ $options[] = array('name' => 'sgpb-button-image', 'type' => 'text', 'defaultValue' => '');
702
+ $options[] = array('name' => 'sgpb-button-image-width', 'type' => 'text', 'defaultValue' => 21);
703
+ $options[] = array('name' => 'sgpb-button-image-height', 'type' => 'text', 'defaultValue' => 21);
704
+ $options[] = array('name' => 'sgpb-video-autoplay', 'type' => 'checkbox', 'defaultValue' => '');
705
+ $options[] = array('name' => 'sgpb-video-invalid-url', 'type' => 'text', 'defaultValue' => __('Invalid URL', SG_POPUP_TEXT_DOMAIN).'.');
706
+ $options[] = array('name' => 'sgpb-video-not-supported-url', 'type' => 'text', 'defaultValue' => __('This video URL is not supported', SG_POPUP_TEXT_DOMAIN).'.');
707
+ $options[] = array('name' => 'sgpb-is-active', 'type' => 'checkbox', 'defaultValue' => 'on');
708
+ // proStartSilverproEndSilver
709
+ $options[] = array('name' => 'sgpb-subs-form-bg-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
710
+ $options[] = array('name' => 'sgpb-subs-form-bg-opacity', 'type' => 'text', 'defaultValue' => 0.8);
711
+ $options[] = array('name' => 'sgpb-subs-form-padding', 'type' => 'number', 'defaultValue' => 2);
712
+ $options[] = array('name' => 'sgpb-subs-email-placeholder', 'type' => 'text', 'defaultValue' => __('Email *', SG_POPUP_TEXT_DOMAIN));
713
+ $options[] = array('name' => 'sgpb-subs-first-name-status', 'type' => 'checkbox', 'defaultValue' => 'on');
714
+ $options[] = array('name' => 'sgpb-subs-first-placeholder', 'type' => 'text', 'defaultValue' => __('First name', SG_POPUP_TEXT_DOMAIN));
715
+ $options[] = array('name' => 'sgpb-subs-first-name-required', 'type' => 'checkbox', 'defaultValue' => '');
716
+ $options[] = array('name' => 'sgpb-subs-last-name-status', 'type' => 'checkbox', 'defaultValue' => 'on');
717
+ $options[] = array('name' => 'sgpb-subs-last-placeholder', 'type' => 'text', 'defaultValue' => __('Last name', SG_POPUP_TEXT_DOMAIN));
718
+ $options[] = array('name' => 'sgpb-subs-last-name-required', 'type' => 'checkbox', 'defaultValue' => '');
719
+ $options[] = array('name' => 'sgpb-subs-validation-message', 'type' => 'text', 'defaultValue' => __('This field is required.', SG_POPUP_TEXT_DOMAIN));
720
+ $options[] = array('name' => 'sgpb-subs-text-width', 'type' => 'text', 'defaultValue' => '300px');
721
+ $options[] = array('name' => 'sgpb-subs-text-height', 'type' => 'text', 'defaultValue' => '40px');
722
+ $options[] = array('name' => 'sgpb-subs-text-border-width', 'type' => 'text', 'defaultValue' => '2px');
723
+ $options[] = array('name' => 'sgpb-subs-text-border-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
724
+ $options[] = array('name' => 'sgpb-subs-text-bg-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
725
+ $options[] = array('name' => 'sgpb-subs-text-color', 'type' => 'text', 'defaultValue' => '#000000');
726
+ $options[] = array('name' => 'sgpb-subs-text-placeholder-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
727
+ $options[] = array('name' => 'sgpb-subs-btn-width', 'type' => 'text', 'defaultValue' => '300px');
728
+ $options[] = array('name' => 'sgpb-subs-btn-height', 'type' => 'text', 'defaultValue' => '40px');
729
+ $options[] = array('name' => 'sgpb-subs-btn-title', 'type' => 'text', 'defaultValue' => __('Subscribe', SG_POPUP_TEXT_DOMAIN));
730
+ $options[] = array('name' => 'sgpb-subs-btn-progress-title', 'type' => 'text', 'defaultValue' => __('Please wait...', SG_POPUP_TEXT_DOMAIN));
731
+ $options[] = array('name' => 'sgpb-subs-btn-bg-color', 'type' => 'text', 'defaultValue' => '#4CAF50');
732
+ $options[] = array('name' => 'sgpb-subs-btn-text-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
733
+ $options[] = array('name' => 'sgpb-subs-error-message', 'type' => 'text', 'defaultValue' => __('There was an error while trying to send your request. Please try again', SG_POPUP_TEXT_DOMAIN).'.');
734
+ $options[] = array('name' => 'sgpb-subs-invalid-message', 'type' => 'text', 'defaultValue' => __('Please enter a valid email address', SG_POPUP_TEXT_DOMAIN).'.');
735
+ $options[] = array('name' => 'sgpb-subs-success-behavior', 'type' => 'text', 'defaultValue' => 'showMessage');
736
+ $options[] = array('name' => 'sgpb-subs-success-message', 'type' => 'text', 'defaultValue' => __('You have successfully subscribed to the newsletter', SG_POPUP_TEXT_DOMAIN));
737
+ $options[] = array('name' => 'sgpb-subs-success-redirect-URL', 'type' => 'text', 'defaultValue' => '');
738
+ $options[] = array('name' => 'sgpb-subs-success-redirect-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
739
+ $options[] = array('name' => 'sgpb-subs-gdpr-status', 'type' => 'checkbox', 'defaultValue' => '');
740
+ $options[] = array('name' => 'sgpb-subs-gdpr-label', 'type' => 'text', 'defaultValue' => __('Accept Terms', SG_POPUP_TEXT_DOMAIN));
741
+ $options[] = array('name' => 'sgpb-subs-gdpr-text', 'type' => 'text', 'defaultValue' => __(get_bloginfo().' will use the information you provide on this form to be in touch with you and to provide updates and marketing.', SG_POPUP_TEXT_DOMAIN));
742
+ // proStartSilverproEndSilver
743
+ $options[] = array('name' => 'sgpb-fblike-like-url', 'type' => 'text', 'defaultValue' => '');
744
+ $options[] = array('name' => 'sgpb-fblike-layout', 'type' => 'text', 'defaultValue' => 'standard');
745
+ $options[] = array('name' => 'sgpb-fblike-dont-show-share-button', 'type' => 'checkbox', 'defaultValue' => '');
746
+ $options[] = array('name' => 'sgpb-subs-fields', 'type' => 'sgpb', 'defaultValue' => '');
747
+ $options[] = array('name' => 'sgpb-contact-fields', 'type' => 'sgpb', 'defaultValue' => '');
748
+ $options[] = array('name' => 'sgpb-border-color', 'type' => 'text', 'defaultValue' => '#000000');
749
+ $options[] = array('name' => 'sgpb-border-radius', 'type' => 'text', 'defaultValue' => 0);
750
+ $options[] = array('name' => 'sgpb-show-popup-same-user', 'type' => 'checkbox', 'defaultValue' => '');
751
+ $options[] = array('name' => 'sgpb-show-popup-same-user-count', 'type' => 'number', 'defaultValue' => 1);
752
+ $options[] = array('name' => 'sgpb-show-popup-same-user-expiry', 'type' => 'number', 'defaultValue' => 1);
753
+ $options[] = array('name' => 'sgpb-show-popup-same-user-page-level', 'type' => 'checkbox', 'defaultValue' => '');
754
+
755
+ $SGPB_OPTIONS = apply_filters('sgpbPopupDefaultOptions', $options);
756
+ }
757
+
758
+ public static function getOldExtensionsInfo()
759
+ {
760
+ $data = array(
761
+ array(
762
+ 'folderName' => 'popup-builder-ad-block',
763
+ 'label' => __('AdBlock', SG_POPUP_TEXT_DOMAIN)
764
+ ),
765
+ array(
766
+ 'folderName' => 'popup-builder-analytics',
767
+ 'label' => __('Analytics', SG_POPUP_TEXT_DOMAIN)
768
+ ),
769
+ array(
770
+ 'folderName' => 'popup-builder-exit-intent',
771
+ 'label' => __('Exit intent', SG_POPUP_TEXT_DOMAIN)
772
+ ),
773
+ array(
774
+ 'folderName' => 'popup-builder-mailchimp',
775
+ 'label' => __('MailChimp', SG_POPUP_TEXT_DOMAIN)
776
+ ),
777
+ array(
778
+ 'folderName' => 'popup-builder-aweber',
779
+ 'label' => __('AWeber', SG_POPUP_TEXT_DOMAIN)
780
+ )
781
+ );
782
+
783
+ return $data;
784
+ }
785
+
786
+ public static function addFilters()
787
+ {
788
+ ConfigDataHelper::addFilters();
789
+ }
790
+ }
com/helpers/AdminHelper.php ADDED
@@ -0,0 +1,780 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \DateTime;
4
+ use \DateTimeZone;
5
+ use \SgpbDataConfig;
6
+
7
+ class AdminHelper
8
+ {
9
+ public static function buildCreatePopupUrl($popupType)
10
+ {
11
+ $isAvailable = $popupType->isAvailable();
12
+ $name = $popupType->getName();
13
+
14
+ $popupUrl = SG_POPUP_ADMIN_URL.'post-new.php?post_type='.SG_POPUP_POST_TYPE.'&sgpb_type='.$name;
15
+
16
+ if (!$isAvailable) {
17
+ $popupUrl = SG_POPUP_PRO_URL;
18
+ }
19
+
20
+ return $popupUrl;
21
+ }
22
+
23
+ public static function getPopupThumbClass($popupType)
24
+ {
25
+ $isAvailable = $popupType->isAvailable();
26
+ $name = $popupType->getName();
27
+
28
+ $popupTypeClassName = $name.'-popup';
29
+
30
+ if (!$isAvailable) {
31
+ $popupTypeClassName .= '-pro';
32
+ }
33
+
34
+ return $popupTypeClassName;
35
+ }
36
+
37
+ public static function getPopupTargetParam($param)
38
+ {
39
+ global $SGPB_DATA_CONFIG_ARRAY;
40
+ $targetData = $SGPB_DATA_CONFIG_ARRAY['target'];
41
+
42
+ if (empty($targetData[$param])) {
43
+ return '';
44
+ }
45
+
46
+ return $targetData[$param];
47
+ }
48
+
49
+ public static function getPopupTargetParamType($param)
50
+ {
51
+ global $SGPB_DATA_CONFIG_ARRAY;
52
+ $targetDataTypes = $SGPB_DATA_CONFIG_ARRAY['target']['types'];
53
+
54
+ if (empty($targetDataTypes[$param])) {
55
+ return '';
56
+ }
57
+
58
+ return $targetDataTypes[$param];
59
+ }
60
+
61
+ public static function createSelectBox($data, $selectedValue, $attrs)
62
+ {
63
+ $attrString = '';
64
+ $selected = '';
65
+ $selectBoxCloseTag = '</select>';
66
+
67
+ if (!empty($attrs) && isset($attrs)) {
68
+
69
+ foreach ($attrs as $attrName => $attrValue) {
70
+ $attrString .= ''.$attrName.'="'.$attrValue.'" ';
71
+ }
72
+ }
73
+
74
+ $selectBox = '<select '.$attrString.'>';
75
+
76
+ if (empty($data)) {
77
+ $selectBox .= $selectBoxCloseTag;
78
+ return $selectBox;
79
+ }
80
+ foreach ($data as $value => $label) {
81
+ // When is multiSelect
82
+ if (is_array($selectedValue)) {
83
+ $isSelected = in_array($value, $selectedValue);
84
+ if ($isSelected) {
85
+ $selected = 'selected';
86
+ }
87
+ }
88
+ else if ($selectedValue == $value) {
89
+ $selected = 'selected';
90
+ }
91
+ else if (is_array($value) && in_array($selectedValue, $value)) {
92
+ $selected = 'selected';
93
+ }
94
+
95
+ if (is_array($label)) {
96
+ $selectBox .= '<optgroup label="'.$value.'">';
97
+ foreach ($label as $key => $optionLabel) {
98
+ $selected = '';
99
+ if (is_array($selectedValue)) {
100
+ $isSelected = in_array($key, $selectedValue);
101
+ if ($isSelected) {
102
+ $selected = 'selected';
103
+ }
104
+ }
105
+ else if ($selectedValue == $key) {
106
+ $selected = 'selected';
107
+ }
108
+ else if (is_array($key) && in_array($selectedValue, $key)) {
109
+ $selected = 'selected';
110
+ }
111
+
112
+ $selectBox .= '<option value="'.$key.'" '.$selected.'>'.$optionLabel.'</option>';
113
+ }
114
+ $selectBox .= '</optgroup>';
115
+ }
116
+ else {
117
+ $selectBox .= '<option value="'.$value.'" '.$selected.'>'.$label.'</option>';
118
+ }
119
+
120
+ $selected = '';
121
+ }
122
+
123
+ $selectBox .= $selectBoxCloseTag;
124
+
125
+ return $selectBox;
126
+ }
127
+
128
+ public static function createInput($data, $selectedValue, $attrs)
129
+ {
130
+ $attrString = '';
131
+ $savedData = $data;
132
+
133
+ if (isset($selectedValue)) {
134
+ $savedData = $selectedValue;
135
+ }
136
+ if (!empty($attrs) && isset($attrs)) {
137
+
138
+ foreach ($attrs as $attrName => $attrValue) {
139
+ if ($attrName == 'class') {
140
+ $attrValue .= ' sgpb-full-width-events form-control';
141
+ }
142
+ $attrString .= ''.$attrName.'="'.$attrValue.'" ';
143
+ }
144
+ }
145
+ $input = "<input $attrString value=\"".esc_attr($savedData)."\">";
146
+
147
+ return $input;
148
+ }
149
+
150
+ public static function createCheckBox($data, $selectedValue, $attrs)
151
+ {
152
+ $attrString = '';
153
+ $checked = '';
154
+
155
+ if (!empty($selectedValue)) {
156
+ $checked = 'checked';
157
+ }
158
+ if (!empty($attrs) && isset($attrs)) {
159
+
160
+ foreach ($attrs as $attrName => $attrValue) {
161
+ $attrString .= ''.$attrName.'="'.$attrValue.'" ';
162
+ }
163
+ }
164
+
165
+ $input = "<input $attrString $checked>";
166
+
167
+ return $input;
168
+ }
169
+
170
+ public static function createRadioButtons($elements, $name, $selectedInput, $lineMode = false)
171
+ {
172
+ $str = '';
173
+
174
+ foreach ($elements as $key => $element) {;
175
+ $value = '';
176
+ $checked = '';
177
+
178
+ if (isset($element['value'])) {
179
+ $value = $element['value'];
180
+ }
181
+ if ($element['value'] == $selectedInput) {
182
+ $checked = 'checked';
183
+ }
184
+ $attrStr = '';
185
+ if (isset($element['data-attributes'])) {
186
+ foreach ($element['data-attributes'] as $attrKey => $dataValue) {
187
+ $attrStr .= $attrKey.'="'.esc_attr($dataValue).'" ';
188
+ }
189
+ }
190
+
191
+ if ($lineMode) {
192
+ $str .= '<input type="radio" name="'.esc_attr($name).'" value="'.esc_attr($value).'" '.$checked.' '.$attrStr.'>';
193
+ }
194
+ else {
195
+ $str .= '<div class="row form-group">';
196
+ $str .= '<label class="col-md-5 control-label">'.__($element['title'], SG_POPUP_TEXT_DOMAIN).'</label>';
197
+ $str .= '<div class="col-sm-7"><input type="radio" name="'.esc_attr($name).'" value="'.esc_attr($value).'" '.$checked.'></div>';
198
+ $str .= '</div>';
199
+ }
200
+ }
201
+
202
+ echo $str;
203
+ }
204
+
205
+ // countdown popup (number) styles
206
+ public static function renderCountdownStyles($popupId = 0, $countdownBgColor, $countdownTextColor)
207
+ {
208
+ return "<style type='text/css'>
209
+ .sgpb-counts-content.sgpb-flipclock-js-$popupId.flip-clock-wrapper ul li a div div.inn {
210
+ background-color: $countdownBgColor;
211
+ color: $countdownTextColor;
212
+ }
213
+ .sgpb-countdown-wrapper {
214
+ width: 446px;
215
+ height: 130px;
216
+ padding-top: 22px;
217
+ box-sizing: border-box;
218
+ margin: 0 auto;
219
+ }
220
+ .sgpb-counts-content {
221
+ display: inline-block;
222
+ }
223
+ .sgpb-counts-content > ul.flip {
224
+ width: 40px;
225
+ margin: 4px;
226
+ }
227
+ </style>";
228
+ }
229
+
230
+ // countdown popup scripts and params
231
+ public static function renderCountdownScript($id, $seconds, $type, $language, $timezone, $autoclose)
232
+ {
233
+ $params = array(
234
+ 'id' => $id,
235
+ 'seconds' => $seconds,
236
+ 'type' => $type,
237
+ 'language' => $language,
238
+ 'timezone' => $timezone,
239
+ 'autoclose' => $autoclose
240
+ );
241
+
242
+ return $params;
243
+ }
244
+
245
+ // convert date to seconds
246
+ public static function dateToSeconds($dueDate, $timezone)
247
+ {
248
+ if (empty($timezone)) {
249
+ return '';
250
+ }
251
+ $timeDate = new DateTime('now', new DateTimeZone($timezone));
252
+ $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
253
+ $seconds = strtotime($dueDate)-$timeNow;
254
+ if ($seconds < 0) {
255
+ $seconds = 0;
256
+ }
257
+
258
+ return $seconds;
259
+ }
260
+
261
+ /**
262
+ * Serialize data
263
+ *
264
+ * @since 1.0.0
265
+ *
266
+ * @param array $data
267
+ *
268
+ * @return string $serializedData
269
+ */
270
+ public static function serializeData($data = array())
271
+ {
272
+ $serializedData = serialize($data);
273
+
274
+ return $serializedData;
275
+ }
276
+
277
+ /**
278
+ * Get correct size to use it safely inside CSS rules
279
+ *
280
+ * @since 1.0.0
281
+ *
282
+ * @param string $dimension
283
+ *
284
+ * @return string $size
285
+ */
286
+ public static function getCSSSafeSize($dimension)
287
+ {
288
+ if (empty($dimension)) {
289
+ return 'inherit';
290
+ }
291
+
292
+ $size = (int)$dimension . 'px';
293
+ // If user write dimension in px or % we give that dimension to target otherwise the default value will be px
294
+ if (strpos($dimension, '%') || strpos($dimension, 'px')) {
295
+ $size = $dimension;
296
+ }
297
+
298
+ return $size;
299
+ }
300
+
301
+ /**
302
+ * Get site protocol
303
+ *
304
+ * @since 1.0.0
305
+ *
306
+ * @return string $protocol
307
+ *
308
+ */
309
+ public static function getSiteProtocol()
310
+ {
311
+ $protocol = 'http';
312
+
313
+ if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
314
+ $protocol = 'https';
315
+ }
316
+
317
+ return $protocol;
318
+ }
319
+
320
+ public static function getCurrentUrl()
321
+ {
322
+ $protocol = self::getSiteProtocol();
323
+ $currentUrl = $protocol."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
324
+
325
+ return $currentUrl;
326
+ }
327
+
328
+ public static function deleteSubscriptionPopupSubscribers($popupId)
329
+ {
330
+ global $wpdb;
331
+
332
+ $prepareSql = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE subscriptionType = %s', $popupId);
333
+ $wpdb->query($prepareSql);
334
+ }
335
+
336
+ public static function subscribersRelatedQuery($query = '')
337
+ {
338
+ global $wpdb;
339
+ $subscribersTablename = $wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME;
340
+ $postsTablename = $wpdb->prefix.SGPB_POSTS_TABLE_NAME;
341
+
342
+ if ($query == '') {
343
+ $query = 'SELECT firstName, lastName, email, cDate, '.$postsTablename.'.post_title AS subscriptionType FROM '.$subscribersTablename.' ';
344
+ }
345
+ $searchQuery = '';
346
+ $filterCriteria = '';
347
+
348
+ $query .= ' LEFT JOIN '.$postsTablename.' ON '.$postsTablename.'.ID='.$subscribersTablename.'.subscriptionType';
349
+
350
+ if (isset($_GET['sgpb-subscription-popup-id']) && !empty($_GET['sgpb-subscription-popup-id'])) {
351
+ $filterCriteria = esc_sql($_GET['sgpb-subscription-popup-id']);
352
+ if ($filterCriteria != 'all') {
353
+ $searchQuery .= "subscriptionType = $filterCriteria";
354
+ }
355
+ }
356
+ if ($filterCriteria != '' && $filterCriteria != 'all' && isset($_GET['s']) && !empty($_GET['s'])) {
357
+ $searchQuery .= ' LIKE ';
358
+ }
359
+ if (isset($_GET['s']) && !empty($_GET['s'])) {
360
+ $searchCriteria = esc_sql($_GET['s']);
361
+ $searchQuery .= " firstName LIKE '%$searchCriteria%' or lastName LIKE '%$searchCriteria%' or email LIKE '%$searchCriteria%' or $postsTablename.post_title LIKE '%$searchCriteria%'";
362
+ }
363
+ if (isset($_GET['sgpb-subscribers-date']) && !empty($_GET['sgpb-subscribers-date'])) {
364
+ $filterCriteria = esc_sql($_GET['sgpb-subscribers-date']);
365
+ if ($filterCriteria != 'all') {
366
+ if ($searchQuery != '') {
367
+ $searchQuery .= ' AND ';
368
+ }
369
+ $searchQuery .= " cDate LIKE '$filterCriteria%'";
370
+ }
371
+ }
372
+ if ($searchQuery != '') {
373
+ $query .= " WHERE ($searchQuery)";
374
+ }
375
+
376
+ return $query;
377
+ }
378
+
379
+ public static function themeRelatedSettings($popupId, $buttonPosition, $theme)
380
+ {
381
+ if ($popupId) {
382
+ if ($theme == 'sgpb-theme-1' || $theme == 'sgpb-theme-4' || $theme == 'sgpb-theme-5') {
383
+ if (isset($buttonPosition)) {
384
+ $buttonPosition = $buttonPosition;
385
+ }
386
+ else {
387
+ $buttonPosition = 'bottomRight';
388
+ }
389
+ }
390
+ else if ($theme == 'sgpb-theme-2' || $theme == 'sgpb-theme-3' || $theme == 'sgpb-theme-6') {
391
+ if (isset($buttonPosition)) {
392
+ $buttonPosition = $buttonPosition;
393
+ }
394
+ else {
395
+ $buttonPosition = 'topRight';
396
+ }
397
+ }
398
+ }
399
+ else {
400
+ if (isset($theme)) {
401
+ if ($theme == 'sgpb-theme-1' || $theme == 'sgpb-theme-4' || $theme == 'sgpb-theme-5') {
402
+ $buttonPosition = 'bottomRight';
403
+ }
404
+ else if ($theme == 'sgpb-theme-2' || $theme == 'sgpb-theme-3' || $theme == 'sgpb-theme-6') {
405
+ $buttonPosition = 'topRight';
406
+ }
407
+ }
408
+ else {
409
+ /* by default set position for the first theme */
410
+ $buttonPosition = 'bottomRight';
411
+ }
412
+ }
413
+
414
+ return $buttonPosition;
415
+ }
416
+
417
+ /**
418
+ * Create html attrs
419
+ *
420
+ * @since 1.0.0
421
+ *
422
+ * @param array $attrs
423
+ *
424
+ * @return string $attrStr
425
+ */
426
+ public static function createAttrs($attrs)
427
+ {
428
+ $attrStr = '';
429
+
430
+ if (empty($attrs)) {
431
+ return $attrStr;
432
+ }
433
+
434
+ foreach ($attrs as $attrKey => $attrValue) {
435
+ $attrStr .= $attrKey.'="'.$attrValue.'" ';
436
+ }
437
+
438
+ return $attrStr;
439
+ }
440
+
441
+ public static function getFormattedDate($date)
442
+ {
443
+ $date = strtotime($date);
444
+ $month = date('F', $date);
445
+ $year = date('Y', $date);
446
+
447
+ return $month.' '.$year;
448
+ }
449
+
450
+ public static function convertImageToData($image = '')
451
+ {
452
+ return $image;
453
+ }
454
+
455
+ public static function defaultButtonImage($theme, $closeImage = '')
456
+ {
457
+ // if no image, set default by theme
458
+ if ($closeImage == '') {
459
+ if ($theme == 'sgpb-theme-1' || !$theme) {
460
+ $closeImage = SG_POPUP_IMG_URL.'theme_1/close.png';
461
+ }
462
+ else if ($theme == 'sgpb-theme-2') {
463
+ $closeImage = SG_POPUP_IMG_URL.'theme_2/close.png';
464
+ }
465
+ else if ($theme == 'sgpb-theme-3') {
466
+ $closeImage = SG_POPUP_IMG_URL.'theme_3/close.png';
467
+ }
468
+ else if ($theme == 'sgpb-theme-5') {
469
+ $closeImage = SG_POPUP_IMG_URL.'theme_5/close.png';
470
+ }
471
+ else if ($theme == 'sgpb-theme-6') {
472
+ $closeImage = SG_POPUP_IMG_URL.'theme_6/close.png';
473
+ }
474
+ }
475
+
476
+ return self::convertImageToData($closeImage);
477
+ }
478
+
479
+ public static function getPopupPostAllowedUserRoles()
480
+ {
481
+ $userSavedRoles = get_option('sgpb-user-roles');
482
+
483
+ if (!$userSavedRoles) {
484
+ $userSavedRoles = array('administrator');
485
+ }
486
+ else {
487
+ array_push($userSavedRoles, 'administrator');
488
+ }
489
+
490
+ return $userSavedRoles;
491
+ }
492
+
493
+ public static function showMenuForCurrentUser()
494
+ {
495
+ $savedUserRoles = self::getPopupPostAllowedUserRoles();
496
+ $currentUserRole = AdminHelper::getCurrentUserRole();
497
+
498
+ return in_array($currentUserRole, $savedUserRoles);
499
+ }
500
+
501
+ public static function getPopupsIdAndTitle($excludesPopups = array())
502
+ {
503
+ $allPopups = SGPopup::getAllPopups();
504
+ $popupIdTitles = array();
505
+
506
+ if (empty($allPopups)) {
507
+ return $popupIdTitles;
508
+ }
509
+
510
+ foreach ($allPopups as $popup) {
511
+ if (empty($popup)) {
512
+ continue;
513
+ }
514
+
515
+ $id = $popup->getId();
516
+ $title = $popup->getTitle();
517
+ $type = $popup->getType();
518
+
519
+ if (!empty($excludesPopups)) {
520
+ foreach ($excludesPopups as $excludesPopupId) {
521
+ if ($excludesPopupId != $id) {
522
+ $popupIdTitles[$id] = $title . ' - ' . $type;
523
+ }
524
+ }
525
+ }
526
+ else {
527
+ $popupIdTitles[$id] = $title . ' - ' . $type;
528
+ }
529
+ }
530
+
531
+ return $popupIdTitles;
532
+ }
533
+
534
+ /**
535
+ * Merge two array and merge same key values to same array
536
+ *
537
+ * @since 1.0.0
538
+ *
539
+ * @param array $array1
540
+ * @param array $array2
541
+ *
542
+ * @return array|bool
543
+ *
544
+ */
545
+ public static function arrayMergeSameKeys($array1, $array2)
546
+ {
547
+ if (empty($array1)) {
548
+ return array();
549
+ }
550
+
551
+ $modified = false;
552
+ $array3 = array();
553
+ foreach ($array1 as $key => $value) {
554
+ if (isset($array2[$key]) && is_array($array2[$key])) {
555
+ $arrDifference = array_diff($array2[$key], $array1[$key]);
556
+ if (empty($arrDifference)) {
557
+ continue;
558
+ }
559
+
560
+ $modified = true;
561
+ $array3[$key] = array_merge($array2[$key], $array1[$key]);
562
+ unset($array2[$key]);
563
+ continue;
564
+ }
565
+
566
+ $modified = true;
567
+ $array3[$key] = $value;
568
+ }
569
+
570
+ // when there are no values
571
+ if (!$modified) {
572
+ return $modified;
573
+ }
574
+
575
+ return $array2 + $array3;
576
+ }
577
+
578
+ public static function getCurrentUserRole()
579
+ {
580
+ $role = 'administrator';
581
+
582
+ if (is_multisite()) {
583
+
584
+ $getUsersObj = get_users(
585
+ array(
586
+ 'blog_id' => get_current_blog_id()
587
+ )
588
+ );
589
+ if (is_array($getUsersObj)) {
590
+ foreach ($getUsersObj as $key => $userData) {
591
+ if ($userData->ID == get_current_user_id()) {
592
+ $roles = $userData->roles;
593
+ if (is_array($roles) && !empty($roles)) {
594
+ $role = $roles[0];
595
+ }
596
+ }
597
+ }
598
+ }
599
+
600
+ return $role;
601
+ }
602
+
603
+ global $current_user, $wpdb;
604
+ $userRoleKey = $wpdb->prefix . 'capabilities';
605
+ $userRoleName = $current_user->$userRoleKey;
606
+
607
+ if ($userRoleName) {
608
+ $usersRoles = array_keys($userRoleName);
609
+
610
+ if (is_array($usersRoles) && !empty($usersRoles)) {
611
+ $role = $usersRoles[0];
612
+ }
613
+ }
614
+
615
+ return $role;
616
+ }
617
+
618
+ public static function isAppleMobileDevice()
619
+ {
620
+ $isIOS = false;
621
+
622
+ $useragent = @$_SERVER['HTTP_USER_AGENT'];
623
+ preg_match('/iPhone|Android|iPad|iPod|webOS/', $useragent, $matches);
624
+ $os = current($matches);
625
+ if ($os == 'iPad' || $os == 'iPhone' || $os == 'iPod') {
626
+ $isIOS = true;
627
+ }
628
+
629
+ return $isIOS;
630
+ }
631
+
632
+ public static function hexToRgba($color, $opacity = false)
633
+ {
634
+ $default = 'rgb(0,0,0)';
635
+
636
+ //Return default if no color provided
637
+ if (empty($color)) {
638
+ return $default;
639
+ }
640
+
641
+ //Sanitize $color if "#" is provided
642
+ if ($color[0] == '#') {
643
+ $color = substr($color, 1);
644
+ }
645
+
646
+ //Check if color has 6 or 3 characters and get values
647
+ if (strlen($color) == 6) {
648
+ $hex = array($color[0].$color[1], $color[2].$color[3], $color[4].$color[5]);
649
+ }
650
+ else if (strlen($color) == 3) {
651
+ $hex = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
652
+ }
653
+ else {
654
+ return $default;
655
+ }
656
+
657
+ //Convert hexadec to rgb
658
+ $rgb = array_map('hexdec', $hex);
659
+
660
+ //Check if opacity is set(rgba or rgb)
661
+ if ($opacity !== false) {
662
+ if (abs($opacity) > 1) {
663
+ $opacity = 1.0;
664
+ }
665
+ $output = 'rgba('.implode(',', $rgb).','.$opacity.')';
666
+ }
667
+ else {
668
+ $output = 'rgb('.implode(',', $rgb).')';
669
+ }
670
+
671
+ //Return rgb(a) color string
672
+ return $output;
673
+ }
674
+
675
+ public static function getAllActiveExtensions()
676
+ {
677
+ $extensions = SgpbDataConfig::getOldExtensionsInfo();
678
+ $labels = array();
679
+
680
+ foreach ($extensions as $extension) {
681
+ if (file_exists(WP_PLUGIN_DIR.'/'.$extension['folderName'])) {
682
+ $labels[] = $extension['label'];
683
+ }
684
+ }
685
+
686
+ return $labels;
687
+ }
688
+
689
+ public static function renderExtensionsContent()
690
+ {
691
+ $extensions = self::getAllActiveExtensions();
692
+ ob_start();
693
+ ?>
694
+ <p class="sgpb-extension-notice-close">x</p>
695
+ <div class="sgpb-extensions-list-wrapper">
696
+ <div class="sgpb-notice-header">
697
+ <h3><?php _e('Popup Builder plugin has been successfully updated', SG_POPUP_TEXT_DOMAIN)?></h3>
698
+ <h4><?php _e('The following extensions need to be updated manually', SG_POPUP_TEXT_DOMAIN)?></h4>
699
+ </div>
700
+ <ul class="sgpb-extensions-list">
701
+ <?php foreach ($extensions as $extensionName): ?>
702
+ <a target="_blank" href="https://popup-builder.com/forms/control-panel/"><li><?php echo $extensionName; ?></li></a>
703
+ <?php endforeach; ?>
704
+ </ul>
705
+ </div>
706
+ <p class="sgpb-extension-notice-dont-show"><?php _e('Don\'t show again')?></p>
707
+ <?php
708
+ $content = ob_get_contents();
709
+ ob_get_clean();
710
+
711
+ return $content;
712
+ }
713
+
714
+ public static function getReverseConvertIds()
715
+ {
716
+ $idsMappingSaved = get_option('sgpbConvertedIds');
717
+ $ids = array();
718
+
719
+ if ($idsMappingSaved) {
720
+ $ids = $idsMappingSaved;
721
+ }
722
+
723
+ return array_flip($ids);
724
+ }
725
+
726
+ public static function getAllExtensions()
727
+ {
728
+ $allExtensions = SgpbDataConfig::allExtensionsKeys();
729
+
730
+ $notActiveExtensions = array();
731
+ $activeExtensions = array();
732
+
733
+ foreach ($allExtensions as $extension) {
734
+ if (!is_plugin_active($extension['pluginKey'])) {
735
+ $notActiveExtensions[] = $extension;
736
+ }
737
+ else {
738
+ $activeExtensions[] = $extension;
739
+ }
740
+ }
741
+
742
+ $divideExtension = array(
743
+ 'noActive' => $notActiveExtensions,
744
+ 'active' => $activeExtensions
745
+ );
746
+
747
+ return $divideExtension;
748
+ }
749
+
750
+ public static function renderAlertProblem()
751
+ {
752
+ ob_start();
753
+ ?>
754
+ <div id="welcome-panel" class="update-nag sgpb-alert-problem">
755
+ <div class="welcome-panel-content">
756
+ <p class="sgpb-problem-notice-close">x</p>
757
+ <div class="sgpb-alert-problem-text-wrapper">
758
+ <h3>Popup Builder plugin has been updated to the new version 3.</h3>
759
+ <h5>A lot of changes and improvements have been made.</h5>
760
+ <h5>In case of any issues, please contact us <a href="<?php echo SG_POPUP_TICKET_URL; ?>" target="_blank">here</a>.</h5>
761
+ </div>
762
+ <p class="sgpb-problem-notice-dont-show"><?php _e('Don\'t show again')?></p>
763
+ </div>
764
+ </div>
765
+ <?php
766
+ $content = ob_get_clean();
767
+
768
+ return $content;
769
+ }
770
+
771
+ public static function remoteFileExists($filename)
772
+ {
773
+ $file = wp_remote_head($filename);
774
+ if (!empty($file['response']['code']) == 200) {
775
+ return $file;
776
+ }
777
+
778
+ return array();
779
+ }
780
+ }
com/helpers/ConfigDataHelper.php ADDED
@@ -0,0 +1,956 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class ConfigDataHelper
3
+ {
4
+ public static $customPostType;
5
+
6
+ public static function getPostTypeData($args = array())
7
+ {
8
+ $query = self::getQueryDataByArgs($args);
9
+
10
+ $posts = array();
11
+ foreach ($query->posts as $post) {
12
+ $posts[$post->ID] = $post->post_title;
13
+ }
14
+
15
+ return $posts;
16
+ }
17
+
18
+ public static function getQueryDataByArgs($args = array())
19
+ {
20
+ $defaultArgs = array(
21
+ 'offset' => 0,
22
+ 'orderby' => 'date',
23
+ 'order' => 'DESC',
24
+ 'post_status' => 'publish',
25
+ 'suppress_filters' => true,
26
+ 'post_type' => 'post',
27
+ 'posts_per_page' => 1000
28
+ );
29
+
30
+ $args = wp_parse_args($args, $defaultArgs);
31
+ $query = new WP_Query($args);
32
+
33
+ return $query;
34
+ }
35
+
36
+ private static function getAllCustomPosts()
37
+ {
38
+ $args = array(
39
+ 'public' => true,
40
+ '_builtin' => false
41
+ );
42
+
43
+ $allCustomPosts = get_post_types($args);
44
+ if (isset($allCustomPosts[SG_POPUP_POST_TYPE])) {
45
+ unset($allCustomPosts[SG_POPUP_POST_TYPE]);
46
+ }
47
+ return $allCustomPosts;
48
+ }
49
+
50
+ public static function addFilters()
51
+ {
52
+ self::addPostTypeToFilters();
53
+ }
54
+
55
+ private static function addPostTypeToFilters()
56
+ {
57
+ add_filter('sgPopupTargetParams', array(__CLASS__, 'addPopupTargetParams'), 1, 1);
58
+ add_filter('sgPopupTargetData', array(__CLASS__, 'addPopupTargetData'), 1, 1);
59
+ add_filter('sgPopupTargetTypes', array(__CLASS__, 'addPopupTargetTypes'), 1, 1);
60
+ add_filter('sgPopupTargetAttrs', array(__CLASS__, 'addPopupTargetAttrs'), 1, 1);
61
+ add_filter('sgPopupPageTemplates', array(__CLASS__, 'addPopupPageTemplates'), 1, 1);
62
+ }
63
+
64
+ public static function addPopupTargetParams($targetParams)
65
+ {
66
+ $allCustomPostTypes = self::getAllCustomPosts();
67
+
68
+ foreach ($allCustomPostTypes as $customPostType) {
69
+ $targetParams[$customPostType] = array(
70
+ $customPostType.'_all' => 'All '.ucfirst($customPostType).'s',
71
+ $customPostType.'_selected' => 'Select '.ucfirst($customPostType).'s'
72
+ );
73
+ }
74
+
75
+ return $targetParams;
76
+ }
77
+
78
+ public static function addPopupTargetData($targetData)
79
+ {
80
+ $allCustomPostTypes = self::getAllCustomPosts();
81
+
82
+ foreach ($allCustomPostTypes as $customPostType) {
83
+ $targetData[$customPostType.'_all'] = null;
84
+ $targetData[$customPostType.'_selected'] = '';
85
+ }
86
+
87
+ return $targetData;
88
+ }
89
+
90
+ public static function addPopupTargetTypes($targetTypes)
91
+ {
92
+ $allCustomPostTypes = self::getAllCustomPosts();
93
+
94
+ foreach ($allCustomPostTypes as $customPostType) {
95
+ $targetTypes[$customPostType.'_selected'] = 'select';
96
+ }
97
+
98
+ return $targetTypes;
99
+ }
100
+
101
+ public static function addPopupTargetAttrs($targetAttrs)
102
+ {
103
+ $allCustomPostTypes = self::getAllCustomPosts();
104
+
105
+ foreach ($allCustomPostTypes as $customPostType) {
106
+ $targetAttrs[$customPostType.'_selected']['htmlAttrs'] = array('class' => 'js-sg-select2 js-select-ajax', 'data-select-class' => 'js-select-ajax', 'data-select-type' => 'ajax', 'data-value-param' => $customPostType, 'multiple' => 'multiple');
107
+ $targetAttrs[$customPostType.'_selected']['infoAttrs'] = array('label' => __('Select ', SG_POPUP_TEXT_DOMAIN).$customPostType);
108
+ }
109
+
110
+ return $targetAttrs;
111
+ }
112
+
113
+ public static function addPopupPageTemplates($templates)
114
+ {
115
+ $pageTemplates = self::getPageTemplates();
116
+
117
+ $pageTemplates += $templates;
118
+
119
+ return $pageTemplates;
120
+ }
121
+
122
+ public static function getAllCustomPostTypes()
123
+ {
124
+ $args = array(
125
+ 'public' => true,
126
+ '_builtin' => false
127
+ );
128
+
129
+ $allCustomPosts = get_post_types($args);
130
+ if (!empty($allCustomPosts[SG_POPUP_POST_TYPE])) {
131
+ unset($allCustomPosts[SG_POPUP_POST_TYPE]);
132
+ }
133
+
134
+ return $allCustomPosts;
135
+ }
136
+
137
+ public static function getPostsAllCategories()
138
+ {
139
+
140
+ $cats = get_categories(
141
+ array(
142
+ 'hide_empty' => 0,
143
+ 'type' => 'post',
144
+ 'orderby' => 'name',
145
+ 'order' => 'ASC'
146
+ )
147
+ );
148
+ $catsParams = array();
149
+ foreach ($cats as $cat) {
150
+
151
+ $id = $cat->term_id;
152
+ $name = $cat->name;
153
+ $catsParams[$id] = $name;
154
+ }
155
+
156
+ return $catsParams;
157
+ }
158
+
159
+ public static function getPageTypes()
160
+ {
161
+ $postTypes = array();
162
+
163
+ $postTypes['is_home_page'] = __('Home Page', SG_POPUP_TEXT_DOMAIN);
164
+ $postTypes['is_home'] = __('Posts Page', SG_POPUP_TEXT_DOMAIN);
165
+ $postTypes['is_search'] = __('Search Pages', SG_POPUP_TEXT_DOMAIN);
166
+ $postTypes['is_404'] = __('404 Pages', SG_POPUP_TEXT_DOMAIN);
167
+
168
+ return $postTypes;
169
+ }
170
+
171
+ public static function getDevices()
172
+ {
173
+ $devices = array();
174
+
175
+ $devices['is_desktop'] = __('Desktop', SG_POPUP_TEXT_DOMAIN);
176
+ $devices['is_tablet'] = __('Tablet', SG_POPUP_TEXT_DOMAIN);
177
+ $devices['is_mobile'] = __('Mobile', SG_POPUP_TEXT_DOMAIN);
178
+ $devices['is_bot'] = __('Bots', SG_POPUP_TEXT_DOMAIN);
179
+
180
+ return $devices;
181
+ }
182
+
183
+ public static function getPageTemplates()
184
+ {
185
+ $pageTemplates = array(
186
+ 'page.php' => __('Default Template', SG_POPUP_TEXT_DOMAIN)
187
+ );
188
+
189
+ $templates = wp_get_theme()->get_page_templates();
190
+ if (empty($templates)) {
191
+ return $pageTemplates;
192
+ }
193
+
194
+ foreach ($templates as $key => $value) {
195
+ $pageTemplates[$key] = $value;
196
+ }
197
+
198
+ return $pageTemplates;
199
+ }
200
+
201
+ public static function getAllTags()
202
+ {
203
+ $allTags = array();
204
+ $tags = get_tags(array(
205
+ 'hide_empty' => false
206
+ ));
207
+
208
+ foreach ($tags as $tag) {
209
+ $allTags[$tag->slug] = $tag->name;
210
+ }
211
+
212
+ return $allTags;
213
+ }
214
+
215
+ public static function defaultData()
216
+ {
217
+ $data = array();
218
+
219
+ $data['contentClickOptions'] = array(
220
+ 'template' => array(
221
+ 'fieldWrapperAttr' => array(
222
+ 'class' => 'col-md-7 sgpb-choice-option-wrapper'
223
+ ),
224
+ 'labelAttr' => array(
225
+ 'class' => 'col-md-5 sgpb-choice-option-wrapper sgpb-sub-option-label'
226
+ ),
227
+ 'groupWrapperAttr' => array(
228
+ 'class' => 'row form-group sgpb-choice-wrapper'
229
+ )
230
+ ),
231
+ 'buttonPosition' => 'right',
232
+ 'nextNewLine' => true,
233
+ 'fields' => array(
234
+ array(
235
+ 'attr' => array(
236
+ 'type' => 'radio',
237
+ 'name' => 'sgpb-content-click-behavior',
238
+ 'value' => 'close'
239
+ ),
240
+ 'label' => array(
241
+ 'name' => __('Close Popup', SG_POPUP_TEXT_DOMAIN).':'
242
+ )
243
+ ),
244
+ array(
245
+ 'attr' => array(
246
+ 'type' => 'radio',
247
+ 'name' => 'sgpb-content-click-behavior',
248
+ 'data-attr-href' => 'content-click-redirect',
249
+ 'value' => 'redirect'
250
+ ),
251
+ 'label' => array(
252
+ 'name' => __('Redirect', SG_POPUP_TEXT_DOMAIN).':'
253
+ )
254
+ ),
255
+ array(
256
+ 'attr' => array(
257
+ 'type' => 'radio',
258
+ 'name' => 'sgpb-content-click-behavior',
259
+ 'data-attr-href' => 'content-copy-to-clipboard',
260
+ 'value' => 'copy'
261
+ ),
262
+ 'label' => array(
263
+ 'name' => __('Copy to clipboard', SG_POPUP_TEXT_DOMAIN).':'
264
+ )
265
+ )
266
+ )
267
+ );
268
+
269
+ $data['popupDimensions'] = array(
270
+ 'template' => array(
271
+ 'fieldWrapperAttr' => array(
272
+ 'class' => 'col-md-7 sgpb-choice-option-wrapper'
273
+ ),
274
+ 'labelAttr' => array(
275
+ 'class' => 'col-md-5 sgpb-choice-option-wrapper'
276
+ ),
277
+ 'groupWrapperAttr' => array(
278
+ 'class' => 'row form-group sgpb-choice-wrapper'
279
+ )
280
+ ),
281
+ 'buttonPosition' => 'right',
282
+ 'nextNewLine' => true,
283
+ 'fields' => array(
284
+ array(
285
+ 'attr' => array(
286
+ 'type' => 'radio',
287
+ 'name' => 'sgpb-popup-dimension-mode',
288
+ 'class' => 'test class',
289
+ 'data-attr-href' => 'responsive-dimension-wrapper',
290
+ 'value' => 'responsiveMode'
291
+ ),
292
+ 'label' => array(
293
+ 'name' => __('Responsive mode', SG_POPUP_TEXT_DOMAIN).':',
294
+ 'info' => __('The sizes of the popup will be counted automatically, according to the content size of the popup. You can select the size in percentages, with this mode, to specify the size on the screen', SG_POPUP_TEXT_DOMAIN).'.'
295
+ )
296
+ ),
297
+ array(
298
+ 'attr' => array(
299
+ 'type' => 'radio',
300
+ 'name' => 'sgpb-popup-dimension-mode',
301
+ 'class' => 'test class',
302
+ 'data-attr-href' => 'custom-dimension-wrapper',
303
+ 'value' => 'customMode'
304
+ ),
305
+ 'label' => array(
306
+ 'name' => __('Custom mode', SG_POPUP_TEXT_DOMAIN).':',
307
+ 'info' => __('Add your own custom dimensions for the popup to get the exact sizing for your popup', SG_POPUP_TEXT_DOMAIN).'.'
308
+ )
309
+ )
310
+ )
311
+ );
312
+
313
+ $data['theme'] = array(
314
+ array(
315
+ 'value' => 'sgpb-theme-1',
316
+ 'data-attributes' => array(
317
+ 'class' => 'js-sgpb-popup-themes',
318
+ 'data-popup-theme-number' => 1
319
+ )
320
+ ),
321
+ array(
322
+ 'value' => 'sgpb-theme-2',
323
+ 'data-attributes' => array(
324
+ 'class' => 'js-sgpb-popup-themes',
325
+ 'data-popup-theme-number' => 2
326
+ )
327
+ ),
328
+ array(
329
+ 'value' => 'sgpb-theme-3',
330
+ 'data-attributes' => array(
331
+ 'class' => 'js-sgpb-popup-themes',
332
+ 'data-popup-theme-number' => 3
333
+ )
334
+ ),
335
+ array(
336
+ 'value' => 'sgpb-theme-4',
337
+ 'data-attributes' => array(
338
+ 'class' => 'js-sgpb-popup-themes',
339
+ 'data-popup-theme-number' => 4
340
+ )
341
+ ),
342
+ array(
343
+ 'value' => 'sgpb-theme-5',
344
+ 'data-attributes' => array(
345
+ 'class' => 'js-sgpb-popup-themes',
346
+ 'data-popup-theme-number' => 5
347
+ )
348
+ ),
349
+ array(
350
+ 'value' => 'sgpb-theme-6',
351
+ 'data-attributes' => array(
352
+ 'class' => 'js-sgpb-popup-themes',
353
+ 'data-popup-theme-number' => 6
354
+ )
355
+ )
356
+ );
357
+
358
+ $data['responsiveDimensions'] = array(
359
+ 'auto' => __('Auto', SG_POPUP_TEXT_DOMAIN),
360
+ '10' => '10%',
361
+ '20' => '20%',
362
+ '30' => '30%',
363
+ '40' => '40%',
364
+ '50' => '50%',
365
+ '60' => '60%',
366
+ '70' => '70%',
367
+ '80' => '80%',
368
+ '90' => '90%',
369
+ '100' => '100%'
370
+ );
371
+
372
+ $data['closeButtonPositions'] = array(
373
+ 'topLeft' => __('top-left', SG_POPUP_TEXT_DOMAIN),
374
+ 'topRight' => __('top-right', SG_POPUP_TEXT_DOMAIN),
375
+ 'bottomLeft' => __('bottom-left', SG_POPUP_TEXT_DOMAIN),
376
+ 'bottomRight' => __('bottom-right', SG_POPUP_TEXT_DOMAIN)
377
+ );
378
+
379
+ $data['closeButtonPositionsFirstTheme'] = array(
380
+ 'bottomLeft' => __('bottom-left', SG_POPUP_TEXT_DOMAIN),
381
+ 'bottomRight' => __('bottom-right', SG_POPUP_TEXT_DOMAIN)
382
+ );
383
+
384
+ $data['pxPercent'] = array(
385
+ 'px' => 'px',
386
+ '%' => '%'
387
+ );
388
+
389
+ $data['countdownFormat'] = array(
390
+ SG_COUNTDOWN_COUNTER_SECONDS_SHOW => 'DD:HH:MM:SS',
391
+ SG_COUNTDOWN_COUNTER_SECONDS_HIDE => 'DD:HH:MM'
392
+ );
393
+
394
+ // proStartGoldproEndGold
395
+
396
+ $data['countdownLanguage'] = array(
397
+ 'English' => 'English',
398
+ 'German' => 'Deutsche',
399
+ 'Spanish' => 'Español',
400
+ 'Arabic' => 'عربى',
401
+ 'Italian' => 'Italiano',
402
+ 'Dutch' => 'Dutch',
403
+ 'Norwegian' => 'Norsk',
404
+ 'Portuguese' => 'Português',
405
+ 'Russian' => 'Русский',
406
+ 'Swedish' => 'Svenska',
407
+ 'Chinese' => '中文'
408
+ );
409
+
410
+ $data['weekDaysArray'] = array(
411
+ 'Mon' => __('Monday', SG_POPUP_TEXT_DOMAIN),
412
+ 'Tue' => __('Tuesday', SG_POPUP_TEXT_DOMAIN),
413
+ 'Wed' => __('Wednesday', SG_POPUP_TEXT_DOMAIN),
414
+ 'Thu' => __('Thursday', SG_POPUP_TEXT_DOMAIN),
415
+ 'Fri' => __('Friday', SG_POPUP_TEXT_DOMAIN),
416
+ 'Sat' => __('Saturday', SG_POPUP_TEXT_DOMAIN),
417
+ 'Sun' => __('Sunday', SG_POPUP_TEXT_DOMAIN)
418
+ );
419
+
420
+ $data['messageResize'] = array(
421
+ 'both' => __('Both', SG_POPUP_TEXT_DOMAIN),
422
+ 'horizontal' => __('Horizontal', SG_POPUP_TEXT_DOMAIN),
423
+ 'vertical' => __('Vertical', SG_POPUP_TEXT_DOMAIN),
424
+ 'none' => __('None', SG_POPUP_TEXT_DOMAIN),
425
+ 'inherit' => __('Inherit', SG_POPUP_TEXT_DOMAIN)
426
+ );
427
+
428
+ $data['socialShareOptions'] = array(
429
+ 'template' => array(
430
+ 'fieldWrapperAttr' => array(
431
+ 'class' => 'col-md-7 sgpb-choice-option-wrapper'
432
+ ),
433
+ 'labelAttr' => array(
434
+ 'class' => 'col-md-5 sgpb-choice-option-wrapper'
435
+ ),
436
+ 'groupWrapperAttr' => array(
437
+ 'class' => 'row form-group sgpb-choice-wrapper'
438
+ )
439
+ ),
440
+ 'buttonPosition' => 'right',
441
+ 'nextNewLine' => true,
442
+ 'fields' => array(
443
+ array(
444
+ 'attr' => array(
445
+ 'type' => 'radio',
446
+ 'name' => 'sgpb-social-share-url-type',
447
+ 'class' => 'sgpb-share-url-type',
448
+ 'data-attr-href' => '',
449
+ 'value' => 'activeUrl'
450
+ ),
451
+ 'label' => array(
452
+ 'name' => __('Use active URL', SG_POPUP_TEXT_DOMAIN).':'
453
+ )
454
+ ),
455
+ array(
456
+ 'attr' => array(
457
+ 'type' => 'radio',
458
+ 'name' => 'sgpb-social-share-url-type',
459
+ 'class' => 'sgpb-share-url-type',
460
+ 'data-attr-href' => 'sgpb-social-share-url-wrapper',
461
+ 'value' => 'shareUrl'
462
+ ),
463
+ 'label' => array(
464
+ 'name' => __('Share URL', SG_POPUP_TEXT_DOMAIN).':'
465
+ )
466
+ )
467
+ )
468
+ );
469
+
470
+ $data['popupInsertEventTypes'] = array(
471
+ 'inherit' => __('Inherit', SG_POPUP_TEXT_DOMAIN),
472
+ 'onLoad' => __('On load', SG_POPUP_TEXT_DOMAIN),
473
+ 'click' => __('On click', SG_POPUP_TEXT_DOMAIN),
474
+ 'hover' => __('On hover', SG_POPUP_TEXT_DOMAIN)
475
+ );
476
+
477
+ $data['subscriptionSuccessBehavior'] = array(
478
+ 'template' => array(
479
+ 'fieldWrapperAttr' => array(
480
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper'
481
+ ),
482
+ 'labelAttr' => array(
483
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper sgpb-sub-option-label'
484
+ ),
485
+ 'groupWrapperAttr' => array(
486
+ 'class' => 'row form-group sgpb-choice-wrapper'
487
+ )
488
+ ),
489
+ 'buttonPosition' => 'right',
490
+ 'nextNewLine' => true,
491
+ 'fields' => array(
492
+ array(
493
+ 'attr' => array(
494
+ 'type' => 'radio',
495
+ 'name' => 'sgpb-subs-success-behavior',
496
+ 'class' => 'subs-success-message',
497
+ 'data-attr-href' => 'subs-show-success-message',
498
+ 'value' => 'showMessage'
499
+ ),
500
+ 'label' => array(
501
+ 'name' => __('Success message', SG_POPUP_TEXT_DOMAIN).':'
502
+ )
503
+ ),
504
+ array(
505
+ 'attr' => array(
506
+ 'type' => 'radio',
507
+ 'name' => 'sgpb-subs-success-behavior',
508
+ 'class' => 'subs-redirect-to-URL',
509
+ 'data-attr-href' => 'subs-redirect-to-URL',
510
+ 'value' => 'redirectToURL'
511
+ ),
512
+ 'label' => array(
513
+ 'name' => __('Redirect to url', SG_POPUP_TEXT_DOMAIN).':'
514
+ )
515
+ ),
516
+ array(
517
+ 'attr' => array(
518
+ 'type' => 'radio',
519
+ 'name' => 'sgpb-subs-success-behavior',
520
+ 'class' => 'subs-success-open-popup',
521
+ 'data-attr-href' => 'subs-open-popup',
522
+ 'value' => 'openPopup'
523
+ ),
524
+ 'label' => array(
525
+ 'name' => __('Open popup', SG_POPUP_TEXT_DOMAIN).':'
526
+ )
527
+ ),
528
+ array(
529
+ 'attr' => array(
530
+ 'type' => 'radio',
531
+ 'name' => 'sgpb-subs-success-behavior',
532
+ 'class' => 'subs-hide-popup',
533
+ 'value' => 'hidePopup'
534
+ ),
535
+ 'label' => array(
536
+ 'name' => __('Hide popup', SG_POPUP_TEXT_DOMAIN).':'
537
+ )
538
+ )
539
+ )
540
+ );
541
+
542
+ $data['contactFormSuccessBehavior'] = array(
543
+ 'template' => array(
544
+ 'fieldWrapperAttr' => array(
545
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper'
546
+ ),
547
+ 'labelAttr' => array(
548
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper sgpb-sub-option-label'
549
+ ),
550
+ 'groupWrapperAttr' => array(
551
+ 'class' => 'row form-group sgpb-choice-wrapper'
552
+ )
553
+ ),
554
+ 'buttonPosition' => 'right',
555
+ 'nextNewLine' => true,
556
+ 'fields' => array(
557
+ array(
558
+ 'attr' => array(
559
+ 'type' => 'radio',
560
+ 'name' => 'sgpb-contact-success-behavior',
561
+ 'class' => 'contact-success-message',
562
+ 'data-attr-href' => 'contact-show-success-message',
563
+ 'value' => 'showMessage'
564
+ ),
565
+ 'label' => array(
566
+ 'name' => __('Success message', SG_POPUP_TEXT_DOMAIN).':'
567
+ )
568
+ ),
569
+ array(
570
+ 'attr' => array(
571
+ 'type' => 'radio',
572
+ 'name' => 'sgpb-contact-success-behavior',
573
+ 'class' => 'contact-redirect-to-URL ok-ggoel',
574
+ 'data-attr-href' => 'contact-redirect-to-URL',
575
+ 'value' => 'redirectToURL'
576
+ ),
577
+ 'label' => array(
578
+ 'name' => __('Redirect to url', SG_POPUP_TEXT_DOMAIN).':'
579
+ )
580
+ ),
581
+ array(
582
+ 'attr' => array(
583
+ 'type' => 'radio',
584
+ 'name' => 'sgpb-contact-success-behavior',
585
+ 'class' => 'contact-success-open-popup',
586
+ 'data-attr-href' => 'contact-open-popup',
587
+ 'value' => 'openPopup'
588
+ ),
589
+ 'label' => array(
590
+ 'name' => __('Open popup', SG_POPUP_TEXT_DOMAIN).':'
591
+ )
592
+ ),
593
+ array(
594
+ 'attr' => array(
595
+ 'type' => 'radio',
596
+ 'name' => 'sgpb-contact-success-behavior',
597
+ 'class' => 'contact-hide-popup',
598
+ 'value' => 'hidePopup'
599
+ ),
600
+ 'label' => array(
601
+ 'name' => __('Hide popup', SG_POPUP_TEXT_DOMAIN).':'
602
+ )
603
+ )
604
+ )
605
+ );
606
+
607
+ $data['socialShareTheme'] = array(
608
+ 'flat' => __('Flat', SG_POPUP_TEXT_DOMAIN),
609
+ 'classic' => __('Classic', SG_POPUP_TEXT_DOMAIN),
610
+ 'minima' => __('Minima', SG_POPUP_TEXT_DOMAIN),
611
+ 'plain' => __('Plain', SG_POPUP_TEXT_DOMAIN)
612
+ );
613
+
614
+ $data['socialThemeSizes'] = array(
615
+ '8' => '8',
616
+ '10' => '10',
617
+ '12' => '12',
618
+ '14' => '14',
619
+ '16' => '16',
620
+ '18' => '18',
621
+ '20' => '20',
622
+ '24' => '24'
623
+ );
624
+
625
+ $data['socialThemeShereCount'] = array(
626
+ 'true' => __('True', SG_POPUP_TEXT_DOMAIN),
627
+ 'false' => __('False', SG_POPUP_TEXT_DOMAIN),
628
+ 'inside' => __('Inside', SG_POPUP_TEXT_DOMAIN)
629
+ );
630
+
631
+ $data['buttonsType'] = array(
632
+ 'standard' => __('Standard', SG_POPUP_TEXT_DOMAIN),
633
+ 'box_count' => __('Box with count', SG_POPUP_TEXT_DOMAIN),
634
+ 'button_count' => __('Button with count', SG_POPUP_TEXT_DOMAIN),
635
+ 'button' => __('Button', SG_POPUP_TEXT_DOMAIN)
636
+ );
637
+
638
+ $data['backroundImageModes'] = array(
639
+ 'no-repeat' => __('None', SG_POPUP_TEXT_DOMAIN),
640
+ 'cover' => __('Cover', SG_POPUP_TEXT_DOMAIN),
641
+ 'fit' => __('Fit', SG_POPUP_TEXT_DOMAIN),
642
+ 'contain' => __('Contain', SG_POPUP_TEXT_DOMAIN),
643
+ 'repeat' => __('Repeat', SG_POPUP_TEXT_DOMAIN)
644
+ );
645
+
646
+ $data['openAnimationEfects'] = array(
647
+ 'No effect' => __('None', SG_POPUP_TEXT_DOMAIN),
648
+ 'sgpb-flip' => __('Flip', SG_POPUP_TEXT_DOMAIN),
649
+ 'sgpb-shake' => __('Shake', SG_POPUP_TEXT_DOMAIN),
650
+ 'sgpb-wobble' => __('Wobble', SG_POPUP_TEXT_DOMAIN),
651
+ 'sgpb-swing' => __('Swing', SG_POPUP_TEXT_DOMAIN),
652
+ 'sgpb-flash' => __('Flash', SG_POPUP_TEXT_DOMAIN),
653
+ 'sgpb-bounce' => __('Bounce', SG_POPUP_TEXT_DOMAIN),
654
+ 'sgpb-bounceInRight' => __('BounceInRight', SG_POPUP_TEXT_DOMAIN),
655
+ 'sgpb-bounceIn' => __('BounceIn', SG_POPUP_TEXT_DOMAIN),
656
+ 'sgpb-pulse' => __('Pulse', SG_POPUP_TEXT_DOMAIN),
657
+ 'sgpb-rubberBand' => __('RubberBand', SG_POPUP_TEXT_DOMAIN),
658
+ 'sgpb-tada' => __('Tada', SG_POPUP_TEXT_DOMAIN),
659
+ 'sgpb-slideInUp' => __('SlideInUp', SG_POPUP_TEXT_DOMAIN),
660
+ 'sgpb-jello' => __('Jello', SG_POPUP_TEXT_DOMAIN),
661
+ 'sgpb-rotateIn' => __('RotateIn', SG_POPUP_TEXT_DOMAIN),
662
+ 'sgpb-fadeIn' => __('FadeIn', SG_POPUP_TEXT_DOMAIN)
663
+ );
664
+
665
+ $data['userRoles'] = self::getAllUserRoles();
666
+
667
+ return $data;
668
+ }
669
+
670
+ public static function getAllUserRoles()
671
+ {
672
+ $rulesArray = array();
673
+ if (!function_exists('get_editable_roles')){
674
+ return $rulesArray;
675
+ }
676
+
677
+ $roles = get_editable_roles();
678
+ foreach ($roles as $roleName => $roleInfo) {
679
+ if ($roleName == 'administrator') {
680
+ continue;
681
+ }
682
+ $rulesArray[$roleName] = $roleName;
683
+ }
684
+
685
+ return $rulesArray;
686
+ }
687
+
688
+ public static function countriesIsoData()
689
+ {
690
+ $countries = array (
691
+ 'AF' => 'Afghanistan',
692
+ 'AX' => 'Aland Islands',
693
+ 'AL' => 'Albania',
694
+ 'DZ' => 'Algeria',
695
+ 'AS' => 'American Samoa',
696
+ 'AD' => 'Andorra',
697
+ 'AO' => 'Angola',
698
+ 'AI' => 'Anguilla',
699
+ 'AQ' => 'Antarctica',
700
+ 'AG' => 'Antigua And Barbuda',
701
+ 'AR' => 'Argentina',
702
+ 'AM' => 'Armenia',
703
+ 'AW' => 'Aruba',
704
+ 'AU' => 'Australia',
705
+ 'AT' => 'Austria',
706
+ 'AZ' => 'Azerbaijan',
707
+ 'BS' => 'Bahamas',
708
+ 'BH' => 'Bahrain',
709
+ 'BD' => 'Bangladesh',
710
+ 'BB' => 'Barbados',
711
+ 'BY' => 'Belarus',
712
+ 'BE' => 'Belgium',
713
+ 'BZ' => 'Belize',
714
+ 'BJ' => 'Benin',
715
+ 'BM' => 'Bermuda',
716
+ 'BT' => 'Bhutan',
717
+ 'BO' => 'Bolivia',
718
+ 'BA' => 'Bosnia And Herzegovina',
719
+ 'BW' => 'Botswana',
720
+ 'BV' => 'Bouvet Island',
721
+ 'BR' => 'Brazil',
722
+ 'IO' => 'British Indian Ocean Territory',
723
+ 'BN' => 'Brunei Darussalam',
724
+ 'BG' => 'Bulgaria',
725
+ 'BF' => 'Burkina Faso',
726
+ 'BI' => 'Burundi',
727
+ 'KH' => 'Cambodia',
728
+ 'CM' => 'Cameroon',
729
+ 'CA' => 'Canada',
730
+ 'CV' => 'Cape Verde',
731
+ 'KY' => 'Cayman Islands',
732
+ 'CF' => 'Central African Republic',
733
+ 'TD' => 'Chad',
734
+ 'CL' => 'Chile',
735
+ 'CN' => 'China',
736
+ 'CX' => 'Christmas Island',
737
+ 'CC' => 'Cocos (Keeling) Islands',
738
+ 'CO' => 'Colombia',
739
+ 'KM' => 'Comoros',
740
+ 'CG' => 'Congo',
741
+ 'CD' => 'Congo, Democratic Republic',
742
+ 'CK' => 'Cook Islands',
743
+ 'CR' => 'Costa Rica',
744
+ 'CI' => "Cote D'Ivoire",
745
+ 'HR' => 'Croatia',
746
+ 'CU' => 'Cuba',
747
+ 'CY' => 'Cyprus',
748
+ 'CZ' => 'Czech Republic',
749
+ 'DK' => 'Denmark',
750
+ 'DJ' => 'Djibouti',
751
+ 'DM' => 'Dominica',
752
+ 'DO' => 'Dominican Republic',
753
+ 'EC' => 'Ecuador',
754
+ 'EG' => 'Egypt',
755
+ 'SV' => 'El Salvador',
756
+ 'GQ' => 'Equatorial Guinea',
757
+ 'ER' => 'Eritrea',
758
+ 'EE' => 'Estonia',
759
+ 'ET' => 'Ethiopia',
760
+ 'FK' => 'Falkland Islands (Malvinas)',
761
+ 'FO' => 'Faroe Islands',
762
+ 'FJ' => 'Fiji',
763
+ 'FI' => 'Finland',
764
+ 'FR' => 'France',
765
+ 'GF' => 'French Guiana',
766
+ 'PF' => 'French Polynesia',
767
+ 'TF' => 'French Southern Territories',
768
+ 'GA' => 'Gabon',
769
+ 'GM' => 'Gambia',
770
+ 'GE' => 'Georgia',
771
+ 'DE' => 'Germany',
772
+ 'GH' => 'Ghana',
773
+ 'GI' => 'Gibraltar',
774
+ 'GR' => 'Greece',
775
+ 'GL' => 'Greenland',
776
+ 'GD' => 'Grenada',
777
+ 'GP' => 'Guadeloupe',
778
+ 'GU' => 'Guam',
779
+ 'GT' => 'Guatemala',
780
+ 'GG' => 'Guernsey',
781
+ 'GN' => 'Guinea',
782
+ 'GW' => 'Guinea-Bissau',
783
+ 'GY' => 'Guyana',
784
+ 'HT' => 'Haiti',
785
+ 'HM' => 'Heard Island & Mcdonald Islands',
786
+ 'VA' => 'Holy See (Vatican City State)',
787
+ 'HN' => 'Honduras',
788
+ 'HK' => 'Hong Kong',
789
+ 'HU' => 'Hungary',
790
+ 'IS' => 'Iceland',
791
+ 'IN' => 'India',
792
+ 'ID' => 'Indonesia',
793
+ 'IR' => 'Islamic Republic of Iran',
794
+ 'IQ' => 'Iraq',
795
+ 'IE' => 'Ireland',
796
+ 'IM' => 'Isle Of Man',
797
+ 'IL' => 'Israel',
798
+ 'IT' => 'Italy',
799
+ 'JM' => 'Jamaica',
800
+ 'JP' => 'Japan',
801
+ 'JE' => 'Jersey',
802
+ 'JO' => 'Jordan',
803
+ 'KZ' => 'Kazakhstan',
804
+ 'KE' => 'Kenya',
805
+ 'KI' => 'Kiribati',
806
+ 'KR' => 'Korea',
807
+ 'KW' => 'Kuwait',
808
+ 'KG' => 'Kyrgyzstan',
809
+ 'LA' => "Lao People's Democratic Republic",
810
+ 'LV' => 'Latvia',
811
+ 'LB' => 'Lebanon',
812
+ 'LS' => 'Lesotho',
813
+ 'LR' => 'Liberia',
814
+ 'LY' => 'Libyan Arab Jamahiriya',
815
+ 'LI' => 'Liechtenstein',
816
+ 'LT' => 'Lithuania',
817
+ 'LU' => 'Luxembourg',
818
+ 'MO' => 'Macao',
819
+ 'MK' => 'Macedonia',
820
+ 'MG' => 'Madagascar',
821
+ 'MW' => 'Malawi',
822
+ 'MY' => 'Malaysia',
823
+ 'MV' => 'Maldives',
824
+ 'ML' => 'Mali',
825
+ 'MT' => 'Malta',
826
+ 'MH' => 'Marshall Islands',
827
+ 'MQ' => 'Martinique',
828
+ 'MR' => 'Mauritania',
829
+ 'MU' => 'Mauritius',
830
+ 'YT' => 'Mayotte',
831
+ 'MX' => 'Mexico',
832
+ 'FM' => 'Micronesia, Federated States Of',
833
+ 'MD' => 'Moldova',
834
+ 'MC' => 'Monaco',
835
+ 'MN' => 'Mongolia',
836
+ 'ME' => 'Montenegro',
837
+ 'MS' => 'Montserrat',
838
+ 'MA' => 'Morocco',
839
+ 'MZ' => 'Mozambique',
840
+ 'MM' => 'Myanmar',
841
+ 'NA' => 'Namibia',
842
+ 'NR' => 'Nauru',
843
+ 'NP' => 'Nepal',
844
+ 'NL' => 'Netherlands',
845
+ 'AN' => 'Netherlands Antilles',
846
+ 'NC' => 'New Caledonia',
847
+ 'NZ' => 'New Zealand',
848
+ 'NI' => 'Nicaragua',
849
+ 'NE' => 'Niger',
850
+ 'NG' => 'Nigeria',
851
+ 'NU' => 'Niue',
852
+ 'NF' => 'Norfolk Island',
853
+ 'MP' => 'Northern Mariana Islands',
854
+ 'NO' => 'Norway',
855
+ 'OM' => 'Oman',
856
+ 'PK' => 'Pakistan',
857
+ 'PW' => 'Palau',
858
+ 'PS' => 'Palestinian Territory, Occupied',
859
+ 'PA' => 'Panama',
860
+ 'PG' => 'Papua New Guinea',
861
+ 'PY' => 'Paraguay',
862
+ 'PE' => 'Peru',
863
+ 'PH' => 'Philippines',
864
+ 'PN' => 'Pitcairn',
865
+ 'PL' => 'Poland',
866
+ 'PT' => 'Portugal',
867
+ 'PR' => 'Puerto Rico',
868
+ 'QA' => 'Qatar',
869
+ 'RE' => 'Reunion',
870
+ 'RO' => 'Romania',
871
+ 'RU' => 'Russian Federation',
872
+ 'RW' => 'Rwanda',
873
+ 'BL' => 'Saint Barthelemy',
874
+ 'SH' => 'Saint Helena',
875
+ 'KN' => 'Saint Kitts And Nevis',
876
+ 'LC' => 'Saint Lucia',
877
+ 'MF' => 'Saint Martin',
878
+ 'PM' => 'Saint Pierre And Miquelon',
879
+ 'VC' => 'Saint Vincent And Grenadines',
880
+ 'WS' => 'Samoa',
881
+ 'SM' => 'San Marino',
882
+ 'ST' => 'Sao Tome And Principe',
883
+ 'SA' => 'Saudi Arabia',
884
+ 'SN' => 'Senegal',
885
+ 'RS' => 'Serbia',
886
+ 'SC' => 'Seychelles',
887
+ 'SL' => 'Sierra Leone',
888
+ 'SG' => 'Singapore',
889
+ 'SK' => 'Slovakia',
890
+ 'SI' => 'Slovenia',
891
+ 'SB' => 'Solomon Islands',
892
+ 'SO' => 'Somalia',
893
+ 'ZA' => 'South Africa',
894
+ 'GS' => 'South Georgia And Sandwich Isl.',
895
+ 'ES' => 'Spain',
896
+ 'LK' => 'Sri Lanka',
897
+ 'SD' => 'Sudan',
898
+ 'SR' => 'Suriname',
899
+ 'SJ' => 'Svalbard And Jan Mayen',
900
+ 'SZ' => 'Swaziland',
901
+ 'SE' => 'Sweden',
902
+ 'CH' => 'Switzerland',
903
+ 'SY' => 'Syrian Arab Republic',
904
+ 'TW' => 'Taiwan',
905
+ 'TJ' => 'Tajikistan',
906
+ 'TZ' => 'Tanzania',
907
+ 'TH' => 'Thailand',
908
+ 'TL' => 'Timor-Leste',
909
+ 'TG' => 'Togo',
910
+ 'TK' => 'Tokelau',
911
+ 'TO' => 'Tonga',
912
+ 'TT' => 'Trinidad And Tobago',
913
+ 'TN' => 'Tunisia',
914
+ 'TR' => 'Turkey',
915
+ 'TM' => 'Turkmenistan',
916
+ 'TC' => 'Turks And Caicos Islands',
917
+ 'TV' => 'Tuvalu',
918
+ 'UG' => 'Uganda',
919
+ 'UA' => 'Ukraine',
920
+ 'AE' => 'United Arab Emirates',
921
+ 'GB' => 'United Kingdom',
922
+ 'US' => 'United States',
923
+ 'UM' => 'United States Outlying Islands',
924
+ 'UY' => 'Uruguay',
925
+ 'UZ' => 'Uzbekistan',
926
+ 'VU' => 'Vanuatu',
927
+ 'VE' => 'Venezuela',
928
+ 'VN' => 'Viet Nam',
929
+ 'VG' => 'Virgin Islands, British',
930
+ 'VI' => 'Virgin Islands, U.S.',
931
+ 'WF' => 'Wallis And Futuna',
932
+ 'EH' => 'Western Sahara',
933
+ 'YE' => 'Yemen',
934
+ 'ZM' => 'Zambia',
935
+ 'ZW' => 'Zimbabwe',
936
+ );
937
+
938
+ return $countries;
939
+ }
940
+
941
+ // proStartSilverproEndSilver
942
+
943
+ // proStartGoldproEndGold
944
+
945
+ public static function getJsLocalizedData()
946
+ {
947
+ $translatedData = array(
948
+ 'imageSupportAlertMessage' => __('Only image files supported', SG_POPUP_TEXT_DOMAIN),
949
+ 'areYouSure' => __('Are you sure?', SG_POPUP_TEXT_DOMAIN),
950
+ 'addButtonSpinner' => __('Add', SG_POPUP_TEXT_DOMAIN),
951
+ 'audioSupportAlertMessage' => __('Only audio files supported (e.g.: mp3, wav, m4a, ogg)', SG_POPUP_TEXT_DOMAIN)
952
+ );
953
+
954
+ return $translatedData;
955
+ }
956
+ }
com/helpers/Functions.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+ use \SxGeo;
4
+
5
+ class Functions
6
+ {
7
+ // proStartPlatinumproEndPlatinum
8
+
9
+ // proStartSilverproEndSilver
10
+
11
+ public static function renderForm($formFields)
12
+ {
13
+ $form = '';
14
+
15
+ if (empty($formFields) || !is_array($formFields)) {
16
+ return $form;
17
+ }
18
+ $simpleElements = array(
19
+ 'text',
20
+ 'email',
21
+ 'hidden',
22
+ 'submit',
23
+ 'button'
24
+ );
25
+
26
+ $form = '<form class="sgpb-form" id="sgpb-form" method="post">';
27
+ $fields = '<div class="sgpb-form-wrapper">';
28
+ foreach ($formFields as $fieldKey => $formField) {
29
+ $htmlElement = '';
30
+ $hideClassName = '';
31
+ $type = 'text';
32
+
33
+ if (!empty($formField['attrs']['type'])) {
34
+ $type = $formField['attrs']['type'];
35
+ }
36
+
37
+ $styles = '';
38
+ $attrs = '';
39
+ $label = '';
40
+ $gdprWrapperStyles = '';
41
+ $gdprText = '';
42
+ $errorMessageBoxStyles = '';
43
+ $errorWrapperClassName = @$formField['attrs']['name'].'-error-message';
44
+ if (isset($formField['errorMessageBoxStyles'])) {
45
+ $errorMessageBoxStyles = 'style="width:'.$formField['errorMessageBoxStyles'].'"';
46
+ }
47
+ if (!empty($formField['label'])) {
48
+ $label = $formField['label'];
49
+ if (isset($formField['text'])) {
50
+ $gdprText = $formField['text'];
51
+ }
52
+ $formField['style'] = array('color' => @$formField['style']['color'], 'width' => $formField['style']['width']);
53
+ $gdprWrapperStyles = 'style="color:'.$formField['style']['color'].'"';
54
+ }
55
+
56
+ if ($type == 'checkbox') {
57
+ $formField['style']['max-width'] = $formField['style']['width'];
58
+ unset($formField['style']['width']);
59
+ }
60
+ if (!empty($formField['style'])) {
61
+ $styles = 'style="';
62
+ if (strpos(@$formField['attrs']['name'], 'gdpr') !== false) {
63
+ unset($formField['style']['height']);
64
+ }
65
+ foreach ($formField['style'] as $styleKey => $styleValue) {
66
+ if ($styleKey == 'placeholder') {
67
+ $styles .= '';
68
+ }
69
+ $styles .= $styleKey.':'.$styleValue.'; ';
70
+ }
71
+ $styles .= '"';
72
+ }
73
+
74
+ if (!empty($formField['attrs'])) {
75
+ foreach ($formField['attrs'] as $attrKey => $attrValue) {
76
+ $attrs .= $attrKey.' = "'.esc_attr($attrValue).'" ';
77
+ }
78
+ }
79
+
80
+ if (!$formField['isShow']) {
81
+ $hideClassName = 'sg-js-hide';
82
+ }
83
+
84
+ if (in_array($type, $simpleElements)) {
85
+ $htmlElement = self::createInputElement($attrs, $styles, $errorWrapperClassName, $errorMessageBoxStyles);
86
+ }
87
+ else if ($type == 'checkbox') {
88
+ $htmlElement = self::createCheckbox($attrs, $styles);
89
+ if (strpos(@$formField['attrs']['name'], 'gdpr') !== false) {
90
+ $label = $formField['label'];
91
+ if (isset($formField['text'])) {
92
+ $gdprText = $formField['text'];
93
+ }
94
+ $formField['style'] = array('color' => @$formField['style']['color'], 'width' => @$formField['style']['width']);
95
+ $gdprWrapperStyles = 'style="color:'.@$formField['style']['color'].'"';
96
+ $htmlElement = self::createGdprCheckbox($attrs, $styles, $label, $gdprWrapperStyles, $gdprText);
97
+ }
98
+ }
99
+ else if ($type == 'textarea') {
100
+ $htmlElement = self::createTextArea($attrs, $styles, $errorWrapperClassName);
101
+ }
102
+
103
+ ob_start();
104
+ ?>
105
+ <div class="sgpb-inputs-wrapper js-<?php echo $fieldKey; ?>-wrapper js-sgpb-form-field-<?php echo $fieldKey; ?>-wrapper <?php echo $hideClassName; ?>">
106
+ <?php echo $htmlElement; ?>
107
+ </div>
108
+ <?php
109
+ $fields .= ob_get_contents();
110
+ ob_get_clean();
111
+ }
112
+ $fields .= '</div>';
113
+
114
+ $form .= $fields;
115
+ $form .= '</form>';
116
+
117
+ return $form;
118
+ }
119
+
120
+ public static function createInputElement($attrs, $styles = '', $errorWrapperClassName = '')
121
+ {
122
+ $inputElement = "<input $attrs $styles>";
123
+
124
+ if (!empty($errorWrapperClassName)) {
125
+ $inputElement .= "<div class='$errorWrapperClassName'></div>";
126
+ }
127
+
128
+ return $inputElement;
129
+ }
130
+
131
+ public static function createCheckbox($attrs, $styles)
132
+ {
133
+ $inputElement = "<input $attrs $styles>";
134
+
135
+ return $inputElement;
136
+ }
137
+
138
+ public static function createGdprCheckbox($attrs, $styles, $label = '', $gdprWrapperStyles = '', $text = '')
139
+ {
140
+ $inputElement = "<input $attrs>";
141
+ $inputElement = '<div class="sgpb-gdpr-label-wrapper" '.$styles.'>'.$inputElement.'<label for="sgpb-gdpr-field-label">'.$label.'</label><div class="sgpb-gdpr-error-message"></div></div>';
142
+ if ($text == '') {
143
+ return $inputElement;
144
+ }
145
+ $inputElement .= '<div class="sgpb-alert-info sgpb-alert sgpb-gdpr-info js-subs-text-checkbox sgpb-gdpr-text-js" '.$styles.'>'.$text.'</div>';
146
+
147
+ return $inputElement;
148
+ }
149
+
150
+ public static function createTextArea($attrs, $styles, $errorWrapperClassName = '')
151
+ {
152
+ $inputElement = "<textarea $attrs $styles></textarea>";
153
+ if (!empty($errorWrapperClassName)) {
154
+ $inputElement .= "<div class='$errorWrapperClassName'></div>";
155
+ }
156
+
157
+ return $inputElement;
158
+ }
159
+
160
+ public static function getPopupTypeToAllowToShowMetabox()
161
+ {
162
+ global $post;
163
+
164
+ if ($post->post_type != SG_POPUP_POST_TYPE) {
165
+ return false;
166
+ }
167
+ if (!empty($_GET['sgpb_type'])) {
168
+ $type = $_GET['sgpb_type'];
169
+ }
170
+ else {
171
+ $popupId = $post->ID;
172
+ $popup = SGPopup::find($popupId);
173
+ if (empty($popup) || !is_object($popup)) {
174
+ return false;
175
+ }
176
+ $type = $popup->getType();
177
+ }
178
+
179
+ return $type;
180
+ }
181
+
182
+ public static function getExtensionDirectory($extensionFolderName = '', $popupMainFolderName = '')
183
+ {
184
+ $directoryExisits = is_dir(SGPB_POPUP_EXTENSIONS_PATH.$extensionFolderName);
185
+ $dir = SGPB_POPUP_EXTENSIONS_PATH.$extensionFolderName;
186
+
187
+ if (!$directoryExisits) {
188
+ $directoryExisits = is_dir(WP_PLUGIN_DIR.'/'.$extensionFolderName);
189
+ $dir = WP_PLUGIN_DIR.'/'.$extensionFolderName;
190
+ if (!$directoryExisits) {
191
+ $dir = false;
192
+ }
193
+ }
194
+
195
+ return $dir;
196
+ }
197
+ }
com/helpers/MultipleChoiceButton.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class MultipleChoiceButton
5
+ {
6
+ private $buttonsData = array();
7
+ private $savedValue = '';
8
+ private $template = array();
9
+ private $buttonPosition = 'right';
10
+ private $fields = array();
11
+
12
+ /**
13
+ * RadioButtons constructor.
14
+ *
15
+ * @since 1.0.0
16
+ *
17
+ * @param $buttonsData
18
+ * @param $savedValue
19
+ */
20
+ public function __construct($buttonsData, $savedValue)
21
+ {
22
+ $this->setButtonsData($buttonsData);
23
+ $this->setSavedValue($savedValue);
24
+ $this->prepareBuild();
25
+ }
26
+
27
+ public function __toString()
28
+ {
29
+ return $this->render();
30
+ }
31
+
32
+ public function setButtonsData($buttonsData)
33
+ {
34
+ $this->buttonsData = $buttonsData;
35
+ }
36
+
37
+ public function getButtonsData()
38
+ {
39
+ return $this->buttonsData;
40
+ }
41
+
42
+ /**
43
+ * Radio buttons saved value
44
+ *
45
+ * @since 1.0.0
46
+ *
47
+ * @param string $savedValue
48
+ */
49
+ public function setSavedValue($savedValue)
50
+ {
51
+ $this->savedValue = $savedValue;
52
+ }
53
+
54
+ public function getSavedValue()
55
+ {
56
+ return $this->savedValue;
57
+ }
58
+
59
+ /**
60
+ * Radio buttons template
61
+ *
62
+ * @since 1.0.0
63
+ *
64
+ * @param array $template
65
+ */
66
+ public function setTemplate($template)
67
+ {
68
+ $this->template = $template;
69
+ }
70
+
71
+ public function getTemplate()
72
+ {
73
+ return $this->template;
74
+ }
75
+
76
+ /**
77
+ * Radio buttons position
78
+ *
79
+ * @since 1.0.0
80
+ *
81
+ * @param string $buttonPosition
82
+ */
83
+ public function setButtonPosition($buttonPosition)
84
+ {
85
+ $this->buttonPosition = $buttonPosition;
86
+ }
87
+
88
+ public function getButtonPosition()
89
+ {
90
+ return $this->buttonPosition;
91
+ }
92
+
93
+ /**
94
+ * Fields Data
95
+ *
96
+ * @since 1.0.0
97
+ *
98
+ * @param array $fields
99
+ */
100
+ public function setFields($fields)
101
+ {
102
+ $this->fields = $fields;
103
+ }
104
+
105
+ public function getFields()
106
+ {
107
+ return $this->fields;
108
+ }
109
+
110
+ private function prepareBuild()
111
+ {
112
+ $buttonsData = $this->getButtonsData();
113
+
114
+ if (!empty($buttonsData['template'])) {
115
+ $this->setTemplate($buttonsData['template']);
116
+ }
117
+ if (!empty($buttonsData['buttonPosition'])) {
118
+ $this->setButtonPosition($buttonsData['buttonPosition']);
119
+ }
120
+ if (!empty($buttonsData['fields'])) {
121
+ $this->setFields($buttonsData['fields']);
122
+ }
123
+ }
124
+
125
+ public function render()
126
+ {
127
+ ob_start();
128
+ ?>
129
+ <div class="sgpb-buttons-wrapper">
130
+ <?php echo $this->renderFields()?>
131
+ </div>
132
+ <?php
133
+ $content = ob_get_contents();
134
+ ob_get_clean();
135
+
136
+ return $content;
137
+ }
138
+
139
+ private function renderFields()
140
+ {
141
+ $fields = $this->getFields();
142
+ $groupAttrStr = '';
143
+ $template = $this->getTemplate();
144
+ $buttonPosition = $this->getButtonPosition();
145
+ $buttonsView = '';
146
+
147
+ if (empty($fields)) {
148
+ return $buttonsView;
149
+ }
150
+
151
+ if (!empty($template['groupWrapperAttr'])) {
152
+ $groupAttrStr = $this->createAttrs($template['groupWrapperAttr']);
153
+ }
154
+
155
+ foreach ($fields as $field) {
156
+ $labelView = $this->createLabel($field);
157
+ $radioButton = $this->createRadioButton($field);
158
+
159
+ $buttonsView .= "<div $groupAttrStr>";
160
+
161
+ if ($buttonPosition == 'right') {
162
+ $buttonsView .= $labelView.$radioButton;
163
+ }
164
+ else {
165
+ $buttonsView .= $radioButton.$labelView;
166
+ }
167
+ $buttonsView .= '</div>';
168
+ }
169
+ return $buttonsView;
170
+ }
171
+
172
+ private function createRadioButton($field)
173
+ {
174
+ $template = $this->getTemplate();
175
+ $savedValue = $this->getSavedValue();
176
+ $parentAttrsStr = '';
177
+ $inputAttrStr = '';
178
+ $value = '';
179
+ $checked = '';
180
+
181
+ if (!empty($template['fieldWrapperAttr'])) {
182
+ $parentAttrsStr = $this->createAttrs($template['fieldWrapperAttr']);
183
+ }
184
+
185
+ if (!empty($field['attr'])) {
186
+
187
+ if (!empty($field['attr']['value'])) {
188
+ $value = $field['attr']['value'];
189
+ }
190
+
191
+ $inputAttrStr = $this->createAttrs($field['attr']);
192
+ }
193
+
194
+ if (is_array($savedValue) && in_array($value, $savedValue)) {
195
+ $checked = 'checked';
196
+ }
197
+ else if (!is_array($savedValue) && $savedValue == $value) {
198
+ $checked = 'checked';
199
+ }
200
+
201
+ $info = '';
202
+ if (isset($field['label']['info'])) {
203
+ $info = '<span class="dashicons dashicons-editor-help sgpb-info-icon sgpb-info-icon-align"></span>';
204
+ $info .= '<span class="infoSelectRepeat samefontStyle sgpb-info-text">';
205
+ $info .= @$field['label']['info'];
206
+ $info .= '</span>';
207
+ }
208
+
209
+ $label = "<div $parentAttrsStr>";
210
+ $label .= "<input $inputAttrStr $checked >";
211
+ $label .= $info;
212
+ $label .= '</div>';
213
+
214
+ return $label;
215
+ }
216
+
217
+ private function createLabel($field)
218
+ {
219
+ $template = $this->getTemplate();
220
+ $parentAttrsStr = '';
221
+ $label = '';
222
+ $labelName = '';
223
+ $checkBoxFor = '';
224
+
225
+ if (!empty($field['attr']['id'])) {
226
+ $checkBoxFor = $field['attr']['id'];
227
+ }
228
+ if (empty($field['label'])) {
229
+ return $label;
230
+ }
231
+
232
+ $labelData = $field['label'];
233
+ if (!empty($template['labelAttr'])) {
234
+ $parentAttrsStr = $this->createAttrs($template['labelAttr']);
235
+ }
236
+
237
+ if (!empty($labelData['name'])) {
238
+ $labelName = $labelData['name'];
239
+ }
240
+
241
+ $label = "<div $parentAttrsStr>";
242
+ $label .= "<label for=\"$checkBoxFor\">$labelName</label>";
243
+ $label .= '</div>';
244
+
245
+ return $label;
246
+ }
247
+
248
+ /**
249
+ * Create html attrs
250
+ *
251
+ * @since 1.0.0
252
+ *
253
+ * @param array $attrs
254
+ *
255
+ * @return string $attrStr
256
+ */
257
+ private function createAttrs($attrs)
258
+ {
259
+ $attrStr = '';
260
+
261
+ if (empty($attrs)) {
262
+ return $attrStr;
263
+ }
264
+
265
+ foreach ($attrs as $attrKey => $attrValue) {
266
+ $attrStr .= $attrKey.'="'.$attrValue.'" ';
267
+ }
268
+
269
+ return $attrStr;
270
+ }
271
+ }
com/helpers/PopupBuilderActivePackage.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class PopupBuilderActivePackage
5
+ {
6
+ // sections and additional options array
7
+ private static $sections = array();
8
+
9
+ public static function init()
10
+ {
11
+ self::$sections = array(
12
+ 'userStatus' => array('min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER),
13
+ 'popupConditionsSection' => array('min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER),
14
+ 'popupOtherConditionsSection' => array('min-version' => SGPB_POPUP_PRO_MIN_VERSION, 'min-pkg' => SGPB_POPUP_PKG_SILVER)
15
+ );
16
+ }
17
+
18
+ public static function canUseSection($optionName)
19
+ {
20
+ if (!isset(self::$sections[$optionName])) {
21
+ return false;
22
+ }
23
+
24
+ return self::checkVersionAndPackage(self::$sections[$optionName]);
25
+ }
26
+
27
+ public static function canUseOption($optionName)
28
+ {
29
+ global $SGPB_OPTIONS;
30
+
31
+ foreach ($SGPB_OPTIONS as $option) {
32
+ if ($option['name'] == $optionName) {
33
+ $currentOption = $option;
34
+ }
35
+ }
36
+
37
+ return self::checkVersionAndPackage($currentOption);
38
+ }
39
+
40
+ private static function checkVersionAndPackage($option)
41
+ {
42
+ $currentOptionSupportedMinVersion = '';
43
+ $currentOptionSupportedMinPackage = '';
44
+
45
+ if (isset($option['min-version'])) {
46
+ $currentOptionSupportedMinVersion = $option['min-version'];
47
+ }
48
+ if (isset($option['min-pkg'])) {
49
+ $currentOptionSupportedMinPackage = $option['min-pkg'];
50
+ }
51
+
52
+ if ($currentOptionSupportedMinVersion <= SG_POPUP_VERSION) {
53
+ if ($currentOptionSupportedMinPackage <= SGPB_POPUP_PKG) {
54
+ return true;
55
+ }
56
+ }
57
+
58
+ return false;
59
+ }
60
+ }
61
+
62
+ PopupBuilderActivePackage::init();
com/helpers/ScriptsIncluder.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ /**
5
+ * Popup Builder Includer
6
+ *
7
+ * @since 2.5.6
8
+ *
9
+ * Register and enqueue popup styles and js files
10
+ *
11
+ */
12
+ class ScriptsIncluder
13
+ {
14
+
15
+ /**
16
+ * Popup register style
17
+ *
18
+ * @since 2.5.6
19
+ *
20
+ * @param string $fileName file address
21
+ * @param array $args wordpress register style args dep|ver|media|dirUrl
22
+ *
23
+ * @return void
24
+ */
25
+ public static function registerStyle($fileName, $args = array())
26
+ {
27
+ if(empty($fileName)) {
28
+ return;
29
+ }
30
+
31
+ $dep = array();
32
+ $ver = SG_POPUP_VERSION;
33
+ $media = 'all';
34
+ $dirUrl = SG_POPUP_CSS_URL;
35
+
36
+ if(!empty($args['dep'])) {
37
+ $dep = $args['dep'];
38
+ }
39
+
40
+ if(!empty($args['ver'])) {
41
+ $ver = $args['ver'];
42
+ }
43
+
44
+ if(!empty($args['media'])) {
45
+ $media = $args['media'];
46
+ }
47
+
48
+ if(!empty($args['dirUrl'])) {
49
+ $dirUrl = $args['dirUrl'];
50
+ }
51
+
52
+ wp_register_style($fileName, $dirUrl.''.$fileName, $dep, $ver, $media);
53
+ }
54
+
55
+ /**
56
+ * Popup register style
57
+ *
58
+ * @since 2.5.6
59
+ *
60
+ * @param string $fileName file address
61
+ *
62
+ * @return void
63
+ */
64
+ public static function enqueueStyle($fileName)
65
+ {
66
+ if(empty($fileName)) {
67
+ return;
68
+ }
69
+
70
+ wp_enqueue_style($fileName);
71
+ }
72
+
73
+ /**
74
+ * Popup register style
75
+ *
76
+ * @since 2.5.6
77
+ *
78
+ * @param string $fileName file address
79
+ * @param array $args wordpress register script args dep|ver|inFooter|dirUrl
80
+ *
81
+ * @return void
82
+ */
83
+ public static function registerScript($fileName, $args = array())
84
+ {
85
+ if(empty($fileName)) {
86
+ return;
87
+ }
88
+
89
+ $dep = array();
90
+ $ver = SG_POPUP_VERSION;
91
+ $inFooter = false;
92
+ $dirUrl = SG_POPUP_JS_URL;
93
+
94
+ if(!empty($args['dep'])) {
95
+ $dep = $args['dep'];
96
+ }
97
+
98
+ if(!empty($args['ver'])) {
99
+ $ver = $args['ver'];
100
+ }
101
+
102
+ if(!empty($args['inFooter'])) {
103
+ $inFooter = $args['inFooter'];
104
+ }
105
+
106
+ if(!empty($args['dirUrl'])) {
107
+ $dirUrl = $args['dirUrl'];
108
+ }
109
+
110
+ wp_register_script($fileName, $dirUrl.''.$fileName, $dep, $ver, $inFooter);
111
+ }
112
+
113
+ /**
114
+ * Popup register style
115
+ *
116
+ * @since 2.5.6
117
+ *
118
+ * @param string $fileName file address
119
+ *
120
+ * @return void
121
+ */
122
+ public static function enqueueScript($fileName)
123
+ {
124
+ if(empty($fileName)) {
125
+ return;
126
+ }
127
+
128
+ wp_enqueue_script($fileName);
129
+ }
130
+
131
+ public static function localizeScript($handle, $name, $data)
132
+ {
133
+ wp_localize_script($handle, $name, $data);
134
+ }
135
+ }
com/libs/EDD_SL_Plugin_Updater.php ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ // Exit if accessed directly
5
+ if ( ! defined( 'ABSPATH' ) ) exit;
6
+ /**
7
+ * Allows plugins to use their own update API.
8
+ *
9
+ * @author Easy Digital Downloads
10
+ * @version 1.6.14
11
+ */
12
+ class EDD_SL_Plugin_Updater {
13
+ private $api_url = '';
14
+ private $api_data = array();
15
+ private $name = '';
16
+ private $slug = '';
17
+ private $version = '';
18
+ private $wp_override = false;
19
+ private $cache_key = '';
20
+ /**
21
+ * Class constructor.
22
+ *
23
+ * @uses plugin_basename()
24
+ * @uses hook()
25
+ *
26
+ * @param string $_api_url The URL pointing to the custom API endpoint.
27
+ * @param string $_plugin_file Path to the plugin file.
28
+ * @param array $_api_data Optional data to send with API calls.
29
+ */
30
+ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
31
+ global $edd_plugin_data;
32
+ $this->api_url = trailingslashit( $_api_url );
33
+ $this->api_data = $_api_data;
34
+ $this->name = plugin_basename( $_plugin_file );
35
+ $this->slug = basename( $_plugin_file, '.php' );
36
+ $this->version = $_api_data['version'];
37
+ $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
38
+ $this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
39
+ $this->cache_key = md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
40
+ $edd_plugin_data[ $this->slug ] = $this->api_data;
41
+ // Set up hooks.
42
+ $this->init();
43
+ }
44
+ /**
45
+ * Set up WordPress filters to hook into WP's update process.
46
+ *
47
+ * @uses add_filter()
48
+ *
49
+ * @return void
50
+ */
51
+ public function init() {
52
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
53
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
54
+ remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
55
+ add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
56
+ add_action( 'admin_init', array( $this, 'show_changelog' ) );
57
+ }
58
+ /**
59
+ * Check for Updates at the defined API endpoint and modify the update array.
60
+ *
61
+ * This function dives into the update API just when WordPress creates its update array,
62
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
63
+ * It is reassembled from parts of the native WordPress plugin update code.
64
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
65
+ *
66
+ * @uses api_request()
67
+ *
68
+ * @param array $_transient_data Update array build by WordPress.
69
+ * @return array Modified update array with custom plugin data.
70
+ */
71
+ public function check_update( $_transient_data ) {
72
+ global $pagenow;
73
+ if ( ! is_object( $_transient_data ) ) {
74
+ $_transient_data = new stdClass;
75
+ }
76
+ if ( 'plugins.php' == $pagenow && is_multisite() ) {
77
+ return $_transient_data;
78
+ }
79
+ if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
80
+ return $_transient_data;
81
+ }
82
+ $version_info = $this->get_cached_version_info();
83
+ if ( false === $version_info ) {
84
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
85
+ $this->set_version_info_cache( $version_info );
86
+ }
87
+ if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
88
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
89
+ $_transient_data->response[ $this->name ] = $version_info;
90
+ }
91
+ $_transient_data->last_checked = current_time( 'timestamp' );
92
+ $_transient_data->checked[ $this->name ] = $this->version;
93
+ }
94
+ return $_transient_data;
95
+ }
96
+ /**
97
+ * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
98
+ *
99
+ * @param string $file
100
+ * @param array $plugin
101
+ */
102
+ public function show_update_notification( $file, $plugin ) {
103
+ if ( is_network_admin() ) {
104
+ return;
105
+ }
106
+ if( ! current_user_can( 'update_plugins' ) ) {
107
+ return;
108
+ }
109
+ if( ! is_multisite() ) {
110
+ return;
111
+ }
112
+ if ( $this->name != $file ) {
113
+ return;
114
+ }
115
+ // Remove our filter on the site transient
116
+ remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
117
+ $update_cache = get_site_transient( 'update_plugins' );
118
+ $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
119
+ if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
120
+ $version_info = $this->get_cached_version_info();
121
+ if ( false === $version_info ) {
122
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
123
+ $this->set_version_info_cache( $version_info );
124
+ }
125
+ if ( ! is_object( $version_info ) ) {
126
+ return;
127
+ }
128
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
129
+ $update_cache->response[ $this->name ] = $version_info;
130
+ }
131
+ $update_cache->last_checked = current_time( 'timestamp' );
132
+ $update_cache->checked[ $this->name ] = $this->version;
133
+ set_site_transient( 'update_plugins', $update_cache );
134
+ } else {
135
+ $version_info = $update_cache->response[ $this->name ];
136
+ }
137
+ // Restore our filter
138
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
139
+ if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
140
+ // build a plugin list row, with update notification
141
+ $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
142
+ # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
143
+ echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
144
+ echo '<td colspan="3" class="plugin-update colspanchange">';
145
+ echo '<div class="update-message notice inline notice-warning notice-alt">';
146
+ $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
147
+ if ( empty( $version_info->download_link ) ) {
148
+ printf(
149
+ __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
150
+ esc_html( $version_info->name ),
151
+ '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
152
+ esc_html( $version_info->new_version ),
153
+ '</a>'
154
+ );
155
+ } else {
156
+ printf(
157
+ __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
158
+ esc_html( $version_info->name ),
159
+ '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
160
+ esc_html( $version_info->new_version ),
161
+ '</a>',
162
+ '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
163
+ '</a>'
164
+ );
165
+ }
166
+ do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
167
+ echo '</div></td></tr>';
168
+ }
169
+ }
170
+ /**
171
+ * Updates information on the "View version x.x details" page with custom data.
172
+ *
173
+ * @uses api_request()
174
+ *
175
+ * @param mixed $_data
176
+ * @param string $_action
177
+ * @param object $_args
178
+ * @return object $_data
179
+ */
180
+ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
181
+ if ( $_action != 'plugin_information' ) {
182
+ return $_data;
183
+ }
184
+ if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
185
+ return $_data;
186
+ }
187
+ $to_send = array(
188
+ 'slug' => $this->slug,
189
+ 'is_ssl' => is_ssl(),
190
+ 'fields' => array(
191
+ 'banners' => array(),
192
+ 'reviews' => false
193
+ )
194
+ );
195
+ $cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
196
+ // Get the transient where we store the api request for this plugin for 24 hours
197
+ $edd_api_request_transient = $this->get_cached_version_info( $cache_key );
198
+ //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
199
+ if ( empty( $edd_api_request_transient ) ) {
200
+ $api_response = $this->api_request( 'plugin_information', $to_send );
201
+ // Expires in 3 hours
202
+ $this->set_version_info_cache( $api_response, $cache_key );
203
+ if ( false !== $api_response ) {
204
+ $_data = $api_response;
205
+ }
206
+ } else {
207
+ $_data = $edd_api_request_transient;
208
+ }
209
+ // Convert sections into an associative array, since we're getting an object, but Core expects an array.
210
+ if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
211
+ $new_sections = array();
212
+ foreach ( $_data->sections as $key => $value ) {
213
+ $new_sections[ $key ] = $value;
214
+ }
215
+ $_data->sections = $new_sections;
216
+ }
217
+ // Convert banners into an associative array, since we're getting an object, but Core expects an array.
218
+ if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
219
+ $new_banners = array();
220
+ foreach ( $_data->banners as $key => $value ) {
221
+ $new_banners[ $key ] = $value;
222
+ }
223
+ $_data->banners = $new_banners;
224
+ }
225
+ return $_data;
226
+ }
227
+ /**
228
+ * Disable SSL verification in order to prevent download update failures
229
+ *
230
+ * @param array $args
231
+ * @param string $url
232
+ * @return object $array
233
+ */
234
+ public function http_request_args( $args, $url ) {
235
+ $verify_ssl = $this->verify_ssl();
236
+ if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
237
+ $args['sslverify'] = $verify_ssl;
238
+ }
239
+ return $args;
240
+ }
241
+ /**
242
+ * Calls the API and, if successfull, returns the object delivered by the API.
243
+ *
244
+ * @uses get_bloginfo()
245
+ * @uses wp_remote_post()
246
+ * @uses is_wp_error()
247
+ *
248
+ * @param string $_action The requested action.
249
+ * @param array $_data Parameters for the API action.
250
+ * @return false|object
251
+ */
252
+ private function api_request( $_action, $_data ) {
253
+ global $wp_version;
254
+ $data = array_merge( $this->api_data, $_data );
255
+ if ( $data['slug'] != $this->slug ) {
256
+ return;
257
+ }
258
+ if( $this->api_url == trailingslashit (home_url() ) ) {
259
+ return false; // Don't allow a plugin to ping itself
260
+ }
261
+ $api_params = array(
262
+ 'edd_action' => 'get_version',
263
+ 'license' => ! empty( $data['license'] ) ? $data['license'] : '',
264
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
265
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
266
+ 'version' => isset( $data['version'] ) ? $data['version'] : false,
267
+ 'slug' => $data['slug'],
268
+ 'author' => $data['author'],
269
+ 'url' => home_url(),
270
+ 'beta' => ! empty( $data['beta'] ),
271
+ );
272
+ $verify_ssl = $this->verify_ssl();
273
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
274
+ if ( ! is_wp_error( $request ) ) {
275
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
276
+ }
277
+ if ( $request && isset( $request->sections ) ) {
278
+ $request->sections = maybe_unserialize( $request->sections );
279
+ } else {
280
+ $request = false;
281
+ }
282
+ if ( $request && isset( $request->banners ) ) {
283
+ $request->banners = maybe_unserialize( $request->banners );
284
+ }
285
+ if( ! empty( $request->sections ) ) {
286
+ foreach( $request->sections as $key => $section ) {
287
+ $request->$key = (array) $section;
288
+ }
289
+ }
290
+ return $request;
291
+ }
292
+ public function show_changelog() {
293
+ global $edd_plugin_data;
294
+ if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
295
+ return;
296
+ }
297
+ if( empty( $_REQUEST['plugin'] ) ) {
298
+ return;
299
+ }
300
+ if( empty( $_REQUEST['slug'] ) ) {
301
+ return;
302
+ }
303
+ if( ! current_user_can( 'update_plugins' ) ) {
304
+ wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
305
+ }
306
+ $data = $edd_plugin_data[ $_REQUEST['slug'] ];
307
+ $beta = ! empty( $data['beta'] ) ? true : false;
308
+ $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
309
+ $version_info = $this->get_cached_version_info( $cache_key );
310
+ if( false === $version_info ) {
311
+ $api_params = array(
312
+ 'edd_action' => 'get_version',
313
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
314
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
315
+ 'slug' => $_REQUEST['slug'],
316
+ 'author' => $data['author'],
317
+ 'url' => home_url(),
318
+ 'beta' => ! empty( $data['beta'] )
319
+ );
320
+ $verify_ssl = $this->verify_ssl();
321
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
322
+ if ( ! is_wp_error( $request ) ) {
323
+ $version_info = json_decode( wp_remote_retrieve_body( $request ) );
324
+ }
325
+ if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
326
+ $version_info->sections = maybe_unserialize( $version_info->sections );
327
+ } else {
328
+ $version_info = false;
329
+ }
330
+ if( ! empty( $version_info ) ) {
331
+ foreach( $version_info->sections as $key => $section ) {
332
+ $version_info->$key = (array) $section;
333
+ }
334
+ }
335
+ $this->set_version_info_cache( $version_info, $cache_key );
336
+ }
337
+ if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
338
+ echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
339
+ }
340
+ exit;
341
+ }
342
+ public function get_cached_version_info( $cache_key = '' ) {
343
+ if( empty( $cache_key ) ) {
344
+ $cache_key = $this->cache_key;
345
+ }
346
+ $cache = get_option( $cache_key );
347
+ if( empty( $cache['timeout'] ) || current_time( 'timestamp' ) > $cache['timeout'] ) {
348
+ return false; // Cache is expired
349
+ }
350
+ return json_decode( $cache['value'] );
351
+ }
352
+ public function set_version_info_cache( $value = '', $cache_key = '' ) {
353
+ if( empty( $cache_key ) ) {
354
+ $cache_key = $this->cache_key;
355
+ }
356
+ $data = array(
357
+ 'timeout' => strtotime( '+3 hours', current_time( 'timestamp' ) ),
358
+ 'value' => json_encode( $value )
359
+ );
360
+ update_option( $cache_key, $data, 'no' );
361
+ }
362
+ /**
363
+ * Returns if the SSL of the store should be verified.
364
+ *
365
+ * @since 1.6.13
366
+ * @return bool
367
+ */
368
+ private function verify_ssl() {
369
+ return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
370
+ }
371
+ }
{classes/sgDataTable → com/libs}/ListTable.php RENAMED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  /**
3
  * Base class for displaying a list of items in an ajaxified HTML table.
4
  *
@@ -8,7 +10,7 @@
8
  * @package WordPress
9
  * @subpackage List_Table
10
  */
11
- class SGPB_ListTable {
12
 
13
  /**
14
  * The current list of items
1
  <?php
2
+
3
+ namespace sgpbDataTable;
4
  /**
5
  * Base class for displaying a list of items in an ajaxified HTML table.
6
  *
10
  * @package WordPress
11
  * @subpackage List_Table
12
  */
13
+ class SGPBListTable {
14
 
15
  /**
16
  * The current list of items
com/libs/Table.php ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace sgpbDataTable;
4
+
5
+ use sgpb\SubscriptionPopup;
6
+ require_once(dirname(__FILE__).'/ListTable.php');
7
+ file_exists(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php') && require_once(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php');
8
+
9
+ class SGPBTable extends SGPBListTable
10
+ {
11
+ protected $id = '';
12
+ protected $columns = array();
13
+ protected $displayColumns = array();
14
+ protected $sortableColumns = array();
15
+ protected $tablename = '';
16
+ protected $rowsPerPage = 10;
17
+ protected $initialOrder = array();
18
+ private $previewPopup = false;
19
+
20
+ public function __construct($id, $popupPreviewId = false)
21
+ {
22
+ $this->id = $id;
23
+ $this->previewPopup = $popupPreviewId;
24
+ parent::__construct(array(
25
+ 'singular'=> 'wp_'.$id, //singular label
26
+ 'plural' => 'wp_'.$id.'s', //plural label
27
+ 'ajax' => false
28
+ ));
29
+ }
30
+
31
+ public function setId($id)
32
+ {
33
+ $this->id = $id;
34
+ }
35
+
36
+ public function setRowsPerPage($rowsPerPage)
37
+ {
38
+ $this->rowsPerPage = $rowsPerPage;
39
+ }
40
+
41
+ public function setColumns($columns)
42
+ {
43
+ $this->columns = $columns;
44
+ }
45
+
46
+ public function getColumns()
47
+ {
48
+ return $this->columns;
49
+ }
50
+
51
+ public function setDisplayColumns($displayColumns)
52
+ {
53
+ $this->displayColumns = $displayColumns;
54
+ }
55
+
56
+ public function setSortableColumns($sortableColumns)
57
+ {
58
+ $this->sortableColumns = $sortableColumns;
59
+ }
60
+
61
+ public function setTablename($tablename)
62
+ {
63
+ $this->tablename = $tablename;
64
+ }
65
+
66
+ public function setInitialSort($orderableColumns)
67
+ {
68
+ $this->initialOrder = $orderableColumns;
69
+ }
70
+
71
+ public function get_columns()
72
+ {
73
+ return $this->displayColumns;
74
+ }
75
+
76
+ public function prepare_items()
77
+ {
78
+ global $wpdb;
79
+ $table = $this->tablename;
80
+
81
+ $query = 'SELECT '.implode(', ', $this->columns).' FROM '.$table;
82
+ $this->customizeQuery($query);
83
+
84
+ $totalItems = count($wpdb->get_results($query)); //return the total number of affected rows
85
+
86
+ if ($this->previewPopup) {
87
+ $totalItems -= 1;
88
+ }
89
+ $perPage = $this->rowsPerPage;
90
+
91
+ $totalPages = ceil($totalItems/$perPage);
92
+
93
+ $orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'ASC';
94
+ $order = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : '';
95
+
96
+ if (isset($this->initialOrder) && empty($order)) {
97
+ foreach ($this->initialOrder as $key => $value) {
98
+ $order = $value;
99
+ $orderby = $key;
100
+ }
101
+ }
102
+
103
+ if (!empty($orderby) && !empty($order)) {
104
+ $query .= ' ORDER BY '.$orderby.' '.$order;
105
+ }
106
+
107
+ $paged = isset($_GET["paged"]) ? (int)$_GET["paged"] : '';
108
+
109
+ if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
110
+ $paged = 1;
111
+ }
112
+
113
+ //adjust the query to take pagination into account
114
+ if (!empty($paged) && !empty($perPage)) {
115
+ $offset = ($paged - 1) * $perPage;
116
+ $query .= ' LIMIT '.(int)$offset.','.(int)$perPage;
117
+ }
118
+
119
+ $this->set_pagination_args(array(
120
+ "total_items" => $totalItems,
121
+ "total_pages" => $totalPages,
122
+ "per_page" => $perPage,
123
+ ));
124
+
125
+ $columns = $this->get_columns();
126
+ $hidden = array();
127
+ $sortable = $this->get_sortable_columns();
128
+ $this->_column_headers = array($columns, $hidden, $sortable);
129
+ $items = $wpdb->get_results($query, ARRAY_N);
130
+ /*Remove popup data when its class does not exist.*/
131
+ $this->customizeRowsData($items);
132
+
133
+ $this->items = $items;
134
+ }
135
+
136
+ public function customizeRowsData(&$items) {
137
+
138
+ }
139
+
140
+ public function get_sortable_columns() {
141
+ return $this->sortableColumns;
142
+ }
143
+
144
+ public function display_rows()
145
+ {
146
+ //get the records registered in the prepare_items method
147
+ $records = $this->items;
148
+
149
+ //get the columns registered in the get_columns and get_sortable_columns methods
150
+ list($columns, $hidden) = $this->get_column_info();
151
+
152
+ if (!empty($records)) {
153
+ foreach($records as $rec) {
154
+ echo '<tr>';
155
+
156
+ $this->customizeRow($rec);
157
+ for ($i = 0; $i<count($rec); $i++) {
158
+ echo '<td>'.stripslashes($rec[$i]).'</td>';
159
+ }
160
+
161
+ echo '</tr>';
162
+ }
163
+ }
164
+ }
165
+
166
+ public function customizeRow(&$row)
167
+ {
168
+
169
+ }
170
+
171
+ public function customizeQuery(&$query)
172
+ {
173
+
174
+ }
175
+
176
+ public function __toString()
177
+ {
178
+ $this->prepare_items(); ?>
179
+ <form method="get" id="posts-filter">
180
+ <p class="search-box">
181
+ <input type="hidden" name="post_type" value="popupbuilder" />
182
+ <input type="hidden" name="page" value="subscribers" />
183
+ <?php $this->search_box('search', 'search_id'); ?>
184
+ </p>
185
+ <?php $this->display();?>
186
+ </form>
187
+ <?php
188
+ return '';
189
+ }
190
+
191
+ // parent class method overriding
192
+ public function extra_tablenav($which)
193
+ {
194
+ $subscriptionPopups = SubscriptionPopup::getAllSubscriptionForms();
195
+ $subscribersDates = SubscriptionPopup::getAllSubscribersDate();
196
+ $uniqueDates = array();
197
+ $uniqueDates[] = array('date-title' => 'All dates', 'date-value' => 'all');
198
+ foreach ($subscribersDates as $arr) {
199
+ $uniqueDates[] = $arr;
200
+ }
201
+ $uniqueDates = array_unique($uniqueDates, SORT_REGULAR);
202
+ $selectedPopup = '';
203
+ $selectedDate = '';
204
+ $dateList = '';
205
+ $list = '';
206
+ $selected = '';
207
+ if (isset($_GET['sgpb-subscription-popup-id'])) {
208
+ $selectedPopup = (int)$_GET['sgpb-subscription-popup-id'];
209
+ }
210
+ if (isset($_GET['sgpb-subscribers-date'])) {
211
+ $selectedDate = esc_sql($_GET['sgpb-subscribers-date']);
212
+ }
213
+ ?>
214
+ <div class="alignleft actions daterangeactions">
215
+ <label class="screen-reader-text" for="sgpb-subscription-popup"><?php _e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
216
+ <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo $selectedPopup;?>">
217
+ <select name="sgpb-subscription-popup" id="sgpb-subscription-popup">
218
+ <?php
219
+ $list .= '<option value="all">'.__('All', SG_POPUP_TEXT_DOMAIN).'</option>';
220
+ foreach ($subscriptionPopups as $popupId => $popupTitle) {
221
+ if ($selectedPopup == $popupId) {
222
+ $selected = ' selected';
223
+ }
224
+ else {
225
+ $selected = '';
226
+ }
227
+ $list .= '<option value="'.esc_attr($popupId).'"'.$selected.'>'.$popupTitle.'</option>';
228
+ }
229
+ echo $list;
230
+ ?>
231
+ </select>
232
+ <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php _e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
233
+ <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
234
+ <select name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
235
+ <?php
236
+ $dateList = '';
237
+ foreach ($uniqueDates as $date) {
238
+ if ($selectedDate == $date['date-value']) {
239
+ $selected = ' selected';
240
+ }
241
+ else {
242
+ $selected = '';
243
+ }
244
+ $dateList .= '<option value="'.$date['date-value'].'"'.$selected.'>'.$date['date-title'].'</option>';
245
+ }
246
+ echo $dateList;
247
+ ?>
248
+ </select>
249
+ <input name="filter_action" id="post-query-submit" class="button" value="<?php _e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
250
+ </div>
251
+ <?php
252
+ }
253
+ }
config-pkg.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- if (!defined( 'ABSPATH' )) {
3
- exit();
4
- }
5
- define('POPUP_BUILDER_PKG', POPUP_BUILDER_PKG_FREE);
6
- define('POPUP_BUILDER_BASENAME', 'popup-builder/popup-builder.php');
 
 
 
 
 
 
config.php CHANGED
@@ -1,124 +0,0 @@
1
- <?php
2
- if(!class_exists('SgPopupBuilderConfig')) {
3
- class SgPopupBuilderConfig
4
- {
5
-
6
- public function __construct()
7
- {
8
- $this->init();
9
- }
10
-
11
- private function init()
12
- {
13
-
14
- if (!defined('ABSPATH')) {
15
- exit();
16
- }
17
-
18
- define('SG_APP_POPUP_PATH', dirname(__FILE__));
19
- define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
20
- define('SG_APP_POPUP_ADMIN_URL', admin_url());
21
- define('SG_APP_POPUP_FILE', plugin_basename(__FILE__));
22
- define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
23
- define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
24
- define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
25
- define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
26
- define('SG_APP_POPUP_TABLE_LIMIT', 15);
27
- define('SG_POPUP_VERSION', 2.676);
28
- define('SG_POPUP_PRO_VERSION', 3.38);
29
- define('SG_POPUP_PRO_URL', 'https://popup-builder.com/');
30
- define('SG_POPUP_EXTENSION_URL', 'https://popup-builder.com/extensions');
31
- define('SG_MAILCHIMP_EXTENSION_URL', 'https://popup-builder.com/downloads/mailchimp/');
32
- define('SG_ANALYTICS_EXTENSION_URL', 'https://popup-builder.com/downloads/analytics/');
33
- define('SG_AWEBER_EXTENSION_URL', 'https://popup-builder.com/downloads/aweber/');
34
- define('SG_EXITINTENT_EXTENSION_URL', 'https://popup-builder.com/downloads/exit-intent/');
35
- define('SG_ADBLOCK_EXTENSION_URL', 'https://popup-builder.com/downloads/adblock/');
36
- define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
37
- define('SG_SHOW_POPUP_REVIEW', get_option("SG_COLOSE_REVIEW_BLOCK"));
38
- define('SG_POSTS_PER_PAGE', 1000);
39
- define('SG_POPUP_MINIMUM_PHP_VERSION', '5.3.3');
40
- define('SG_POPUP_SHOW_COUNT', 80);
41
- define('SG_REVIEW_POPUP_PERIOD', 30);
42
- define('SGPB_REVIEW_URL' , 'https://wordpress.org/support/plugin/popup-builder/reviews/?rate=5#rate-response');
43
- /*Example 1 minute*/
44
- define('SG_FILTER_REPEAT_INTERVAL', 1);
45
- define('SG_POST_TYPE_PAGE', 'allPages');
46
- define('SG_POST_TYPE_POST', 'allPosts');
47
-
48
- define('POPUP_BUILDER_PKG_FREE', 1);
49
- define('POPUP_BUILDER_PKG_SILVER', 2);
50
- define('POPUP_BUILDER_PKG_GOLD', 3);
51
- define('POPUP_BUILDER_PKG_PLATINUM', 4);
52
-
53
- global $POPUP_TITLES;
54
- global $POPUP_ADDONS;
55
- global $SGPB_INSIDE_POPUPS;
56
-
57
- $SGPB_INSIDE_POPUPS = array();
58
-
59
- $POPUP_TITLES = array(
60
- 'image' => 'Image',
61
- 'html' => 'HTML',
62
- 'fblike' => 'Facebook',
63
- 'iframe' => 'Iframe',
64
- 'video' => 'Video',
65
- 'shortcode' => 'Shortcode',
66
- 'ageRestriction' => 'Age Restriction',
67
- 'countdown' => 'Countdown',
68
- 'social' => 'Social',
69
- 'exitIntent' => 'Exit Intent',
70
- 'subscription' => 'Subscription',
71
- 'contactForm' => 'Contact Form'
72
- );
73
-
74
- $POPUP_ADDONS = array(
75
- 'aweber',
76
- 'mailchimp',
77
- 'analytics',
78
- 'exitIntent',
79
- 'adBlock'
80
- );
81
-
82
-
83
- require_once(dirname(__FILE__) . '/config-pkg.php');
84
-
85
- }
86
-
87
- public static function popupJsDataInit()
88
- {
89
-
90
- $popupBuilderVersion = SG_POPUP_VERSION;
91
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
92
- $popupBuilderVersion = SG_POPUP_PRO_VERSION;
93
- }
94
-
95
- $dataString = "<script type='text/javascript'>
96
- SG_POPUPS_QUEUE = [];
97
- SG_POPUP_DATA = [];
98
- SG_APP_POPUP_URL = '" . SG_APP_POPUP_URL . "';
99
- SG_POPUP_VERSION='" . $popupBuilderVersion . "_" . POPUP_BUILDER_PKG . ";';
100
-
101
- function sgAddEvent(element, eventName, fn) {
102
- if (element.addEventListener)
103
- element.addEventListener(eventName, fn, false);
104
- else if (element.attachEvent)
105
- element.attachEvent('on' + eventName, fn);
106
- }
107
- </script>";
108
-
109
- return $dataString;
110
- }
111
-
112
- public static function getFrontendScriptLocalizedData()
113
- {
114
- $localizedData = array(
115
- 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
116
- 'ajaxNonce' => wp_create_nonce('sgPbNonce')
117
- );
118
-
119
- return $localizedData;
120
- }
121
- }
122
-
123
- $popupConf = new SgPopupBuilderConfig();
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/index.php DELETED
File without changes
files/main_section/fblike.php DELETED
@@ -1,19 +0,0 @@
1
- <div class="sg-wp-editor-container">
2
- <?php
3
- if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
4
- echo SGFunctions::noticeForShortcode();
5
- }
6
-
7
- $content = @$sgPopupDataFblike;
8
- $editorId = 'sg_popup_fblike';
9
- $settings = array(
10
- 'wpautop' => false,
11
- 'tinymce' => array(
12
- 'width' => '100%'
13
- ),
14
- 'textarea_rows' => '6',
15
- 'media_buttons' => true
16
- );
17
- wp_editor($content, $editorId, $settings);
18
- ?>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/main_section/html.php DELETED
@@ -1,19 +0,0 @@
1
- <div class="sg-wp-editor-container">
2
- <?php
3
- if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
4
- echo SGFunctions::noticeForShortcode();
5
- }
6
-
7
- $content = @$sgPopupDataHtml;
8
- $editorId = 'sg_popup_html';
9
- $settings = array(
10
- 'wpautop' => false,
11
- 'tinymce' => array(
12
- 'width' => '100%'
13
- ),
14
- 'textarea_rows' => '6',
15
- 'media_buttons' => true
16
- );
17
- wp_editor($content, $editorId, $settings);
18
- ?>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/main_section/image.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="sg-wp-editor-container">
2
- <h1 class="image-popup-headline">Please choose your picture</h1>
3
- <div class="image-uploader-wrapper">
4
- <input class="input-width-static" id="js-upload-image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>" required>
5
- <input id="js-upload-image-button" class="button" type="button" value="Select image">
6
- </div>
7
- <div class="show-image-contenier">
8
- <span class="no-image">(No image selected)</span>
9
- </div>
10
- </div>
 
 
 
 
 
 
 
 
 
 
files/main_section/shortcode.php DELETED
@@ -1,2 +0,0 @@
1
- <span class="liquid-width">Enter shortcode:</span>
2
- <input class="input-width-static" type="text" name="shortcode" value="<?php echo esc_attr(@$sgPopupDataShortcode);?>"><br>
 
 
files/options_section/fblike.php DELETED
@@ -1,30 +0,0 @@
1
- <div id="special-options">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popup-builder-special-postbox">
6
- <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle js-special-title">
8
- <span>
9
- <?php
10
- global $POPUP_TITLES;
11
- $popupTypeTitle = $POPUP_TITLES[$popupType];
12
- echo $popupTypeTitle." <span>options</span>";
13
- ?>
14
- </span>
15
- </h3>
16
- <div class="special-options-content">
17
- <span class="liquid-width">Url:</span>
18
- <input class="input-width-static" type="text" name="fblike-like-url" value="<?php echo esc_url(@$sgFblikeurl); ?>">
19
- <span class="liquid-width">Layout:</span>
20
- <?php echo sgCreateSelect($sgFbLikeButtons,'fblike-layout',esc_html(@$sgFbLikeLayout)); ?>
21
- <span class="liquid-width">Don't show share button:</span>
22
- <input type="checkbox" name="fblike-dont-show-share-button" <?php echo $sgFblikeDontShowShareButton;?>><br>
23
- <span class="liquid-width">Close popup after like:</span>
24
- <input type="checkbox" name="fblike-close-popup-after-like" <?php echo $sgFblikeClosePopupAfterLike; ?>><br>
25
- </div>
26
- </div>
27
- </div>
28
- </div>
29
- </div>
30
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_section/html.php DELETED
@@ -1,25 +0,0 @@
1
- <div id="special-options">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popup-builder-special-postbox">
6
- <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle js-special-title">
8
- <span>
9
- <?php
10
- global $POPUP_TITLES;
11
- $popupTypeTitle = $POPUP_TITLES[$popupType];
12
- echo $popupTypeTitle." <span>options</span>";
13
- ?>
14
- </span>
15
- </h3>
16
- <div class="inside">
17
- <div class="special-options-content">
18
- <p>No options</p>
19
- </div>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_section/image.php DELETED
@@ -1,25 +0,0 @@
1
- <div id="special-options">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popup-builder-special-postbox">
6
- <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle js-special-title">
8
- <span>
9
- <?php
10
- global $POPUP_TITLES;
11
- $popupTypeTitle = $POPUP_TITLES[$popupType];
12
- echo $popupTypeTitle." <span>options</span>";
13
- ?>
14
- </span>
15
- </h3>
16
- <div class="inside">
17
- <div class="special-options-content">
18
- <p>No options</p>
19
- </div>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_section/pro.php DELETED
@@ -1,160 +0,0 @@
1
- <?php
2
- if (POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE) {
3
- require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
4
- }
5
-
6
- $sgAllSelectedPages = @implode(',', $sgAllSelectedPages);
7
- $sgAllSelectedPosts = @implode(',', $sgAllSelectedPosts);
8
- $sgAllSelectedCustomPosts = @implode(',', $sgAllSelectedCustomPosts);
9
-
10
- ?>
11
- <div id="pro-options">
12
- <div id="post-body" class="metabox-holder columns-2">
13
- <div id="postbox-container-2" class="postbox-container">
14
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
15
- <div class="postbox js-advanced-postbox">
16
- <div class="handlediv js-advanced-title" title="Click to toggle"><br></div>
17
- <h3 class="hndle ui-sortable-handle js-advanced-title">
18
- <span>Advanced options</span>
19
- </h3>
20
- <div class="advanced-options-content">
21
- <span class="liquid-width">Show on selected pages:</span><input class="input-width-static js-on-all-pages" type="checkbox" name="allPagesStatus" <?php echo @$sgAllPagesStatus;?>>
22
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select the page where the popup should be shown.</span><br>
23
- <div class="js-all-pages-content acordion-main-div-content">
24
- <?php echo createRadiobuttons($pagesRadio, SG_POST_TYPE_PAGE, true, esc_html($sgAllPages), "liquid-width"); ?>
25
- <div class="js-pages-selectbox-content acordion-main-div-content">
26
- <span class="liquid-width sg-pages-title">pages</span>
27
- <select class="js-all-pages js-multiselect" multiple data-slectbox="all-selected-page" data-sorce="<?php echo SG_POST_TYPE_PAGE; ?>" size="10" class="popup-builder-multiselect">
28
-
29
- </select>
30
- <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allPages js-sg-spinner sg-hide-element js-sg-import-gif">
31
- <input type="hidden" class="js-sg-selected-pages" name="all-selected-page" value="<?php echo $sgAllSelectedPages;?>">
32
- </div>
33
- </div>
34
- <span class="liquid-width">Show on selected posts:</span><input class="input-width-static js-on-all-posts" type="checkbox" name="allPostsStatus" <?php echo @$sgAllPostsStatus;?>>
35
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select the post where the popup should be shown.</span><br>
36
- <div class="js-all-posts-content acordion-main-div-content">
37
- <?php echo createRadiobuttons($postsRadio, SG_POST_TYPE_POST, true, esc_html($sgAllPosts), "liquid-width"); ?>
38
- <div class="js-posts-selectbox-content acordion-main-div-content">
39
- <span class="liquid-width sg-pages-title">posts</span>
40
- <select class="js-all-posts js-multiselect" multiple data-slectbox="all-selected-posts" data-sorce="<?php echo SG_POST_TYPE_POST; ?>" size="10" class="popup-builder-multiselect">
41
-
42
- </select>
43
- <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allPosts js-sg-spinner sg-hide-element js-sg-import-gif">
44
- <input type="hidden" class="js-sg-selected-posts" name="all-selected-posts" value="<?php echo $sgAllSelectedPosts; ?>">
45
- </div>
46
- <div class="js-all-categories-content acordion-main-div-content">
47
- <span class="liquid-width sg-pages-title">all categories</span>
48
- <?php
49
- $categories = SgPopupGetData::getPostsAllCategories();
50
- echo SGFunctions::createSelectBox($categories, @$sgPostsAllCategories, array("name"=>"posts-all-categories[]","multiple"=>"multiple","size"=>10,"class"=>"popup-builder-multiselect")); ?>
51
- </div>
52
- </div>
53
-
54
- <span class="liquid-width">Show on selected Custom posts:</span><input class="input-width-static js-on-all-custom-posts" type="checkbox" name="allCustomPostsStatus" <?php echo @$sgAllCustomPostsStatus;?>>
55
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select the custom post where the popup should be shown (e.g.: woocommerce products).</span><br>
56
- <div class="js-all-custom-posts-content acordion-main-div-content">
57
- <span class="liquid-width sg-pages-title">custom Posts</span>
58
- <?php
59
- $allCustomPosts = SgPopupGetData::getAllCustomPosts();
60
- echo SGFunctions::createSelectBox($allCustomPosts, @$sgAllCustomPostsType, array("name"=>"all-custom-posts[]","multiple"=>"multiple","size"=>10,"class"=>"popup-builder-multiselect"))."<br>";
61
- echo createRadiobuttons($customPostsRadio, 'allCustomPosts', true, esc_html(@$sgAllCustomPosts), "liquid-width");
62
-
63
- ?>
64
- <div class="js-all-custompost-content acordion-main-div-content">
65
- <span class="liquid-width sg-pages-title"></span><select class="js-all-custom-posts js-multiselect" multiple data-slectbox="all-selected-custom-posts" data-sorce="<?php echo SG_POST_TYPE_POST; ?>" size="10" ></select>
66
- <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allCustomPosts js-sg-spinner sg-hide-element js-sg-import-gif">
67
- <input type="hidden" class="js-sg-selected-custom-posts" name="all-selected-custom-posts" value="<?php echo $sgAllSelectedCustomPosts; ?>">
68
- </div>
69
- </div>
70
-
71
- <?php if (!sgRemoveOption('onScrolling')): ?>
72
- <span class="liquid-width">Show while scrolling:</span><input id="js-scrolling-event-inp" class="input-width-static js-checkbox-acordion" type="checkbox" name="onScrolling" <?php echo @$sgOnScrolling;?> >
73
- <span id="scrollingEvent" class="dashicons dashicons-info same-image-style"></span><span class="infoScrollingEvent samefontStyle">Show the popup whenever the user scrolls the page.</span><br>
74
- <div class="js-scrolling-content acordion-main-div-content">
75
- <span class="liquid-width">show popup after scrolling</span><input class="before-scroling-percent improveOptionsstyle" type="text" name="beforeScrolingPrsent" value="<?php echo esc_attr(@$beforeScrolingPrsent); ?>">
76
- <span class="span-percent">%</span>
77
- </div>
78
- <?php endif; ?>
79
- <span class="liquid-width">Show after inactivity</span><input id="js-inactivity-event-inp" class="input-width-static js-checkbox-acordion" type="checkbox" name="inActivityStatus" <?php echo $sgInActivityStatus;?> >
80
- <span id="scrollingEvent" class="dashicons dashicons-info same-image-style"></span><span class="infoScrollingEvent samefontStyle">Show the popup after some time of inactivity. The popup will appear if a user does nothing for some specific time mentioned.</span><br>
81
- <div class="js-inactivity-content acordion-main-div-content">
82
- <span class="liquid-width">show popup after</span><input class="improveOptionsstyle before-scroling-percent" type="number" name="inactivity-timout" value="<?php echo esc_attr(@$sgInactivityTimout); ?>">
83
- <span class="span-percent">sec</span>
84
- </div>
85
-
86
-
87
- <span class="liquid-width">Hide on mobile devices:</span><input class="input-width-static" type="checkbox" name="forMobile" <?php echo @$sgForMobile;?>>
88
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Don't show the popup for mobile.</span><br>
89
-
90
- <span class="liquid-width">Show only on mobile devices:</span><input class="input-width-static" type="checkbox" name="openMobile" <?php echo @$sgOpenOnMobile;?> />
91
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">If this option is active the popup will appear only on mobile devices.</span><br>
92
-
93
- <span class="liquid-width">Show popup in date range:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popup-timer-status" <?php echo $sgPopupTimerStatus;?>>
94
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show the popup for selected date range. If current date is in selected date range then popup will appear.</span><br>
95
- <div class="acordion-main-div-content">
96
- <span class="liquid-width">start date</span><input class="popup-start-timer" type="text" name="popup-start-timer" value="<?php echo esc_attr(@$sgPopupStartTimer)?>"><br>
97
- <span class="liquid-width">end date</span><input class="popup-finish-timer" type="text" name="popup-finish-timer" value="<?php echo esc_attr(@$sgPopupFinishTimer)?>"><br>
98
- <div class="sgpb-time-zone-info-wrapper">
99
- <span>Ensure that your popup time zone is setup correctly <a href="<?php echo SG_APP_POPUP_ADMIN_URL; ?>?page=popup-settings">here</a>.</span>
100
- </div>
101
- </div>
102
- <span class="liquid-width">Schedule:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popup-schedule-status" <?php echo $sgPopupScheduleStatus;?>>
103
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show the popup for selected date range (e.g.: if you need the popup to appear every Tuesday at 14.00).</span><br>
104
- <div class="acordion-main-div-content schedule-main-div-content">
105
- <div class="liquid-width sg-label-div">
106
- </div><div class="sg-options-content-div">
107
- <h3 class="sg-h3">Every</h3>
108
- <?php echo SGFunctions::createSelectBox($sgWeekDaysArray, @$sgPopupScheduleStartWeeks, array('name'=>'schedule-start-weeks[]', 'class' => 'schedule-start-selectbox sg-margin0', 'multiple'=> 'multiple', 'size'=>7));?>
109
- <h3 class="sg-h3">From</h3>
110
- <input type="text" class="sg-time-picker sg-time-picker-style" name="schedule-start-time" value="<?php echo esc_attr(@$sgPopupScheduleStartTime)?>">
111
- <h3 class="sg-h3">To</h3>
112
- <input type="text" class="sg-time-picker sg-time-picker-style" name="schedule-end-time" value="<?php echo esc_attr(@$sgPopupScheduleEndTime)?>">
113
- </div>
114
-
115
- </div>
116
-
117
- <span class="liquid-width">Show popup by user status:</span><input class="js-checkbox-acordion js-user-seperator" type="checkbox" name="sg-user-status" <?php echo $sgUserSeperate; ?>>
118
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show Popup if the user is logged in to your site or vice versa.</span><br>
119
- <div class="acordion-main-div-content js-user-seperator-content">
120
- <span class="liquid-width">user is</span><?php echo SGFunctions::sgCreateRadioElements($usersGroup, @$sgLogedUser);?>
121
- </div>
122
-
123
- <span class="liquid-width">Disable popup closing:</span><input class="input-width-static" type="checkbox" name="disablePopup" <?php echo $sgDisablePopup;?>>
124
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoDisablePopup samefontStyle">Disable popup closing in any possible way.</span><br>
125
-
126
- <span class="liquid-width">Disable popup overlay:</span><input class="input-width-static" type="checkbox" name="disablePopupOverlay" <?php echo $sgDisablePopupOverlay;?>>
127
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoDisablePopup samefontStyle">Disable popup overlay.</span><br>
128
-
129
- <span class="liquid-width">Add to random popup list:</span><input class="input-width-static" type="checkbox" name="randomPopup" <?php echo $sgRandomPopup;?>>
130
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoDisablePopup samefontStyle">If this option is enabled and you have multiple popups on the same page one of the random popups will be opened..</span><br>
131
-
132
- <span class="liquid-width">Auto close popup:</span><input id="js-auto-close" class="input-width-static js-checkbox-acordion" type="checkbox" name="autoClosePopup" <?php echo $sgAutoClosePopup;?>>
133
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoAutoClose samefontStyle">Close popup automatically.</span><br>
134
- <div class="js-auto-close-content acordion-main-div-content">
135
- <span class="liquid-width" >after</span><input class="popupTimer improveOptionsstyle" type="text" name="popupClosingTimer" value="<?php echo esc_attr(@$sgPopupClosingTimer);?>"><span class="scroll-percent">seconds</span>
136
- </div>
137
- <?php if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_PLATINUM): ?>
138
- <span class="liquid-width">Filter popup for selected countries:</span><input id="js-countris" class="input-width-static js-checkbox-acordion" type="checkbox" name="countryStatus" <?php echo @$sgCountryStatus;?>>
139
- <span class="dashicons dashicons-info same-image-style"></span><span class="infoAutoClose samefontStyle">Select countries where popup should be shown/hidden.</span><br>
140
- <div class="js-countri-content">
141
- <span class="liquid-width" ></span><?php echo SGFunctions::sgCreateRadioElements($countriesRadio, @$sgAllowCountries);?>
142
- <span class="liquid-width" ></span><?php echo SGFunctions::countrisSelect(); ?>
143
- <input type="button" value="Add" class="addCountry">
144
- <span class="liquid-width"></span><input type="text" name="countryName" id="countryName" data-role="tagsinput" id="countryName" value="<?php echo esc_attr(@$sgCountryName);?>">
145
- <span class="liquid-width"></span><input type="hidden" name="countryIso" id="countryIso" value="<?php echo esc_attr(@$sgCountryIso);?>">
146
- </div>
147
- <?php endif;?>
148
- </div>
149
- <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) : ?>
150
- <a href="<?php echo SG_POPUP_PRO_URL; ?>" target="_blank">
151
- <div class="sgpb-pro pro-options-div">
152
- <p class="pro-options-title">PRO Features</p>
153
- </div>
154
- </a>
155
- <?php endif; ?>
156
- </div>
157
- </div>
158
- </div>
159
- </div>
160
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_section/shortcode.php DELETED
@@ -1,25 +0,0 @@
1
- <div id="special-options">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popup-builder-special-postbox">
6
- <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle js-special-title">
8
- <span>
9
- <?php
10
- global $POPUP_TITLES;
11
- $popupTypeTitle = $POPUP_TITLES[$popupType];
12
- echo $popupTypeTitle." <span>options</span>";
13
- ?>
14
- </span>
15
- </h3>
16
- <div class="inside">
17
- <div class="special-options-content">
18
- <p>No options</p>
19
- </div>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_admin_post.php DELETED
@@ -1,233 +0,0 @@
1
- <?php
2
- function sgGetCsvFile() {
3
- global $wpdb;
4
- $content = '';
5
- $rows = array('id', 'firstName', 'lastName', 'email', 'subscriptionType');
6
- foreach ($rows as $value) {
7
-
8
- $content .= $value.',';
9
- }
10
- $content .= "\n";
11
-
12
- $sql = "SELECT id, firstName, lastName, email, subscriptionType FROM ". $wpdb->prefix ."sg_subscribers";
13
- $subscribers = $wpdb->get_results($sql, ARRAY_A);
14
-
15
- foreach($subscribers as $values) {
16
- foreach ($values as $value) {
17
- $content .= $value.',';
18
- }
19
- $content .= "\n";
20
- }
21
-
22
- header("Pragma: public");
23
- header("Expires: 0");
24
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
25
- header("Cache-Control: private", false);
26
- header("Content-Type: application/octet-stream");
27
- header("Content-Disposition: attachment; filename=\"subscribersList.csv\";" );
28
- header("Content-Transfer-Encoding: binary");
29
- echo $content;
30
- }
31
-
32
- add_action('admin_post_csv_file', 'sgGetCsvFile');
33
-
34
- function sgPopupClone() {
35
- $id = (int)$_GET['id'];
36
- $allPosts = get_option('SG_ALL_POSTS');
37
-
38
-
39
- $obj = SGPopup::findById($id);
40
- $title = $obj->getTitle();
41
- $title .= "(clone)";
42
- $obj->setId("");
43
- $obj->setTitle($title);
44
-
45
- $options = $obj->getOptions();
46
- $options = json_decode($options, true);
47
- $obj->save();
48
-
49
- $cloneId = $obj->getId();
50
- /* For save popupIn pages table */
51
- if($options['allPagesStatus'] && (!empty($options['showAllPages']) && $options['showAllPages'] != 'all')) {
52
- SGPopup::addPopupForAllPages($cloneId, $options['allSelectedPages'], 'page');
53
- }
54
- if($options['allPostsStatus'] && (!empty($options['showAllPosts']) && $options['showAllPosts'] != "all")) {
55
- SGPopup::addPopupForAllPages($cloneId, $options['allSelectedPosts'], 'page');
56
- }
57
- if($options['allCustomPostsStatus'] && (!empty($options['allSelectedCustomPosts']) && $options['showAllCustomPosts'] == "selected")) {
58
- SGPopup::addPopupForAllPages($cloneId, $options['allSelectedCustomPosts'], 'page');
59
- }
60
-
61
- $parentAllPostData = SGFunctions::findInAllPostTypeData($id, $allPosts);
62
- if(!empty($parentAllPostData)) {
63
- $parentAllPostData['id'] = $cloneId;
64
- $allPosts = get_option("SG_ALL_POSTS");
65
- $allPosts[] = $parentAllPostData;
66
- update_option("SG_ALL_POSTS", $allPosts);
67
- }
68
- wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=PopupBuilder");
69
- }
70
-
71
- add_action('admin_post_popup_clone', 'sgPopupClone');
72
-
73
- function sgPopupDataExport() {
74
- global $wpdb;
75
-
76
- $allData = array();
77
- $exportArray = array();
78
- $wpOptions = array();
79
- $optionsName = array(
80
- "SG_ALL_PAGES",
81
- "SG_ALL_POSTS",
82
- "SG_MULTIPLE_POPUP"
83
- );
84
-
85
- $mainTable = PopupInstaller::$mainTableName;
86
-
87
- $popupDataSql = "SELECT * FROM ".$wpdb->prefix.$mainTable;
88
- $getAllPopupData = $wpdb->get_results($popupDataSql, ARRAY_A);
89
- foreach ($getAllPopupData as $popupData) {
90
- $type = $popupData['type'];
91
- $id = $popupData['id'];
92
- if ($type == 'ageRestriction') {
93
- $type = "age_restriction";
94
- }
95
- else if($type == 'exitIntent') {
96
- $type = "exit_intent";
97
- }
98
- else if($type == 'contactForm') {
99
- $type = "contact_form";
100
- }
101
- else if($type == 'shortcode') {
102
- $type = "shortCode";
103
- }
104
- $table = "sg_".$type."_popup";
105
- $tableName = $wpdb->prefix.$table;
106
-
107
- $chieldPopupDataSql = "SELECT * FROM ".$tableName;
108
- $chieldPopupData = $wpdb->get_results($chieldPopupDataSql, ARRAY_A);
109
-
110
- $getRowsSql = "SHOW COLUMNS FROM ".$tableName;
111
- $chiledRows = $wpdb->get_results($getRowsSql, ARRAY_A);
112
-
113
- unset($chieldPopupData[0]['id']);
114
- //unset($chiledRows[0]);
115
-
116
- $exportArray[] = array(
117
- 'mainPopupData' => $popupData,
118
- 'childData' => $chieldPopupData,
119
- 'chiledColums' => $chiledRows,
120
- 'childTableName' => $table
121
- );
122
- }
123
- $customTables['sg_popup_in_pages'] = $wpdb->prefix."sg_popup_in_pages";
124
- $customTables['sg_subscribers'] = $wpdb->prefix."sg_subscribers";
125
- $customTablesColumsName = array();
126
- $customTablesData = array();
127
-
128
- foreach ($customTables as $key => $tableName) {
129
-
130
- $showColumnsSql = "SHOW COLUMNS FROM ".$tableName;
131
- $colums = $wpdb->get_results($showColumnsSql, ARRAY_A);
132
- $customTablesColumsName[$key] = $colums;
133
-
134
- $getCustomDataSql = "SELECT * FROM ".$tableName;
135
- $getCustomData = $wpdb->get_results($getCustomDataSql, ARRAY_A);
136
- $customTablesData[$key] = $getCustomData;
137
- }
138
-
139
- foreach ($optionsName as $optionName) {
140
- if(get_option($optionName)) {
141
- $wpOptions[$optionName] = get_option($optionName);
142
- }
143
- }
144
-
145
- $allData['exportArray'] = $exportArray;
146
- $allData['customData'] = $customTablesData;
147
- $allData['customTablesColumsName'] = $customTablesColumsName;
148
- $allData['wpOptions'] = $wpOptions;
149
-
150
- header("Pragma: public");
151
- header("Expires: 0");
152
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
153
- header("Cache-Control: private", false);
154
- header("Content-Type: application/octet-stream");
155
- header("Content-Disposition: attachment; filename=\"sgexportdata.txt\";" );
156
- header("Content-Transfer-Encoding: binary");
157
- echo base64_encode(serialize($allData));
158
- }
159
-
160
- add_action('admin_post_popup_export', 'sgPopupDataExport');
161
- function sgSanitizeField($key, $isTextField = false) {
162
-
163
- if (isset($_POST[$key])) {
164
- if($isTextField) {
165
- return wp_kses_post($_POST[$key]);
166
- }
167
- return sanitize_text_field($_POST[$key]);
168
- }
169
- return "";
170
- }
171
-
172
- function sgPopupSaveSettings() {
173
-
174
- global $wpdb;
175
- if(isset($_POST)) {
176
- check_admin_referer('sgPopupBuilderSettings');
177
- }
178
- $st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
179
- $options = $wpdb->get_row($st, ARRAY_A);
180
-
181
- $settingsOptions = array(
182
- 'plugin_users_role' => sgSanitizeField('plugin_users_role', true),
183
- 'tables-delete-status' => sgSanitizeField('tables-delete-status'),
184
- 'sg-popup-time-zone' => sgSanitizeField('sg-popup-time-zone')
185
- );
186
-
187
- $settingsOptions = json_encode($settingsOptions);
188
- if(is_null($options) || empty($options)) {
189
-
190
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup_settings (id, options) VALUES (%d,%s)",'1',$settingsOptions);
191
- $res = $wpdb->query($sql);
192
- }
193
- else {
194
- $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup_settings SET options=%s WHERE id=%d",$settingsOptions,1);
195
- $res = $wpdb->query($sql);
196
- }
197
- wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=popup-settings&saved=1");
198
- }
199
-
200
- add_action('admin_post_save_settings', 'sgPopupSaveSettings');
201
-
202
- function sgSubsErrorList() {
203
- global $wpdb;
204
- $content = '';
205
- $sql = "SHOW COLUMNS FROM ". $wpdb->prefix ."sg_subscription_error_log";
206
- $rows = $wpdb->get_results($sql, ARRAY_A);
207
- foreach ($rows as $value) {
208
- $content .= $value['Field'].",";
209
- }
210
- $content .= "\n";
211
-
212
- $sql = "Select * from ". $wpdb->prefix ."sg_subscription_error_log";
213
- $subscribers = $wpdb->get_results($sql, ARRAY_A);
214
-
215
- foreach($subscribers as $values) {
216
- foreach ($values as $value) {
217
- $content .= $value.',';
218
- }
219
- $content .= "\n";
220
- }
221
-
222
- header("Pragma: public");
223
- header("Expires: 0");
224
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
225
- header("Cache-Control: private", false);
226
- header("Content-Type: application/octet-stream");
227
- header("Content-Disposition: attachment; filename=\"MailErrorLog.csv\";" );
228
- header("Content-Transfer-Encoding: binary");
229
- echo $content;
230
- }
231
-
232
- add_action('admin_post_subs_error_csv', 'sgSubsErrorList');
233
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_functions.php DELETED
@@ -1,891 +0,0 @@
1
- <?php
2
- class SGFunctions
3
- {
4
- public static function showInfo()
5
- {
6
- $sgInfo = '';
7
- $divisor = "<span class=\"info-vertical-divisor\">|</span>";
8
- $sgInfo .= "<span>If you like the plugin, please <a href=\"https://wordpress.org/support/view/plugin-reviews/popup-builder?filter=5\" target=\"_blank\">rate it 5 stars</a></span>".$divisor;
9
- $sgInfo .= "<a href=\"https://wordpress.org/support/plugin/popup-builder\" target=\"_blank\">Support</a>".$divisor;
10
- $sgInfo .= "<a href=\"https://www.youtube.com/watch?v=3ZwRKPhHMzY\" target=\"_blank\">How to create a popup</a>";
11
- echo $sgInfo;
12
- }
13
-
14
- public static function getMaxOpenPopupId() {
15
-
16
- $popupsCounterData = get_option('SgpbCounter');
17
- if(!$popupsCounterData) {
18
- return 0;
19
- }
20
-
21
- $counters = array_values($popupsCounterData);
22
- $maxCount = max($counters);
23
- $popupId = array_search($maxCount, $popupsCounterData);
24
-
25
- $maxPopupData = array(
26
- 'popupId' => $popupId,
27
- 'maxCount' => $maxCount
28
- );
29
-
30
- return $maxPopupData;
31
- }
32
-
33
- public static function getPopupMainTableCreationDate()
34
- {
35
- global $wpdb;
36
-
37
- $query = $wpdb->prepare('SELECT table_name,create_time FROM information_schema.tables WHERE table_schema="%s" AND table_name="%s"', DB_NAME, $wpdb->prefix.'sg_popup');
38
- $results = $wpdb->get_results($query, ARRAY_A);
39
-
40
- if(empty($results)) {
41
- return 0;
42
- }
43
-
44
- $createTime = $results[0]['create_time'];
45
- $createTime = strtotime($createTime);
46
- update_option('SGPBInstallDate', $createTime);
47
- $diff = time()-$createTime;
48
- $days = floor($diff/(60*60*24));
49
-
50
- return $days;
51
- }
52
-
53
- public static function shouldOpenReviewPopupForDays()
54
- {
55
- $shouldOpen = true;
56
- $dontShowAgain = get_option('SGPBCloseReviewPopup');
57
- $periodNextTime = get_option('SGPBOpenNextTime');
58
-
59
- if($dontShowAgain) {
60
- return false;
61
- }
62
-
63
- /*When period next time does not exits it means the user is old*/
64
- if(!$periodNextTime) {
65
-
66
- $usageDays = self::getPopupMainTableCreationDate();
67
- update_option('SGPBUsageDays', $usageDays);
68
- /*When very old user*/
69
- if($usageDays > SG_REVIEW_POPUP_PERIOD && !$dontShowAgain) {
70
- return $shouldOpen;
71
- }
72
- $remainingDays = SG_REVIEW_POPUP_PERIOD - $usageDays;
73
-
74
- $popupTimeZone = @SgPopupGetData::getPopupTimeZone();
75
- $timeDate = new DateTime('now', new DateTimeZone($popupTimeZone));
76
- $timeDate->modify('+'.$remainingDays.' day');
77
-
78
- $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
79
- update_option('SGPBOpenNextTime', $timeNow);
80
-
81
- return false;
82
- }
83
-
84
- $currentData = new DateTime('now');
85
- $timeNow = $currentData->format('Y-m-d H:i:s');
86
- $timeNow = strtotime($timeNow);
87
-
88
- if($periodNextTime > $timeNow) {
89
- return false;
90
- }
91
-
92
- return $shouldOpen;
93
- }
94
-
95
- public static function shouldOpenForMaxOpenPopupMessage()
96
- {
97
- $counterMaxPopup = self::getMaxOpenPopupId();
98
-
99
- if(empty($counterMaxPopup)) {
100
- return false;
101
- }
102
- $dontShowAgain = get_option('SGPBCloseReviewPopup');
103
- $maxCountDefine = get_option('SGPBMaxOpenCount');
104
- if(!$maxCountDefine) {
105
- $maxCountDefine = SG_POPUP_SHOW_COUNT;
106
- }
107
- return $counterMaxPopup['maxCount'] >= $maxCountDefine && !$dontShowAgain;
108
- }
109
-
110
- public static function getPopupUsageDays()
111
- {
112
- $installDate = get_option('SGPBInstallDate');
113
-
114
- $timeDate = new DateTime('now');
115
- $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
116
-
117
- $diff = $timeNow-$installDate;
118
-
119
- $days = floor($diff/(60*60*24));
120
-
121
- return $days;
122
- }
123
-
124
- public static function getMaxOpenDaysMessage()
125
- {
126
- $getUsageDays = self::getPopupUsageDays();
127
- $firstHeader = '<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">Wow!</strong> You’ve been using Popup Builder on your site for '.$getUsageDays.' days</h1>';
128
- $popupContent = self::getMaxOepnPopupContent($firstHeader, 'days');
129
-
130
- $popupContent .= self::showReviewBlockJs();
131
-
132
- return $popupContent;
133
- }
134
-
135
- public static function getMaxOpenPopupsMessage()
136
- {
137
- $counterMaxPopup = self::getMaxOpenPopupId();
138
- $popupTitle = '';
139
- $maxCountDefine = get_option('SGPBMaxOpenCount');
140
- $popupData = SGPopup::findById($counterMaxPopup['popupId']);
141
-
142
- if(!empty($counterMaxPopup['maxCount'])) {
143
- $maxCountDefine = $counterMaxPopup['maxCount'];
144
- }
145
-
146
- if(!empty($popupData)) {
147
- $popupTitle = $popupData->getTitle();
148
- }
149
-
150
- $firstHeader = '<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">Wow!</strong> <b>Popup Builder</b> plugin helped you to share your message via <strong class="sgrb-review-strong">'.$popupTitle.'</strong> popup with your users for <strong class="sgrb-review-strong">'.$maxCountDefine.' times!</strong></h1>';
151
- $popupContent = self::getMaxOepnPopupContent($firstHeader, 'count');
152
-
153
- $popupContent .= self::showReviewBlockJs();
154
-
155
- return $popupContent;
156
- }
157
-
158
- public static function showReviewBlockJs()
159
- {
160
- ob_start();
161
- ?>
162
- <script type="text/javascript">
163
- jQuery('.sg-already-did-review').each(function () {
164
- jQuery(this).on('click', function () {
165
- var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
166
-
167
- var data = {
168
- action: 'dont_show_review_popup',
169
- ajaxNonce: ajaxNonce
170
- };
171
- jQuery.post(ajaxurl, data, function(response,d) {
172
- if(typeof jQuery.sgcolorbox != 'undefined') {
173
- jQuery.sgcolorbox.close();
174
- }
175
- if(jQuery('.sgpb-review-block').length) {
176
- jQuery('.sgpb-review-block').remove();
177
- }
178
- });
179
- });
180
- });
181
-
182
- jQuery('.sg-show-popup-period').on('click', function () {
183
- var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
184
- var messageType = jQuery(this).attr('data-message-type');
185
-
186
- var data = {
187
- action: 'change_review_popup_show_period',
188
- messageType: messageType,
189
- ajaxNonce: ajaxNonce
190
- };
191
- jQuery.post(ajaxurl, data, function(response,d) {
192
- if(typeof jQuery.sgcolorbox != 'undefined') {
193
- jQuery.sgcolorbox.close();
194
- }
195
- if(jQuery('.sgpb-review-block').length) {
196
- jQuery('.sgpb-review-block').remove();
197
- }
198
- });
199
- });
200
- </script>
201
- <?php
202
- $content = ob_get_clean();
203
-
204
- return $content;
205
- }
206
-
207
- public static function showReviewPopup()
208
- {
209
- $popupContent = '';
210
-
211
- $maxOpenPopupStatus = self::shouldOpenForMaxOpenPopupMessage();
212
-
213
- if($maxOpenPopupStatus) {
214
- $popupContent = self::getMaxOpenPopupsMessage();
215
- self::addContentToFooter($popupContent);
216
- self::openReviewPopup();
217
- return;
218
- }
219
-
220
- $shouldOpenForDays = self::shouldOpenReviewPopupForDays();
221
-
222
- if($shouldOpenForDays) {
223
- $popupContent = self::getMaxOpenDaysMessage();
224
- self::addContentToFooter($popupContent);
225
- self::openReviewPopup();
226
- return;
227
- }
228
- }
229
-
230
- public static function addContentToFooter($popupContent)
231
- {
232
- add_action('admin_footer', function() use ($popupContent){
233
- $popupContent = "<div style=\"display:none\"><div id=\"sg-popup-content-wrapper\">$popupContent</div></div>";
234
- echo $popupContent;
235
- }, 1);
236
- }
237
-
238
- public static function openReviewPopup()
239
- {
240
- wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), SG_POPUP_VERSION);
241
- wp_enqueue_script('sg_colorbox');
242
- wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/sgthemes.css", array(), SG_POPUP_VERSION);
243
- wp_enqueue_style('sg_colorbox_theme');
244
- $ajaxNonce = wp_create_nonce("sgPopupBuilderReview");
245
-
246
- echo "<script>
247
- jQuery(document).ready(function() {
248
- SGPB_AJAX_NONCE = '".$ajaxNonce."';
249
- var SG_POPUP_SETTINGS = {
250
- inline: true,
251
- escKey: false,
252
- closeButton: false,
253
- overlayClose: false,
254
- href: '#sg-popup-content-wrapper',
255
- onOpen: function() {
256
- jQuery('#sgcboxOverlay').addClass('sgcboxOverlayBg');
257
- },
258
- onCleanup: function () {
259
- jQuery('#sgcolorbox').trigger('sgPopupCleanup', []);
260
- },
261
- maxWidth: 640
262
- };
263
- jQuery.sgcolorbox(SG_POPUP_SETTINGS);
264
- });
265
- </script>";
266
- }
267
-
268
- public static function getMaxOepnPopupContent($firstHeader, $type) {
269
- $ajaxNonce = wp_create_nonce("sgPopupBuilderReview");
270
- ob_start();
271
- ?>
272
- <style>
273
- .sgpb-buttons-wrapper .press{
274
- box-sizing:border-box;
275
- cursor:pointer;
276
- display:inline-block;
277
- font-size:1em;
278
- margin:0;
279
- padding:0.5em 0.75em;
280
- text-decoration:none;
281
- transition:background 0.15s linear
282
- }
283
- .sgpb-buttons-wrapper .press-grey {
284
- background-color:#9E9E9E;
285
- border:2px solid #9E9E9E;
286
- color: #FFF;
287
- }
288
- .sgpb-buttons-wrapper .press-lightblue {
289
- background-color:#03A9F4;
290
- border:2px solid #03A9F4;
291
- color: #FFF;
292
- }
293
- .sgpb-review-wrapper{
294
- text-align: center;
295
- padding: 20px;
296
- }
297
- .sgpb-review-wrapper p {
298
- color: black;
299
- }
300
- .sgpb-review-h1 {
301
- font-size: 22px;
302
- font-weight: normal;
303
- line-height: 1.384;
304
- }
305
- .sgrb-review-h2{
306
- font-size: 20px;
307
- font-weight: normal;
308
- }
309
- :root {
310
- --main-bg-color: #1ac6ff;
311
- }
312
- .sgrb-review-strong{
313
- color: var(--main-bg-color);
314
- }
315
- .sgrb-review-mt20{
316
- margin-top: 20px
317
- }
318
- </style>
319
- <div class="sgpb-review-wrapper">
320
- <div class="sgpb-review-description">
321
- <?php echo $firstHeader; ?>
322
- <h2 class="sgrb-review-h2">This is really great for your website score.</h2>
323
- <p class="sgrb-review-mt20">Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!</p>
324
- </div>
325
- <div class="sgpb-buttons-wrapper">
326
- <button class="press press-grey sgpb-button-1 sg-already-did-review" data-ajaxnonce="<?php echo esc_attr($ajaxNonce); ?>">I already did</button>
327
- <button class="press press-lightblue sgpb-button-3 sg-already-did-review" data-ajaxnonce="<?php echo esc_attr($ajaxNonce); ?>" onclick="window.open('<?php echo SGPB_REVIEW_URL; ?>')">You worth it!</button>
328
- <button class="press press-grey sgpb-button-2 sg-show-popup-period" data-ajaxnonce="<?php echo esc_attr($ajaxNonce); ?>" data-message-type="<?php echo $type; ?>">Maybe later</button></div>
329
- <div> </div>
330
- </div>
331
- <?php
332
- $popupContent = ob_get_clean();
333
-
334
- return $popupContent;
335
- }
336
-
337
- public static function sgPopupDataSanitize($sgPopupData)
338
- {
339
- /*Remove iframe tag and empty line*/
340
- $pattern = '/\s+(<iframe.*?>.*?<\/iframe>)/';
341
-
342
- return preg_replace($pattern, '', $sgPopupData);
343
- }
344
-
345
- public static function getPopupsDataList($restrictParams = array()) {
346
-
347
- $orderBy = 'id DESC';
348
- $popupsData = SGPopup::findAll($orderBy);
349
- $dataList = array();
350
-
351
- foreach ($popupsData as $popupData) {
352
-
353
- if(empty($popupData)) {
354
- continue;
355
- }
356
-
357
- $title = $popupData->getTitle();
358
- $type = $popupData->getType();
359
- $id = $popupData->getId();
360
- if(is_array($restrictParams)) {
361
- if(isset($restrictParams['type']) && $type == $restrictParams['type']) {
362
- continue;
363
- }
364
- if(isset($restrictParams['id']) && $id == $restrictParams['id']) {
365
- continue;
366
- }
367
- }
368
- $dataList[$id] = $title.' - '.$type;
369
- }
370
-
371
- return $dataList;
372
-
373
- }
374
-
375
- public static function popupTablesDeleteSatus() {
376
-
377
- global $wpdb;
378
-
379
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
380
- $arr = $wpdb->get_row($st,ARRAY_A);
381
-
382
- if(empty($arr)) {
383
- return true;
384
- }
385
-
386
- $options = json_decode($arr['options'], true);
387
- $deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
388
-
389
- return $deleteStatus;
390
- }
391
-
392
- public static function addReview()
393
- {
394
- $ajaxNonce = wp_create_nonce("sgPopupBuilderReview");
395
- ob_start();
396
- ?>
397
- <div class="sg-info-panel-wrapper">
398
- <div class="sg-info-panel-row">
399
- <div class="sg-info-panel-col-3">
400
- <p class="sg-info-text sg-info-logo">
401
- <span class="sg-info-text-white">Popup</span><span class="sg-info-text-highlight">Builder</span>
402
- </p>
403
- <p class="sg-info-text">
404
- If you have any difficulties in using the options, please follow the link to <a href="https://sygnoos.ladesk.com/235213-Popup-Builder" class="sg-info-link">Knowledge Base</a>
405
- </p>
406
- </div>
407
- <div class="sg-info-panel-col-3 sg-info-text-center">
408
- <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
409
- <a class="sg-info-upgrade-pro sg-info-blink" href="http://popup-builder.com" target="_blank">
410
- Upgrade NOW
411
- </a>
412
- <p class="sg-info-text">
413
- Want to upgrade to PRO version?<br> Just click on "Upgrade NOW".
414
- </p>
415
- <?php endif; ?>
416
- <?php if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE): ?>
417
- <p class="sg-social-headline">Follow us</p>
418
- <div class="sg-social-icons-wrapper">
419
- <a class="sg-social-icon social-icon-fb" href="https://www.facebook.com/popupbuildercom/" target="_blank"></a>
420
- <a class="sg-social-icon social-icon-tw" href="https://twitter.com/popup_builder" target="_blank"></a>
421
- <a class="sg-social-icon social-icon-gp" href="https://plus.google.com/u/0/+PopupBuildercom" target="_blank"></a>
422
- </div>
423
- <?php endif; ?>
424
- </div>
425
- <div class="sg-info-panel-col-3">
426
- <ul class="sg-info-menu sg-info-text">
427
- <li>
428
- <a class="sg-info-links" target="_blank" href="https://wordpress.org/support/plugin/popup-builder/reviews/?filter=5"><span class="dashicons dashicons-heart sg-info-text-white"></span><span class="sg-info-text"> Rate Us</span></a>
429
- </li>
430
- <li>
431
- <a class="sg-info-links" target="_blank" href="https://sygnoos.ladesk.com/submit_ticket"><span class="dashicons dashicons-megaphone sg-info-text-white"></span></span> Submit Ticket</a>
432
- </li>
433
- <li>
434
- <a class="sg-info-links" target="_blank" href="https://wordpress.org/support/plugin/popup-builder"><span class="dashicons dashicons-admin-plugins sg-info-text-white"></span> Support</a>
435
- </li>
436
- <li>
437
- <a class="sg-info-links" target="_blank" href="https://wordpress.org/plugins/popup-builder/faq/"><span class="dashicons dashicons-editor-help sg-info-text-white"></span> FAQ</a>
438
- </li>
439
- <li>
440
- <a class="sg-info-links" target="_blank" href="mailto:support@popup-builder.com?subject=Hello"><span class="dashicons dashicons-email-alt sg-info-text-white"></span></span> Contact</a>
441
- </li>
442
- </ul>
443
- </div>
444
- </div>
445
- <div>
446
- <span class="sg-info-close">+</span>
447
- <?php echo '<span class="sg-dont-show-agin" data-ajaxnonce="'.esc_attr($ajaxNonce).'">Don’t show again.</span>'; ?>
448
- </div>
449
- </div>
450
- <?php
451
- $reviewPanel = ob_get_contents();
452
- ob_end_clean();
453
-
454
- return $reviewPanel;
455
- }
456
-
457
- public static function noticeForShortcode() {
458
- $notice = '<span class="shortcode-use-info">NOTE: Shortcodes doesn\'t work inside the HTML Popup. Please use <a href="'.SG_APP_POPUP_ADMIN_URL.'admin.php?page=edit-popup&type=shortcode">Shortcode Popup</a> instead.</span>';
459
- return $notice;
460
- }
461
-
462
- public static function createSelectBox($data, $selectedValue, $attrs) {
463
-
464
- $attrString = '';
465
- $selected = '';
466
-
467
- if(!empty($attrs) && isset($attrs)) {
468
-
469
- foreach ($attrs as $attrName => $attrValue) {
470
- $attrString .= ''.$attrName.'="'.$attrValue.'" ';
471
- }
472
- }
473
-
474
- $selectBox = '<select '.$attrString.'>';
475
-
476
- foreach ($data as $value => $label) {
477
-
478
- /*When is multiselect*/
479
- if(is_array($selectedValue)) {
480
- $isSelected = in_array($value, $selectedValue);
481
- if($isSelected) {
482
- $selected = 'selected';
483
- }
484
- }
485
- else if($selectedValue == $value) {
486
- $selected = 'selected';
487
- }
488
- else if(is_array($value) && in_array($selectedValue, $value)) {
489
- $selected = 'selected';
490
- }
491
-
492
- $selectBox .= '<option value="'.$value.'" '.$selected.'>'.$label.'</option>';
493
- $selected = '';
494
- }
495
-
496
- $selectBox .= '</select>';
497
-
498
- return $selectBox;
499
- }
500
-
501
- public static function sgCreateRadioElements($radioElements, $checkedValue)
502
- {
503
- $content = '';
504
- for ($i = 0; $i < count($radioElements); $i++) {
505
- $checked = '';
506
- $br = '';
507
- $radioElement = @$radioElements[$i];
508
- $name = @$radioElement['name'];
509
- $label = @$radioElement['label'];
510
- $value = @$radioElement['value'];
511
- $brValue = @$radioElement['newline'];
512
- $additionalHtml = @$radioElement['additionalHtml'];
513
- $labelId = 'sg-select-'.$name.'-'.$i;
514
- if($checkedValue == $value) {
515
- $checked = 'checked';
516
- }
517
- if($brValue) {
518
- $br = "<br>";
519
- }
520
- $content .= '<label for="'.$labelId.'"><input id="'.$labelId.'" class="radio-btn-fix" type="radio" name="'.$name.'" value="'.$value.'" '.$checked.'>';
521
- $content .= $additionalHtml.$br;
522
- }
523
- return $content;
524
- }
525
-
526
- public static function getUserIpAdress() {
527
- $ipaddress = '';
528
- if (getenv('HTTP_CLIENT_IP'))
529
- $ipaddress = getenv('HTTP_CLIENT_IP');
530
- else if(getenv('HTTP_X_FORWARDED_FOR'))
531
- $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
532
- else if(getenv('HTTP_X_FORWARDED'))
533
- $ipaddress = getenv('HTTP_X_FORWARDED');
534
- else if(getenv('HTTP_FORWARDED_FOR'))
535
- $ipaddress = getenv('HTTP_FORWARDED_FOR');
536
- else if(getenv('HTTP_FORWARDED'))
537
- $ipaddress = getenv('HTTP_FORWARDED');
538
- else if(getenv('REMOTE_ADDR'))
539
- $ipaddress = getenv('REMOTE_ADDR');
540
- else
541
- $ipaddress = 'UNKNOWN';
542
- return $ipaddress;
543
- }
544
-
545
- public static function getCountryName($ip)
546
- {
547
- if(empty($_COOKIE['SG_POPUP_USER_COUNTRY_NAME'])) {
548
- require_once(SG_APP_POPUP_FILES."/lib/SxGeo/SxGeo.php");
549
-
550
- $SxGeo = new SxGeo(SG_APP_POPUP_FILES."/lib/SxGeo/SxGeo.dat");
551
- $counrty = $SxGeo->getCountry($ip);
552
-
553
- /*When Ip addres does not correct*/
554
- if($counrty == '') {
555
- return true;
556
- }
557
- }
558
- else {
559
- $counrty = $_COOKIE['SG_POPUP_USER_COUNTRY_NAME'];
560
- }
561
-
562
- return $counrty;
563
- }
564
-
565
- public static function getUserLocationData($popupId) {
566
- $obj = SGPopup::findById($popupId);
567
- $countryStatus = '';
568
- $countryName = '';
569
-
570
- if($obj) {
571
- $options = json_decode($obj->getOptions(), true);
572
- $countryStatus = $options['countryStatus'];
573
- }
574
-
575
- if(!empty($countryStatus)) {
576
- $ip = SGFunctions::getUserIpAdress();
577
- $countryName = SGFunctions::getCountryName($ip);
578
- }
579
- if(!empty($countryName)) {
580
- return $countryName;
581
- }
582
- return false;
583
- }
584
-
585
- public static function isShowMenuForCurrentUser() {
586
- $usersSelectedRoles = SgPopupGetData::getValue('plugin_users_role', 'settings');
587
-
588
- $currentUserRole = SgPopupGetData::getCurrentUserRole();
589
-
590
- if (is_super_admin()) {
591
- return true;
592
- }
593
- $usersSelectedRoles = (array)$usersSelectedRoles;
594
- if ((!empty($usersSelectedRoles) && !in_array($currentUserRole, $usersSelectedRoles))) {
595
- return false;
596
- }
597
-
598
- return true;
599
- }
600
-
601
- public static function getCurrentPopupIdFromOptions($id) {
602
-
603
- $allPosts = get_option("SG_ALL_POSTS");
604
-
605
- if(!is_array($allPosts)) {
606
- return false;
607
- }
608
-
609
- foreach ($allPosts as $key => $post) {
610
- if($post['id'] == $id) {
611
- return $key;
612
- }
613
- }
614
-
615
- return false;
616
- }
617
-
618
- public static function findInAllPostTypeData($popupId, $allPosts)
619
- {
620
- $searchData = array();
621
-
622
- if(empty($allPosts)) {
623
- return $searchData;
624
- }
625
-
626
- foreach ($allPosts as $key => $postData) {
627
-
628
- if(!empty($postData['id']) && $postData['id'] == $popupId) {
629
- $searchData = $postData;
630
- break;
631
- }
632
- }
633
-
634
- return $searchData;
635
- }
636
-
637
- public static function countrisSelect() {
638
-
639
- return '<select id="sameWidthinputs" name="countris" class="optionsCountry" data-role="tagsinput">
640
- <option value="AF">Afghanistan</option>
641
- <option value="AX">Åland Islands</option>
642
- <option value="AL">Albania</option>
643
- <option value="DZ">Algeria</option>
644
- <option value="AS">American Samoa</option>
645
- <option value="AD">Andorra</option>
646
- <option value="AO">Angola</option>
647
- <option value="AI">Anguilla</option>
648
- <option value="AQ">Antarctica</option>
649
- <option value="AG">Antigua and Barbuda</option>
650
- <option value="AR">Argentina</option>
651
- <option value="AM">Armenia</option>
652
- <option value="AW">Aruba</option>
653
- <option value="AU">Australia</option>
654
- <option value="AT">Austria</option>
655
- <option value="AZ">Azerbaijan</option>
656
- <option value="BS">Bahamas</option>
657
- <option value="BH">Bahrain</option>
658
- <option value="BD">Bangladesh</option>
659
- <option value="BB">Barbados</option>
660
- <option value="BY">Belarus</option>
661
- <option value="BE">Belgium</option>
662
- <option value="BZ">Belize</option>
663
- <option value="BJ">Benin</option>
664
- <option value="BM">Bermuda</option>
665
- <option value="BT">Bhutan</option>
666
- <option value="BO">Bolivia Plurinational State</option>
667
- <option value="BQ">Bonaire Sint Eustatius and Saba</option>
668
- <option value="BA">Bosnia and Herzegovina</option>
669
- <option value="BW">Botswana</option>
670
- <option value="BV">Bouvet Island</option>
671
- <option value="BR">Brazil</option>
672
- <option value="IO">British Indian Ocean Territory</option>
673
- <option value="BN">Brunei Darussalam</option>
674
- <option value="BG">Bulgaria</option>
675
- <option value="BF">Burkina Faso</option>
676
- <option value="BI">Burundi</option>
677
- <option value="KH">Cambodia</option>
678
- <option value="CM">Cameroon</option>
679
- <option value="CA">Canada</option>
680
- <option value="CV">Cape Verde</option>
681
- <option value="KY">Cayman Islands</option>
682
- <option value="CF">Central African Republic</option>
683
- <option value="TD">Chad</option>
684
- <option value="CL">Chile</option>
685
- <option value="CN">China</option>
686
- <option value="CX">Christmas Island</option>
687
- <option value="CC">Cocos (Keeling) Islands</option>
688
- <option value="CO">Colombia</option>
689
- <option value="KM">Comoros</option>
690
- <option value="CG">Congo</option>
691
- <option value="CD">Congo the Democratic Republic</option>
692
- <option value="CK">Cook Islands</option>
693
- <option value="CR">Costa Rica</option>
694
- <option value="CI">Côte d\'Ivoire</option>
695
- <option value="HR">Croatia</option>
696
- <option value="CU">Cuba</option>
697
- <option value="CW">Curaçao</option>
698
- <option value="CY">Cyprus</option>
699
- <option value="CZ">Czech Republic</option>
700
- <option value="DK">Denmark</option>
701
- <option value="DJ">Djibouti</option>
702
- <option value="DM">Dominica</option>
703
- <option value="DO">Dominican Republic</option>
704
- <option value="EC">Ecuador</option>
705
- <option value="EG">Egypt</option>
706
- <option value="SV">El Salvador</option>
707
- <option value="GQ">Equatorial Guinea</option>
708
- <option value="ER">Eritrea</option>
709
- <option value="EE">Estonia</option>
710
- <option value="ET">Ethiopia</option>
711
- <option value="FK">Falkland Islands (Malvinas)</option>
712
- <option value="FO">Faroe Islands</option>
713
- <option value="FJ">Fiji</option>
714
- <option value="FI">Finland</option>
715
- <option value="FR">France</option>
716
- <option value="GF">French Guiana</option>
717
- <option value="PF">French Polynesia</option>
718
- <option value="TF">French Southern Territories</option>
719
- <option value="GA">Gabon</option>
720
- <option value="GM">Gambia</option>
721
- <option value="GE">Georgia</option>
722
- <option value="DE">Germany</option>
723
- <option value="GH">Ghana</option>
724
- <option value="GI">Gibraltar</option>
725
- <option value="GR">Greece</option>
726
- <option value="GL">Greenland</option>
727
- <option value="GD">Grenada</option>
728
- <option value="GP">Guadeloupe</option>
729
- <option value="GU">Guam</option>
730
- <option value="GT">Guatemala</option>
731
- <option value="GG">Guernsey</option>
732
- <option value="GN">Guinea</option>
733
- <option value="GW">Guinea-Bissau</option>
734
- <option value="GY">Guyana</option>
735
- <option value="HT">Haiti</option>
736
- <option value="HM">Heard Island and McDonald Islands</option>
737
- <option value="VA">Holy See (Vatican City State)</option>
738
- <option value="HN">Honduras</option>
739
- <option value="HK">Hong Kong</option>
740
- <option value="HU">Hungary</option>
741
- <option value="IS">Iceland</option>
742
- <option value="IN">India</option>
743
- <option value="ID">Indonesia</option>
744
- <option value="IR">Iran Islamic Republic of</option>
745
- <option value="IQ">Iraq</option>
746
- <option value="IE">Ireland</option>
747
- <option value="IM">Isle of Man</option>
748
- <option value="IL">Israel</option>
749
- <option value="IT">Italy</option>
750
- <option value="JM">Jamaica</option>
751
- <option value="JP">Japan</option>
752
- <option value="JE">Jersey</option>
753
- <option value="JO">Jordan</option>
754
- <option value="KZ">Kazakhstan</option>
755
- <option value="KE">Kenya</option>
756
- <option value="KI">Kiribati</option>
757
- <option value="KP">Korea Democratic People\'s Republic</option>
758
- <option value="KR">Korea</option>
759
- <option value="KW">Kuwait</option>
760
- <option value="KG">Kyrgyzstan</option>
761
- <option value="LA">Lao People\'s Democratic Republic</option>
762
- <option value="LV">Latvia</option>
763
- <option value="LB">Lebanon</option>
764
- <option value="LS">Lesotho</option>
765
- <option value="LR">Liberia</option>
766
- <option value="LY">Libya</option>
767
- <option value="LI">Liechtenstein</option>
768
- <option value="LT">Lithuania</option>
769
- <option value="LU">Luxembourg</option>
770
- <option value="MO">Macao</option>
771
- <option value="MK">Macedonia the former Yugoslav Republic</option>
772
- <option value="MG">Madagascar</option>
773
- <option value="MW">Malawi</option>
774
- <option value="MY">Malaysia</option>
775
- <option value="MV">Maldives</option>
776
- <option value="ML">Mali</option>
777
- <option value="MT">Malta</option>
778
- <option value="MH">Marshall Islands</option>
779
- <option value="MQ">Martinique</option>
780
- <option value="MR">Mauritania</option>
781
- <option value="MU">Mauritius</option>
782
- <option value="YT">Mayotte</option>
783
- <option value="MX">Mexico</option>
784
- <option value="FM">Micronesia Federated States</option>
785
- <option value="MD">Moldova</option>
786
- <option value="MC">Monaco</option>
787
- <option value="MN">Mongolia</option>
788
- <option value="ME">Montenegro</option>
789
- <option value="MS">Montserrat</option>
790
- <option value="MA">Morocco</option>
791
- <option value="MZ">Mozambique</option>
792
- <option value="MM">Myanmar</option>
793
- <option value="NA">Namibia</option>
794
- <option value="NR">Nauru</option>
795
- <option value="NP">Nepal</option>
796
- <option value="NL">Netherlands</option>
797
- <option value="NC">New Caledonia</option>
798
- <option value="NZ">New Zealand</option>
799
- <option value="NI">Nicaragua</option>
800
- <option value="NE">Niger</option>
801
- <option value="NG">Nigeria</option>
802
- <option value="NU">Niue</option>
803
- <option value="NF">Norfolk Island</option>
804
- <option value="MP">Northern Mariana Islands</option>
805
- <option value="NO">Norway</option>
806
- <option value="OM">Oman</option>
807
- <option value="PK">Pakistan</option>
808
- <option value="PW">Palau</option>
809
- <option value="PS">Palestinian Territory</option>
810
- <option value="PA">Panama</option>
811
- <option value="PG">Papua New Guinea</option>
812
- <option value="PY">Paraguay</option>
813
- <option value="PE">Peru</option>
814
- <option value="PH">Philippines</option>
815
- <option value="PN">Pitcairn</option>
816
- <option value="PL">Poland</option>
817
- <option value="PT">Portugal</option>
818
- <option value="PR">Puerto Rico</option>
819
- <option value="QA">Qatar</option>
820
- <option value="RE">Réunion</option>
821
- <option value="RO">Romania</option>
822
- <option value="RU">Russian Federation</option>
823
- <option value="RW">Rwanda</option>
824
- <option value="BL">Saint Barthélemy</option>
825
- <option value="SH">Saint Helena Ascension and Tristan da Cunha</option>
826
- <option value="KN">Saint Kitts and Nevis</option>
827
- <option value="LC">Saint Lucia</option>
828
- <option value="MF">Saint Martin (French part)</option>
829
- <option value="PM">Saint Pierre and Miquelon</option>
830
- <option value="VC">Saint Vincent and the Grenadines</option>
831
- <option value="WS">Samoa</option>
832
- <option value="SM">San Marino</option>
833
- <option value="ST">Sao Tome and Principe</option>
834
- <option value="SA">Saudi Arabia</option>
835
- <option value="SN">Senegal</option>
836
- <option value="RS">Serbia</option>
837
- <option value="SC">Seychelles</option>
838
- <option value="SL">Sierra Leone</option>
839
- <option value="SG">Singapore</option>
840
- <option value="SX">Sint Maarten (Dutch part)</option>
841
- <option value="SK">Slovakia</option>
842
- <option value="SI">Slovenia</option>
843
- <option value="SB">Solomon Islands</option>
844
- <option value="SO">Somalia</option>
845
- <option value="ZA">South Africa</option>
846
- <option value="GS">South Georgia and the South Sandwich Islands</option>
847
- <option value="SS">South Sudan</option>
848
- <option value="ES">Spain</option>
849
- <option value="LK">Sri Lanka</option>
850
- <option value="SD">Sudan</option>
851
- <option value="SR">Suriname</option>
852
- <option value="SJ">Svalbard and Jan Mayen</option>
853
- <option value="SZ">Swaziland</option>
854
- <option value="SE">Sweden</option>
855
- <option value="CH">Switzerland</option>
856
- <option value="SY">Syrian Arab Republic</option>
857
- <option value="TW">Taiwan Province of China</option>
858
- <option value="TJ">Tajikistan</option>
859
- <option value="TZ">Tanzania United Republic of</option>
860
- <option value="TH">Thailand</option>
861
- <option value="TL">Timor-Leste</option>
862
- <option value="TG">Togo</option>
863
- <option value="TK">Tokelau</option>
864
- <option value="TO">Tonga</option>
865
- <option value="TT">Trinidad and Tobago</option>
866
- <option value="TN">Tunisia</option>
867
- <option value="TR">Turkey</option>
868
- <option value="TM">Turkmenistan</option>
869
- <option value="TC">Turks and Caicos Islands</option>
870
- <option value="TV">Tuvalu</option>
871
- <option value="UG">Uganda</option>
872
- <option value="UA">Ukraine</option>
873
- <option value="AE">United Arab Emirates</option>
874
- <option value="GB">United Kingdom</option>
875
- <option value="US">United States</option>
876
- <option value="UM">United States Minor Outlying Islands</option>
877
- <option value="UY">Uruguay</option>
878
- <option value="UZ">Uzbekistan</option>
879
- <option value="VU">Vanuatu</option>
880
- <option value="VE">Venezuela Bolivarian Republic</option>
881
- <option value="VN">Viet Nam</option>
882
- <option value="VG">Virgin Islands British</option>
883
- <option value="VI">Virgin Islands U.S.</option>
884
- <option value="WF">Wallis and Futuna</option>
885
- <option value="EH">Western Sahara</option>
886
- <option value="YE">Yemen</option>
887
- <option value="ZM">Zambia</option>
888
- <option value="ZW">Zimbabwe</option>
889
- </select>';
890
- }
891
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_more_plugins.php DELETED
@@ -1,68 +0,0 @@
1
-
2
- <div class="plugin-group" id="sg-plugins-wrapper">
3
-
4
- <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/backup/')">
5
- <div class="plugin-card-top">
6
- <a href="https://wordpress.org/plugins/backup/" target="_blank" class="plugin-icon"><div class="plugin-icon" id="plugin-icon-backup"></div></a>
7
- <div class="name column-name">
8
- <h4><a href="https://wordpress.org/plugins/backup/" target="_blank">Backup Guard</a></h4>
9
- </div>
10
- <div class="desc column-description">
11
- <p>Backup Guard for WordPress is the best backup choice for WordPress based websites or blogs.</p>
12
- <div class="column-compatibility"><span class="compatibility-compatible"><strong>Compatible</strong> with your version of WordPress</span></div>
13
- </div>
14
- </div>
15
- </div>
16
- <div class="plugin-card">
17
- <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/breadcrumbs-builder/')">
18
- <a href="https://wordpress.org/plugins/breadcrumbs-builder/" class="plugin-icon"><style type="text/css">#plugin-icon-breadcrumbs-builder { width:128px; height:128px; background-image: url("//ps.w.org/breadcrumbs-builder/assets/icon-128x128.jpg?rev=1581944"); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-breadcrumbs-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
19
- <div class="name column-name">
20
- <h4><a href="#">Breadcrumbs</a></h4>
21
- </div>
22
- <div class="desc column-description">
23
- <p>Breadcrumb Builder will allow you to add Breadcrumbs navigation section to your site and your visitors will know current path.</p>
24
- </div>
25
- <div class="sg-row sg-compatible">
26
- <div class="sg-col-8">
27
- <div class="column-compatibility"><span class="compatibility-compatible"><strong>Compatible</strong> with your version of WordPress</span></div>
28
- </div>
29
- </div>
30
- </div>
31
- </div>
32
- <div class="plugin-card">
33
- <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/social-media-builder/')">
34
- <a href="https://wordpress.org/plugins/social-media-builder/" class="plugin-icon" target="_blank"><div class="plugin-icon" id="plugin-icon-social-media-builder"></div></a>
35
- <div class="name column-name">
36
- <h4><a href="https://wordpress.org/plugins/social-media-builder/" target="_blank">Social</a></h4>
37
- </div>
38
- <div class="desc column-description">
39
- <p>Social plugin provides you with many social networks, effects, dozens of themes and many other awesome options to make your page more shareable.</p>
40
- <div class="column-compatibility"><span class="compatibility-compatible"><strong>Compatible</strong> with your version of WordPress</span></div>
41
- </div>
42
- </div>
43
- </div>
44
-
45
- <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/review-builder/')">
46
- <div class="plugin-card-top">
47
- <a href="https://wordpress.org/plugins/review-builder/" target="_blank" class="plugin-icon"><style type="text/css"></style><div class="plugin-icon" id="plugin-icon-review-builder"></div></a>
48
- <div class="name column-name">
49
- <h4><a href="https://wordpress.org/plugins/review-builder/" target="_blank">Review</a></h4>
50
- </div>
51
- <div class="desc column-description">
52
- <p>Review Builder will allow you to add reviews section to your site. Build a reviews section so customers can leave reviews for your products.</p>
53
- <div class="column-compatibility"><span class="compatibility-compatible"><strong>Compatible</strong> with your version of WordPress</span></div>
54
- </div>
55
- </div>
56
- </div>
57
- <div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
58
- <div class="plugin-card-top">
59
- <a href="http://wpkicker.com/" class="plugin-icon"><div class="plugin-icon"><img id="plugin-icon-kicker" src="<?php echo SG_APP_POPUP_URL.'/img/blog-wp-kicker.png';?>"></div></a>
60
- <div class="name column-name">
61
- <h4><a href="#">WP Kicker</a></h4>
62
- </div>
63
- <div class="desc column-description">
64
- <p>Wp Kicker has a definite mission, to provide WordPress users with all the necessary information they may be needing concerning the security, the aim or the instructions of usage of WordPress in general.</p>
65
- </div>
66
- </div>
67
- </div>
68
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_actions.php DELETED
@@ -1,183 +0,0 @@
1
- <?php
2
- class sgPopupActions {
3
-
4
- public function __construct() {
5
-
6
- $this->actions();
7
- }
8
-
9
- private function actions() {
10
-
11
- add_action('sgPopupDelete', array($this, 'sgPopupDeleteAction'));
12
- add_action('admin_notices', array($this, 'popupBuilderShowReviewNotice'));
13
- add_action('network_admin_notices', array($this, 'popupBuilderShowReviewNotice'));
14
- add_action('user_admin_notices', array($this, 'popupBuilderShowReviewNotice'));
15
- }
16
-
17
- public function sgPopupDeleteAction($args) {
18
-
19
- $extensionManagerObj = new SGPBExtensionManager();
20
- $popupCount = get_option('SGPBMaxOpenCount');
21
- $popupId = $args['popupId'];
22
-
23
- if(is_array($popupCount) && isset($popupCount[$popupId])) {
24
- unset($popupCount[$popupId]);
25
- update_option('SGPBMaxOpenCount', $popupId);
26
- }
27
- $extensionManagerObj->deletePopupFromConnection($popupId);
28
- $this->deletePopupFromAllPostTypes($popupId);
29
- }
30
-
31
- private function deletePopupFromAllPostTypes($popupId) {
32
-
33
- $popupId = (int)$popupId;
34
- $allPosts = get_option("SG_ALL_POSTS");
35
- $popupKey = SGFunctions::getCurrentPopupIdFromOptions($popupId);
36
-
37
- if($popupKey != false) {
38
- unset($allPosts[$popupKey]);
39
- update_option("SG_ALL_POSTS", $allPosts);
40
- }
41
- }
42
-
43
- public function popupBuilderShowReviewNotice()
44
- {
45
- $messageContent = '';
46
- $maxOpenPopupStatus = SGFunctions::shouldOpenForMaxOpenPopupMessage();
47
- $shouldOpenForDays = SGFunctions::shouldOpenReviewPopupForDays();
48
-
49
- if($maxOpenPopupStatus) {
50
- $messageContent = SGFunctions::getMaxOpenPopupsMessage();
51
- }
52
- else if($shouldOpenForDays) {
53
- $messageContent = SGFunctions::getMaxOpenDaysMessage();
54
- }
55
-
56
- if(empty($messageContent)) {
57
- return $messageContent;
58
- }
59
- ob_start();
60
- ?>
61
- <div id="welcome-panel" class="welcome-panel sgpb-review-block">
62
- <div class="welcome-panel-content">
63
- <?php echo $messageContent; ?>
64
- </div>
65
- </div>
66
- <?php
67
- $content = ob_get_clean();
68
-
69
- echo $content;
70
- return '';
71
- }
72
- }
73
-
74
- $actionsObj = new sgPopupActions();
75
-
76
- function sgPopupPluginLoaded() {
77
-
78
- $versionPopup = get_option('SG_POPUP_VERSION');
79
- if (!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
80
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
81
- PopupInstaller::install();
82
- }
83
- }
84
-
85
- add_action('plugins_loaded', 'sgPopupPluginLoaded');
86
-
87
- function sgnewslatter_repeat_function($args) {
88
-
89
- global $wpdb;
90
- /*Args is json from newsletter form parameters*/
91
- $params= json_decode($args, true);
92
-
93
- $subscriptionType = $params['subsFormType'];
94
- $sendingLimit = $params['emailsOneTime'];
95
- $emailMessage = $params['messageBody'];
96
- $mailSubject = $params['newsletterSubject'];
97
- $fromEmail = $params['fromEmail'];
98
- if (!preg_match("/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$/", $fromEmail)) {
99
- $fromEmail = "popupBuilder@gmail.com";
100
- }
101
- $successMails = 0;
102
- $allData = array();
103
- $adminEmail = get_option('admin_email');
104
-
105
- $sql = $wpdb->prepare("select id from ".$wpdb->prefix."sg_subscribers where status=0 and subscriptionType = %s limit 1",$subscriptionType);
106
- $result = $wpdb->get_row($sql, ARRAY_A);
107
- $id = (int)$result['id'];
108
- $getTotalSql = $wpdb->prepare("select count(*) from ".$wpdb->prefix."sg_subscribers where subscriptionType = %s ", $subscriptionType);
109
- $totalSubscribers = $wpdb->get_var($getTotalSql);
110
-
111
- /*Id = 0 when all emails status = 1*/
112
- if($id == 0) {
113
- /*Clear schedule hook*/
114
- $headers = 'MIME-Version: 1.0'."\r\n";
115
- $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
116
- $successTotal = get_option("SG_NEWSLETTER_".$subscriptionType);
117
- if(!$successTotal) {
118
- $successTotal = 0;
119
- }
120
- $faildTotal = $totalSubscribers - $successTotal;
121
-
122
- $emailMessageCustom = 'Your mail list '.$subscriptionType.' delivered successfully!
123
- '.$successTotal.' of the '.$totalSubscribers.' emails succeeded, '.$faildTotal.' failed.
124
- For more details, please download log file inside the plugin.
125
-
126
- This email was generated via Popup Builder plugin.';
127
-
128
- $mailStatus = wp_mail($adminEmail, $subscriptionType.' list has been successfully delivered!', $emailMessageCustom, $headers);
129
- delete_option("SG_NEWSLETTER_".$subscriptionType);
130
- wp_clear_scheduled_hook("sgnewsletter_send_messages", array(json_encode($params)));
131
- return;
132
- }
133
- else {
134
- $getAllDataSql = $wpdb->prepare("select firstName,lastName,email from ".$wpdb->prefix."sg_subscribers where id>=$id and subscriptionType = %s limit $sendingLimit",$subscriptionType);
135
- $allData = $wpdb->get_results($getAllDataSql, ARRAY_A);
136
- }
137
-
138
- /*Mail Headers*/
139
- $blogInfo = get_bloginfo();
140
- $headers = array(
141
- 'From: "'.$blogInfo.'" <'.$fromEmail.'>' ,
142
- 'MIME-Version: 1.0' ,
143
- 'Content-type: text/html; charset=iso-8859-1'
144
- );
145
-
146
- foreach ($allData as $data) {
147
-
148
- $patternFirstName = '/\[First name]/';
149
- $patternLastName = '/\[Last name]/';
150
- $patternBlogName = '/\[Blog name]/';
151
- $patternUserName = '/\[User name]/';
152
- $replacementFirstName = $data['firstName'];
153
- $replacementLastName = $data['lastName'];
154
- $replacementBlogName = get_bloginfo("name");
155
- $replacementUserName = wp_get_current_user()->user_login;
156
- /*Replace First name and Last name form email message*/
157
- $emailMessageCustom = preg_replace($patternFirstName, $replacementFirstName, $emailMessage);
158
- $emailMessageCustom = preg_replace($patternLastName, $replacementLastName, $emailMessageCustom);
159
- $emailMessageCustom = preg_replace($patternBlogName, $replacementBlogName, $emailMessageCustom);
160
- $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
161
- $emailMessageCustom = stripslashes($emailMessageCustom);
162
-
163
- $mailStatus = wp_mail($data['email'], $mailSubject, $emailMessageCustom, $headers);
164
- if(!$mailStatus) {
165
- $errorLogSql = $wpdb->prepare('INSERT INTO '. $wpdb->prefix .'sg_subscription_error_log(`popupType`, `email`, `date`) VALUES (%s, %s, %s)', $subscriptionType, $data['email'], date('Y-m-d H:i'));
166
- $wpdb->query($errorLogSql);
167
- }
168
- /*Sending status*/
169
- $successCount = get_option("SG_NEWSLETTER_".$subscriptionType);
170
- if(!$successCount) {
171
- update_option("SG_NEWSLETTER_".$subscriptionType, 1);
172
- }
173
- else {
174
- update_option("SG_NEWSLETTER_".$subscriptionType, ++$successCount);
175
- }
176
-
177
- }
178
- /*Update all mails status which has been sent*/
179
- $updateStatusQuery = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_subscribers SET status=1 where id>=$id and subscriptionType = %s limit $sendingLimit",$subscriptionType);
180
- $wpdb->query($updateStatusQuery);
181
- }
182
- add_action ('sgnewsletter_send_messages', 'sgnewslatter_repeat_function', 10, 1);
183
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_ajax.php DELETED
@@ -1,669 +0,0 @@
1
- <?php
2
- //sanitizing and validating input before any action
3
- function sgSanitizeAjaxField($optionValue, $isTextField = false) {
4
- /*TODO: Extend function for other sanitization and validation actions*/
5
- if(!$isTextField) {
6
- return sanitize_text_field($optionValue);
7
- }
8
- }
9
-
10
- function sgPopupDelete()
11
- {
12
- check_ajax_referer('sgPopupBuilderDeleteNonce', 'ajaxNonce');
13
- $id = (int)@$_POST['popup_id'];
14
-
15
- if($id == 0 || !$id) {
16
- return;
17
- }
18
-
19
- require_once(SG_APP_POPUP_CLASSES.'/SGPopup.php');
20
- SGPopup::delete($id);
21
- SGPopup::removePopupFromPages($id);
22
-
23
- $args = array('popupId'=> $id);
24
- do_action('sgPopupDelete', $args);
25
- }
26
-
27
- add_action('wp_ajax_delete_popup', 'sgPopupDelete');
28
-
29
- function sgFrontend()
30
- {
31
- global $wpdb;
32
- check_ajax_referer('sgPopupBuilderSubsNonce', 'subsSecurity');
33
- parse_str($_POST['subsribers'], $subsribers);
34
- if(!empty($subsribers['sg-subs-hidden-checker'])) {
35
- return 'Bot';
36
- }
37
- $email = sanitize_email($subsribers['subs-email-name']);
38
- $firstName = sgSanitizeAjaxField($subsribers['subs-first-name']);
39
- $lastName = sgSanitizeAjaxField($subsribers['subs-last-name']);
40
- $title = sanitize_title($subsribers['subs-popup-title']);
41
-
42
- $query = $wpdb->prepare("SELECT id FROM ". $wpdb->prefix ."sg_subscribers WHERE email = %s AND subscriptionType = %s", $email, $title);
43
- $list = $wpdb->get_row($query, ARRAY_A);
44
- if(!isset($list['id'])) {
45
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix."sg_subscribers (firstName, lastName, email, subscriptionType, status) VALUES (%s, %s, %s, %s,%d)", $firstName, $lastName, $email, $title, 0);
46
- $res = $wpdb->query($sql);
47
- }
48
- die();
49
- }
50
-
51
- add_action('wp_ajax_nopriv_subs_send_mail', 'sgFrontend');
52
- add_action('wp_ajax_subs_send_mail', 'sgFrontend');
53
-
54
- function sgpbAddToCounter()
55
- {
56
- check_ajax_referer('sgPbNonce', 'ajaxNonce');
57
- $popupParams = $_POST['params'];
58
- $popupId = (int)$popupParams['popupId'];
59
- $popupsCounterData = get_option('SgpbCounter');
60
-
61
- if($popupsCounterData === false) {
62
- $popupsCounterData = array();
63
- }
64
-
65
- if(empty($popupsCounterData[$popupId])) {
66
- $popupsCounterData[$popupId] = 0;
67
- }
68
- $popupsCounterData[$popupId] += 1;
69
-
70
- update_option('SgpbCounter', $popupsCounterData);
71
- die();
72
- }
73
-
74
- add_action('wp_ajax_nopriv_send_to_open_counter', 'sgpbAddToCounter');
75
- add_action('wp_ajax_send_to_open_counter', 'sgpbAddToCounter');
76
-
77
- function sgContactForm()
78
- {
79
- global $wpdb;
80
- parse_str($_POST['contactParams'], $params);
81
- //CSRF CHECK
82
- check_ajax_referer('sgPopupBuilderContactNonce', 'contactSecurity');
83
- if(!empty($params['sg-hidden-checker'])) {
84
- return 'Bot';
85
- }
86
- $adminMail = sanitize_email($_POST['receiveMail']);
87
- $popupTitle = sanitize_title($_POST['popupTitle']);
88
- $name = sgSanitizeAjaxField($params['contact-name']);
89
- $subject = sgSanitizeAjaxField($params['contact-subject']);
90
- $userMessage = sgSanitizeAjaxField($params['content-message']);
91
- $mail = sanitize_email($params['contact-email']);
92
-
93
-
94
- $message = '';
95
- if(isset($name)) {
96
- if($name == '') {
97
- $name = 'Not provided';
98
- }
99
- $message .= '<b>Name</b>: '.$name."<br>";
100
- }
101
-
102
- $message .= '<b>E-mail</b>: '.$mail."<br>";
103
- if(isset($subject)) {
104
- if($subject == '') {
105
- $subject = 'Not provided';
106
- }
107
- $message .= '<b>Subject</b>: '.$subject."<br>";
108
- }
109
-
110
- $message .= '<b>Message</b>: '.$userMessage."<br>";
111
- $headers = 'MIME-Version: 1.0'."\r\n";
112
- $headers = 'From: '.$adminMail.''."\r\n";
113
- $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; //set UTF-8
114
-
115
- $sendStatus = wp_mail($adminMail, $popupTitle.'- Popup contact form', $message, $headers); //return true or false
116
- echo $sendStatus;
117
- die();
118
- }
119
-
120
- add_action('wp_ajax_nopriv_contact_send_mail', 'sgContactForm');
121
- add_action('wp_ajax_contact_send_mail', 'sgContactForm');
122
-
123
- function sgImportPopups()
124
- {
125
- global $wpdb;
126
- check_ajax_referer('sgPopupBuilderImportNonce', 'ajaxNonce');
127
- $url = sgSanitizeAjaxField($_POST['attachmentUrl']);
128
-
129
- $contents = unserialize(base64_decode(file_get_contents($url)));
130
-
131
- /* For tables wich they are not popup tables child ex. subscribers */
132
- foreach ($contents['customData'] as $tableName => $datas) {
133
- $columns = '';
134
-
135
- $columsArray = array();
136
- foreach ($contents['customTablesColumsName'][$tableName] as $key => $value) {
137
- $columsArray[$key] = $value['Field'];
138
- }
139
- $columns .= implode(array_values($columsArray), ', ');
140
- foreach ($datas as $key => $data) {
141
- $values = "'".implode(array_values($data), "','")."'";
142
- $customInsertSql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix.$tableName."($columns) VALUES ($values)");
143
- $wpdb->query($customInsertSql);
144
- }
145
- }
146
-
147
- foreach ($contents['wpOptions'] as $key => $option) {
148
- update_option($key,$option);
149
- }
150
-
151
- foreach ($contents['exportArray'] as $content) {
152
- //Main popup table data
153
- $popupData = $content['mainPopupData'];
154
- $popupId = $popupData['id'];
155
- $popupType = $popupData['type'];
156
- $popupTitle = $popupData['title'];
157
- $popupOptions = $popupData['options'];
158
-
159
- //Insert popup
160
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix.PopupInstaller::$mainTableName."(id, type, title, options) VALUES (%d, %s, %s, %s)", $popupId, $popupType, $popupTitle, $popupOptions);
161
- $res = $wpdb->query($sql);
162
- //Get last insert popup id
163
- $lastInsertId = $wpdb->insert_id;
164
-
165
- //Child popup data
166
- $childPopupTableName = $content['childTableName']; // change it Tbale to Table
167
- $childPopupData = $content['childData']; //change it child
168
-
169
- //Foreach throw child popups
170
- foreach ($childPopupData as $childPopup) {
171
- //Child popup table columns
172
- $values = '';
173
- $columns = implode(array_keys($childPopup), ', ');
174
- foreach (array_values($childPopup) as $value) {
175
- $values .= "'".addslashes($value)."', ";
176
- }
177
- $values = rtrim($values, ', ');
178
-
179
- $queryValues = str_repeat("%s, ", count(array_keys($childPopup)));
180
- $queryValues = "%d, ".rtrim($queryValues, ', ');
181
-
182
- $queryStr = 'INSERT INTO '.$wpdb->prefix.$childPopupTableName.'(id, '.$columns.') VALUES ('.$lastInsertId.','. $values.')';
183
-
184
- $resa = (int)$wpdb->query($queryStr);
185
-
186
- echo 'ChildRes: '.$resa;
187
- }
188
- echo 'MainRes: '.$res;
189
- }
190
- }
191
-
192
- add_action('wp_ajax_import_popups', 'sgImportPopups');
193
-
194
- function sgCloseReviewPanel()
195
- {
196
- check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
197
- update_option('SG_COLOSE_REVIEW_BLOCK', true);
198
- die();
199
- }
200
- add_action('wp_ajax_close_review_panel', 'sgCloseReviewPanel');
201
-
202
- function sgDontShowReviewPopup()
203
- {
204
- check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
205
- update_option('SGPBCloseReviewPopup', true);
206
- die();
207
- }
208
- add_action('wp_ajax_dont_show_review_popup', 'sgDontShowReviewPopup');
209
-
210
- function sgChangeReviewPopupPeriod()
211
- {
212
- check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
213
- $messageType = sanitize_text_field($_POST['messageType']);
214
-
215
- if($messageType == 'count') {
216
- $maxPopupCount = get_option('SGPBMaxOpenCount');
217
- if(!$maxPopupCount) {
218
- $maxPopupCount = SG_POPUP_SHOW_COUNT;
219
- }
220
- $maxPopupData = SGFunctions::getMaxOpenPopupId();
221
- if(!empty($maxPopupData['maxCount'])) {
222
- $maxPopupCount = $maxPopupData['maxCount'];
223
- }
224
-
225
- $maxPopupCount += SG_POPUP_SHOW_COUNT;
226
- update_option('SGPBMaxOpenCount', $maxPopupCount);
227
- die();
228
- }
229
-
230
- $popupTimeZone = @SgPopupGetData::getPopupTimeZone();
231
- $timeDate = new DateTime('now', new DateTimeZone($popupTimeZone));
232
- $timeDate->modify('+'.SG_REVIEW_POPUP_PERIOD.' day');
233
-
234
- $timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
235
- update_option('SGPBOpenNextTime', $timeNow);
236
- $usageDays = get_option('SGPBUsageDays');
237
- $usageDays += SG_REVIEW_POPUP_PERIOD;
238
- update_option('SGPBUsageDays', $usageDays);
239
- die();
240
- }
241
-
242
- add_action('wp_ajax_change_review_popup_show_period', 'sgChangeReviewPopupPeriod');
243
-
244
- function addToSubscribers() {
245
-
246
- global $wpdb;
247
- check_ajax_referer('sgPopupBuilderAddSubsToListNonce', 'ajaxNonce');
248
- $firstName = sgSanitizeAjaxField($_POST['firstName']);
249
- $lastName = sgSanitizeAjaxField($_POST['lastName']);
250
- $email = sanitize_email($_POST['email']);
251
- $subsType = array_map( 'sanitize_text_field', $_POST['subsType']);
252
-
253
- foreach ($subsType as $subType) {
254
- $selectSql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.'sg_subscribers WHERE email = %s AND subscriptionType = %s', $email, $subType);
255
- $res = $wpdb->get_row($selectSql, ARRAY_A);
256
- if(empty($res)) {
257
- $sql = $wpdb->prepare('INSERT INTO '.$wpdb->prefix.'sg_subscribers (firstName, lastName, email, subscriptionType) VALUES (%s, %s, %s, %s) ', $firstName, $lastName, $email, $subType);
258
- $wpdb->query($sql);
259
- }
260
- else {
261
- $sql = $wpdb->prepare('UPDATE '.$wpdb->prefix.'sg_subscribers SET firstName = %s, lastName = %s, email = %s, subscriptionType = %s WHERE id = %s', $firstName, $lastName, $email, $subType, $res['id']);
262
- $wpdb->query($sql);
263
- }
264
- }
265
-
266
- die();
267
- }
268
- add_action('wp_ajax_add_to_subsribers', 'addToSubscribers');
269
-
270
- function sgDeleteSubscribers() {
271
-
272
- global $wpdb;
273
- check_ajax_referer('sgPopupBuilderAddSubsNonce', 'ajaxNonce');
274
- $subsribersId = array_map( 'sanitize_text_field', $_POST['subsribersId']);
275
- foreach ($subsribersId as $subsriberId) {
276
- $prepareSql = $wpdb->prepare("DELETE FROM ". $wpdb->prefix ."sg_subscribers WHERE id = %d",$subsriberId);
277
- $wpdb->query($prepareSql);
278
- }
279
- die();
280
- }
281
-
282
- add_action('wp_ajax_subsribers_delete', 'sgDeleteSubscribers');
283
-
284
- function sgIsHaveErrorLog() {
285
-
286
- global $wpdb;
287
- check_ajax_referer('sgPopupBuilderSubsLogNonce', 'ajaxNonce');
288
- $countRows = '';
289
- $popupType = sgSanitizeAjaxField($_POST['subsType']);
290
-
291
- $getErrorCounteSql = $wpdb->prepare("SELECT count(*) FROM ". $wpdb->prefix ."sg_subscription_error_log WHERE popupType=%s",$popupType);
292
- $countRows = $wpdb->get_var($getErrorCounteSql);
293
- echo $countRows;
294
- die();
295
- }
296
-
297
- add_action('wp_ajax_subs_error_log_count', 'sgIsHaveErrorLog');
298
-
299
- function sgChangePopupStatus() {
300
- check_ajax_referer('sgPopupBuilderDeactivateNonce', 'ajaxNonce');
301
- $popupId = (int)$_POST['popupId'];
302
- $obj = SGPopup::findById($popupId);
303
- $options = json_decode($obj->getOptions(), true);
304
- $options['isActiveStatus'] = sgSanitizeAjaxField($_POST['popupStatus']);
305
- $obj->setOptions(json_encode($options));
306
- $obj->save();
307
- }
308
- add_action('wp_ajax_change_popup_status', 'sgChangePopupStatus');
309
-
310
- function savePopupPreviewData() {
311
- check_ajax_referer('popup-builder-ajax', 'ajaxNonce');
312
-
313
- $formSerializedData = $_POST['popupDta'];
314
- if(get_option('popupPreviewId')) {
315
- $id = (int)get_option('popupPreviewId');
316
-
317
- if($id == 0 || !$id) {
318
- return;
319
- }
320
-
321
- require_once(SG_APP_POPUP_CLASSES.'/SGPopup.php');
322
- $delete = SGPopup::delete($id);
323
- if(!$delete) {
324
- delete_option('popupPreviewId');
325
- }
326
-
327
- $args = array('popupId'=> $id);
328
- do_action('sgPopupDelete', $args);
329
- }
330
-
331
- parse_str($formSerializedData, $popupPreviewPostData);
332
- $popupPreviewPostData['allPagesStatus'] = '';
333
- $popupPreviewPostData['allPostsStatus'] = '';
334
- $popupPreviewPostData['allCustomPostsStatus'] = '';
335
- $popupPreviewPostData['onScrolling'] = '';
336
- $popupPreviewPostData['inActivityStatus'] = '';
337
- $popupPreviewPostData['popup-timer-status'] = '';
338
- $popupPreviewPostData['popup-schedule-status'] = '';
339
- $popupPreviewPostData['sg-user-status'] = '';
340
- $popupPreviewPostData['countryStatus'] = '';
341
- $popupPreviewPostData['forMobile'] = '';
342
- $popupPreviewPostData['openMobile'] = '';
343
- $popupPreviewPostData['hidden_popup_number'] = '';
344
- $popupPreviewPostData['repeatPopup'] = '';
345
- $_POST += $popupPreviewPostData;
346
-
347
- $showAllPages = sgSanitize('allPages');
348
- $showAllPosts = sgSanitize('allPosts');
349
- $showAllCustomPosts = sgSanitize('allCustomPosts');
350
- $allSelectedPages = "";
351
- $allSelectedPosts = "";
352
- $allSelectedCustomPosts = "";
353
- $allSelectedCategories = sgSanitize("posts-all-categories", true);
354
-
355
- $selectedPages = sgSanitize('all-selected-page');
356
- $selectedPosts = sgSanitize('all-selected-posts');
357
- $selectedCustomPosts = sgSanitize('all-selected-custom-posts');
358
-
359
- /* if popup check for all pages it is not needed for save all pages all posts */
360
- if($showAllPages !== "all" && !empty($selectedPages)) {
361
- $allSelectedPages = explode(",", $selectedPages);
362
- }
363
-
364
- if($showAllPosts !== "all" && !empty($selectedPosts)) {
365
- $allSelectedPosts = explode(",", $selectedPosts);
366
- }
367
- if($showAllCustomPosts !== "all" && !empty($selectedCustomPosts)) {
368
- $allSelectedCustomPosts = explode(",", $selectedCustomPosts);
369
- }
370
-
371
- $socialOptions = array(
372
- 'sgSocialTheme' => sgSanitize('sgSocialTheme'),
373
- 'sgSocialButtonsSize' => sgSanitize('sgSocialButtonsSize'),
374
- 'sgSocialLabel' => sgSanitize('sgSocialLabel'),
375
- 'sgSocialShareCount' => sgSanitize('sgSocialShareCount'),
376
- 'sgRoundButton' => sgSanitize('sgRoundButton'),
377
- 'fbShareLabel' => sgSanitize('fbShareLabel'),
378
- 'lindkinLabel' => sgSanitize('lindkinLabel'),
379
- 'sgShareUrl' => esc_url_raw(@$_POST['sgShareUrl']),
380
- 'shareUrlType' => sgSanitize('shareUrlType'),
381
- 'googLelabel' => sgSanitize('googLelabel'),
382
- 'twitterLabel' => sgSanitize('twitterLabel'),
383
- 'pinterestLabel' => sgSanitize('pinterestLabel'),
384
- 'sgMailSubject' => sgSanitize('sgMailSubject'),
385
- 'sgMailLable' => sgSanitize('sgMailLable')
386
- );
387
-
388
- $socialButtons = array(
389
- 'sgTwitterStatus' => sgSanitize('sgTwitterStatus'),
390
- 'sgFbStatus' => sgSanitize('sgFbStatus'),
391
- 'sgEmailStatus' => sgSanitize('sgEmailStatus'),
392
- 'sgLinkedinStatus' => sgSanitize('sgLinkedinStatus'),
393
- 'sgGoogleStatus' => sgSanitize('sgGoogleStatus'),
394
- 'sgPinterestStatus' => sgSanitize('sgPinterestStatus'),
395
- 'pushToBottom' => sgSanitize('pushToBottom')
396
- );
397
-
398
- $countdownOptions = array(
399
- 'pushToBottom' => sgSanitize('pushToBottom'),
400
- 'countdownNumbersBgColor' => sgSanitize('countdownNumbersBgColor'),
401
- 'countdownNumbersTextColor' => sgSanitize('countdownNumbersTextColor'),
402
- 'sg-due-date' => sgSanitize('sg-due-date'),
403
- 'countdown-position' => sgSanitize('countdown-position'),
404
- 'counts-language'=> sgSanitize('counts-language'),
405
- 'sg-time-zone' => sgSanitize('sg-time-zone'),
406
- 'sg-countdown-type' => sgSanitize('sg-countdown-type'),
407
- 'countdown-autoclose' => sgSanitize('countdown-autoclose')
408
- );
409
-
410
- $videoOptions = array(
411
- 'video-autoplay' => sgSanitize('video-autoplay')
412
- );
413
-
414
- $exitIntentOptions = array(
415
- 'exit-intent-type' => sgSanitize('exit-intent-type'),
416
- 'exit-intent-expire-time' => sgSanitize('exit-intent-expire-time'),
417
- 'exit-intent-alert' => sgSanitize('exit-intent-alert')
418
- );
419
-
420
- $subscriptionOptions = array(
421
- 'subs-first-name-status' => sgSanitize('subs-first-name-status'),
422
- 'subs-last-name-status' => sgSanitize('subs-last-name-status'),
423
- // email input placeholder text
424
- 'subscription-email' => sgSanitize('subscription-email'),
425
- 'subs-first-name' => sgSanitize('subs-first-name'),
426
- 'subs-last-name' => sgSanitize('subs-last-name'),
427
- 'subs-text-width' => sgSanitize('subs-text-width'),
428
- 'subs-button-bgColor' => sgSanitize('subs-button-bgColor'),
429
- 'subs-btn-width' => sgSanitize('subs-btn-width'),
430
- 'subs-btn-title' => sgSanitize('subs-btn-title'),
431
- 'subs-text-input-bgColor' => sgSanitize('subs-text-input-bgColor'),
432
- 'subs-text-borderColor' => sgSanitize('subs-text-borderColor'),
433
- 'subs-button-color' => sgSanitize('subs-button-color'),
434
- 'subs-inputs-color' => sgSanitize('subs-inputs-color'),
435
- 'subs-btn-height' => sgSanitize('subs-btn-height'),
436
- 'subs-text-height' => sgSanitize('subs-text-height'),
437
- 'subs-placeholder-color' => sgSanitize('subs-placeholder-color'),
438
- 'subs-validation-message' => sgSanitize('subs-validation-message'),
439
- 'subs-success-message' => sgSanitize('subs-success-message'),
440
- 'subs-btn-progress-title' => sgSanitize('subs-btn-progress-title'),
441
- 'subs-text-border-width' => sgSanitize('subs-text-border-width'),
442
- 'subs-success-behavior' => sgSanitize('subs-success-behavior'),
443
- 'subs-success-redirect-url' => esc_url_raw(@$_POST['subs-success-redirect-url']),
444
- 'subs-success-popups-list' => sgSanitize('subs-success-popups-list'),
445
- 'subs-first-name-required' => sgSanitize('subs-first-name-required'),
446
- 'subs-last-name-required' => sgSanitize('subs-last-name-required'),
447
- 'subs-success-redirect-new-tab' => sgSanitize('subs-success-redirect-new-tab')
448
- );
449
-
450
- $contactFormOptions = array(
451
- 'contact-name' => sgSanitize('contact-name'),
452
- 'contact-name-status' => sgSanitize('contact-name-status'),
453
- 'contact-name-required' => sgSanitize('contact-name-required'),
454
- 'contact-subject' => sgSanitize('contact-subject'),
455
- 'contact-subject-status' => sgSanitize('contact-subject-status'),
456
- 'contact-subject-required' => sgSanitize('contact-subject-required'),
457
- // email input placeholder text(string)
458
- 'contact-email' => sgSanitize('contact-email'),
459
- 'contact-message' => sgSanitize('contact-message'),
460
- 'contact-validation-message' => sgSanitize('contact-validation-message'),
461
- 'contact-success-message' => sgSanitize('contact-success-message'),
462
- 'contact-inputs-width' => sgSanitize('contact-inputs-width'),
463
- 'contact-inputs-height' => sgSanitize('contact-inputs-height'),
464
- 'contact-inputs-border-width' => sgSanitize('contact-inputs-border-width'),
465
- 'contact-text-input-bgcolor' => sgSanitize('contact-text-input-bgcolor'),
466
- 'contact-text-bordercolor' => sgSanitize('contact-text-bordercolor'),
467
- 'contact-inputs-color' => sgSanitize('contact-inputs-color'),
468
- 'contact-placeholder-color' => sgSanitize('contact-placeholder-color'),
469
- 'contact-btn-width' => sgSanitize('contact-btn-width'),
470
- 'contact-btn-height' => sgSanitize('contact-btn-height'),
471
- 'contact-btn-title' => sgSanitize('contact-btn-title'),
472
- 'contact-btn-progress-title' => sgSanitize('contact-btn-progress-title'),
473
- 'contact-button-bgcolor' => sgSanitize('contact-button-bgcolor'),
474
- 'contact-button-color' => sgSanitize('contact-button-color'),
475
- 'contact-area-width' => sgSanitize('contact-area-width'),
476
- 'contact-area-height' => sgSanitize('contact-area-height'),
477
- 'sg-contact-resize' => sgSanitize('sg-contact-resize'),
478
- 'contact-validate-email' => sgSanitize('contact-validate-email'),
479
- 'contact-receive-email' => sanitize_email(@$_POST['contact-receive-email']),
480
- 'contact-fail-message' => sgSanitize('contact-fail-message'),
481
- 'show-form-to-top' => sgSanitize('show-form-to-top'),
482
- 'contact-success-behavior' => sgSanitize('contact-success-behavior'),
483
- 'contact-success-redirect-url' => sgSanitize('contact-success-redirect-url'),
484
- 'contact-success-popups-list' => sgSanitize('contact-success-popups-list'),
485
- 'dont-show-content-to-contacted-user' => sgSanitize('dont-show-content-to-contacted-user'),
486
- 'contact-success-frequency-days' => sgSanitize('contact-success-frequency-days'),
487
- 'contact-success-redirect-new-tab' => sgSanitize('contact-success-redirect-new-tab')
488
- );
489
-
490
- $fblikeOptions = array(
491
- 'fblike-like-url' => esc_url_raw(@$_POST['fblike-like-url']),
492
- 'fblike-layout' => sgSanitize('fblike-layout'),
493
- 'fblike-dont-show-share-button' => sgSanitize('fblike-dont-show-share-button'),
494
- 'fblike-close-popup-after-like' => sgSanitize('fblike-close-popup-after-like')
495
- );
496
-
497
- $addToGeneralOptions = array(
498
- 'showAllPages' => array(),
499
- 'showAllPosts' => array(),
500
- 'showAllCustomPosts' => array(),
501
- 'allSelectedPages' => array(),
502
- 'allSelectedPosts' => array(),
503
- 'allSelectedCustomPosts' => array(),
504
- 'allSelectedCategories'=> array(),
505
- 'fblikeOptions'=> $fblikeOptions,
506
- 'videoOptions'=>$videoOptions,
507
- 'exitIntentOptions'=> $exitIntentOptions,
508
- 'countdownOptions'=> $countdownOptions,
509
- 'socialOptions'=> $socialOptions,
510
- 'socialButtons'=> $socialButtons
511
- );
512
-
513
- $options = IntegrateExternalSettings::getPopupGeneralOptions($addToGeneralOptions);
514
-
515
- $html = stripslashes(sgSanitize("sg_popup_html"));
516
- $fblike = stripslashes(sgSanitize("sg_popup_fblike"));
517
- $ageRestriction = stripslashes(sgSanitize('sg_ageRestriction'));
518
- $social = stripslashes(sgSanitize('sg_social'));
519
- $image = sgSanitize('ad_image');
520
- $countdown = stripslashes(sgSanitize('sg_countdown'));
521
- $subscription = stripslashes(sgSanitize('sg_subscription'));
522
- $sgContactForm = stripslashes(sgSanitize('sg_contactForm'));
523
- $iframe = sgSanitize('iframe');
524
- $video = sgSanitize('video');
525
- $shortCode = stripslashes(sgSanitize('shortcode'));
526
- $mailchimp = stripslashes(sgSanitize('sg_popup_mailchimp'));
527
- $aweber = stripslashes(sgSanitize('sg_popup_aweber'));
528
- $exitIntent = stripslashes(sgSanitize('sg-exit-intent'));
529
- $type = sgSanitize('type');
530
-
531
- if($type == 'mailchimp') {
532
-
533
- $mailchimpOptions = array(
534
- 'mailchimp-disable-double-optin' => sgSanitize('mailchimp-disable-double-optin'),
535
- 'mailchimp-list-id' => sgSanitize('mailchimp-list-id'),
536
- 'sg-mailchimp-form' => stripslashes(sgSanitize('sg-mailchimp-form')),
537
- 'mailchimp-required-error-message' => sgSanitize('mailchimp-required-error-message'),
538
- 'mailchimp-email-validate-message' => sgSanitize('mailchimp-email-validate-message'),
539
- 'mailchimp-error-message' => sgSanitize('mailchimp-error-message'),
540
- 'mailchimp-submit-button-bgcolor' => sgSanitize('mailchimp-submit-button-bgcolor'),
541
- 'mailchimp-form-aligment' => sgSanitize('mailchimp-form-aligment'),
542
- 'mailchimp-label-aligment' => sgSanitize('mailchimp-label-aligment'),
543
- 'mailchimp-success-message' => sgSanitize('mailchimp-success-message'),
544
- 'mailchimp-only-required' => sgSanitize('mailchimp-only-required'),
545
- 'mailchimp-show-form-to-top' => sgSanitize('mailchimp-show-form-to-top'),
546
- 'mailchimp-label-color' => sgSanitize('mailchimp-label-color'),
547
- 'mailchimp-input-width' => sgSanitize('mailchimp-input-width'),
548
- 'mailchimp-input-height' => sgSanitize('mailchimp-input-height'),
549
- 'mailchimp-input-border-radius' => sgSanitize('mailchimp-input-border-radius'),
550
- 'mailchimp-input-border-width' => sgSanitize('mailchimp-input-border-width'),
551
- 'mailchimp-input-border-color' => sgSanitize('mailchimp-input-border-color'),
552
- 'mailchimp-input-bg-color' => sgSanitize('mailchimp-input-bg-color'),
553
- 'mailchimp-input-text-color' => sgSanitize('mailchimp-input-text-color'),
554
- 'mailchimp-submit-width' => sgSanitize('mailchimp-submit-width'),
555
- 'mailchimp-submit-height' => sgSanitize('mailchimp-submit-height'),
556
- 'mailchimp-submit-border-width' => sgSanitize('mailchimp-submit-border-width'),
557
- 'mailchimp-submit-border-radius' => sgSanitize('mailchimp-submit-border-radius'),
558
- 'mailchimp-submit-border-color' => sgSanitize('mailchimp-submit-border-color'),
559
- 'mailchimp-submit-color' => sgSanitize('mailchimp-submit-color'),
560
- 'mailchimp-submit-title' => sgSanitize('mailchimp-submit-title'),
561
- 'mailchimp-email-label' => sgSanitize('mailchimp-email-label'),
562
- 'mailchimp-indicates-required-fields' => sgSanitize('mailchimp-indicates-required-fields'),
563
- 'mailchimp-asterisk-label' => sgSanitize('mailchimp-asterisk-label'),
564
- 'mailchimp-success-behavior' => sgSanitize('mailchimp-success-behavior'),
565
- 'mailchimp-success-redirect-url' => sgSanitize('mailchimp-success-redirect-url'),
566
- 'mailchimp-success-popups-list' => sgSanitize('mailchimp-success-popups-list'),
567
- 'mailchimp-success-redirect-new-tab' => sgSanitize('mailchimp-success-redirect-new-tab'),
568
- 'mailchimp-close-popup-already-subscribed' => sgSanitize('mailchimp-close-popup-already-subscribed')
569
- );
570
-
571
- $options['mailchimpOptions'] = json_encode($mailchimpOptions);
572
- }
573
-
574
- if($type == 'aweber') {
575
- $aweberOptions = array(
576
- 'sg-aweber-webform' => sgSanitize('sg-aweber-webform'),
577
- 'sg-aweber-list' => sgSanitize('sg-aweber-list'),
578
- 'aweber-custom-success-message' => sgSanitize('aweber-custom-success-message'),
579
- 'aweber-success-message' => sgSanitize('aweber-success-message'),
580
- 'aweber-custom-invalid-email-message' => sgSanitize('aweber-custom-invalid-email-message'),
581
- 'aweber-invalid-email' => sgSanitize('aweber-invalid-email'),
582
- 'aweber-custom-error-message' => sgSanitize('aweber-custom-error-message'),
583
- 'aweber-error-message' => sgSanitize('aweber-error-message'),
584
- 'aweber-custom-subscribed-message' => sgSanitize('aweber-custom-subscribed-message'),
585
- 'aweber-already-subscribed-message' => sgSanitize('aweber-already-subscribed-message'),
586
- 'aweber-validate-email-message' => sgSanitize('aweber-validate-email-message'),
587
- 'aweber-required-message' => sgSanitize('aweber-required-message'),
588
- 'aweber-success-behavior' => sgSanitize('aweber-success-behavior'),
589
- 'aweber-success-redirect-url' => sgSanitize('aweber-success-redirect-url'),
590
- 'aweber-success-popups-list' => sgSanitize('aweber-success-popups-list'),
591
- 'aweber-success-redirect-new-tab' => sgSanitize('aweber-success-redirect-new-tab')
592
- );
593
- $options['aweberOptions'] = json_encode($aweberOptions);
594
- }
595
-
596
-
597
- $title = stripslashes(sgSanitize('title'));
598
- $id = sgSanitize('hidden_popup_number');
599
- $jsonDataArray = json_encode($options);
600
-
601
- $data = array(
602
- 'id' => $id,
603
- 'title' => $title,
604
- 'type' => $type,
605
- 'image' => $image,
606
- 'html' => $html,
607
- 'fblike' => $fblike,
608
- 'iframe' => $iframe,
609
- 'video' => $video,
610
- 'shortcode' => $shortCode,
611
- 'ageRestriction' => $ageRestriction,
612
- 'countdown' => $countdown,
613
- 'exitIntent' => $exitIntent,
614
- 'sg_subscription' => $subscription,
615
- 'sg_contactForm' => $sgContactForm,
616
- 'social' => $social,
617
- 'mailchimp' => $mailchimp,
618
- 'aweber' => $aweber,
619
- 'options' => $jsonDataArray,
620
- 'subscriptionOptions' => json_encode($subscriptionOptions),
621
- 'contactFormOptions' => json_encode($contactFormOptions)
622
- );
623
-
624
- function setPopupForAllPages($id, $data, $type) {
625
- //-1 is the home page key
626
- if(is_array($data) && $data[0] == -1 && defined('ICL_LANGUAGE_CODE')) {
627
- $data[0] .='_'.ICL_LANGUAGE_CODE;
628
- }
629
- SGPopup::addPopupForAllPages($id, $data, $type);
630
- }
631
-
632
- function setOptionPopupType($id, $type) {
633
- update_option("SG_POPUP_".strtoupper($type)."_".$id,$id);
634
- }
635
-
636
- $popupName = "SG".sanitize_text_field(ucfirst(strtolower($popupPreviewPostData['type'])));
637
- $popupClassName = $popupName."Popup";
638
- $classPath = SG_APP_POPUP_PATH;
639
-
640
- if($type == 'mailchimp' || $type == 'aweber') {
641
-
642
- $currentActionName1 = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
643
- $classPath = $currentActionName1['app-path'];
644
- }
645
-
646
- require_once($classPath ."/classes/".$popupClassName.".php");
647
-
648
- if ($id == "") {
649
- global $wpdb;
650
-
651
- call_user_func(array($popupClassName, 'create'), $data);
652
-
653
- $lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
654
- $postData['saveMod'] = '';
655
- $postData['popupId'] = $lastId;
656
- $extensionManagerObj = new SGPBExtensionManager();
657
- $extensionManagerObj->setPostData($postData);
658
- $extensionManagerObj->save();
659
- update_option('popupPreviewId', $lastId);
660
- setOptionPopupType($lastId, $type);
661
- echo $lastId;
662
- die();
663
- }
664
-
665
- die();
666
- }
667
-
668
- add_action('wp_ajax_save_popup_preview_data', 'savePopupPreviewData');
669
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_create.php DELETED
@@ -1,125 +0,0 @@
1
- <?php
2
-
3
- if(!SG_SHOW_POPUP_REVIEW) {
4
- echo SGFunctions::addReview();
5
- }
6
-
7
- $externalPlugins = IntegrateExternalSettings::getAllExternalPlugins();
8
- $doesntHaveAnyActiveExtensions = IntegrateExternalSettings::doesntHaveAnyActiveExtensions();
9
- ?>
10
- <h2>Add New Popup</h2>
11
- <div class="popups-wrapper">
12
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=image">
13
- <div class="popups-div image-popup">
14
- </div>
15
- </a>
16
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=html">
17
- <div class="popups-div html-popup">
18
- </div>
19
- </a>
20
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=fblike">
21
- <div class="popups-div fblike-popup">
22
- </div>
23
- </a>
24
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=shortcode">
25
- <div class="popups-div shortcode-popup">
26
- </div>
27
- </a>
28
- <?php if(POPUP_BUILDER_PKG >= POPUP_BUILDER_PKG_SILVER): ?>
29
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=iframe">
30
- <div class="popups-div iframe-popup">
31
- </div>
32
- </a>
33
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=video">
34
- <div class="popups-div video-popup">
35
- </div>
36
- </a>
37
- <?php if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER): ?>
38
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=ageRestriction">
39
- <div class="popups-div age-restriction">
40
- </div>
41
- </a>
42
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=countdown">
43
- <div class="popups-div countdown">
44
- </div>
45
- </a>
46
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=social">
47
- <div class="popups-div sg-social">
48
- </div>
49
- </a>
50
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=subscription">
51
- <div class="popups-div sg-subscription">
52
- </div>
53
- </a>
54
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=contactForm">
55
- <div class="popups-div sg-contact-form">
56
- </div>
57
- </a>
58
- <?php endif; ?>
59
- <?php endif; ?>
60
- <?php
61
- if(!empty($externalPlugins)) {
62
- foreach ($externalPlugins as $externalPlugin) { ?>
63
- <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=<?php echo $externalPlugin['name']?>">
64
- <div class="popups-div <?php echo $externalPlugin['name'].'-image';?>">
65
- </div>
66
- </a>
67
- <?php }
68
- }
69
- ?>
70
- <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
71
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
72
- <div class="popups-div iframe-popup-pro">
73
- </div>
74
- </a>
75
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
76
- <div class="popups-div video-popup-pro">
77
- </div>
78
- </a>
79
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
80
- <div class="popups-div age-restriction-pro">
81
- </div>
82
- </a>
83
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
84
- <div class="popups-div countdown-pro">
85
- </div>
86
- </a>
87
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
88
- <div class="popups-div social-pro">
89
- </div>
90
- </a>
91
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
92
- <div class="popups-div subscription-pro">
93
- </div>
94
- </a>
95
- <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
96
- <div class="popups-div contact-pro">
97
- </div>
98
- </a>
99
-
100
- <?php endif; ?>
101
-
102
- </div>
103
-
104
- <?php
105
-
106
- if ($doesntHaveAnyActiveExtensions) : ?>
107
- <div class="add-new-extensions-wrapper">
108
- <span class="add-new-extensions">
109
- Extensions
110
- </span>
111
- </div>
112
- <?php
113
- global $POPUP_ADDONS;
114
- foreach ($POPUP_ADDONS as $addonName) {
115
- $isExtension = IntegrateExternalSettings::isExtensionExists($addonName);
116
- if(!$isExtension) :
117
- $defineString = 'SG_'.strtoupper($addonName).'_EXTENSION_URL';
118
- $urlDefine = constant($defineString);?>
119
- <a class="create-popup-link" href="<?php echo $urlDefine;?>" target="_blank">
120
- <div class="popups-div" <?php echo "id='".$addonName."-pro'";?>>
121
- </div>
122
- </a>
123
- <?php endif;
124
- } ?>
125
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_create_new.php DELETED
@@ -1,1567 +0,0 @@
1
- <?php
2
- $extensionManagerObj = new SGPBExtensionManager();
3
-
4
- $popupType = @sanitize_text_field($_GET['type']);
5
- if (!$popupType) {
6
- $popupType = 'html';
7
- }
8
- $popupCount = get_option('SGPBMaxOpenCount');
9
-
10
- //Get current paths for popup, for addons it different
11
- $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($popupType);
12
- //Get current form action, for addons it different
13
- $currentActionName = IntegrateExternalSettings::getCurrentPopupAdminPostActionName($popupType);
14
-
15
- $popupAppPath = $paths['app-path'];
16
- $popupFilesPath = $paths['files-path'];
17
-
18
- $popupName = "SG".ucfirst(strtolower($popupType));
19
- $popupClassName = $popupName."Popup";
20
- require_once($popupAppPath ."/classes/".$popupClassName.".php");
21
- $obj = new $popupClassName();
22
-
23
- global $removeOptions;
24
- $removeOptions = $obj->getRemoveOptions();
25
-
26
- if (isset($_GET['id'])) {
27
- $id = (int)$_GET['id'];
28
- $result = call_user_func(array($popupClassName, 'findById'), $id);
29
- if (!$result) {
30
- $redirectUrl = add_query_arg( array(
31
- 'type' => $popupType,
32
- ), SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup");
33
-
34
- wp_safe_redirect($redirectUrl);
35
- }
36
-
37
- switch ($popupType) {
38
- case 'iframe':
39
- $sgPopupDataIframe = $result->getUrl();
40
- break;
41
- case 'video':
42
- $sgPopupDataVideo = $result->getRealUrl();
43
- $sgVideoOptions = $result->getVideoOptions();
44
- break;
45
- case 'image':
46
- $sgPopupDataImage = $result->getUrl();
47
- break;
48
- case 'html':
49
- //We cannot escape this input because the data is raw HTML
50
- $sgPopupDataHtml = $result->getContent();
51
- break;
52
- case 'fblike':
53
- //We cannot escape this input because the data is raw HTML
54
- $sgPopupDataFblike = $result->getContent();
55
- $sgFlikeOptions = $result->getFblikeOptions();
56
- break;
57
- case 'shortcode':
58
- $sgPopupDataShortcode = $result->getShortcode();
59
- break;
60
- case 'ageRestriction':
61
- //We cannot escape this input because the data is raw HTML
62
- $sgPopupAgeRestriction = ($result->getContent());
63
- $sgYesButton = sgSafeStr($result->getYesButton());
64
- $sgNoButton = sgSafeStr($result->getNoButton());
65
- $sgRestrictionUrl = sgSafeStr($result->getRestrictionUrl());
66
- break;
67
- case 'countdown':
68
- $sgCoundownContent = $result->getCountdownContent();
69
- $countdownOptions = json_decode(sgSafeStr($result->getCountdownOptions()),true);
70
- $sgCountdownNumbersBgColor = $countdownOptions['countdownNumbersBgColor'];
71
- $sgCountdownNumbersTextColor = $countdownOptions['countdownNumbersTextColor'];
72
- $sgDueDate = $countdownOptions['sg-due-date'];
73
- @$sgGetCountdownType = $countdownOptions['sg-countdown-type'];
74
- $sgCountdownLang = $countdownOptions['counts-language'];
75
- @$sgCountdownPosition = $countdownOptions['coundown-position'];
76
- @$sgSelectedTimeZone = $countdownOptions['sg-time-zone'];
77
- @$sgCountdownAutoclose = $countdownOptions['countdown-autoclose'];
78
- break;
79
- case 'social':
80
- $sgSocialContent = ($result->getSocialContent());
81
- $sgSocialButtons = sgSafeStr($result->getButtons());
82
- $sgSocialOptions = sgSafeStr($result->getSocialOptions());
83
- break;
84
- case 'exitIntent':
85
- $sgExitIntentContent = $result->getContent();
86
- $exitIntentOptions = $result->getExitIntentOptions();
87
- break;
88
- case 'subscription':
89
- $sgSunbscriptionContent = $result->getContent();
90
- $subscriptionOptions = $result->getSubscriptionOptions();
91
- break;
92
- case 'contactForm':
93
- $params = $result->getParams();
94
- $sgContactFormContent = $result->getContent();
95
- break;
96
- }
97
-
98
- $title = $result->getTitle();
99
- $jsonData = json_decode($result->getOptions(), true);
100
- $sgEscKey = @$jsonData['escKey'];
101
- $sgScrolling = @$jsonData['scrolling'];
102
- $sgDisablePageScrolling = @$jsonData['disable-page-scrolling'];
103
- $sgScaling = @$jsonData['scaling'];
104
- $sgCloseButton = @$jsonData['closeButton'];
105
- $sgReposition = @$jsonData['reposition'];
106
- $sgOverlayClose = @$jsonData['overlayClose'];
107
- $sgReopenAfterSubmission = @$jsonData['reopenAfterSubmission'];
108
- $sgOverlayColor = @$jsonData['sgOverlayColor'];
109
- $sgContentBackgroundColor = @$jsonData['sg-content-background-color'];
110
- $sgContentClick = @$jsonData['contentClick'];
111
- $sgContentClickBehavior = @$jsonData['content-click-behavior'];
112
- $sgClickRedirectToUrl = @$jsonData['click-redirect-to-url'];
113
- $sgRedirectToNewTab = @$jsonData['redirect-to-new-tab'];
114
- $sgOpacity = @$jsonData['opacity'];
115
- $sgPopupBackgroundOpacity = @$jsonData['popup-background-opacity'];
116
- $sgPopupFixed = @$jsonData['popupFixed'];
117
- $sgFixedPostion = @$jsonData['fixedPostion'];
118
- $sgOnScrolling = @$jsonData['onScrolling'];
119
- $sgInActivityStatus = @$jsonData['inActivityStatus'];
120
- $sgInactivityTimout = @$jsonData['inactivity-timout'];
121
- $beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
122
- $duration = @$jsonData['duration'];
123
- $delay = @$jsonData['delay'];
124
-
125
- $sgCloseButtonDelay = @$jsonData['buttonDelayValue'];
126
- $sgTheme3BorderColor = @$jsonData['sgTheme3BorderColor'];
127
- $sgTheme3BorderRadius = @$jsonData['sgTheme3BorderRadius'];
128
- $sgThemeCloseText = @$jsonData['theme-close-text'];
129
- $effect =@$jsonData['effect'];
130
- $sgInitialWidth = @$jsonData['initialWidth'];
131
- $sgInitialHeight = @$jsonData['initialHeight'];
132
- $sgWidth = @$jsonData['width'];
133
- $sgHeight = @$jsonData['height'];
134
- $sgPopupDimensionMode = @$jsonData['popup-dimension-mode'];
135
- $sgPopupResponsiveDimensionMeasure = @$jsonData['popup-responsive-dimension-measure'];
136
- $sgMaxWidth = @$jsonData['maxWidth'];
137
- $sgMaxHeight = @$jsonData['maxHeight'];
138
- $sgForMobile = @$jsonData['forMobile'];
139
- $sgOpenOnMobile = @$jsonData['openMobile'];
140
- $sgAllPagesStatus = @$jsonData['allPagesStatus'];
141
- $sgAllPostsStatus = @$jsonData['allPostsStatus'];
142
- $sgAllCustomPostsStatus = @$jsonData['allCustomPostsStatus'];
143
- $sgPostsAllCategories = @$jsonData['posts-all-categories'];
144
- $sgRepeatPopup = @$jsonData['repeatPopup'];
145
- $sgRepetitivePopup = @$jsonData['repetitivePopup'];
146
- $sgPopupAppearNumberLimit = @$jsonData['popup-appear-number-limit'];
147
- $sgRepetitivePopupPeriod = @$jsonData['repetitivePopupPeriod'];
148
- $sgPopupCookiePageLevel = @$jsonData['save-cookie-page-level'];
149
- $sgDisablePopup = @$jsonData['disablePopup'];
150
- $sgDisablePopupOverlay = @$jsonData['disablePopupOverlay'];
151
- $sgPopupClosingTimer = @$jsonData['popupClosingTimer'];
152
- $sgAutoClosePopup = @$jsonData['autoClosePopup'];
153
- $sgRandomPopup = @$jsonData['randomPopup'];
154
- $sgPopupOpenSound = @$jsonData['popupOpenSound'];
155
- $sgPopupOpenSoundFile = @$jsonData['popupOpenSoundFile'];
156
- $sgPopupContentBgImage = @$jsonData['popupContentBgImage'];
157
- $sgPopupContentBgImageUrl = @$jsonData['popupContentBgImageUrl'];
158
- $sgPopupContentBackgroundSize = @$jsonData['popupContentBackgroundSize'];
159
- $sgPopupContentBackgroundRepeat = @$jsonData['popupContentBackgroundRepeat'];
160
- $sgCountryStatus = @$jsonData['countryStatus'];
161
- $sgAllSelectedPages = @$jsonData['allSelectedPages'];
162
- $sgAllSelectedCustomPosts = @$jsonData['allSelectedCustomPosts'];
163
- $sgAllPostStatus = @$jsonData['showAllPosts'];
164
- $sgAllSelectedPosts = @$jsonData['allSelectedPosts'];
165
- $sgAllowCountries = @$jsonData['allowCountries'];
166
- $sgAllPages = @$jsonData['showAllPages'];
167
- $sgAllPosts = @$jsonData['showAllPosts'];
168
- $sgAllCustomPosts = @$jsonData['showAllCustomPosts'];
169
- $sgAllCustomPostsType = @$jsonData['all-custom-posts'];
170
- $sgLogedUser = @$jsonData['loggedin-user'];
171
- $sgUserSeperate = @$jsonData['sg-user-status'];
172
- $sgCountryName = @$jsonData['countryName'];
173
- $sgCountryIso = @$jsonData['countryIso'];
174
- $sgPopupTimerStatus = @$jsonData['popup-timer-status'];
175
- $sgPopupScheduleStatus = @$jsonData['popup-schedule-status'];
176
- $sgPopupScheduleStartWeeks = @$jsonData['schedule-start-weeks'];
177
- $sgPopupScheduleStartTime = @$jsonData['schedule-start-time'];
178
- $sgPopupScheduleEndTime = @$jsonData['schedule-end-time'];
179
- $sgPopupFinishTimer = @$jsonData['popup-finish-timer'];
180
- $sgPopupStartTimer = @$jsonData['popup-start-timer'];
181
- $sgColorboxTheme = @$jsonData['theme'];
182
- $sgOverlayCustomClasss = @$jsonData['sgOverlayCustomClasss'];
183
- $sgContentCustomClasss = @$jsonData['sgContentCustomClasss'];
184
- $sgPopupZIndex = @$jsonData['popup-z-index'];
185
- $sgPopupContentPadding = @$jsonData['popup-content-padding'];
186
- $sgOnceExpiresTime = @$jsonData['onceExpiresTime'];
187
- $sgRestrictionAction = @$jsonData['restrictionAction'];
188
- $yesButtonBackgroundColor = @sgSafeStr($jsonData['yesButtonBackgroundColor']);
189
- $noButtonBackgroundColor = @sgSafeStr($jsonData['noButtonBackgroundColor']);
190
- $yesButtonTextColor = @sgSafeStr($jsonData['yesButtonTextColor']);
191
- $noButtonTextColor = @sgSafeStr($jsonData['noButtonTextColor']);
192
- $yesButtonRadius = @sgSafeStr($jsonData['yesButtonRadius']);
193
- $noButtonRadius = @sgSafeStr($jsonData['noButtonRadius']);
194
- $sgRestrictionExpirationTime = @sgSafeStr($jsonData['sgRestrictionExpirationTime']);
195
- $sgRestrictionCookeSavingLevel = @sgSafeStr($jsonData['restrictionCookeSavingLevel']);
196
- $sgSocialOptions = json_decode(@$sgSocialOptions,true);
197
- $sgShareUrl = $sgSocialOptions['sgShareUrl'];
198
- $shareUrlType = @sgSafeStr($sgSocialOptions['shareUrlType']);
199
- $fbShareLabel = @sgSafeStr($sgSocialOptions['fbShareLabel']);
200
- $lindkinLabel = @sgSafeStr($sgSocialOptions['lindkinLabel']);
201
- $googLelabel = @sgSafeStr($sgSocialOptions['googLelabel']);
202
- $twitterLabel = @sgSafeStr($sgSocialOptions['twitterLabel']);
203
- $pinterestLabel = @sgSafeStr($sgSocialOptions['pinterestLabel']);
204
- $sgMailSubject = @sgSafeStr($sgSocialOptions['sgMailSubject']);
205
- $sgMailLable = @sgSafeStr($sgSocialOptions['sgMailLable']);
206
- $sgSocialButtons = json_decode(@$sgSocialButtons,true);
207
- $sgTwitterStatus = @sgSafeStr($sgSocialButtons['sgTwitterStatus']);
208
- $sgFbStatus = @sgSafeStr($sgSocialButtons['sgFbStatus']);
209
- $sgEmailStatus = @sgSafeStr($sgSocialButtons['sgEmailStatus']);
210
- $sgLinkedinStatus = @sgSafeStr($sgSocialButtons['sgLinkedinStatus']);
211
- $sgGoogleStatus = @sgSafeStr($sgSocialButtons['sgGoogleStatus']);
212
- $sgPinterestStatus = @sgSafeStr($sgSocialButtons['sgPinterestStatus']);
213
- $sgSocialTheme = @sgSafeStr($sgSocialOptions['sgSocialTheme']);
214
- $sgSocialButtonsSize = @sgSafeStr($sgSocialOptions['sgSocialButtonsSize']);
215
- $sgSocialLabel = @sgSafeStr($sgSocialOptions['sgSocialLabel']);
216
- $sgSocialShareCount = @sgSafeStr($sgSocialOptions['sgSocialShareCount']);
217
- $sgRoundButton = @sgSafeStr($sgSocialOptions['sgRoundButton']);
218
- $sgPushToBottom = @sgSafeStr($jsonData['pushToBottom']);
219
- $exitIntentOptions = json_decode(@$exitIntentOptions, true);
220
- $sgExitIntentTpype = @$exitIntentOptions['exit-intent-type'];
221
- $sgExitIntntExpire = @$exitIntentOptions['exit-intent-expire-time'];
222
- $sgExitIntentAlert = @$exitIntentOptions['exit-intent-alert'];
223
- $sgVideoOptions = json_decode(@$sgVideoOptions, true);
224
- $sgVideoAutoplay = $sgVideoOptions['video-autoplay'];
225
- $sgFlikeOptions = json_decode(@$sgFlikeOptions, true);
226
- $sgFblikeurl = @$sgFlikeOptions['fblike-like-url'];
227
- $sgFbLikeLayout = @$sgFlikeOptions['fblike-layout'];
228
- $sgFblikeDontShowShareButton = @$sgFlikeOptions['fblike-dont-show-share-button'];
229
- $sgFblikeClosePopupAfterLike = @$sgFlikeOptions['fblike-close-popup-after-like'];
230
- $subscriptionOptions = json_decode(@$subscriptionOptions, true);
231
- $sgSubsFirstNameStatus = $subscriptionOptions['subs-first-name-status'];
232
- $sgSubsLastNameStatus = $subscriptionOptions['subs-last-name-status'];
233
- $sgSubscriptionEmail = @$subscriptionOptions['subscription-email'];
234
- $sgSubsFirstName = @$subscriptionOptions['subs-first-name'];
235
- $sgSubsLastName = @$subscriptionOptions['subs-last-name'];
236
- $sgSubsButtonBgColor = @$subscriptionOptions['subs-button-bgColor'];
237
- $sgSubsBtnWidth = @$subscriptionOptions['subs-btn-width'];
238
- $sgSubsBtnHeight = @$subscriptionOptions['subs-btn-height'];
239
- $sgSubsTextHeight = @$subscriptionOptions['subs-text-height'];
240
- $sgSubsBtnTitle = @$subscriptionOptions['subs-btn-title'];
241
- $sgSubsTextInputBgColor = @$subscriptionOptions['subs-text-input-bgColor'];
242
- $sgSubsTextBorderColor = @$subscriptionOptions['subs-text-borderColor'];
243
- $sgSubsTextWidth = @$subscriptionOptions['subs-text-width'];
244
- $sgSubsButtonColor = @$subscriptionOptions['subs-button-color'];
245
- $sgSubsInputsColor = @$subscriptionOptions['subs-inputs-color'];
246
- $sgSubsPlaceholderColor = @$subscriptionOptions['subs-placeholder-color'];
247
- $sgSubsValidateMessage = @$subscriptionOptions['subs-validation-message'];
248
- $sgSuccessMessage = @$subscriptionOptions['subs-success-message'];
249
- $sgSubsBtnProgressTitle = @$subscriptionOptions['subs-btn-progress-title'];
250
- $sgSubsTextBorderWidth = @$subscriptionOptions['subs-text-border-width'];
251
- $sgSubsSuccessBehavior = @$subscriptionOptions['subs-success-behavior'];
252
- $sgSubsSuccessRedirectUrl = @$subscriptionOptions['subs-success-redirect-url'];
253
- $sgSubsSuccessPopupsList = @$subscriptionOptions['subs-success-popups-list'];
254
- $sgSubsFirstNameRequired = @$subscriptionOptions['subs-first-name-required'];
255
- $sgSubsLastNameRequired = @$subscriptionOptions['subs-last-name-required'];
256
- $sgSubsSuccessRedirectNewTab = @$subscriptionOptions['subs-success-redirect-new-tab'];
257
- $contactFormOptions = json_decode(@$params, true);
258
- $sgContactNameLabel = @$contactFormOptions['contact-name'];
259
- $sgContactNameStatus = @$contactFormOptions['contact-name-status'];
260
- $sgShowFormToTop = @$contactFormOptions['show-form-to-top'];
261
- $sgContactNameRequired = @$contactFormOptions['contact-name-required'];
262
- $sgContactSubjectLabel = @$contactFormOptions['contact-subject'];
263
- $sgContactSubjectStatus = @$contactFormOptions['contact-subject-status'];
264
- $sgContactSubjectRequired = @$contactFormOptions['contact-subject-required'];
265
- $sgContactEmailLabel = @$contactFormOptions['contact-email'];
266
- $sgContactMessageLabel = @$contactFormOptions['contact-message'];
267
- $sgContactValidationMessage = @$contactFormOptions['contact-validation-message'];
268
- $sgContactSuccessMessage = @$contactFormOptions['contact-success-message'];
269
- $sgContactInputsWidth = @$contactFormOptions['contact-inputs-width'];
270
- $sgContactInputsHeight = @$contactFormOptions['contact-inputs-height'];
271
- $sgContactInputsBorderWidth = @$contactFormOptions['contact-inputs-border-width'];
272
- $sgContactTextInputBgcolor = @$contactFormOptions['contact-text-input-bgcolor'];
273
- $sgContactTextBordercolor = @$contactFormOptions['contact-text-bordercolor'];
274
- $sgContactInputsColor = @$contactFormOptions['contact-inputs-color'];
275
- $sgContactPlaceholderColor = @$contactFormOptions['contact-placeholder-color'];
276
- $sgContactBtnWidth = @$contactFormOptions['contact-btn-width'];
277
- $sgContactBtnHeight = @$contactFormOptions['contact-btn-height'];
278
- $sgContactBtnTitle = @$contactFormOptions['contact-btn-title'];
279
- $sgContactBtnProgressTitle = @$contactFormOptions['contact-btn-progress-title'];
280
- $sgContactButtonBgcolor = @$contactFormOptions['contact-button-bgcolor'];
281
- $sgContactButtonColor = @$contactFormOptions['contact-button-color'];
282
- $sgContactAreaWidth = @$contactFormOptions['contact-area-width'];
283
- $sgContactAreaHeight = @$contactFormOptions['contact-area-height'];
284
- $sgContactResize = @$contactFormOptions['sg-contact-resize'];
285
- $sgContactValidateEmail = @$contactFormOptions['contact-validate-email'];
286
- $sgContactResiveEmail = @$contactFormOptions['contact-receive-email'];
287
- $sgContactFailMessage = @$contactFormOptions['contact-fail-message'];
288
- $sgContactSuccessBehavior = @$contactFormOptions['contact-success-behavior'];
289
- $sgContactSuccessRedirectUrl = @$contactFormOptions['contact-success-redirect-url'];
290
- $sgContactSuccessPopupsList = @$contactFormOptions['contact-success-popups-list'];
291
- $sgDontShowContentToContactedUser = @$contactFormOptions['dont-show-content-to-contacted-user'];
292
- $sgContactSuccessFrequencyDays = @$contactFormOptions['contact-success-frequency-days'];
293
- $sgContactSuccessRedirectNewTab = @$contactFormOptions['contact-success-redirect-new-tab'];
294
- }
295
-
296
- $dataPopupId = @$id;
297
- /* For layze loading get selected data */
298
- if(!isset($id)) {
299
- $dataPopupId = "-1";
300
- }
301
-
302
- /* FREE options default values */
303
- $sgPopup = array(
304
- 'escKey'=> true,
305
- 'closeButton' => true,
306
- 'scrolling'=> true,
307
- 'disable-page-scrolling'=> true,
308
- 'scaling'=> false,
309
- 'opacity'=> 0.8,
310
- 'popup-background-opacity'=> 1,
311
- 'reposition' => true,
312
- 'width' => '640px',
313
- 'height' => '480px',
314
- 'popup-dimension-mode' => 'customMode',
315
- 'popup-responsive-dimension-measure' => 'auto',
316
- 'initialWidth' => '300',
317
- 'initialHeight' => '100',
318
- 'maxWidth' => false,
319
- 'maxHeight' => false,
320
- 'overlayClose' => true,
321
- 'reopenAfterSubmission' => false,
322
- 'contentClick'=>false,
323
- 'repetitivePopup' => false,
324
- 'fixed' => false,
325
- 'top' => false,
326
- 'right' => false,
327
- 'bottom' => false,
328
- 'left' => false,
329
- 'duration' => 1,
330
- 'delay' => 0,
331
- 'buttonDelayValue' => 0,
332
- 'theme-close-text' => 'Close',
333
- 'content-click-behavior' => 'close',
334
- 'sgTheme3BorderRadius' => 0,
335
- 'popup-z-index' => 9999,
336
- 'popup-content-padding' => 0,
337
- 'fblike-dont-show-share-button' => false,
338
- 'fblike-close-popup-after-like' => false
339
- );
340
-
341
- $popupProDefaultValues = array(
342
- 'closeType' => false,
343
- 'onScrolling' => false,
344
- 'inactivity-timout' => '0',
345
- 'inActivityStatus' => false,
346
- 'video-autoplay' => false,
347
- 'forMobile' => false,
348
- 'openMobile' => false,
349
- 'repetPopup' => false,
350
- 'disablePopup' => false,
351
- 'disablePopupOverlay' => false,
352
- 'redirect-to-new-tab' => true,
353
- 'autoClosePopup' => false,
354
- 'randomPopup' => false,
355
- 'popupOpenSound' => false,
356
- 'popupContentBgImage' => false,
357
- 'popupOpenSoundFile' => SG_APP_POPUP_URL.'/files/lib/popupOpenSound.wav',
358
- 'popupContentBgImageUrl' => '',
359
- 'popupContentBackgroundSize' => 'cover',
360
- 'popupContentBackgroundRepeat' => 'no-repeat',
361
- 'fbStatus' => true,
362
- 'twitterStatus' => true,
363
- 'emailStatus' => true,
364
- 'linkedinStatus' => true,
365
- 'googleStatus' => true,
366
- 'pinterestStatus' => true,
367
- 'sgSocialLabel'=>true,
368
- 'roundButtons'=>false,
369
- 'sgShareUrl' => '',
370
- 'pushToBottom' => true,
371
- 'allPages' => "all",
372
- 'allPosts' => "all",
373
- 'allCustomPosts' => "all",
374
- 'allPagesStatus' => false,
375
- 'allPostsStatus' => false,
376
- 'allCustomPostsStatus' => false,
377
- 'onceExpiresTime' => 7,
378
- 'popup-appear-number-limit' => 1,
379
- 'repetitivePopupPeriod' => 60,
380
- 'save-cookie-page-level' => false,
381
- 'overlay-custom-classs' => 'sg-popup-overlay',
382
- 'content-custom-classs' => 'sg-popup-content',
383
- 'countryStatus' => false,
384
- 'sg-user-status' => false,
385
- 'allowCountries' => 'allow',
386
- 'loggedin-user' => 'true',
387
- 'sgRestrictionExpirationTime' => 365,
388
- 'restrictionCookeSavingLevel' => '',
389
- 'countdownNumbersTextColor' => '',
390
- 'countdownNumbersBgColor' => '',
391
- 'countDownLang' => 'English',
392
- 'popup-timer-status' => false,
393
- 'popup-schedule-status' => false,
394
- 'countdown-position' => true,
395
- 'countdown-autoclose' => true,
396
- 'time-zone' => 'Etc/GMT',
397
- 'due-date' => date('Y-m-d H:i', strtotime(' +1 day')),
398
- 'popup-start-timer' => date('M d y H:i'),
399
- 'schedule-start-time' => date("H:i"),
400
- 'exit-intent-type' => "soft",
401
- 'exit-intent-expire-time' => '1',
402
- 'subs-first-name-status' => true,
403
- 'subs-last-name-status' => true,
404
- 'subscription-email' => 'Email *',
405
- 'subs-first-name' => 'First name',
406
- 'subs-last-name' => 'Last name',
407
- 'subs-button-bgColor' => '#239744',
408
- 'subs-button-color' => '#FFFFFF',
409
- 'subs-text-input-bgColor' => '#FFFFFF',
410
- 'subs-inputs-color' => '#000000',
411
- 'subs-placeholder-color' => '#CCCCCC',
412
- 'subs-text-borderColor' => '#CCCCCC',
413
- 'subs-btn-title' => 'Subscribe',
414
- 'subs-text-height' => '30px',
415
- 'subs-btn-height' => '30px',
416
- 'subs-text-width' => '200px',
417
- 'subs-btn-width' => '200px',
418
- 'subs-text-border-width' => '2px',
419
- 'subs-success-message' =>'You have successfully subscribed to the newsletter',
420
- 'subs-validation-message' => 'This field is required.',
421
- 'subs-btn-progress-title' => 'Please wait...',
422
- 'subs-success-behavior' => 'showMessage',
423
- 'subs-success-redirect-url' => '',
424
- 'subs-success-popups-list' => '',
425
- 'subs-first-name-required' => '',
426
- 'subs-last-name-required' => '',
427
- 'subs-success-redirect-new-tab' => false,
428
- 'contact-name' => 'Name *',
429
- 'contact-name-required' => true,
430
- 'contact-name-status' => true,
431
- 'show-form-to-top' => false,
432
- 'contact-subject-status' => true,
433
- 'contact-subject-required' => true,
434
- 'contact-email' => 'E-mail *',
435
- 'contact-message' => 'Message *',
436
- 'contact-subject' => 'Subject *',
437
- 'contact-success-message' => 'Your message has been successfully sent.',
438
- 'contact-btn-title' => 'Contact',
439
- 'contact-validate-email' => 'Please enter a valid email.',
440
- 'contact-receive-email' => get_option('admin_email'),
441
- 'contact-fail-message' => 'Unable to send.',
442
- 'contact-success-behavior' => 'showMessage',
443
- 'contact-success-redirect-url' => '',
444
- 'contact-success-popups-list' => 0,
445
- 'dont-show-content-to-contacted-user' => '',
446
- 'contact-success-frequency-days' => 365,
447
- 'contact-success-redirect-new-tab' => false
448
- );
449
-
450
- $escKey = sgBoolToChecked($sgPopup['escKey']);
451
- $closeButton = sgBoolToChecked($sgPopup['closeButton']);
452
- $scrolling = sgBoolToChecked($sgPopup['scrolling']);
453
- $disablePageScrolling = sgBoolToChecked($sgPopup['disable-page-scrolling']);
454
- $scaling = sgBoolToChecked($sgPopup['scaling']);
455
- $reposition = sgBoolToChecked($sgPopup['reposition']);
456
- $overlayClose = sgBoolToChecked($sgPopup['overlayClose']);
457
- $reopenAfterSubmission = sgBoolToChecked($sgPopup['reopenAfterSubmission']);
458
- $contentClick = sgBoolToChecked($sgPopup['contentClick']);
459
- $repetitivePopup = sgBoolToChecked($sgPopup['repetitivePopup']);
460
- $fblikeDontShowShareButton = sgBoolToChecked($sgPopup['fblike-dont-show-share-button']);
461
- $fblikeClosePopupAfterLike = sgBoolToChecked($sgPopup['fblike-close-popup-after-like']);
462
-
463
- $buttonDelayValue = $sgPopup['buttonDelayValue'];
464
- $contentClickBehavior = $sgPopup['content-click-behavior'];
465
- $theme3BorderRadius = $sgPopup['sgTheme3BorderRadius'];
466
- $popupZIndex = $sgPopup['popup-z-index'];
467
- $popupContentPadding = $sgPopup['popup-content-padding'];
468
-
469
- $closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
470
- $onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
471
- $inActivityStatus = sgBoolToChecked($popupProDefaultValues['inActivityStatus']);
472
- $userSeperate = sgBoolToChecked($popupProDefaultValues['sg-user-status']);
473
- $forMobile = sgBoolToChecked($popupProDefaultValues['forMobile']);
474
- $openMobile = sgBoolToChecked($popupProDefaultValues['openMobile']);
475
- $popupTimerStatus = sgBoolToChecked($popupProDefaultValues['popup-timer-status']);
476
- $popupScheduleStatus = sgBoolToChecked($popupProDefaultValues['popup-schedule-status']);
477
- $repetPopup = sgBoolToChecked($popupProDefaultValues['repetPopup']);
478
- $disablePopup = sgBoolToChecked($popupProDefaultValues['disablePopup']);
479
- $disablePopupOverlay = sgBoolToChecked($popupProDefaultValues['disablePopupOverlay']);
480
- $autoClosePopup = sgBoolToChecked($popupProDefaultValues['autoClosePopup']);
481
- $randomPopup = sgBoolToChecked($popupProDefaultValues['randomPopup']);
482
- $popupOpenSound = sgBoolToChecked($popupProDefaultValues['popupOpenSound']);
483
- $popupContentBgImage = sgBoolToChecked($popupProDefaultValues['popupContentBgImage']);
484
- $fbStatus = sgBoolToChecked($popupProDefaultValues['fbStatus']);
485
- $twitterStatus = sgBoolToChecked($popupProDefaultValues['twitterStatus']);
486
- $emailStatus = sgBoolToChecked($popupProDefaultValues['emailStatus']);
487
- $linkedinStatus = sgBoolToChecked($popupProDefaultValues['linkedinStatus']);
488
- $googleStatus = sgBoolToChecked($popupProDefaultValues['googleStatus']);
489
- $pinterestStatus = sgBoolToChecked($popupProDefaultValues['pinterestStatus']);
490
- $socialLabel = sgBoolToChecked($popupProDefaultValues['sgSocialLabel']);
491
- $roundButtons = sgBoolToChecked($popupProDefaultValues['roundButtons']);
492
- $countdownAutoclose = sgBoolToChecked($popupProDefaultValues['countdown-autoclose']);
493
- $shareUrl = $popupProDefaultValues['sgShareUrl'];
494
- $pushToBottom = sgBoolToChecked($popupProDefaultValues['pushToBottom']);
495
- $allPages = $popupProDefaultValues['allPages'];
496
- $allPosts = $popupProDefaultValues['allPosts'];
497
- $allCustomPosts = $popupProDefaultValues['allCustomPosts'];
498
- $allPagesStatus = sgBoolToChecked($popupProDefaultValues['allPagesStatus']);
499
- $allPostsStatus = sgBoolToChecked($popupProDefaultValues['allPostsStatus']);
500
- $allCustomPostsStatus = sgBoolToChecked($popupProDefaultValues['allCustomPostsStatus']);
501
- $contactNameStatus = sgBoolToChecked($popupProDefaultValues['contact-name-status']);
502
- $showFormToTop = sgBoolToChecked($popupProDefaultValues['show-form-to-top']);
503
- $subsSuccessRedirectNewTab = sgBoolToChecked($popupProDefaultValues['subs-success-redirect-new-tab']);
504
- $contactNameRequired = sgBoolToChecked($popupProDefaultValues['contact-name-required']);
505
- $contactSubjectStatus = sgBoolToChecked($popupProDefaultValues['contact-subject-status']);
506
- $contactSubjectRequired = sgBoolToChecked($popupProDefaultValues['contact-subject-required']);
507
- $saveCookiePageLevel = sgBoolToChecked($popupProDefaultValues['save-cookie-page-level']);
508
- $onceExpiresTime = $popupProDefaultValues['onceExpiresTime'];
509
- $popupAppearNumberLimit = $popupProDefaultValues['popup-appear-number-limit'];
510
- $repetitivePopupPeriod = $popupProDefaultValues['repetitivePopupPeriod'];
511
- $countryStatus = sgBoolToChecked($popupProDefaultValues['countryStatus']);
512
- $allowCountries = $popupProDefaultValues['allowCountries'];
513
- $logedUser = $popupProDefaultValues['loggedin-user'];
514
- $restrictionExpirationTime = $popupProDefaultValues['sgRestrictionExpirationTime'];
515
- $restrictionCookeSavingLevel = sgBoolToChecked($popupProDefaultValues['restrictionCookeSavingLevel']);
516
- $countdownNumbersTextColor = $popupProDefaultValues['countdownNumbersTextColor'];
517
- $countdownNumbersBgColor = $popupProDefaultValues['countdownNumbersBgColor'];
518
- $countdownLang = $popupProDefaultValues['countDownLang'];
519
- $countdownPosition = $popupProDefaultValues['countdown-position'];
520
- $timeZone = $popupProDefaultValues['time-zone'];
521
- $dueDate = $popupProDefaultValues['due-date'];
522
- $popupStartTimer = $popupProDefaultValues['popup-start-timer'];
523
- $scheduleStartTime = $popupProDefaultValues['schedule-start-time'];
524
- $inactivityTimout = $popupProDefaultValues['inactivity-timout'];
525
- $exitIntentType = $popupProDefaultValues['exit-intent-type'];
526
- $exitIntentExpireTime = $popupProDefaultValues['exit-intent-expire-time'];
527
- $subsFirstNameStatus = sgBoolToChecked($popupProDefaultValues['subs-first-name-status']);
528
- $subsLastNameStatus = sgBoolToChecked($popupProDefaultValues['subs-last-name-status']);
529
- $subscriptionEmail = $popupProDefaultValues['subscription-email'];
530
- $subsFirstName = $popupProDefaultValues['subs-first-name'];
531
- $subsLastName = $popupProDefaultValues['subs-last-name'];
532
- $subsButtonBgColor = $popupProDefaultValues['subs-button-bgColor'];
533
- $subsButtonColor = $popupProDefaultValues['subs-button-color'];
534
- $subsInputsColor = $popupProDefaultValues['subs-inputs-color'];
535
- $subsBtnTitle = $popupProDefaultValues['subs-btn-title'];
536
- $subsPlaceholderColor = $popupProDefaultValues['subs-placeholder-color'];
537
- $subsTextHeight = $popupProDefaultValues['subs-text-height'];
538
- $subsBtnHeight = $popupProDefaultValues['subs-btn-height'];
539
- $subsSuccessMessage = $popupProDefaultValues['subs-success-message'];
540
- $subsValidationMessage = $popupProDefaultValues['subs-validation-message'];
541
- $subsTextWidth = $popupProDefaultValues['subs-text-width'];
542
- $subsBtnWidth = $popupProDefaultValues['subs-btn-width'];
543
- $subsBtnProgressTitle = $popupProDefaultValues['subs-btn-progress-title'];
544
- $subsTextBorderWidth = $popupProDefaultValues['subs-text-border-width'];
545
- $subsTextBorderColor = $popupProDefaultValues['subs-text-borderColor'];
546
- $subsTextInputBgColor = $popupProDefaultValues['subs-text-input-bgColor'];
547
- $subsSuccessBehavior = $popupProDefaultValues['subs-success-behavior'];
548
- $subsSuccessPopupsList = $popupProDefaultValues['subs-success-popups-list'];
549
- $subsSuccessRedirectUrl = $popupProDefaultValues['subs-success-redirect-url'];
550
- $subsFirstNameRequired = $popupProDefaultValues['subs-first-name-required'];
551
- $subsLastNameRequired = $popupProDefaultValues['subs-last-name-required'];
552
- $contactName = $popupProDefaultValues['contact-name'];
553
- $contactEmail = $popupProDefaultValues['contact-email'];
554
- $contactMessage = $popupProDefaultValues['contact-message'];
555
- $contactSubject = $popupProDefaultValues['contact-subject'];
556
- $contactSuccessMessage = $popupProDefaultValues['contact-success-message'];
557
- $contactBtnTitle = $popupProDefaultValues['contact-btn-title'];
558
- $contactValidateEmail = $popupProDefaultValues['contact-validate-email'];
559
- $contactResiveEmail = $popupProDefaultValues['contact-receive-email'];
560
- $contactFailMessage = $popupProDefaultValues['contact-fail-message'];
561
- $overlayCustomClasss = $popupProDefaultValues['overlay-custom-classs'];
562
- $contentCustomClasss = $popupProDefaultValues['content-custom-classs'];
563
- $contactSuccessBehavior = $popupProDefaultValues['contact-success-behavior'];
564
- $contactSuccessRedirectUrl = $popupProDefaultValues['contact-success-redirect-url'];
565
- $contactSuccessPopupsList = $popupProDefaultValues['contact-success-popups-list'];
566
- $redirectToNewTab = $popupProDefaultValues['redirect-to-new-tab'];
567
- $dontShowContentToContactedUser = sgBoolToChecked($popupProDefaultValues['dont-show-content-to-contacted-user']);
568
- $contactSuccessFrequencyDays = $popupProDefaultValues['contact-success-frequency-days'];
569
- $contactSuccessRedirectNewTab = $popupProDefaultValues['contact-success-redirect-new-tab'];
570
- $popupOpenSoundFile = $popupProDefaultValues['popupOpenSoundFile'];
571
- $popupContentBgImageUrl = $popupProDefaultValues['popupContentBgImageUrl'];
572
- $popupContentBackgroundSize = $popupProDefaultValues['popupContentBackgroundSize'];
573
- $popupContentBackgroundRepeat = $popupProDefaultValues['popupContentBackgroundRepeat'];
574
-
575
- function sgBoolToChecked($var)
576
- {
577
- return ($var?'checked':'');
578
- }
579
-
580
- function sgRemoveOption($option)
581
- {
582
- global $removeOptions;
583
- return isset($removeOptions[$option]);
584
- }
585
-
586
- $width = $sgPopup['width'];
587
- $height = $sgPopup['height'];
588
- $popupDimensionMode = $sgPopup['popup-dimension-mode'];
589
- $popupResponsiveDimensionMeasure = $sgPopup['popup-responsive-dimension-measure'];
590
- $opacityValue = $sgPopup['opacity'];
591
- $popupBackgroundOpacity = $sgPopup['popup-background-opacity'];
592
- $top = $sgPopup['top'];
593
- $right = $sgPopup['right'];
594
- $bottom = $sgPopup['bottom'];
595
- $left = $sgPopup['left'];
596
- $initialWidth = $sgPopup['initialWidth'];
597
- $initialHeight = $sgPopup['initialHeight'];
598
- $maxWidth = $sgPopup['maxWidth'];
599
- $maxHeight = $sgPopup['maxHeight'];
600
- $deafultFixed = $sgPopup['fixed'];
601
- $defaultDuration = $sgPopup['duration'];
602
- $defaultDelay = $sgPopup['delay'];
603
- $defaultButtonDelayValue = $sgPopup['buttonDelayValue'];
604
- $themeCloseText = $sgPopup['theme-close-text'];
605
-
606
- $sgCloseButton = @sgSetChecked($sgCloseButton, $closeButton);
607
- $sgEscKey = @sgSetChecked($sgEscKey, $escKey);
608
- $sgContentClick = @sgSetChecked($sgContentClick, $contentClick);
609
- $sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
610
- $sgReopenAfterSubmission = @sgSetChecked($sgReopenAfterSubmission, $reopenAfterSubmission);
611
- $sgReposition = @sgSetChecked($sgReposition, $reposition);
612
- $sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
613
- $sgDisablePageScrolling = @sgSetChecked($sgDisablePageScrolling, $disablePageScrolling);
614
- $sgScaling = @sgSetChecked($sgScaling, $scaling);
615
- $sgCountdownAutoclose = @sgSetChecked($sgCountdownAutoclose, $countdownAutoclose);
616
- $sgFblikeDontShowShareButton = @sgSetChecked($sgFblikeDontShowShareButton, $fblikeDontShowShareButton);
617
- $sgFblikeClosePopupAfterLike = @sgSetChecked($sgFblikeClosePopupAfterLike, $fblikeClosePopupAfterLike);
618
-
619
- $sgCloseType = @sgSetChecked($sgCloseType, $closeType);
620
- $sgOnScrolling = @sgSetChecked($sgOnScrolling, $onScrolling);
621
- $sgInActivityStatus = @sgSetChecked($sgInActivityStatus, $inActivityStatus);
622
- $sgForMobile = @sgSetChecked($sgForMobile, $forMobile);
623
- $sgOpenOnMobile = @sgSetChecked($sgOpenOnMobile, $openMobile);
624
- $sgPopupCookiePageLevel = @sgSetChecked($sgPopupCookiePageLevel, $saveCookiePageLevel);
625
- $sgUserSeperate = @sgSetChecked($sgUserSeperate, $userSeperate);
626
- $sgPopupTimerStatus = @sgSetChecked($sgPopupTimerStatus, $popupTimerStatus);
627
- $sgPopupScheduleStatus = @sgSetChecked($sgPopupScheduleStatus, $popupScheduleStatus);
628
- $sgRepeatPopup = @sgSetChecked($sgRepeatPopup, $repetPopup);
629
- $sgRepetitivePopup = @sgSetChecked($sgRepetitivePopup, $repetitivePopup);
630
- $sgDisablePopup = @sgSetChecked($sgDisablePopup, $disablePopup);
631
- $sgDisablePopupOverlay = @sgSetChecked($sgDisablePopupOverlay, $disablePopupOverlay);
632
- $sgAutoClosePopup = @sgSetChecked($sgAutoClosePopup, $autoClosePopup);
633
- $sgRandomPopup = @sgSetChecked($sgRandomPopup, $randomPopup);
634
- $sgPopupOpenSound = @sgSetChecked($sgPopupOpenSound, $popupOpenSound);
635
- $sgPopupContentBgImage = @sgSetChecked($sgPopupContentBgImage, $popupContentBgImage);
636
- $sgFbStatus = @sgSetChecked($sgFbStatus, $fbStatus);
637
- $sgTwitterStatus = @sgSetChecked($sgTwitterStatus, $twitterStatus);
638
- $sgEmailStatus = @sgSetChecked($sgEmailStatus, $emailStatus);
639
- $sgLinkedinStatus = @sgSetChecked($sgLinkedinStatus, $linkedinStatus);
640
- $sgGoogleStatus = @sgSetChecked($sgGoogleStatus, $googleStatus);
641
- $sgPinterestStatus = @sgSetChecked($sgPinterestStatus, $pinterestStatus);
642
- $sgRoundButtons = @sgSetChecked($sgRoundButton, $roundButtons);
643
- $sgSocialLabel = @sgSetChecked($sgSocialLabel, $socialLabel);
644
- $sgPopupFixed = @sgSetChecked($sgPopupFixed, $deafultFixed);
645
- $sgPushToBottom = @sgSetChecked($sgPushToBottom, $pushToBottom);
646
- $sgRestrictionCookeSavingLevel = @sgSetChecked($sgRestrictionCookeSavingLevel, $restrictionCookeSavingLevel);
647
- $sgSubsFirstNameRequired = @sgSetChecked($sgSubsFirstNameRequired, $subsFirstNameRequired);
648
- $sgSubsLastNameRequired = @sgSetChecked($sgSubsLastNameRequired, $subsLastNameRequired);
649
- $sgSubsSuccessRedirectNewTab = @sgSetChecked($sgSubsSuccessRedirectNewTab, $subsSuccessRedirectNewTab);
650
- $sgContactSuccessRedirectNewTab = @sgSetChecked($sgContactSuccessRedirectNewTab, $contactSuccessRedirectNewTab);
651
-
652
- $sgAllPagesStatus = @sgSetChecked($sgAllPagesStatus, $allPagesStatus);
653
- $sgAllPostsStatus = @sgSetChecked($sgAllPostsStatus, $allPostsStatus);
654
- $sgAllCustomPostsStatus = @sgSetChecked($sgAllCustomPostsStatus, $allCustomPostsStatus);
655
- $sgCountdownPosition = @sgSetChecked($sgCountdownPosition, $countdownPosition);
656
- $sgVideoAutoplay = @sgSetChecked($sgVideoAutoplay, $videoAutoplay);
657
- $sgSubsLastNameStatus = @sgSetChecked($sgSubsLastNameStatus, $subsLastNameStatus);
658
- $sgSubsFirstNameStatus = @sgSetChecked($sgSubsFirstNameStatus, $subsFirstNameStatus);
659
- $sgCountryStatus = @sgSetChecked($sgCountryStatus, $countryStatus);
660
- /* Contact popup otions */
661
- $sgContactNameStatus = @sgSetChecked($sgContactNameStatus, $contactNameStatus);
662
- $sgContactNameRequired = @sgSetChecked($sgContactNameRequired, $contactNameRequired);
663
- $sgContactSubjectStatus = @sgSetChecked($sgContactSubjectStatus, $contactSubjectStatus);
664
- $sgContactSubjectRequired = @sgSetChecked($sgContactSubjectRequired, $contactSubjectRequired);
665
- $sgShowFormToTop = @sgSetChecked($sgShowFormToTop, $showFormToTop);
666
- $sgRedirectToNewTab = @sgSetChecked($sgRedirectToNewTab, $redirectToNewTab);
667
- $sgDontShowContentToContactedUser = @sgSetChecked($sgDontShowContentToContactedUser, $dontShowContentToContactedUser);
668
-
669
- function sgSetChecked($optionsParam,$defaultOption)
670
- {
671
- if (isset($optionsParam)) {
672
- if ($optionsParam == '') {
673
- return '';
674
- }
675
- else {
676
- return 'checked';
677
- }
678
- }
679
- else {
680
- return $defaultOption;
681
- }
682
- }
683
-
684
- $sgTheme3BorderRadius = @sgGetValue($sgTheme3BorderRadius, $theme3BorderRadius);
685
- $sgPopupOpenSoundFile = @sgGetValue($sgPopupOpenSoundFile, $popupOpenSoundFile);
686
- $sgPopupContentBackgroundSize = @sgGetValue($sgPopupContentBackgroundSize, $popupContentBackgroundSize);
687
- $sgPopupContentBackgroundRepeat = @sgGetValue($sgPopupContentBackgroundRepeat, $popupContentBackgroundRepeat);
688
- $sgPopupContentBgImageUrl = @sgGetValue($sgPopupContentBgImageUrl, $popupContentBgImageUrl);
689
- $sgOpacity = @sgGetValue($sgOpacity, $opacityValue);
690
- $sgPopupBackgroundOpacity = @sgGetValue($sgPopupBackgroundOpacity, $popupBackgroundOpacity);
691
- $sgWidth = @sgGetValue($sgWidth, $width);
692
- $sgHeight = @sgGetValue($sgHeight, $height);
693
- $sgPopupZIndex = @sgGetValue($sgPopupZIndex, $popupZIndex);
694
- $sgPopupContentPadding = @sgGetValue($sgPopupContentPadding, $popupContentPadding);
695
- $sgPopupDimensionMode = @sgGetValue($sgPopupDimensionMode, $popupDimensionMode);
696
- $sgPopupResponsiveDimensionMeasure = @sgGetValue($sgPopupResponsiveDimensionMeasure, $popupResponsiveDimensionMeasure);
697
- $sgInitialWidth = @sgGetValue($sgInitialWidth, $initialWidth);
698
- $sgInitialHeight = @sgGetValue($sgInitialHeight, $initialHeight);
699
- $sgMaxWidth = @sgGetValue($sgMaxWidth, $maxWidth);
700
- $sgMaxHeight = @sgGetValue($sgMaxHeight, $maxHeight);
701
- $sgThemeCloseText = @sgGetValue($sgThemeCloseText, $themeCloseText);
702
- $duration = @sgGetValue($duration, $defaultDuration);
703
- $sgOnceExpiresTime = @sgGetValue($sgOnceExpiresTime, $onceExpiresTime);
704
- $sgPopupAppearNumberLimit = @sgGetValue($sgPopupAppearNumberLimit, $popupAppearNumberLimit);
705
- $sgRepetitivePopupPeriod = @sgGetValue($sgRepetitivePopupPeriod, $repetitivePopupPeriod);
706
- $delay = @sgGetValue($delay, $defaultDelay);
707
- $sgCloseButtonDelay = @sgGetValue($sgCloseButtonDelay, $buttonDelayValue);
708
-
709
- $sgInactivityTimout = @sgGetValue($sgInactivityTimout, $inactivityTimout);
710
- $sgContentClickBehavior = @sgGetValue($sgContentClickBehavior, $contentClickBehavior);
711
- $sgPopupStartTimer = @sgGetValue($sgPopupStartTimer, $popupStartTimer);
712
- $sgPopupFinishTimer = @sgGetValue($sgPopupFinishTimer, '');
713
- $sgPopupScheduleStartTime = @sgGetValue($sgPopupScheduleStartTime, $scheduleStartTime);
714
- $sgPopupDataIframe = @sgGetValue($sgPopupDataIframe, '');
715
- $sgShareUrl = @sgGetValue($sgShareUrl, $shareUrl);
716
- $sgPopupDataHtml = @sgGetValue($sgPopupDataHtml, '');
717
- $sgPopupDataImage = @sgGetValue($sgPopupDataImage, '');
718
- $sgAllowCountries = @sgGetValue($sgAllowCountries, $allowCountries);
719
- $sgAllPages = @sgGetValue($sgAllPages, $allPages);
720
- $sgAllPosts = @sgGetValue($sgAllPosts, $allPosts);
721
- $sgAllCustomPosts = @sgGetValue($sgAllCustomPosts, $allCustomPosts);
722
- $sgLogedUser = @sgGetValue($sgLogedUser, $logedUser);
723
- $sgRestrictionExpirationTime = @sgGetValue($sgRestrictionExpirationTime, $restrictionExpirationTime);
724
- $sgCountdownNumbersTextColor = @sgGetValue($sgCountdownNumbersTextColor, $countdownNumbersTextColor);
725
- $sgCountdownNumbersBgColor = @sgGetValue($sgCountdownNumbersBgColor, $countdownNumbersBgColor);
726
- $sgCountdownLang = @sgGetValue($sgCountdownLang, $countdownLang);
727
- $sgSelectedTimeZone = @sgGetValue($sgSelectedTimeZone, $timeZone);
728
- $sgDueDate = @sgGetValue($sgDueDate, $dueDate);
729
- $sgExitIntentTpype = @sgGetValue($sgExitIntentTpype, $exitIntentType);
730
- $sgExitIntntExpire = @sgGetValue($sgExitIntntExpire, $exitIntentExpireTime);
731
- $sgSubsTextWidth = @sgGetValue($sgSubsTextWidth, $subsTextWidth);
732
- $sgSubsBtnWidth = @sgGetValue($sgSubsBtnWidth, $subsBtnWidth);
733
- $sgSubsTextInputBgColor = @sgGetValue($sgSubsTextInputBgColor, $subsTextInputBgColor);
734
- $sgSubsButtonBgColor = @sgGetValue($sgSubsButtonBgColor, $subsButtonBgColor);
735
- $sgSubsTextBorderColor = @sgGetValue($sgSubsTextBorderColor, $subsTextBorderColor);
736
- $sgSubscriptionEmail = @sgGetValue($sgSubscriptionEmail, $subscriptionEmail);
737
- $sgSubsFirstName = @sgGetValue($sgSubsFirstName, $subsFirstName);
738
- $sgSubsLastName = @sgGetValue($sgSubsLastName, $subsLastName);
739
- $sgSubsButtonColor = @sgGetValue($sgSubsButtonColor, $subsButtonColor);
740
- $sgSubsInputsColor = @sgGetValue($sgSubsInputsColor, $subsInputsColor);
741
- $sgSubsBtnTitle = @sgGetValue($sgSubsBtnTitle, $subsBtnTitle);
742
- $sgSubsPlaceholderColor = @sgGetValue($sgSubsPlaceholderColor, $subsPlaceholderColor);
743
- $sgSubsTextHeight = @sgGetValue($sgSubsTextHeight, $subsTextHeight);
744
- $sgSubsBtnHeight = @sgGetValue($sgSubsBtnHeight, $subsBtnHeight);
745
- $sgSuccessMessage = @sgGetValue($sgSuccessMessage, $subsSuccessMessage);
746
- $sgSubsValidateMessage = @sgGetValue($sgSubsValidateMessage, $subsValidationMessage);
747
- $sgSubsBtnProgressTitle = @sgGetValue($sgSubsBtnProgressTitle, $subsBtnProgressTitle);
748
- $sgSubsTextBorderWidth = @sgGetValue($sgSubsTextBorderWidth, $subsTextBorderWidth);
749
- $sgSubsSuccessBehavior = @sgGetValue($sgSubsSuccessBehavior, $subsSuccessBehavior);
750
- $sgSubsSuccessRedirectUrl = @sgGetValue($sgSubsSuccessRedirectUrl, $subsSuccessRedirectUrl);
751
- $sgSubsSuccessPopupsList = @sgGetValue($sgSubsSuccessPopupsList, $subsSuccessPopupsList);
752
- $sgContactNameLabel = @sgGetValue($sgContactNameLabel, $contactName);
753
- $sgContactSubjectLabel = @sgGetValue($sgContactSubjectLabel, $contactSubject);
754
- $sgContactEmailLabel = @sgGetValue($sgContactEmailLabel, $contactEmail);
755
- $sgContactMessageLabel = @sgGetValue($sgContactMessageLabel, $contactMessage);
756
- $sgContactValidationMessage = @sgGetValue($sgContactValidationMessage, $subsValidationMessage);
757
- $sgContactSuccessMessage = @sgGetValue($sgContactSuccessMessage, $contactSuccessMessage);
758
- $sgContactInputsWidth = @sgGetValue($sgContactInputsWidth, $subsTextWidth);
759
- $sgContactInputsHeight = @sgGetValue($sgContactInputsHeight, $subsTextHeight);
760
- $sgContactInputsBorderWidth = @sgGetValue($sgContactInputsBorderWidth, $subsTextBorderWidth);
761
- $sgContactTextInputBgcolor = @sgGetValue($sgContactTextInputBgcolor, $subsTextInputBgColor);
762
- $sgContactTextBordercolor = @sgGetValue($sgContactTextBordercolor, $subsTextBorderColor);
763
- $sgContactInputsColor = @sgGetValue($sgContactInputsColor, $subsInputsColor);
764
- $sgContactPlaceholderColor = @sgGetValue($sgContactPlaceholderColor, $subsPlaceholderColor);
765
- $sgContactBtnWidth = @sgGetValue($sgContactBtnWidth, $subsBtnWidth);
766
- $sgContactBtnHeight = @sgGetValue($sgContactBtnHeight, $subsBtnHeight);
767
- $sgContactBtnTitle = @sgGetValue($sgContactBtnTitle, $contactBtnTitle);
768
- $sgContactBtnProgressTitle = @sgGetValue($sgContactBtnProgressTitle, $subsBtnProgressTitle);
769
- $sgContactButtonBgcolor = @sgGetValue($sgContactButtonBgcolor, $subsButtonBgColor);
770
- $sgContactButtonColor = @sgGetValue($sgContactButtonColor, $subsButtonColor);
771
- $sgContactAreaWidth = @sgGetValue($sgContactAreaWidth, $subsTextWidth);
772
- $sgContactAreaHeight = @sgGetValue($sgContactAreaHeight, '');
773
- $sgContactValidateEmail = @sgGetValue($sgContactValidateEmail, $contactValidateEmail);
774
- $sgContactResiveEmail = @sgGetValue($sgContactResiveEmail, $contactResiveEmail);
775
- $sgContactFailMessage = @sgGetValue($sgContactFailMessage, $contactFailMessage);
776
- $sgOverlayCustomClasss = @sgGetValue($sgOverlayCustomClasss, $overlayCustomClasss);
777
- $sgContentCustomClasss = @sgGetValue($sgContentCustomClasss, $contentCustomClasss);
778
- $sgContactSuccessBehavior = @sgGetValue($sgContactSuccessBehavior, $contactSuccessBehavior);
779
- $sgContactSuccessRedirectUrl = @sgGetValue($sgContactSuccessRedirectUrl, $contactSuccessRedirectUrl);
780
- $sgContactSuccessPopupsList = @sgGetValue($sgContactSuccessPopupsList, $contactSuccessPopupsList);
781
- $sgContactSuccessFrequencyDays = @sgGetValue($sgContactSuccessFrequencyDays, $contactSuccessFrequencyDays);
782
- $sgAllSelectedPages = @sgGetValue($sgAllSelectedPages, array());
783
- $sgAllSelectedPosts = @sgGetValue($sgAllSelectedPosts, array());
784
- $sgAllSelectedCustomPosts = @sgGetValue($sgAllSelectedCustomPosts, array());
785
-
786
- function sgGetValue($getedVal,$defValue)
787
- {
788
- if (!isset($getedVal)) {
789
- return $defValue;
790
- }
791
- else {
792
- return $getedVal;
793
- }
794
- }
795
-
796
- $radioElements = array(
797
- array(
798
- 'name'=>'shareUrlType',
799
- 'value'=>'activeUrl',
800
- 'additionalHtml'=>''.'<span>'.'Use active URL'.'</span></span>
801
- <span class="span-width-static"></span><span class="dashicons dashicons-info scrollingImg sameImageStyle sg-active-url"></span><span class="info-active-url samefontStyle">If this option is active Share URL will be current page URL.</span>'
802
- ),
803
- array(
804
- 'name'=>'shareUrlType',
805
- 'value'=>'shareUrl',
806
- 'additionalHtml'=>''.'<span>'.'Share url'.'</span></span>'.' <input class="input-width-static sg-active-url" type="text" name="sgShareUrl" value="'.@$sgShareUrl.'">'
807
- )
808
- );
809
-
810
- $countriesRadio = array(
811
- array(
812
- 'name'=>'allowCountries',
813
- 'value'=>'allow',
814
- 'additionalHtml'=>'<span class="countries-radio-text allow-countries">allow</span>',
815
- 'newline' => false
816
- ),
817
- array(
818
- 'name'=>'allowCountries',
819
- 'value'=>'disallow',
820
- 'additionalHtml'=>'<span class="countries-radio-text">disallow</span>',
821
- 'newline' => true
822
- )
823
- );
824
-
825
- $usersGroup = array(
826
- array(
827
- 'name'=>'loggedin-user',
828
- 'value'=>'true',
829
- 'additionalHtml'=>'<span id="sg-radio-logged-in" class="countries-radio-text allow-countries">logged in</span></label>',
830
- 'newline' => false
831
- ),
832
- array(
833
- 'name'=>'loggedin-user',
834
- 'value'=>'false',
835
- 'additionalHtml'=>'<span id="sg-radio-not-logged-in" class="countries-radio-text">not logged in</span></label>',
836
- 'newline' => true
837
- )
838
- );
839
-
840
- function sgCreateRadioElements($radioElements,$checkedValue)
841
- {
842
- $content = '';
843
- for ($i = 0; $i < count($radioElements); $i++) {
844
- $checked = '';
845
- $radioElement = @$radioElements[$i];
846
- $name = @$radioElement['name'];
847
- $label = @$radioElement['label'];
848
- $value = @$radioElement['value'];
849
- $additionalHtml = @$radioElement['additionalHtml'];
850
- if ($checkedValue == $value) {
851
- $checked = 'checked';
852
- }
853
- $content .= '<span class="liquid-width"><input class="radio-btn-fix" type="radio" name="'.esc_attr($name).'" value="'.esc_attr($value).'" '.esc_attr($checked).'>';
854
- $content .= $additionalHtml."<br>";
855
- }
856
- return $content;
857
- }
858
-
859
- $contentClickOptions = array(
860
- array(
861
- "title" => "close Popup:",
862
- "value" => "close",
863
- "info" => ""
864
- ),
865
- array(
866
- "title" => "redirect:",
867
- "value" => "redirect",
868
- "info" => ""
869
- )
870
- );
871
-
872
- $ajaxNonce = wp_create_nonce("sgPopupBuilderPageNonce");
873
- $ajaxNoncePages = wp_create_nonce("sgPopupBuilderPagesNonce");
874
- $pagesRadio = array(
875
- array(
876
- "title" => "show on all pages:",
877
- "value" => "all",
878
- "info" => ""
879
- ),
880
- array(
881
- "title" => "show on selected pages:",
882
- "value" => "selected",
883
- "info" => "",
884
- "data-attributes" => array(
885
- "data-name" => SG_POST_TYPE_PAGE,
886
- "data-popupid" => $dataPopupId,
887
- "data-loading-number" => 0,
888
- "data-selectbox-role" => "js-all-pages",
889
- "data-ajaxNoncePages" => $ajaxNoncePages
890
- )
891
- )
892
- );
893
-
894
- $postsRadio = array(
895
- array(
896
- "title" => "show on all posts:",
897
- "value" => "all",
898
- "info" => ""
899
- ),
900
- array(
901
- "title" => "show on selected post:",
902
- "value" => "selected",
903
- "info" => "",
904
- "data-attributes" => array(
905
- "data-name" => SG_POST_TYPE_POST,
906
- "data-popupid" => $dataPopupId,
907
- "data-loading-number" => 0,
908
- "data-selectbox-role" => "js-all-posts",
909
- "data-ajaxNonce" => $ajaxNonce
910
- )
911
-
912
- ),
913
- array(
914
- "title" => "show on selected categories",
915
- "value" => "allCategories",
916
- "info" => "",
917
- "data-attributes" => array(
918
- "class" => 'js-all-categories',
919
- "data-ajaxNonce" => $ajaxNonce
920
- )
921
- )
922
- );
923
-
924
- function getResponsiveData($popupType = '') {
925
- $responsiveDataAttrs = array(
926
- "class" => "js-responsive-mode"
927
- );
928
-
929
- if($popupType == 'iframe' || $popupType == 'video') {
930
- $responsiveDataAttrs['disabled'] = true;
931
- }
932
-
933
- $responsiveMode = array(
934
- array(
935
- "title" => "Responsive mode:",
936
- "value" => "responsiveMode",
937
- "info" => "",
938
- "data-attributes" => $responsiveDataAttrs
939
- ),
940
- array(
941
- "title" => "Custom mode:",
942
- "value" => "customMode",
943
- "info" => "",
944
- "data-attributes" => array(
945
- "class" => "js-custom-mode"
946
- )
947
-
948
- )
949
- );
950
-
951
- return $responsiveMode;
952
- }
953
-
954
-
955
-
956
- $subsSuccessBehavior = array(
957
- array(
958
- "title" => "Show success message:",
959
- "value" => "showMessage",
960
- "info" => "",
961
- "data-attributes" => array(
962
- "class" => "js-subs-success-message"
963
- )
964
-
965
- ),
966
- array(
967
- "title" => "Redirect to url:",
968
- "value" => "redirectToUrl",
969
- "info" => "",
970
- "data-attributes" => array(
971
- "class" => "js-subs-success-redirect"
972
- )
973
-
974
- ),
975
- array(
976
- "title" => "Open popup:",
977
- "value" => "openPopup",
978
- "info" => "",
979
- "data-attributes" => array(
980
- "class" => "js-subs-success-redirect"
981
- )
982
- ),
983
- array(
984
- "title" => "Hide popup:",
985
- "value" => "hidePopup",
986
- "info" => "",
987
- "data-attributes" => array(
988
- "class" => ""
989
- )
990
- )
991
- );
992
-
993
- $customPostsRadio = array(
994
- array(
995
- "title" => "show on all custom posts:",
996
- "value" => "all",
997
- "info" => ""
998
- ),
999
- array(
1000
- "title" => "show on selected custom post:",
1001
- "value" => "selected",
1002
- "info" => "",
1003
- "data-attributes" => array(
1004
- "data-name" => 'allCustomPosts',
1005
- "data-popupid" => $dataPopupId,
1006
- "data-loading-number" => 0,
1007
- "data-selectbox-role" => "js-all-custom-posts"
1008
- )
1009
-
1010
- )
1011
- );
1012
-
1013
- function createRadiobuttons($elements, $name, $newLine, $selectedInput, $class)
1014
- {
1015
- $str = "";
1016
-
1017
- foreach ($elements as $key => $element) {
1018
- $breakLine = "";
1019
- $infoIcon = "";
1020
- $title = "";
1021
- $value = "";
1022
- $infoIcon = "";
1023
- $checked = "";
1024
-
1025
- if(isset($element["title"])) {
1026
- $title = $element["title"];
1027
- }
1028
- if(isset($element["value"])) {
1029
- $value = $element["value"];
1030
- }
1031
- if($newLine) {
1032
- $breakLine = "<br>";
1033
- }
1034
- if(isset($element["info"])) {
1035
- $infoIcon = $element['info'];
1036
- }
1037
- if($element["value"] == $selectedInput) {
1038
- $checked = "checked";
1039
- }
1040
- $attrStr = '';
1041
- if(isset($element['data-attributes'])) {
1042
- foreach ($element['data-attributes'] as $key => $dataValue) {
1043
- $attrStr .= $key.'="'.esc_attr($dataValue).'" ';
1044
- }
1045
- }
1046
-
1047
- $str .= "<span class=".$class.">".$element['title']."</span>
1048
- <input type=\"radio\" name=".esc_attr($name)." ".$attrStr." value=".esc_attr($value)." $checked>".$infoIcon.$breakLine;
1049
- }
1050
-
1051
- echo $str;
1052
- }
1053
-
1054
- $sgPopupEffects = array(
1055
- 'No effect' => 'No Effect',
1056
- 'sgpb-flip' => 'flip',
1057
- 'sgpb-shake' => 'shake',
1058
- 'sgpb-wobble' => 'wobble',
1059
- 'sgpb-swing' => 'swing',
1060
- 'sgpb-flash' => 'flash',
1061
- 'sgpb-bounce' => 'bounce',
1062
- 'sgpb-bounceInRight' => 'bounceInRight',
1063
- 'sgpb-bounceIn' => 'bounceIn',
1064
- 'sgpb-pulse' => 'pulse',
1065
- 'sgpb-rubberBand' => 'rubberBand',
1066
- 'sgpb-tada' => 'tada',
1067
- 'sgpb-slideInUp' => 'slideInUp',
1068
- 'sgpb-jello' => 'jello',
1069
- 'sgpb-rotateIn' => 'rotateIn',
1070
- 'sgpb-fadeIn' => 'fadeIn'
1071
- );
1072
-
1073
- $sgPopupBgSizes = array(
1074
- 'auto' => 'Auto',
1075
- 'cover' => 'Cover',
1076
- 'contain' => 'Contain'
1077
- );
1078
-
1079
- $sgPopupBgRepeat = array(
1080
- 'repeat' => 'Repeat',
1081
- 'repeat-x' => 'Repeat x',
1082
- 'repeat-y' => 'Repeat y',
1083
- 'no-repeat' => 'Not repeat'
1084
- );
1085
-
1086
- $sgPopupTheme = array(
1087
- 'colorbox1.css',
1088
- 'colorbox2.css',
1089
- 'colorbox3.css',
1090
- 'colorbox4.css',
1091
- 'colorbox5.css',
1092
- 'colorbox6.css'
1093
- );
1094
-
1095
- $sgFbLikeButtons = array(
1096
- 'standard' => 'Standard',
1097
- 'box_count' => 'Box with count',
1098
- 'button_count' => 'Button with count',
1099
- 'button' => 'Button'
1100
- );
1101
-
1102
- $sgTheme = array(
1103
- 'flat' => 'flat',
1104
- 'classic' => 'classic',
1105
- 'minima' => 'minima',
1106
- 'plain' => 'plain'
1107
- );
1108
-
1109
- $sgResponsiveMeasure = array(
1110
- 'auto' => 'Auto',
1111
- '10' => '10%',
1112
- '20' => '20%',
1113
- '30' => '30%',
1114
- '40' => '40%',
1115
- '50' => '50%',
1116
- '60' => '60%',
1117
- '70' => '70%',
1118
- '80' => '80%',
1119
- '90' => '90%',
1120
- '100' => '100%'
1121
- );
1122
-
1123
- $sgThemeSize = array(
1124
- '8' => '8',
1125
- '10' => '10',
1126
- '12' => '12',
1127
- '14' => '14',
1128
- '16' => '16',
1129
- '18' => '18',
1130
- '20' => '20',
1131
- '24' => '24'
1132
- );
1133
-
1134
- $sgSocialCount = array(
1135
- 'true' => 'True',
1136
- 'false' => 'False',
1137
- 'inside' => 'Inside'
1138
- );
1139
-
1140
- $sgCountdownType = array(
1141
- 1 => 'DD:HH:MM:SS',
1142
- 2 => 'DD:HH:MM'
1143
- );
1144
-
1145
- $sgCountdownlang = array(
1146
- 'English' => 'English',
1147
- 'German' => 'German',
1148
- 'Spanish' => 'Spanish',
1149
- 'Arabic' => 'Arabic',
1150
- 'Italian' => 'Italian',
1151
- 'Italian' => 'Italian',
1152
- 'Dutch' => 'Dutch',
1153
- 'Norwegian' => 'Norwegian',
1154
- 'Portuguese' => 'Portuguese',
1155
- 'Russian' => 'Russian',
1156
- 'Swedish' => 'Swedish',
1157
- 'Chinese' => 'Chinese'
1158
- );
1159
-
1160
- $sgTextAreaResizeOptions = array(
1161
- 'both' => 'Both',
1162
- 'horizontal' => 'Horizontal',
1163
- 'vertical' => 'Vertical',
1164
- 'none' => 'None',
1165
- 'inherit' => 'Inherit'
1166
- );
1167
-
1168
- $sgWeekDaysArray = array(
1169
- 'Mon' => 'Monday',
1170
- 'Tue' => 'Tuesday',
1171
- 'Wed' => 'Wendnesday',
1172
- 'Thu' => 'Thursday',
1173
- 'Fri' => 'Friday',
1174
- 'Sat' => 'Saturday',
1175
- 'Sun' => 'Sunday'
1176
- );
1177
-
1178
- if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
1179
- require_once(SG_APP_POPUP_FILES ."/sg_params_arrays.php");
1180
- $popupDefaultData = SgParamsArray::defaultDataArray();
1181
- }
1182
-
1183
- function sgCreateSelect($options,$name,$selecteOption)
1184
- {
1185
- $selected ='';
1186
- $str = "";
1187
- $checked = "";
1188
- if ($name == 'theme' || $name == 'restrictionAction') {
1189
-
1190
- $popup_style_name = 'popup_theme_name';
1191
- $firstOption = array_shift($options);
1192
- $i = 1;
1193
- foreach ($options as $key) {
1194
- $checked ='';
1195
-
1196
- if ($key == $selecteOption) {
1197
- $checked = "checked";
1198
- }
1199
- $i++;
1200
- $str .= "<input type='radio' name=\"$name\" value=\"$key\" $checked class='popup_theme_name' sgPoupNumber=".$i.">";
1201
-
1202
- }
1203
- if ($checked == ''){
1204
- $checked = "checked";
1205
- }
1206
- $str = "<input type='radio' name=\"".esc_attr($name)."\" value=\"".esc_attr($firstOption)."\" $checked class='popup_theme_name' sgPoupNumber='1'>".$str;
1207
- return $str;
1208
- }
1209
- else {
1210
- @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
1211
- $str .= "<select name=$name class=$popup_style_name input-width-static >";
1212
- foreach ($options as $key => $option) {
1213
-
1214
- $selected ='';
1215
-
1216
- if ($key == $selecteOption) {
1217
- $selected = 'selected';
1218
- }
1219
-
1220
- $str .= "<option value='".esc_attr($key)."' ".$selected." >$option</potion>";
1221
- }
1222
-
1223
- $str .="</select>" ;
1224
- return $str;
1225
-
1226
- }
1227
-
1228
- }
1229
-
1230
- if(!SG_SHOW_POPUP_REVIEW) {
1231
- echo SGFunctions::addReview();
1232
- }
1233
-
1234
- if (isset($_GET['saved']) && $_GET['saved']==1) {
1235
- echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
1236
- }
1237
- if (isset($_GET["titleError"])): ?>
1238
- <div class="error notice" id="title-error-message">
1239
- <p>Invalid Title</p>
1240
- </div>
1241
- <?php endif; ?>
1242
- <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
1243
- <?php
1244
- if(function_exists('wp_nonce_field')) {
1245
- wp_nonce_field('sgPopupBuilderSave');
1246
- }
1247
- ?>
1248
- <input type="hidden" name="action" value="<?php echo $currentActionName;?>">
1249
- <div class="crud-wrapper">
1250
- <div class="cereate-title-wrapper">
1251
- <div class="sg-title-crud">
1252
- <?php if (isset($id)): ?>
1253
- <h2>Edit popup</h2>
1254
- <?php else: ?>
1255
- <h2>Create new popup</h2>
1256
- <?php endif; ?>
1257
- <?php $pageUrl = SgPopupGetData::getPageUrl(); ?>
1258
- </div>
1259
- <div class="button-wrapper">
1260
- <div class="sg-tooltip">
1261
- <input type="submit" id="sg-save-button" class="button-primary" value="<?php echo 'Save Changes'; ?>">
1262
- <?php if( !empty($pageUrl)): ?>
1263
- <input type="button" class="sg-popup-preview button-primary sg-popup-general-option" data-page-url="<?php echo $pageUrl; ?>" value="Preview">
1264
- <?php endif; ?>
1265
- <span class="sg-tooltip-text">
1266
- Liked the preview of your popup?
1267
- <a href="https://sygnoos.ladesk.com/377214-How-to-insert-popups-on-a-pagepost">Don't forget to insert it in any post/page</a>.
1268
- </span>
1269
- </div>
1270
- <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
1271
- <input class="crud-to-pro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
1272
- <?php endif; ?>
1273
-
1274
- </div>
1275
- </div>
1276
- <div class="clear"></div>
1277
- <div class="general-wrapper">
1278
- <div id="titlediv">
1279
- <div id="titlewrap">
1280
- <input id="title" class="sg-js-popup-title" type="text" name="title" size="30" value="<?php echo esc_attr(@$title)?>" spellcheck="true" autocomplete="off" required = "required" placeholder='Enter title here'>
1281
- </div>
1282
- </div>
1283
- <div id="left-main-div">
1284
- <div id="sg-general">
1285
- <div id="post-body" class="metabox-holder columns-2">
1286
- <div id="postbox-container-2" class="postbox-container">
1287
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1288
- <div class="postbox popupBuilder_general_postbox sgSameWidthPostBox" style="display: block;">
1289
- <div class="handlediv generalTitle" title="Click to toggle"><br></div>
1290
- <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
1291
- <div class="generalContent sgSameWidthPostBox">
1292
- <?php require_once($popupFilesPath."/main_section/".$popupType.".php");?>
1293
- <input type="hidden" name="type" value="<?php echo $popupType;?>">
1294
- <span class="liquid-width" id="theme-span">Popup theme:</span>
1295
- <?php echo sgCreateSelect($sgPopupTheme,'theme',esc_html(@$sgColorboxTheme));?>
1296
- <div class="theme1 sg-hide"></div>
1297
- <div class="theme2 sg-hide"></div>
1298
- <div class="theme3 sg-hide"></div>
1299
- <div class="theme4 sg-hide"></div>
1300
- <div class="theme5 sg-hide"></div>
1301
- <div class="theme6 sg-hide"></div>
1302
- <div class="sg-popup-theme-3 themes-suboptions sg-hide">
1303
- <span class="liquid-width">Border color:</span>
1304
- <div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgTheme3BorderColor" value="<?php echo esc_attr(@$sgTheme3BorderColor); ?>" /></div>
1305
- <br><span class="liquid-width">Border radius:</span>
1306
- <input class="input-width-percent" type="number" min="0" max="50" name="sgTheme3BorderRadius" value="<?php echo esc_attr(@$sgTheme3BorderRadius); ?>">
1307
- <span class="span-percent">%</span>
1308
- </div>
1309
- <div class="sg-popup-theme-4 themes-suboptions sg-hide">
1310
- <span class="liquid-width">Close button text:</span>
1311
- <input type="text" name="theme-close-text" value="<?php echo esc_attr($sgThemeCloseText);?>">
1312
- </div>
1313
- </div>
1314
- </div>
1315
-
1316
- </div>
1317
- </div>
1318
- </div>
1319
- </div>
1320
- <div id="effect">
1321
- <div id="post-body" class="metabox-holder columns-2">
1322
- <div id="postbox-container-2" class="postbox-container">
1323
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1324
- <div class="postbox popupBuilder_effect_postbox sgSameWidthPostBox" style="display: block;">
1325
- <div class="handlediv effectTitle" title="Click to toggle"><br></div>
1326
- <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
1327
- <div class="effectsContent">
1328
- <span class="liquid-width">Effect type:</span>
1329
- <?php echo sgCreateSelect($sgPopupEffects,'effect',esc_html(@$effect));?>
1330
- <span class="js-preview-effect"></span>
1331
- <div class="effectWrapper"><div id="effectShow" ></div></div>
1332
-
1333
- <span class="liquid-width">Effect duration:</span>
1334
- <input class="input-width-static" type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
1335
-
1336
- <span class="liquid-width">Popup open sound:</span>
1337
- <div class="input-width-static sg-display-inline">
1338
- <input class="input-width-static js-checkbox-sound-option" type="checkbox" name="popupOpenSound" <?php echo $sgPopupOpenSound;?>></div><span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option enabled a sound will play after popup opened.Sound option is not available on mobile devices, as there are restrictions on sound auto-play options for mobile devices.</span><br>
1339
- <div class="acordion-main-div-content js-checkbox-sound-option-wrapper">
1340
- <div class="sound-uploader-wrapper">
1341
- <div class="liquid-width-div sg-vertical-top"><input id="js-upload-open-sound-button" class="button" type="button" value="Change the sound">
1342
- <button data-default-song="<?php echo $popupOpenSoundFile; ?> " id="reset-to-default" class="button">Reset</button>
1343
- </div>
1344
- <input class="input-width-static sg-margin-top-0" id="js-upload-open-sound" type="text" size="36" name="popupOpenSoundFile" value="<?php echo esc_attr($sgPopupOpenSoundFile); ?>" required readonly>
1345
- <span class="dashicons dashicons-controls-volumeon sg-preview-sound"></span>
1346
- </div>
1347
- </div>
1348
-
1349
- <span class="liquid-width">Popup opening delay:</span>
1350
- <input class="input-width-static" type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
1351
- </div>
1352
- </div>
1353
-
1354
- </div>
1355
- </div>
1356
- </div>
1357
- </div>
1358
- <?php
1359
- require_once($popupFilesPath."/options_section/".$popupType.".php");
1360
- echo $extensionManagerObj->optionsInclude($popupType);
1361
- ?>
1362
- </div>
1363
- <div id="right-main-div">
1364
- <div id="right-main">
1365
- <div id="dimentions">
1366
- <div id="post-body" class="metabox-holder columns-2">
1367
- <div id="postbox-container-2" class="postbox-container">
1368
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1369
- <div class="postbox popupBuilder_dimention_postbox sgSameWidthPostBox" style="display: block;">
1370
- <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
1371
- <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
1372
- <div class="dimensionsContent">
1373
- <div class="sg-radio-option-behavior">
1374
- <?php $responsiveMode = getResponsiveData($popupType);?>
1375
- <?php createRadiobuttons($responsiveMode, 'popup-dimension-mode', true, esc_html($sgPopupDimensionMode), "liquid-width");?>
1376
- </div>
1377
- <div class="js-accordion-responsiveMode js-radio-accordion sg-accordion-content">
1378
- <span class="liquid-width">size</span>
1379
- <?php echo sgCreateSelect($sgResponsiveMeasure,'popup-responsive-dimension-measure',esc_html(@$sgPopupResponsiveDimensionMeasure));?>
1380
- </div>
1381
- <div class="js-accordion-customMode js-radio-accordion sg-accordion-content">
1382
- <span class="liquid-width">Width:</span>
1383
- <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1384
- <span class="liquid-width">Height:</span>
1385
- <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1386
- <span class="liquid-width">Initial width:</span>
1387
- <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1388
- <span class="liquid-width">Initial height:</span>
1389
- <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1390
- </div>
1391
- <span class="liquid-width">Max width:</span>
1392
- <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1393
- <span class="liquid-width">Max height:</span>
1394
- <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1395
- </div>
1396
- </div>
1397
-
1398
- </div>
1399
- </div>
1400
- </div>
1401
- </div>
1402
- <div id="options">
1403
- <div id="post-body" class="metabox-holder columns-2">
1404
- <div id="postbox-container-2" class="postbox-container">
1405
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1406
- <div class="postbox popupBuilder_options_postbox sgSameWidthPostBox" style="display: block;">
1407
- <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
1408
- <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
1409
- <div class="optionsContent">
1410
- <span class="liquid-width">Dismiss on &quot;esc&quot; key:</span><input class="input-width-static" type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
1411
- <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
1412
-
1413
- <span class="liquid-width" id="createDescribeClose">Show &quot;close&quot; button:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
1414
- <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
1415
-
1416
- <div class="acordion-main-div-content">
1417
- <span class="liquid-width" style="margin-left: 10px;">&quot;close&quot; button delay:</span>
1418
- <input class="input-width-static sg-close-button-delay" type="number" min="0" name="buttonDelayValue" value="<?php echo esc_attr($sgCloseButtonDelay);?>" title="It must be number"/>
1419
- <span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span>
1420
- <span class="infoDelay samefontStyle">Add seconds after which the close button will appear.If no seconds are mentioned, the close button will be shown by default.</span></br>
1421
- </div>
1422
-
1423
- <span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
1424
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the content is larger than the specified dimensions, then the content will be scrollable.</span><br>
1425
-
1426
- <span class="liquid-width">Disable page scrolling:</span><input class="input-width-static" type="checkbox" name="disable-page-scrolling" <?php echo $sgDisablePageScrolling; ?>>
1427
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If this option is enabled, the page scrolling will be disabled when the popup is open.</span><br>
1428
-
1429
- <span class="liquid-width">Enable reposition:</span><input class="input-width-static" type="checkbox" name="reposition" <?php echo $sgReposition;?> />
1430
- <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
1431
-
1432
- <span class="liquid-width">Enable scaling:</span><input class="input-width-static" type="checkbox" name="scaling" <?php echo $sgScaling;?> />
1433
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScaling samefontStyle">Resize popup according to screen size</span><br>
1434
-
1435
- <span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
1436
- <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks on the popup overlay.</span><br>
1437
-
1438
- <?php if(!sgRemoveOption('contentClick')): ?>
1439
- <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static js-checkbox-contnet-click" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
1440
- <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
1441
-
1442
- <div class="sg-hide sg-full-width js-content-click-wrraper">
1443
- <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1444
- <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1445
- <span class="liquid-width">URL:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1446
- <span class="liquid-width">redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1447
- </div>
1448
- </div>
1449
- <?php endif;?>
1450
-
1451
- <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1452
- <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1453
-
1454
- <?php if(!sgRemoveOption('showOnlyOnce')): ?>
1455
- <span class="liquid-width">Show popup this often:</span><input class="input-width-static js-checkbox-acordion" id="js-popup-only-once" type="checkbox" name="repeatPopup" <?php echo $sgRepeatPopup;?>>
1456
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Specify how many times the popup should be shown to the user. The “expire time” specifies when this rule expires and you can show the popup to the same user again.</span><br>
1457
- <div class="acordion-main-div-content js-popup-only-once-content">
1458
- <span class="liquid-width">show popup</span><input class="before-scroling-percent" type="number" min="1" name="popup-appear-number-limit" value="<?php echo esc_attr(@$sgPopupAppearNumberLimit); ?>">
1459
- <span class="span-percent">time(s) for same user</span><br>
1460
- <span class="liquid-width">expire time</span><input class="before-scroling-percent improveOptionsstyle" type="number" min="1" name="onceExpiresTime" value="<?php echo esc_attr(@$sgOnceExpiresTime); ?>">
1461
- <span class="span-percent">days</span><br>
1462
- <span class="liquid-width">page level cookie saving</span>
1463
- <input type="checkbox" name="save-cookie-page-level" <?php echo $sgPopupCookiePageLevel; ?>>
1464
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option is checked popup's cookie will be saved for a current page.By default cookie is set for all site.</span>
1465
- </div>
1466
- <?php endif;?>
1467
-
1468
- <?php if(!sgRemoveOption('repetitivePopup')): ?>
1469
- <span class="liquid-width">Repetitive popup:</span><input class="input-width-static js-checkbox-acordion" id="js-popup-only-once" type="checkbox" name="repetitivePopup" <?php echo $sgRepetitivePopup;?>>
1470
- <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option is enabled the same popup will open up after every X seconds you have defined (after closing it).</span><br>
1471
- <div class="acordion-main-div-content js-popup-only-once-content">
1472
- <span class="liquid-width">show popup</span>
1473
- <input type="number" class="before-scroling-percent" name="repetitivePopupPeriod" min="10" value="<?php echo esc_attr($sgRepetitivePopupPeriod); ?>">
1474
- <span class="span-percent">after X seconds</span>
1475
- </div>
1476
- <?php endif;?>
1477
-
1478
- <?php if(!sgRemoveOption('popupContentBgImage')): ?>
1479
- <span class="liquid-width">Popup background image:</span><input class="input-width-static js-popup-content-bg-image" type="checkbox" name="popupContentBgImage" <?php echo $sgPopupContentBgImage;?>><span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Enable this option if you need to have background image for popup.</span><br>
1480
- <div class="acordion-main-div-content js-popup-content-bg-image-wrapper">
1481
- <span class="liquid-width">Background size:</span>
1482
- <?php echo sgCreateSelect($sgPopupBgSizes,'popupContentBackgroundSize',esc_html(@$sgPopupContentBackgroundSize));?>
1483
- <span class="liquid-width">Background repeat:</span>
1484
- <?php echo sgCreateSelect($sgPopupBgRepeat,'popupContentBackgroundRepeat',esc_html(@$sgPopupContentBackgroundRepeat));?>
1485
-
1486
- <div class="sg-wp-editor-container">
1487
- <div class="liquid-width-div sg-vertical-top">
1488
- <input id="js-upload-image-button" class="button popup-content-bg-image-btn" type="button" value="Select image">
1489
- </div>
1490
- <input class="input-width-static popup-content-bg-image-url" id="js-upload-image" type="text" size="36" name="popupContentBgImageUrl" value="<?php echo esc_attr($sgPopupContentBgImageUrl); ?>" >
1491
- <span class="liquid-width-div"></span>
1492
- <div class="show-image-contenier popup-content-bg-image-preview">
1493
- <span class="no-image">(No image selected)</span>
1494
- </div>
1495
- </div>
1496
-
1497
- </div>
1498
- <?php endif; ?>
1499
-
1500
- <span class="liquid-width">Change overlay color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
1501
-
1502
- <span class="liquid-width">Change background color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sg-content-background-color" value="<?php echo esc_attr(@$sgContentBackgroundColor); ?>" /></div><br>
1503
-
1504
- <span class="liquid-width">Background opacity:</span>
1505
- <div class="slider-wrapper">
1506
- <input type="text" class="js-popup-content-opacity" value="<?php echo esc_attr($sgPopupBackgroundOpacity);?>" rel="<?php echo esc_attr($sgPopupBackgroundOpacity);?>" name="popup-background-opacity">
1507
- <div id="js-popup-content-opacity" data-init="false" class="display-box"></div>
1508
- </div><br>
1509
-
1510
- <span class="liquid-width" id="createDescribeOpacitcy">Background overlay opacity:</span>
1511
- <div class="slider-wrapper">
1512
- <input type="text" class="js-decimal" value="<?php echo esc_attr($sgOpacity);?>" rel="<?php echo esc_attr($sgOpacity);?>" name="opacity"/>
1513
- <div id="js-decimal" data-init="false" class="display-box"></div>
1514
- </div><br>
1515
-
1516
- <span class="liquid-width">Overlay custom class:</span><input class="input-width-static" type="text" name="sgOverlayCustomClasss" value="<?php echo esc_attr(@$sgOverlayCustomClasss);?>">
1517
- <br>
1518
-
1519
- <span class="liquid-width">Content custom class:</span><input class="input-width-static" type="text" name="sgContentCustomClasss" value="<?php echo esc_attr(@$sgContentCustomClasss);?>">
1520
- <br>
1521
-
1522
- <span class="liquid-width">Popup z-index:</span><input class="input-width-static" type="number" name="popup-z-index" value="<?php echo esc_attr($sgPopupZIndex);?>">
1523
- <br>
1524
-
1525
- <?php if (!sgRemoveOption('popup-content-padding')): ?>
1526
- <span class="liquid-width">Content padding:</span><input class="input-width-static" type="number" name="popup-content-padding" value="<?php echo esc_attr($sgPopupContentPadding);?>">
1527
- <br>
1528
- <?php endif; ?>
1529
-
1530
- <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popupFixed" <?php echo $sgPopupFixed;?> />
1531
- <div class="js-popop-fixeds">
1532
- <span class="fix-wrapper-style" >&nbsp;</span>
1533
- <div class="fixed-wrapper">
1534
- <div class="js-fixed-position-style" id="fixed-position1" data-sgvalue="1"></div>
1535
- <div class="js-fixed-position-style" id="fixed-position2"data-sgvalue="2"></div>
1536
- <div class="js-fixed-position-style" id="fixed-position3" data-sgvalue="3"></div>
1537
- <div class="js-fixed-position-style" id="fixed-position4" data-sgvalue="4"></div>
1538
- <div class="js-fixed-position-style" id="fixed-position5" data-sgvalue="5"></div>
1539
- <div class="js-fixed-position-style" id="fixed-position6" data-sgvalue="6"></div>
1540
- <div class="js-fixed-position-style" id="fixed-position7" data-sgvalue="7"></div>
1541
- <div class="js-fixed-position-style" id="fixed-position8" data-sgvalue="8"></div>
1542
- <div class="js-fixed-position-style" id="fixed-position9" data-sgvalue="9"></div>
1543
- </div>
1544
- </div>
1545
- <input type="hidden" name="fixedPostion" class="js-fixed-postion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
1546
- </div>
1547
- </div>
1548
-
1549
- </div>
1550
- </div>
1551
- </div>
1552
- </div>
1553
- <?php require_once("options_section/pro.php"); ?>
1554
- </div>
1555
- </div>
1556
- <div class="clear"></div>
1557
- <?php
1558
- $isActivePopup = SgPopupGetData::isActivePopup(@$id);
1559
- if(!@$id) $isActivePopup = 'checked';
1560
- ?>
1561
- <input class="sg-hide-element" name="isActiveStatus" data-switch-id="'.$id.'" type="checkbox" <?php echo $isActivePopup; ?> >
1562
- <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
1563
- </div>
1564
- </div>
1565
- </form>
1566
- <?php
1567
- SGFunctions::showInfo();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_filetrs.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- function cron_add_minute( $schedules ) {
3
- // Adds once every minute to the existing schedules.
4
- $schedules['newsLetterSendEveryMinute'] = array(
5
- 'interval' => SG_FILTER_REPEAT_INTERVAL*60,
6
- 'display' => __('Once Every Minute')
7
- );
8
- return $schedules;
9
- }
10
- add_filter('cron_schedules', 'cron_add_minute');
 
 
 
 
 
 
 
 
 
 
files/sg_popup_main.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- require_once(SG_APP_POPUP_CLASSES.'/sgDataTable/SGPopupTable.php');
3
- $allData = SGPopup::findAll();
4
-
5
- if(!SG_SHOW_POPUP_REVIEW) {
6
- echo SGFunctions::addReview();
7
- }
8
- echo SGFunctions::showReviewPopup();
9
- $ajaxNonce = wp_create_nonce("sgPopupBuilderImportNonce");
10
- ?>
11
- <div class="wrap">
12
- <div class="headers-wrapper">
13
- <h2 class="add-new-buttons">Popups <a href="<?php echo admin_url();?>admin.php?page=create-popup" class="add-new-h2">Add New</a></h2>
14
- <?php if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
15
- <input type="button" class="main-update-to-pro" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')">
16
- <?php endif; ?>
17
- <?php if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE): ?>
18
- <div class="export-import-buttons-wrraper">
19
- <?php if(!empty($allData)):?>
20
- <a href= "admin-post.php?action=popup_export" ><input type="button" value="Export" class="button"></a>
21
- <?php endif;?>
22
- <input id="js-upload-export-file" data-ajaxNonce="<?php echo esc_attr($ajaxNonce); ?>" class="button" type="button" value="Import"><img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../'); ?>" alt="gif" class="sg-hide-element js-sg-import-gif">
23
- </div>
24
- <div class="clear"></div>
25
- <?php endif; ?>
26
- </div>
27
- <?php
28
- $table = new SGPB_PopupsView();
29
- echo $table;
30
- SGFunctions::showInfo();
31
- ?>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_media_button.php DELETED
@@ -1,242 +0,0 @@
1
- <?php
2
- function sgPopupMediaButton()
3
- {
4
- global $pagenow, $typenow;
5
-
6
- $showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
7
- if(!$showCurrentUser) {return;}
8
- $buttonTitle = 'Insert popup';
9
- $output = '';
10
-
11
- $pages = array(
12
- 'post.php',
13
- 'page.php',
14
- 'post-new.php',
15
- 'post-edit.php',
16
- 'widgets.php'
17
- );
18
-
19
-
20
- /* For show in plugins page when package is pro */
21
- if(POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE) {
22
- array_push($pages, "admin.php");
23
- }
24
-
25
- $checkPage = in_array(
26
- $pagenow,
27
- $pages
28
- );
29
-
30
- if ($checkPage && $typenow != 'download') {
31
-
32
- wp_enqueue_script('jquery-ui-dialog');
33
- wp_register_style('sg_jQuery_ui', SG_APP_POPUP_URL . "/style/jQueryDialog/jquery-ui.css");
34
- wp_enqueue_style('sg_jQuery_ui');
35
- $img = '<span class="dashicons dashicons-welcome-widgets-menus" id="sg-popup-media-button" style="padding: 3px 2px 0px 0px"></span>';
36
- $output = '<a href="javascript:void(0);" onclick="jQuery(\'#sgpb-thickbox\').dialog({ width: 450, modal: true, title: \'Insert the shortcode\', dialogClass: \'sg-popup-builder\' });" class="button" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
37
- }
38
- echo $output;
39
- }
40
-
41
- add_action('media_buttons', 'sgPopupMediaButton', 11);
42
-
43
- function sgpbPopupVariable()
44
- {
45
- $showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
46
- if (!$showCurrentUser) {
47
- return;
48
- }
49
-
50
- $buttonTitle = 'Insert custom JS variable';
51
- $output = '';
52
-
53
- require_once(ABSPATH .'wp-admin/includes/screen.php');
54
- $currentScreen = get_current_screen();
55
- $currentPageParams = @get_object_vars($currentScreen);
56
-
57
- if ($currentPageParams['id'] != 'popup-builder_page_edit-popup') {
58
- return '';
59
- }
60
- wp_enqueue_script('jquery-ui-dialog');
61
- wp_register_style('sg_jQuery_ui', SG_APP_POPUP_URL . "/style/jQueryDialog/jquery-ui.css");
62
- wp_enqueue_style('sg_jQuery_ui');
63
-
64
- $img = '<span class="dashicons dashicons-welcome-widgets-menus" id="sg-popup-js-variable" style="padding: 3px 2px 0px 0px"></span>';
65
- $output = '<a href="javascript:void(0);" onclick="jQuery(\'#sgpb-js-variable-thickbox\').dialog({ width: 500, modal: true, title: \'Insert JS variable\', dialogClass: \'sg-popup-builder\' });" class="button" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
66
-
67
- echo $output;
68
- return '';
69
- }
70
-
71
- add_action('media_buttons', 'sgpbPopupVariable', 11);
72
-
73
- function sgJsVariableThickbox() {
74
-
75
- require_once(ABSPATH .'wp-admin/includes/screen.php');
76
- $currentScreen = get_current_screen();
77
- $currentPageParams = get_object_vars($currentScreen);
78
-
79
- if($currentPageParams['id'] != 'popup-builder_page_edit-popup') {
80
- return '';
81
- }
82
- ?>
83
- <script type="text/javascript">
84
- jQuery(document).ready(function ($) {
85
- $('#sgpb-insert-variable').on('click', function (e) {
86
- var jsVariableSelector = jQuery('.sgpb-js-variable-selector').val();
87
- var jsVariableAttribute = jQuery('.sgpb-js-variable-attribute').val();
88
-
89
- if (jsVariableSelector == '' || jsVariableAttribute == '') {
90
- alert('Please, fill in all the fields.');
91
- return;
92
- }
93
- window.send_to_editor('[pbvariable selector="' + jsVariableSelector + '" attribute="'+jsVariableAttribute+'"]');
94
- jQuery('#sgpb-js-variable-thickbox').dialog('close')
95
- });
96
- });
97
- </script>
98
- <div id="sgpb-js-variable-thickbox" style="display: none;">
99
- <div class="wrap">
100
- <p>Insert JS variable inside the popup.</p>
101
- <div>
102
- <div style="margin-bottom: 5px;">
103
- <span>Selector</span>
104
- <input type="text" class="sgpb-js-variable-selector">
105
- <span>Ex. #myselector or .myselector</span>
106
- </div>
107
- <div>
108
- <span>Attribute</span>
109
- <input type="text" class="sgpb-js-variable-attribute">
110
- <span>Ex. value or data-name</span>
111
- </div>
112
- </div>
113
- <p class="submit">
114
- <input type="button" id="sgpb-insert-variable" class="button-primary dashicons-welcome-widgets-menus" value="Insert"/>
115
- <a id="sgpb-cancel" class="button-secondary" onclick="jQuery('#sgpb-js-variable-thickbox').dialog( 'close' )" title="Cancel">Cancel</a>
116
- </p>
117
- </div>
118
- </div>
119
- <?php
120
- }
121
-
122
- function sgPopupMediaButtonThickboxs()
123
- {
124
- global $pagenow, $typenow;
125
- require_once(ABSPATH .'wp-admin/includes/screen.php');
126
- $currentScreen = get_current_screen();
127
- $currentPageParams = get_object_vars($currentScreen);
128
-
129
- $showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
130
- if(!$showCurrentUser) {return;}
131
-
132
- $pages = array(
133
- 'post.php',
134
- 'page.php',
135
- 'post-new.php',
136
- 'post-edit.php',
137
- 'widgets.php'
138
- );
139
-
140
- if(POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE) {
141
- array_push($pages, "admin.php");
142
- }
143
-
144
- $checkPage = in_array(
145
- $pagenow,
146
- $pages
147
- );
148
-
149
-
150
- if ($checkPage && $typenow != 'download') :
151
- $orderBy = 'id DESC';
152
- $allPopups = SGPopup::findAll($orderBy);
153
- $popupPreviewId = get_option('popupPreviewId');
154
- ?>
155
- <script type="text/javascript">
156
- jQuery(document).ready(function ($) {
157
-
158
- $('#sg-ptp-popup-insert').on('click', function () {
159
- var id = $('#sg-insert-popup-id').val();
160
- if ('' === id) {
161
- alert('Select your popup');
162
- return;
163
- }
164
- var appearEvent = jQuery("#openEvent").val();
165
-
166
- var selectionText = '';
167
- if (typeof(tinyMCE.editors.content) != "undefined") {
168
- selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
169
- }
170
- /* For plugin editor selected text */
171
- else if(typeof(tinyMCE.editors[0]) != "undefined") {
172
- var pluginEditorId = tinyMCE.editors[0]['id'];
173
- selectionText = (tinyMCE['editors'][pluginEditorId].selection.getContent()) ? tinyMCE['editors'][pluginEditorId].selection.getContent() : '';
174
- }
175
- if(appearEvent == 'onload') {
176
- selectionText = '';
177
- }
178
- <?php if( $currentPageParams['id'] == 'popup-builder_page_edit-popup'){ ?>
179
- window.send_to_editor('[sg_popup id="' + id + '" insidePopup="on"]'+selectionText+"[/sg_popup]");
180
- <?php }
181
- else { ?>
182
- window.send_to_editor('[sg_popup id="' + id + '" event="'+appearEvent+'"]'+selectionText+"[/sg_popup]");
183
- <?php } ?>
184
- jQuery('#sgpb-thickbox').dialog( "close" );
185
- });
186
- });
187
- </script>
188
-
189
- <div id="sgpb-thickbox" style="display: none;">
190
- <div class="wrap">
191
- <p>Insert the shortcode for showing a Popup.</p>
192
- <div>
193
- <div class="sg-select-popup">
194
- <span>Select Popup</span>
195
- <select id="sg-insert-popup-id" style="margin-bottom: 5px;">
196
- <option value="">Please select...</option>
197
- <?php
198
- foreach ($allPopups as $popup) :
199
-
200
- if(empty($popup)) {
201
- continue;
202
- }
203
- $popupId = (int)$popup->getId();
204
- $popupType = $popup->getType();
205
- $popupTitle = $popup->getTitle();
206
-
207
- if(empty($popupId) || empty($popupType) || $popupId == $popupPreviewId) {
208
- continue;
209
- }
210
-
211
- /*Inside popup*/
212
- if((isset($_GET['id']) && $popupId == (int)@$_GET['id'] || $popupType == 'exitIntent') && $currentPageParams['id'] == 'popup-builder_page_edit-popup') {
213
- continue;
214
- }
215
- ?>
216
- <option value="<?php echo $popupId; ?>"><?php echo $popupTitle;?><?php echo " - ".$popupType;?></option>;
217
- <?php endforeach; ?>
218
- </select>
219
- </div>
220
- <?php /* Becouse in popup content must be have only click */
221
- if($pagenow !== 'admin.php'): ?>
222
- <div class="sg-select-popup">
223
- <span>Select Event</span>
224
- <select id="openEvent">
225
- <option value="onload">On load</option>
226
- <option value="click">Click</option>
227
- <option value="hover">Hover</option>
228
- </select>
229
- </div>
230
- <?php endif;?>
231
- </div>
232
- <p class="submit">
233
- <input type="button" id="sg-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="Insert"/>
234
- <a id="sg_popup_cancel" class="button-secondary" onclick="jQuery('#sgpb-thickbox').dialog( 'close' )" title="Cancel">Cancel</a>
235
- </p>
236
- </div>
237
- </div>
238
- <?php endif;
239
- }
240
-
241
- add_action('admin_footer', 'sgPopupMediaButtonThickboxs');
242
- add_action('admin_footer', 'sgJsVariableThickbox');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_page_selection.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- function sgPopupMeta()
3
- {
4
- $showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
5
- if(!$showCurrentUser) {return;}
6
-
7
- $screens = array('post', 'page');
8
- foreach ( $screens as $screen ) {
9
- add_meta_box( 'prfx_meta', __('Select popup on page load', 'prfx-textdomain'), 'sgPopupCallback', $screen, 'normal');
10
- }
11
- }
12
- add_action('add_meta_boxes', 'sgPopupMeta');
13
-
14
- function sgPopupCallback($post)
15
- {
16
- wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );
17
- $prfx_stored_meta = get_post_meta( $post->ID );
18
- ?>
19
- <p class="preview-paragaraph">
20
- <?php
21
- global $wpdb;
22
- $proposedTypes = array();
23
- $orderBy = 'id DESC';
24
-
25
- $proposedTypes = SGPopup::findAll($orderBy);
26
- function sgCreateSelect($options,$name,$selecteOption) {
27
-
28
- $popupPreviewId = get_option('popupPreviewId');
29
- $str = "";
30
- $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
31
- $str .= "<option value='-1'>Not selected</option>";
32
- foreach($options as $option) {
33
-
34
- $selected ='';
35
-
36
- if ($option) {
37
- $title = $option->getTitle();
38
- $type = $option->getType();
39
- $id = $option->getId();
40
- if($id == $popupPreviewId) {
41
- continue;
42
- }
43
- if ($selecteOption == $id) {
44
- $selected = "selected";
45
- }
46
- $str .= "<option value='".$id."' disable='".$id."' ".esc_attr($selected)." >".esc_html($title .'-'. $type)."</option>";
47
- }
48
- }
49
- $str .="</select>" ;
50
- return $str;
51
- }
52
- global $post;
53
- $page = (int)$post->ID;
54
- $popup = "sg_promotional_popup";
55
-
56
- $popupId = 0;
57
- $postMetaSavedValue = get_post_meta($post->ID, 'sg_promotional_popup');
58
- if(!empty($postMetaSavedValue[0])) $popupId = (int)$postMetaSavedValue[0];
59
-
60
- echo sgCreateSelect($proposedTypes,'sg_promotional_popup',$popupId);
61
- $SG_APP_POPUP_URL = SG_APP_POPUP_URL;
62
- ?>
63
- </p>
64
- <input type="hidden" value="<?php echo $SG_APP_POPUP_URL;?>" id="SG_APP_POPUP_URL">
65
- <?php
66
- }
67
-
68
- function sgSelectPopupSaved($post_id)
69
- {
70
- $post_id = (int)$post_id;
71
- if(isset($_POST['sg_promotional_popup']) && $_POST['sg_promotional_popup'] == -1) {
72
- delete_post_meta($post_id, 'sg_promotional_popup');
73
- return false;
74
- }
75
- else if(isset($_POST['sg_promotional_popup'])) {
76
- update_post_meta($post_id, 'sg_promotional_popup' , (int)$_POST['sg_promotional_popup']);
77
- }
78
- }
79
-
80
- add_action('save_post','sgSelectPopupSaved');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_save.php DELETED
@@ -1,542 +0,0 @@
1
- <?php
2
- add_action('admin_post_save_popup', 'sgPopupSave');
3
-
4
- function sgSanitize($optionsKey, $isTextField = false)
5
- {
6
- if (isset($_POST[$optionsKey])) {
7
- if ($optionsKey == "sg_popup_html"||
8
- $optionsKey == "sg_ageRestriction"||
9
- $optionsKey == "sg_countdown"||
10
- $optionsKey == "sg_social" ||
11
- $optionsKey == "sg-exit-intent" ||
12
- $optionsKey == "sg_popup_fblike" ||
13
- $optionsKey == "sg_subscription" ||
14
- $optionsKey == "sg_contactForm" ||
15
- $optionsKey == "all-selected-page" ||
16
- $optionsKey == "all-selected-posts" ||
17
- $optionsKey == "sg_popup_mailchimp" ||
18
- $optionsKey == "sg_popup_aweber" ||
19
- $optionsKey == "sg-mailchimp-form" ||
20
- $isTextField == true
21
- ) {
22
- if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
23
- $sgPopupData = $_POST[$optionsKey];
24
- return $sgPopupData;
25
- /*require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
26
- return SgPopupPro::sgPopupDataSanitize($sgPopupData);*/
27
- }
28
- return SGFunctions::sgPopupDataSanitize($_POST[$optionsKey]);
29
- }
30
- return sanitize_text_field($_POST[$optionsKey]);
31
- }
32
- else {
33
- return "";
34
- }
35
- }
36
-
37
- function sgPopupSave()
38
- {
39
- global $wpdb;
40
-
41
- if(isset($_POST)) {
42
- check_admin_referer('sgPopupBuilderSave');
43
- }
44
- /*Removing all added slashes*/
45
- $_POST = stripslashes_deep($_POST);
46
- $postData = $_POST;
47
- $socialButtons = array();
48
- $socialOptions = array();
49
- $countdownOptions = array();
50
- $fblikeOptions = array();
51
- $subscriptionOptions = array();
52
- $options = array();
53
- $contactFormOptions = array();
54
- $showAllPages = sgSanitize('allPages');
55
- $showAllPosts = sgSanitize('allPosts');
56
- $showAllCustomPosts = sgSanitize('allCustomPosts');
57
- $allSelectedPages = "";
58
- $allSelectedPosts = "";
59
- $allSelectedCustomPosts = "";
60
- $allSelectedCategories = sgSanitize("posts-all-categories", true);
61
-
62
- $selectedPages = sgSanitize('all-selected-page');
63
- $selectedPosts = sgSanitize('all-selected-posts');
64
- $selectedCustomPosts = sgSanitize('all-selected-custom-posts');
65
-
66
- /* if popup check for all pages it is not needed for save all pages all posts */
67
- if($showAllPages !== "all" && !empty($selectedPages)) {
68
- $allSelectedPages = explode(",", $selectedPages);
69
- }
70
-
71
- if($showAllPosts !== "all" && !empty($selectedPosts)) {
72
- $allSelectedPosts = explode(",", $selectedPosts);
73
- }
74
- if($showAllCustomPosts !== "all" && !empty($selectedCustomPosts)) {
75
- $allSelectedCustomPosts = explode(",", $selectedCustomPosts);
76
- }
77
-
78
- $socialOptions = array(
79
- 'sgSocialTheme' => sgSanitize('sgSocialTheme'),
80
- 'sgSocialButtonsSize' => sgSanitize('sgSocialButtonsSize'),
81
- 'sgSocialLabel' => sgSanitize('sgSocialLabel'),
82
- 'sgSocialShareCount' => sgSanitize('sgSocialShareCount'),
83
- 'sgRoundButton' => sgSanitize('sgRoundButton'),
84
- 'fbShareLabel' => sgSanitize('fbShareLabel'),
85
- 'lindkinLabel' => sgSanitize('lindkinLabel'),
86
- 'sgShareUrl' => esc_url_raw(@$_POST['sgShareUrl']),
87
- 'shareUrlType' => sgSanitize('shareUrlType'),
88
- 'googLelabel' => sgSanitize('googLelabel'),
89
- 'twitterLabel' => sgSanitize('twitterLabel'),
90
- 'pinterestLabel' => sgSanitize('pinterestLabel'),
91
- 'sgMailSubject' => sgSanitize('sgMailSubject'),
92
- 'sgMailLable' => sgSanitize('sgMailLable')
93
- );
94
-
95
- $socialButtons = array(
96
- 'sgTwitterStatus' => sgSanitize('sgTwitterStatus'),
97
- 'sgFbStatus' => sgSanitize('sgFbStatus'),
98
- 'sgEmailStatus' => sgSanitize('sgEmailStatus'),
99
- 'sgLinkedinStatus' => sgSanitize('sgLinkedinStatus'),
100
- 'sgGoogleStatus' => sgSanitize('sgGoogleStatus'),
101
- 'sgPinterestStatus' => sgSanitize('sgPinterestStatus'),
102
- 'pushToBottom' => sgSanitize('pushToBottom')
103
- );
104
-
105
- $countdownOptions = array(
106
- 'pushToBottom' => sgSanitize('pushToBottom'),
107
- 'countdownNumbersBgColor' => sgSanitize('countdownNumbersBgColor'),
108
- 'countdownNumbersTextColor' => sgSanitize('countdownNumbersTextColor'),
109
- 'sg-due-date' => sgSanitize('sg-due-date'),
110
- 'countdown-position' => sgSanitize('countdown-position'),
111
- 'counts-language'=> sgSanitize('counts-language'),
112
- 'sg-time-zone' => sgSanitize('sg-time-zone'),
113
- 'sg-countdown-type' => sgSanitize('sg-countdown-type'),
114
- 'countdown-autoclose' => sgSanitize('countdown-autoclose')
115
- );
116
-
117
- $videoOptions = array(
118
- 'video-autoplay' => sgSanitize('video-autoplay')
119
- );
120
-
121
- $exitIntentOptions = array(
122
- 'exit-intent-type' => sgSanitize('exit-intent-type'),
123
- 'exit-intent-expire-time' => sgSanitize('exit-intent-expire-time'),
124
- 'exit-intent-alert' => sgSanitize('exit-intent-alert')
125
- );
126
-
127
- $subscriptionOptions = array(
128
- 'subs-first-name-status' => sgSanitize('subs-first-name-status'),
129
- 'subs-last-name-status' => sgSanitize('subs-last-name-status'),
130
- // email input placeholder text
131
- 'subscription-email' => sgSanitize('subscription-email'),
132
- 'subs-first-name' => sgSanitize('subs-first-name'),
133
- 'subs-last-name' => sgSanitize('subs-last-name'),
134
- 'subs-text-width' => sgSanitize('subs-text-width'),
135
- 'subs-button-bgColor' => sgSanitize('subs-button-bgColor'),
136
- 'subs-btn-width' => sgSanitize('subs-btn-width'),
137
- 'subs-btn-title' => sgSanitize('subs-btn-title'),
138
- 'subs-text-input-bgColor' => sgSanitize('subs-text-input-bgColor'),
139
- 'subs-text-borderColor' => sgSanitize('subs-text-borderColor'),
140
- 'subs-button-color' => sgSanitize('subs-button-color'),
141
- 'subs-inputs-color' => sgSanitize('subs-inputs-color'),
142
- 'subs-btn-height' => sgSanitize('subs-btn-height'),
143
- 'subs-text-height' => sgSanitize('subs-text-height'),
144
- 'subs-placeholder-color' => sgSanitize('subs-placeholder-color'),
145
- 'subs-validation-message' => sgSanitize('subs-validation-message'),
146
- 'subs-success-message' => sgSanitize('subs-success-message'),
147
- 'subs-btn-progress-title' => sgSanitize('subs-btn-progress-title'),
148
- 'subs-text-border-width' => sgSanitize('subs-text-border-width'),
149
- 'subs-success-behavior' => sgSanitize('subs-success-behavior'),
150
- 'subs-success-redirect-url' => esc_url_raw(@$_POST['subs-success-redirect-url']),
151
- 'subs-success-popups-list' => sgSanitize('subs-success-popups-list'),
152
- 'subs-first-name-required' => sgSanitize('subs-first-name-required'),
153
- 'subs-last-name-required' => sgSanitize('subs-last-name-required'),
154
- 'subs-success-redirect-new-tab' => sgSanitize('subs-success-redirect-new-tab')
155
- );
156
-
157
- $contactFormOptions = array(
158
- 'contact-name' => sgSanitize('contact-name'),
159
- 'contact-name-status' => sgSanitize('contact-name-status'),
160
- 'contact-name-required' => sgSanitize('contact-name-required'),
161
- 'contact-subject' => sgSanitize('contact-subject'),
162
- 'contact-subject-status' => sgSanitize('contact-subject-status'),
163
- 'contact-subject-required' => sgSanitize('contact-subject-required'),
164
- // email input placeholder text(string)
165
- 'contact-email' => sgSanitize('contact-email'),
166
- 'contact-message' => sgSanitize('contact-message'),
167
- 'contact-validation-message' => sgSanitize('contact-validation-message'),
168
- 'contact-success-message' => sgSanitize('contact-success-message'),
169
- 'contact-inputs-width' => sgSanitize('contact-inputs-width'),
170
- 'contact-inputs-height' => sgSanitize('contact-inputs-height'),
171
- 'contact-inputs-border-width' => sgSanitize('contact-inputs-border-width'),
172
- 'contact-text-input-bgcolor' => sgSanitize('contact-text-input-bgcolor'),
173
- 'contact-text-bordercolor' => sgSanitize('contact-text-bordercolor'),
174
- 'contact-inputs-color' => sgSanitize('contact-inputs-color'),
175
- 'contact-placeholder-color' => sgSanitize('contact-placeholder-color'),
176
- 'contact-btn-width' => sgSanitize('contact-btn-width'),
177
- 'contact-btn-height' => sgSanitize('contact-btn-height'),
178
- 'contact-btn-title' => sgSanitize('contact-btn-title'),
179
- 'contact-btn-progress-title' => sgSanitize('contact-btn-progress-title'),
180
- 'contact-button-bgcolor' => sgSanitize('contact-button-bgcolor'),
181
- 'contact-button-color' => sgSanitize('contact-button-color'),
182
- 'contact-area-width' => sgSanitize('contact-area-width'),
183
- 'contact-area-height' => sgSanitize('contact-area-height'),
184
- 'sg-contact-resize' => sgSanitize('sg-contact-resize'),
185
- 'contact-validate-email' => sgSanitize('contact-validate-email'),
186
- 'contact-receive-email' => sanitize_email(@$_POST['contact-receive-email']),
187
- 'contact-fail-message' => sgSanitize('contact-fail-message'),
188
- 'show-form-to-top' => sgSanitize('show-form-to-top'),
189
- 'contact-success-behavior' => sgSanitize('contact-success-behavior'),
190
- 'contact-success-redirect-url' => sgSanitize('contact-success-redirect-url'),
191
- 'contact-success-popups-list' => sgSanitize('contact-success-popups-list'),
192
- 'dont-show-content-to-contacted-user' => sgSanitize('dont-show-content-to-contacted-user'),
193
- 'contact-success-frequency-days' => sgSanitize('contact-success-frequency-days'),
194
- 'contact-success-redirect-new-tab' => sgSanitize('contact-success-redirect-new-tab')
195
- );
196
-
197
- $fblikeOptions = array(
198
- 'fblike-like-url' => esc_url_raw(@$_POST['fblike-like-url']),
199
- 'fblike-layout' => sgSanitize('fblike-layout'),
200
- 'fblike-dont-show-share-button' => sgSanitize('fblike-dont-show-share-button'),
201
- 'fblike-close-popup-after-like' => sgSanitize('fblike-close-popup-after-like')
202
- );
203
-
204
- $addToGeneralOptions = array(
205
- 'showAllPages' => $showAllPages,
206
- 'showAllPosts' => $showAllPosts,
207
- 'showAllCustomPosts' => $showAllCustomPosts,
208
- 'allSelectedPages' => $allSelectedPages,
209
- 'allSelectedPosts' => $allSelectedPosts,
210
- 'allSelectedCustomPosts' => $allSelectedCustomPosts,
211
- 'allSelectedCategories'=> $allSelectedCategories,
212
- 'fblikeOptions'=> $fblikeOptions,
213
- 'videoOptions'=>$videoOptions,
214
- 'exitIntentOptions'=> $exitIntentOptions,
215
- 'countdownOptions'=> $countdownOptions,
216
- 'socialOptions'=> $socialOptions,
217
- 'socialButtons'=> $socialButtons
218
- );
219
-
220
- $options = IntegrateExternalSettings::getPopupGeneralOptions($addToGeneralOptions);
221
-
222
- $html = stripslashes(sgSanitize("sg_popup_html"));
223
- $fblike = stripslashes(sgSanitize("sg_popup_fblike"));
224
- $ageRestriction = stripslashes(sgSanitize('sg_ageRestriction'));
225
- $social = stripslashes(sgSanitize('sg_social'));
226
- $image = sgSanitize('ad_image');
227
- $countdown = stripslashes(sgSanitize('sg_countdown'));
228
- $subscription = stripslashes(sgSanitize('sg_subscription'));
229
- $sgContactForm = stripslashes(sgSanitize('sg_contactForm'));
230
- $iframe = sgSanitize('iframe');
231
- $video = sgSanitize('video');
232
- $shortCode = stripslashes(sgSanitize('shortcode'));
233
- $exitIntent = stripslashes(sgSanitize('sg-exit-intent'));
234
- $type = sgSanitize('type');
235
- $title = stripslashes(sgSanitize('title'));
236
- $id = sgSanitize('hidden_popup_number');
237
- $jsonDataArray = json_encode($options);
238
-
239
- $data = array(
240
- 'id' => $id,
241
- 'title' => $title,
242
- 'type' => $type,
243
- 'image' => $image,
244
- 'html' => $html,
245
- 'fblike' => $fblike,
246
- 'iframe' => $iframe,
247
- 'video' => $video,
248
- 'shortcode' => $shortCode,
249
- 'ageRestriction' => $ageRestriction,
250
- 'countdown' => $countdown,
251
- 'exitIntent' => $exitIntent,
252
- 'sg_subscription' => $subscription,
253
- 'sg_contactForm' => $sgContactForm,
254
- 'social' => $social,
255
- 'options' => $jsonDataArray,
256
- 'subscriptionOptions' => json_encode($subscriptionOptions),
257
- 'contactFormOptions' => json_encode($contactFormOptions)
258
- );
259
-
260
- function setPopupForAllPages($id, $data, $type) {
261
- //-1 is the home page key
262
- if(is_array($data) && $data[0] == -1 && defined('ICL_LANGUAGE_CODE')) {
263
- $data[0] .='_'.ICL_LANGUAGE_CODE;
264
- }
265
- SGPopup::addPopupForAllPages($id, $data, $type);
266
- }
267
-
268
- function setOptionPopupType($id, $type) {
269
- update_option("SG_POPUP_".strtoupper($type)."_".$id,$id);
270
- }
271
-
272
- if (empty($title)) {
273
- $redirectUrl = add_query_arg( array(
274
- 'titleError' => 1,
275
- 'type' => $type,
276
- ), SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup");
277
-
278
- wp_safe_redirect($redirectUrl);
279
- exit();
280
- }
281
- $popupName = "SG".sanitize_text_field(ucfirst(strtolower($_POST['type'])));
282
- $popupClassName = $popupName."Popup";
283
-
284
- require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
285
-
286
- if ($id == "") {
287
- global $wpdb;
288
-
289
- call_user_func(array($popupClassName, 'create'), $data);
290
- $lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
291
- $postData['saveMod'] = '';
292
- $postData['popupId'] = $lastId;
293
- $extensionManagerObj = new SGPBExtensionManager();
294
- $extensionManagerObj->setPostData($postData);
295
- $extensionManagerObj->save();
296
-
297
- if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
298
- SGPopup::removePopupFromPages($lastId,'page');
299
- SGPopup::removePopupFromPages($lastId,'categories');
300
- if($options['allPagesStatus']) {
301
- if(!empty($showAllPages) && $showAllPages != 'all') {
302
- setPopupForAllPages($lastId, $allSelectedPages, 'page');
303
- }
304
- else {
305
-
306
- updatePopupOptions($lastId, array('page'), true);
307
- }
308
- }
309
-
310
- if($options['allPostsStatus']) {
311
- if(!empty($showAllPosts) && $showAllPosts == "selected") {
312
-
313
- setPopupForAllPages($lastId, $allSelectedPosts, 'page');
314
- }
315
- else if($showAllPosts == "all") {
316
- updatePopupOptions($lastId, array('post'), true);
317
- }
318
- if($showAllPosts == "allCategories") {
319
- setPopupForAllPages($lastId, $allSelectedCategories, 'categories');
320
- }
321
- }
322
-
323
- if($options['allCustomPostsStatus']) {
324
- if(!empty($showAllCustomPosts) && $showAllCustomPosts == "selected") {
325
- setPopupForAllPages($lastId, $allSelectedCustomPosts, 'page');
326
- }
327
- else if($showAllCustomPosts == "all") {
328
- updatePopupOptions($lastId, $options['all-custom-posts'], true);
329
- }
330
- }
331
-
332
- }
333
-
334
- setOptionPopupType($lastId, $type);
335
-
336
- $redirectUrl = add_query_arg( array(
337
- 'id' => $lastId,
338
- 'saved' => 1,
339
- 'type' => $type,
340
- ), SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup");
341
-
342
- wp_safe_redirect($redirectUrl);
343
- exit();
344
- }
345
- else {
346
- $popup = SGPopup::findById($id);
347
- $popup->setTitle($title);
348
- $popup->setId($id);
349
- $popup->setType($type);
350
- $popup->setOptions($jsonDataArray);
351
-
352
- switch ($popupName) {
353
- case 'SGImage':
354
- $popup->setUrl($image);
355
- break;
356
- case 'SGIframe':
357
- $popup->setUrl($iframe);
358
- break;
359
- case 'SGVideo':
360
- $popup->setUrl($video);
361
- $popup->setRealUrl($video);
362
- $popup->setVideoOptions(json_encode($videoOptions));
363
- break;
364
- case 'SGHtml':
365
- $popup->setContent($html);
366
- break;
367
- case 'SGFblike':
368
- $popup->setContent($fblike);
369
- $popup->setFblikeOptions(json_encode($fblikeOptions));
370
- break;
371
- case 'SGShortcode':
372
- $popup->setShortcode($shortCode);
373
- break;
374
- case 'SGAgerestriction':
375
- $popup->setContent($ageRestriction);
376
- $popup->setYesButton($options['yesButtonLabel']);
377
- $popup->setNoButton($options['noButtonLabel']);
378
- $popup->setRestrictionUrl($options['restrictionUrl']);
379
- break;
380
- case 'SGCountdown':
381
- $popup->setCountdownContent($countdown);
382
- $popup->setCountdownOptions(json_encode($countdownOptions));
383
- break;
384
- case 'SGSocial':
385
- $popup->setSocialContent($social);
386
- $popup->setButtons(json_encode($socialButtons));
387
- $popup->setSocialOptions(json_encode($socialOptions));
388
- break;
389
- case 'SGExitintent':
390
- $popup->setContent($exitIntent);
391
- $popup->setExitIntentOptions(json_encode($exitIntentOptions));
392
- break;
393
- case 'SGSubscription':
394
- $popup->setContent($subscription);
395
- $popup->setSubscriptionOptions(json_encode($subscriptionOptions));
396
- break;
397
- case 'SGContactform':
398
- $popup->setContent($sgContactForm);
399
- $popup->steParams(json_encode($contactFormOptions));
400
- break;
401
- }
402
- if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
403
- SGPopup::removePopupFromPages($id, 'page');
404
- SGPopup::removePopupFromPages($id, 'categories');
405
- if(!empty($options['allPagesStatus'])) {
406
- if($showAllPages && $showAllPages != 'all') {
407
- updatePopupOptions($id, array('page'), false);
408
- setPopupForAllPages($id, $allSelectedPages, 'page');
409
- }
410
- else {
411
- updatePopupOptions($id, array('page'), true);
412
- }
413
- }
414
- else {
415
- updatePopupOptions($id, array('page'), false);
416
- }
417
-
418
- if(!empty($options['allPostsStatus'])) {
419
- if(!empty($showAllPosts) && $showAllPosts == "selected") {
420
- updatePopupOptions($id, array('post'), false);
421
- setPopupForAllPages($id, $allSelectedPosts, 'page');
422
- }
423
- else if($showAllPosts == "all"){
424
- updatePopupOptions($id, array('post'), true);
425
- }
426
- if($showAllPosts == "allCategories") {
427
- setPopupForAllPages($id, $allSelectedCategories, 'categories');
428
- }
429
- }
430
- else {
431
- updatePopupOptions($id, array('post'), false);
432
- }
433
-
434
- if(!empty($options['allCustomPostsStatus'])) {
435
- if(!empty($showAllCustomPosts) && $showAllCustomPosts == "selected") {
436
- updatePopupOptions($id, $options['all-custom-posts'], false);
437
- setPopupForAllPages($id, $allSelectedCustomPosts, 'page');
438
- }
439
- else if($showAllCustomPosts == "all") {
440
- updatePopupOptions($id, $options['all-custom-posts'], true);
441
- }
442
- }
443
- else {
444
- updatePopupOptions($id, $options['all-custom-posts'], false);
445
- }
446
- }
447
-
448
- setOptionPopupType($id, $type);
449
- $postData['saveMod'] = '1';
450
- $postData['popupId'] = $id;
451
- $extensionManagerObj = new SGPBExtensionManager();
452
- $extensionManagerObj->setPostData($postData);
453
- $extensionManagerObj->save();
454
- $popup->save();
455
-
456
- $redirectUrl = add_query_arg( array(
457
- 'id' => $id,
458
- 'saved' => 1,
459
- 'type' => $type,
460
- ), SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup");
461
-
462
- wp_safe_redirect($redirectUrl);
463
- exit();
464
- }
465
-
466
- }
467
-
468
- /**
469
- * Save data to wp options
470
- *
471
- * @since 3.2.2
472
- *
473
- * @param int $id popup id number
474
- * @param array $postTypes page post types
475
- * @param bool $isInsert true for insert false for remove
476
- *
477
- * @return void
478
- *
479
- */
480
-
481
- function updatePopupOptions($id, $postTypes, $isInsert) {
482
-
483
- /*getting wp option data*/
484
- $allPosts = get_option("SG_ALL_POSTS");
485
- $key = false;
486
-
487
- if(!$allPosts) {
488
- $allPosts = array();
489
- }
490
-
491
- if(empty($postTypes)) {
492
- $postTypes = array();
493
- }
494
-
495
- if($allPosts && !empty($allPosts)) {
496
- /*Get current popup id key from assoc array*/
497
- $key = SGFunctions::getCurrentPopupIdFromOptions($id);
498
- }
499
-
500
- /*When isset like id data in wp options*/
501
- if($key !== false) {
502
- $popupPostTypes = $allPosts[$key]['popstTypes'];
503
- if(empty($popupPostTypes)) {
504
- $popupPostTypes = array();
505
- }
506
-
507
- /*Insert or remove from exist post types*/
508
- if($isInsert) {
509
- $popupPostTypes = array_merge($popupPostTypes, $postTypes);
510
- $popupPostTypes = array_unique($popupPostTypes);
511
- }
512
- else {
513
- if(!empty($postTypes)) {
514
- $popupPostTypes = array_diff($popupPostTypes, $postTypes);
515
- }
516
-
517
- }
518
-
519
- /*After modificition remove popup id from all post types or cghanged exist value*/
520
- if(empty($popupPostTypes)) {
521
- unset($allPosts[$key]);
522
- }
523
- else {
524
- $allPosts[$key]['popstTypes'] = $popupPostTypes;
525
- if(defined('ICL_LANGUAGE_CODE')){
526
- $allPosts[$key]['lang'] = ICL_LANGUAGE_CODE;
527
- }
528
- }
529
-
530
- }
531
- else if($isInsert && !empty($postTypes)) {
532
- $data = array('id'=>$id, 'popstTypes'=>$postTypes);
533
- if(defined('ICL_LANGUAGE_CODE')){
534
- $data['lang'] = ICL_LANGUAGE_CODE;
535
- }
536
- if(is_array($allPosts)) {
537
- array_push($allPosts, $data);
538
- }
539
- }
540
-
541
- update_option("SG_ALL_POSTS", $allPosts);
542
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_settings.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- $defaultVaules = SgPopupGetData::getDefaultValues();
3
- $tableDeleteValue = SgPopupGetData::getValue('tables-delete-status','settings');
4
- $usrsSelectedRoles = SgPopupGetData::getValue('plugin_users_role', 'settings');
5
- $sgSelectedTimeZone = SgPopupGetData::getValue('sg-popup-time-zone','settings');
6
- $tableDeleteSatatus = SgPopupGetData::sgSetChecked($tableDeleteValue);
7
-
8
- if (isset($_GET['saved']) && $_GET['saved']==1) {
9
- echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
10
- }
11
- ?>
12
- <div class="crud-wrapper">
13
- <div class="sg-settings-wrapper">
14
- <div id="special-options">
15
- <div id="post-body" class="metabox-holder columns-2">
16
- <div id="postbox-container-2" class="postbox-container">
17
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
18
- <div class="postbox popup-builder-special-postbox">
19
- <div class="handlediv js-special-title" title="Click to toggle"><br></div>
20
- <h3 class="hndle ui-sortable-handle js-special-title">
21
- <span>General Settings</span>
22
- </h3>
23
- <div class="special-options-content">
24
- <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php?action=save_settings" id="sg-settings-form">
25
- <?php
26
- if(function_exists('wp_nonce_field')) {
27
- wp_nonce_field('sgPopupBuilderSettings');
28
- }
29
- ?>
30
- <span class="liquid-width">Delete popup data:</span>
31
- <input type="checkbox" name="tables-delete-status" <?php echo $tableDeleteSatatus;?>>
32
- <br><span class="liquid-width sg-aligin-with-multiselect">User role who can use plugin:</span>
33
- <?php echo SGFunctions::createSelectBox($defaultVaules['usersRoleList'], @$usrsSelectedRoles, array("name"=>"plugin_users_role[]","multiple"=>"multiple","class"=>"sg-selectbox","size"=>count($defaultVaules['usersRoleList']))); ?><br>
34
-
35
- <?php if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
36
- require_once(SG_APP_POPUP_FILES ."/sg_params_arrays.php");
37
- ?>
38
- <span class="liquid-width">Popup time zone:</span><?php echo SGFunctions::createSelectBox($sgTimeZones,@$sgSelectedTimeZone, array('name'=>'sg-popup-time-zone','class'=>'sg-selectbox'))?>
39
- <?php }?>
40
- <div class="setting-submit-wrraper">
41
- <input type="submit" class="button-primary" value="<?php echo 'Save Changes'; ?>">
42
- </div>
43
- </form>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/Integrate_external_settings.php DELETED
@@ -1,215 +0,0 @@
1
- <?php
2
-
3
- Class IntegrateExternalSettings {
4
-
5
- public static function getAllExternalPlugins() {
6
-
7
- global $wpdb;
8
-
9
- $query = "SELECT name FROM ". $wpdb->prefix ."sg_popup_addons WHERE type='plugin'";
10
- $addons = $wpdb->get_results($query, ARRAY_A);
11
-
12
- if(empty($addons)) {
13
- return false;
14
- }
15
- return $addons;
16
- }
17
-
18
- public static function getAllAddons() {
19
-
20
- global $wpdb;
21
-
22
- $query = "SELECT name FROM ". $wpdb->prefix ."sg_popup_addons";
23
- $addons = $wpdb->get_results($query, ARRAY_A);
24
-
25
- if(empty($addons)) {
26
- return false;
27
- }
28
- return $addons;
29
- }
30
-
31
- public static function doesntHaveAnyActiveExtensions() {
32
-
33
- global $POPUP_ADDONS;
34
-
35
- $addons = self::getAllAddons();
36
-
37
- if(empty($addons)) {
38
- return true;
39
- }
40
-
41
- $activeExtensionsCount = count($addons);
42
- $allSizeOf = count($POPUP_ADDONS);
43
-
44
- return $allSizeOf > $activeExtensionsCount;
45
- }
46
-
47
- public static function isExtensionExists($extensionName) {
48
-
49
- global $wpdb;
50
- $sql = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_addons WHERE name=%s", $extensionName);
51
- $ressults = $wpdb->get_results($sql, ARRAY_A);
52
-
53
- if(empty($ressults)) {
54
- return false;
55
- }
56
- return true;
57
- }
58
-
59
- /* retrun All paths */
60
- public static function getCurrentPopupAppPaths($popupType) {
61
-
62
- $pathsArray = array();
63
-
64
- global $wpdb;
65
- $sql = $wpdb->prepare("SELECT paths FROM ". $wpdb->prefix ."sg_popup_addons WHERE name=%s", $popupType);
66
- $ressults = $wpdb->get_results($sql, ARRAY_A);
67
-
68
- if(empty($ressults)) {
69
- $pathsArray['app-path'] = SG_APP_POPUP_PATH;
70
- $pathsArray['files-path'] = SG_APP_POPUP_FILES;
71
- }
72
- else {
73
- $addonPaths = json_decode($ressults['0']['paths'], true);
74
- $appPath = $addonPaths['app-path'];
75
- $filesPath = $addonPaths['files-path'];
76
- $hasPluginDirPathApp = strrpos($appPath, WP_PLUGIN_DIR);
77
- $hasPluginDirPath = strrpos($filesPath, WP_PLUGIN_DIR);
78
-
79
- if ($hasPluginDirPathApp === false) {
80
- $appPath = WP_PLUGIN_DIR.'/'.$appPath;
81
- }
82
- if ($hasPluginDirPath === false) {
83
- $filesPath = WP_PLUGIN_DIR.'/'.$filesPath;
84
- }
85
- $addonPaths['app-path'] = $appPath;
86
- $addonPaths['files-path'] = $filesPath;
87
- $pathsArray = $addonPaths;
88
- }
89
- return $pathsArray;
90
- }
91
-
92
- public static function getCurrentPopupAdminPostActionName($popupType) {
93
-
94
- global $wpdb;
95
- $getcurrentAddonSql = $wpdb->prepare("SELECT id FROM ". $wpdb->prefix ."sg_popup_addons WHERE name=%s and type='plugin'", $popupType);
96
- $addonId = $wpdb->get_results($getcurrentAddonSql, ARRAY_A);
97
-
98
- if(!empty($addonId)) {
99
- return $popupType;
100
- }
101
- return "save_popup";
102
- }
103
-
104
- public static function getPopupGeneralOptions($params) {
105
-
106
- $options = array(
107
- 'width' => sgSanitize('width'),
108
- 'height' => sgSanitize('height'),
109
- 'delay' => (int)sgSanitize('delay'),
110
- 'buttonDelayValue' => (int)sgSanitize('buttonDelayValue'),
111
- 'duration' => (int)sgSanitize('duration'),
112
- 'effect' => sgSanitize('effect'),
113
- 'escKey' => sgSanitize('escKey'),
114
- 'isActiveStatus' => sgSanitize('isActiveStatus'),
115
- 'scrolling' => sgSanitize('scrolling'),
116
- 'disable-page-scrolling' => sgSanitize('disable-page-scrolling'),
117
- 'scaling' => sgSanitize('scaling'),
118
- 'reposition' => sgSanitize('reposition'),
119
- 'overlayClose' => sgSanitize('overlayClose'),
120
- 'reopenAfterSubmission' => sgSanitize('reopenAfterSubmission'),
121
- 'contentClick' => sgSanitize('contentClick'),
122
- 'content-click-behavior' => sgSanitize('content-click-behavior'),
123
- 'click-redirect-to-url' => sgSanitize('click-redirect-to-url'),
124
- 'redirect-to-new-tab' => sgSanitize('redirect-to-new-tab'),
125
- 'opacity' => sgSanitize('opacity'),
126
- 'popup-background-opacity' => sgSanitize('popup-background-opacity'),
127
- 'sgOverlayColor' => sgSanitize('sgOverlayColor'),
128
- 'sg-content-background-color' => sgSanitize('sg-content-background-color'),
129
- 'popupFixed' => sgSanitize('popupFixed'),
130
- 'fixedPostion' => sgSanitize('fixedPostion'),
131
- 'popup-dimension-mode' => sgSanitize('popup-dimension-mode'),
132
- 'popup-responsive-dimension-measure' => sgSanitize('popup-responsive-dimension-measure'),
133
- 'maxWidth' => sgSanitize('maxWidth'),
134
- 'maxHeight' => sgSanitize('maxHeight'),
135
- 'initialWidth' => sgSanitize('initialWidth'),
136
- 'initialHeight' => sgSanitize('initialHeight'),
137
- 'closeButton' => sgSanitize('closeButton'),
138
- 'theme' => sgSanitize('theme'),
139
- 'sgTheme3BorderColor'=> sgSanitize("sgTheme3BorderColor"),
140
- 'sgTheme3BorderRadius'=> sgSanitize("sgTheme3BorderRadius"),
141
- 'onScrolling' => sgSanitize('onScrolling'),
142
- 'inActivityStatus' => sgSanitize('inActivityStatus'),
143
- 'inactivity-timout' => sgSanitize('inactivity-timout'),
144
- 'beforeScrolingPrsent' => (int)sgSanitize('beforeScrolingPrsent'),
145
- 'forMobile' => sgSanitize('forMobile'),
146
- 'openMobile' => sgSanitize('openMobile'), // open only for mobile
147
- 'repeatPopup' => sgSanitize('repeatPopup'),
148
- 'popup-appear-number-limit' => sgSanitize('popup-appear-number-limit'),
149
- 'save-cookie-page-level' => sgSanitize('save-cookie-page-level'),
150
- 'autoClosePopup' => sgSanitize('autoClosePopup'),
151
- 'countryStatus' => sgSanitize('countryStatus'),
152
- 'showAllPages' => $params['showAllPages'],
153
- 'allPagesStatus' => sgSanitize('allPagesStatus'),
154
- 'allPostsStatus' => sgSanitize('allPostsStatus'),
155
- 'allCustomPostsStatus' => sgSanitize('allCustomPostsStatus'),
156
- 'allSelectedPages' => $params['allSelectedPages'],
157
- 'showAllPosts' => $params['showAllPosts'],
158
- 'showAllCustomPosts' => $params['showAllCustomPosts'],
159
- 'allSelectedPosts' => $params['allSelectedPosts'],
160
- 'allSelectedCustomPosts' => $params['allSelectedCustomPosts'],
161
- 'posts-all-categories'=> $params['allSelectedCategories'],
162
- 'all-custom-posts' => sgSanitize('all-custom-posts', true),
163
- 'sg-user-status' => sgSanitize('sg-user-status'),
164
- 'loggedin-user' => sgSanitize('loggedin-user'),
165
- 'popup-timer-status' => sgSanitize('popup-timer-status'),
166
- 'popup-schedule-status' => sgSanitize('popup-schedule-status'),
167
- 'popup-start-timer' => sgSanitize('popup-start-timer'),
168
- 'popup-finish-timer' => sgSanitize('popup-finish-timer'),
169
- 'schedule-start-weeks' => sgSanitize('schedule-start-weeks', true),
170
- 'schedule-start-time' => sgSanitize('schedule-start-time'),
171
- 'schedule-end-time' => sgSanitize('schedule-end-time'),
172
- 'allowCountries' => sgSanitize('allowCountries'),
173
- 'countryName' => sgSanitize('countryName'),
174
- 'countryIso' => sgSanitize('countryIso'),
175
- 'disablePopup' => sgSanitize('disablePopup'),
176
- 'disablePopupOverlay' => sgSanitize('disablePopupOverlay'),
177
- 'popupClosingTimer' => sgSanitize('popupClosingTimer'),
178
- 'yesButtonLabel' => sgSanitize('yesButtonLabel', true),
179
- 'noButtonLabel' => sgSanitize('noButtonLabel', true),
180
- 'restrictionUrl' => sgSanitize('restrictionUrl'),
181
- 'yesButtonBackgroundColor' => sgSanitize('yesButtonBackgroundColor'),
182
- 'noButtonBackgroundColor' => sgSanitize('noButtonBackgroundColor'),
183
- 'yesButtonTextColor' => sgSanitize('yesButtonTextColor'),
184
- 'noButtonTextColor' => sgSanitize('noButtonTextColor'),
185
- 'yesButtonRadius' => (int)sgSanitize('yesButtonRadius'),
186
- 'noButtonRadius' => (int)sgSanitize('noButtonRadius'),
187
- 'sgRestrictionExpirationTime' => (int)sgSanitize('sgRestrictionExpirationTime'),
188
- 'restrictionCookeSavingLevel' => sgSanitize('restrictionCookeSavingLevel'),
189
- 'pushToBottom' => sgSanitize('pushToBottom'),
190
- 'onceExpiresTime' => sgSanitize('onceExpiresTime'),
191
- 'sgOverlayCustomClasss' => sgSanitize('sgOverlayCustomClasss'),
192
- 'sgContentCustomClasss' => sgSanitize('sgContentCustomClasss'),
193
- 'popup-z-index' => sgSanitize('popup-z-index'),
194
- 'popup-content-padding' => sgSanitize('popup-content-padding'),
195
- 'theme-close-text' => sgSanitize('theme-close-text'),
196
- 'socialButtons' => json_encode($params['socialButtons']),
197
- 'socialOptions' => json_encode($params['socialOptions']),
198
- 'countdownOptions' => json_encode($params['countdownOptions']),
199
- 'exitIntentOptions' => json_encode($params['exitIntentOptions']),
200
- 'videoOptions' => json_encode($params['videoOptions']),
201
- 'fblikeOptions' => json_encode($params['fblikeOptions']),
202
- 'repetitivePopup' => sgSanitize('repetitivePopup'),
203
- 'repetitivePopupPeriod' => sgSanitize('repetitivePopupPeriod'),
204
- 'randomPopup' => sgSanitize('randomPopup'),
205
- 'popupOpenSound' => sgSanitize('popupOpenSound'),
206
- 'popupOpenSoundFile' => sgSanitize('popupOpenSoundFile'),
207
- 'popupContentBgImage' => sgSanitize('popupContentBgImage'),
208
- 'popupContentBgImageUrl' => sgSanitize('popupContentBgImageUrl'),
209
- 'popupContentBackgroundSize' => sgSanitize('popupContentBackgroundSize'),
210
- 'popupContentBackgroundRepeat' => sgSanitize('popupContentBackgroundRepeat')
211
- );
212
-
213
- return $options;
214
- }
215
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/SgPopupGetData.php DELETED
@@ -1,220 +0,0 @@
1
- <?php
2
- class SgPopupGetData {
3
-
4
- public static function getDefaultValues() {
5
-
6
- $settingsParams = array(
7
- 'tables-delete-status' => 'on',
8
- 'plugin_users_role' => array(),
9
- 'sg-popup-time-zone' => 'Pacific/Midway'
10
- );
11
-
12
- $usersRoleList = self::getAllUserRoles();
13
-
14
- $defaultParams = array(
15
- 'settingsParams' => $settingsParams,
16
- 'usersRoleList' => $usersRoleList
17
- );
18
-
19
- return $defaultParams;
20
- }
21
-
22
- public static function getValue($optionName,$optionType) {
23
-
24
- $optionType = strtolower($optionType);
25
- $optionFunctionName = 'get'.ucfirst($optionType).'Options';
26
- $options = self::$optionFunctionName();
27
-
28
-
29
- if(isset($options[$optionName])) {
30
- return $options[$optionName];
31
- }
32
-
33
- $deafaultValues = self::getDefaultValues();
34
- $deafultSettings = $deafaultValues[$optionType.'Params'];
35
-
36
- return $deafultSettings[$optionName];
37
- }
38
-
39
- public static function getSettingsOptions() {
40
-
41
- global $wpdb;
42
-
43
- $st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
44
- $options = $wpdb->get_row($st, ARRAY_A);
45
-
46
- /*Option can be null when ex settings table does now exists for old users*/
47
- if(is_null($options)) {
48
- return array();
49
- }
50
- $options = json_decode($options['options'], true);
51
-
52
- return $options;
53
- }
54
-
55
- public static function getPopupTimeZone() {
56
-
57
- $options = self::getSettingsOptions();
58
-
59
- $popupImeZone = @$options['sg-popup-time-zone'];
60
-
61
- if(!isset($popupImeZone) || empty($popupImeZone)) {
62
- $popupImeZone = 'Asia/Yerevan';
63
- }
64
-
65
- return $popupImeZone;
66
- }
67
-
68
- public static function getPostsAllCategories() {
69
-
70
- $cats = get_categories(
71
- array(
72
- "hide_empty" => 0,
73
- "type" => "post",
74
- "orderby" => "name",
75
- "order" => "ASC"
76
- )
77
- );
78
- $catsParams = array();
79
- foreach ($cats as $cat) {
80
-
81
- $id = $cat->term_id;
82
- $name = $cat->name;
83
- $catsParams[$id] = $name;
84
- }
85
-
86
- return $catsParams;
87
- }
88
-
89
- public static function sgSetChecked($value) {
90
-
91
- if($value == '') {
92
- return '';
93
- }
94
- return 'checked';
95
- }
96
-
97
- public static function getAllUserRoles() {
98
-
99
- $rulesArray = array();
100
- if(!function_exists('get_editable_roles')){
101
- return $rulesArray;
102
- }
103
-
104
- $roles = get_editable_roles();
105
- foreach ($roles as $role_name => $role_info) {
106
- if($role_name == 'administrator') {
107
- continue;
108
- }
109
- $rulesArray["sgpb_".$role_name] = $role_name;
110
-
111
- }
112
- return $rulesArray;
113
- }
114
-
115
- public static function getCurrentUserRole() {
116
-
117
- $role = 'administrator';
118
-
119
- if(is_multisite()) {
120
-
121
- $getUsersObj = get_users(
122
- array(
123
- 'blog_id' => get_current_blog_id()
124
- )
125
- );
126
- if(is_array($getUsersObj)) {
127
- foreach ($getUsersObj as $key => $userData) {
128
- if($userData->ID == get_current_user_id()) {
129
- $roles = $userData->roles;
130
- if(is_array($roles) && !empty($roles)) {
131
- $role = $roles[0];
132
- }
133
- }
134
- }
135
- }
136
-
137
- return "sgpb_".$role;
138
- }
139
-
140
- global $current_user, $wpdb;
141
- $userRoleKey = $wpdb->prefix . 'capabilities';
142
- $usersRoles = array_keys($current_user->$userRoleKey);
143
-
144
- if(is_array($usersRoles) && !empty($usersRoles)) {
145
- $role = $usersRoles[0];
146
- }
147
-
148
- return "sgpb_".$role;
149
- }
150
-
151
- public static function getAllSubscriptionForms() {
152
- global $wpdb;
153
- $st = "SELECT title FROM ". $wpdb->prefix ."sg_popup WHERE type='subscription'";
154
- $subsriptionForms = $wpdb->get_results($st, ARRAY_A);
155
- $subsFormList = array();
156
-
157
- foreach ($subsriptionForms as $subsriptionForm) {
158
- $value = $subsriptionForm['title'];
159
- $subsFormList[$value] = $value;
160
- }
161
- return $subsFormList;
162
- }
163
-
164
- public static function isActivePopup($id) {
165
-
166
- $obj = SGPopup::findById($id);
167
- if(empty($obj)) {
168
- return '';
169
- }
170
- $options = $obj->getOptions();
171
- $options = json_decode($options, true);
172
-
173
- if(!isset($options['isActiveStatus']) || $options['isActiveStatus'] == 'on') {
174
- return "checked";
175
- }
176
- return "";
177
- }
178
-
179
- public static function getAllCustomPosts() {
180
-
181
- $args = array(
182
- 'public' => true,
183
- '_builtin' => false
184
- );
185
-
186
- $allCustomPosts = get_post_types($args);
187
-
188
- return $allCustomPosts;
189
- }
190
-
191
- public static function getPageUrl()
192
- {
193
- $args = array(
194
- 'sort_order' => 'asc',
195
- 'sort_column' => 'post_title',
196
- 'hierarchical' => 0,
197
- 'exclude' => '',
198
- 'include' => '',
199
- 'meta_key' => '',
200
- 'meta_value' => '',
201
- 'authors' => '',
202
- 'child_of' => 0,
203
- 'parent' => -1,
204
- 'exclude_tree' => '',
205
- 'number' => 2,
206
- 'offset' => 0,
207
- 'post_type' => 'page',
208
- 'post_status' => 'publish'
209
- );
210
- $pages = get_pages($args);
211
-
212
- if(empty($pages[0])) {
213
- return "";
214
- }
215
-
216
- $pageId = $pages[0]->ID;
217
- $pageUrl = get_permalink($pageId);
218
- return $pageUrl;
219
- }
220
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/index.php DELETED
File without changes
img/AWeberPro.png DELETED
Binary file
img/AdblockPro.png DELETED
Binary file
img/AgeRestrictionPro.png DELETED
Binary file
img/ContactFormButtonPro.png DELETED
Binary file
img/CountdownButtonPro.png DELETED
Binary file
img/ExitIntent.png DELETED
Binary file
img/ExitIntentPro.png DELETED
Binary file
img/Facebook.png DELETED
Binary file
img/HTML-Button.png DELETED
Binary file
img/Images-Button.png DELETED
Binary file
img/ShortcodePopup.png DELETED
Binary file
img/SocialButtonPro.png DELETED
Binary file
img/SubscriptionButtonPro.png DELETED
Binary file
img/VideoPopupPro.png DELETED
Binary file
img/analiticsPro.png DELETED
Binary file
img/blog-wp-kicker.png DELETED
Binary file
img/colorbox1/border.png DELETED
Binary file
img/colorbox1/controls.png DELETED
Binary file
img/colorbox1/loading.gif DELETED
Binary file
img/colorbox1/loading_background.png DELETED
Binary file
img/colorbox2/controls.png DELETED
Binary file
img/colorbox2/loading.gif DELETED
Binary file
img/colorbox3/controls.png DELETED
Binary file
img/colorbox3/loading.gif DELETED
Binary file
img/colorbox4/border1.png DELETED
Binary file
img/colorbox4/border2.png DELETED
Binary file
img/colorbox4/loading.gif DELETED
Binary file
img/colorbox5/border.png DELETED
Binary file
img/colorbox5/controls.png DELETED
Binary file
img/colorbox5/loading.gif DELETED
Binary file
img/colorbox5/loading_background.png DELETED
Binary file
img/colorbox6/border1.png DELETED
Binary file
img/colorbox6/border2.png DELETED
Binary file
img/colorbox6/colorbox_overlay.png DELETED
Binary file
img/colorbox6/colorbox_sprite.png DELETED
Binary file
img/colorbox6/loading.gif DELETED
Binary file
img/default-image.png DELETED
Binary file
img/down_arrow-2x.gif DELETED
Binary file
img/iframePopupPro.png DELETED
Binary file
img/index.php DELETED
File without changes
img/info-error.png DELETED
Binary file
img/info.png DELETED
Binary file
img/mailchimpPro.png DELETED
Binary file
img/newYearBg.jpg DELETED
Binary file
img/pattern.jpg DELETED
Binary file
img/proOptions.png DELETED
Binary file
img/sg-shopping-cart-blue.png DELETED
Binary file
img/sg-shopping-cart-white.png DELETED
Binary file
img/sg-shopping-cart.png DELETED
Binary file
img/social-icons.png DELETED
Binary file
img/socialPopup.png DELETED
Binary file
img/theme1.jpg DELETED
Binary file
img/theme2.jpg DELETED
Binary file
img/theme3.jpg DELETED
Binary file
img/theme4.jpg DELETED
Binary file
img/theme5.jpg DELETED
Binary file
img/theme6.jpg DELETED
Binary file
img/wpAjax.gif DELETED
Binary file
img/wpspin_light.gif DELETED
Binary file
javascript/index.php DELETED
File without changes
javascript/jquery.sgcolorbox-min.js DELETED
@@ -1,97 +0,0 @@
1
- (function($,document,window){var
2
- defaults={html:false,photo:false,iframe:false,inline:false,transition:"elastic",speed:300,fadeOut:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,opacity:0.9,preloading:true,className:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:undefined,closeButton:true,fastIframe:true,open:false,reposition:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,customClass:'colorbox1',retinaImage:false,retinaUrl:false,retinaSuffix:'@2x.$1',current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",contentCustomClassName:"sg-popup-content",overlayCutsomClassName:"sg-popup-overlay",returnFocus:true,trapFocus:true,onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,rel:function(){return this.rel;},href:function(){return $(this).attr('href');},title:function(){return this.title;},createImg:function(){var img=new Image();var attrs=$(this).data('cbox-img-attrs');if(typeof attrs==='object'){$.each(attrs,function(key,val){img[key]=val;});}
3
- return img;},createIframe:function(){var iframe=document.createElement('iframe');var attrs=$(this).data('cbox-iframe-attrs');if(typeof attrs==='object'){$.each(attrs,function(key,val){iframe[key]=val;});}
4
- if('frameBorder'in iframe){iframe.frameBorder=0;}
5
- if('allowTransparency'in iframe){iframe.allowTransparency="true";}
6
- iframe.name=(new Date()).getTime();iframe.allowFullscreen=true;return iframe;}},colorbox='sgcolorbox',prefix='sgcbox',boxElement=prefix+'Element',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,$events=$('<a/>'),settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,index,photo,open,active,closing,loadingTimer,publicMethod,div="div",requests=0,previousCSS={},init;function $tag(tag,id,css){var element=document.createElement(tag);if(id){element.id=prefix+id;}
7
- if(css){element.style.cssText=css;}
8
- return $(element);}
9
- function winheight(){return window.innerHeight?window.innerHeight:$(window).height();}
10
- function Settings(element,options){if(options!==Object(options)){options={};}
11
- this.cache={};this.el=element;this.value=function(key){var dataAttr;if(this.cache[key]===undefined){dataAttr=$(this.el).attr('data-cbox-'+key);if(dataAttr!==undefined){this.cache[key]=dataAttr;}else if(options[key]!==undefined){this.cache[key]=options[key];}else if(defaults[key]!==undefined){this.cache[key]=defaults[key];}}
12
- return this.cache[key];};this.get=function(key){var value=this.value(key);return $.isFunction(value)?value.call(this.el,this):value;};}
13
- function getIndex(increment){var
14
- max=$related.length,newIndex=(index+increment)%max;return(newIndex<0)?max+newIndex:newIndex;}
15
- function setSize(size,dimension){return Math.round((/%/.test(size)?((dimension==='x'?$window.width():winheight())/100):1)*parseInt(size,10));}
16
- function isImage(settings,url){return settings.get('photo')||settings.get('photoRegex').test(url);}
17
- function retinaUrl(settings,url){return settings.get('retinaUrl')&&window.devicePixelRatio>1?url.replace(settings.get('photoRegex'),settings.get('retinaSuffix')):url;}
18
- function trapFocus(e){if('contains'in $box[0]&&!$box[0].contains(e.target)&&e.target!==$overlay[0]){e.stopPropagation();$box.focus();}}
19
- function setClass(str){if(setClass.str!==str){$box.add($overlay).removeClass(setClass.str).addClass(str);setClass.str=str;}}
20
- function getRelated(rel){index=0;if(rel&&rel!==false&&rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var options=$.data(this,colorbox);var settings=new Settings(this,options);return(settings.get('rel')===rel);});index=$related.index(settings.el);if(index===-1){$related=$related.add(settings.el);index=$related.length-1;}}else{$related=$(settings.el);}}
21
- function trigger(event){$(document).trigger(event);$events.triggerHandler(event);}
22
- var slideshow=(function(){var active,className=prefix+"Slideshow_",click="click."+prefix,timeOut;function clear(){clearTimeout(timeOut);}
23
- function set(){if(settings.get('loop')||$related[index+1]){clear();timeOut=setTimeout(publicMethod.next,settings.get('slideshowSpeed'));}}
24
- function start(){$slideshow.html(settings.get('slideshowStop')).unbind(click).one(click,stop);$events.bind(event_complete,set).bind(event_load,clear);$box.removeClass(className+"off").addClass(className+"on");}
25
- function stop(){clear();$events.unbind(event_complete,set).unbind(event_load,clear);$slideshow.html(settings.get('slideshowStart')).unbind(click).one(click,function(){publicMethod.next();start();});$box.removeClass(className+"on").addClass(className+"off");}
26
- function reset(){active=false;$slideshow.hide();clear();$events.unbind(event_complete,set).unbind(event_load,clear);$box.removeClass(className+"off "+className+"on");}
27
- return function(){if(active){if(!settings.get('slideshow')){$events.unbind(event_cleanup,reset);reset();}}else{if(settings.get('slideshow')&&$related[1]){active=true;$events.one(event_cleanup,reset);if(settings.get('slideshowAuto')){start();}else{stop();}
28
- $slideshow.show();}}};}());function launch(element){var options;if(!closing){options=$(element).data(colorbox);settings=new Settings(element,options);getRelated(settings.get('rel'));if(!open){open=active=true;setClass(settings.get('className'));$box.css({visibility:'hidden',display:'block',opacity:''});$loaded=$tag(div,'LoadedContent','width:0; height:0; overflow:hidden; visibility:hidden');$content.css({width:'',height:''}).append($loaded);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);var initialWidth=setSize(settings.get('initialWidth'),'x');var initialHeight=setSize(settings.get('initialHeight'),'y');var maxWidth=settings.get('maxWidth');var maxHeight=settings.get('maxHeight');settings.w=Math.max((maxWidth!==false?Math.min(initialWidth,setSize(maxWidth,'x')):initialWidth)-loadedWidth-interfaceWidth,0);settings.h=Math.max((maxHeight!==false?Math.min(initialHeight,setSize(maxHeight,'y')):initialHeight)-loadedHeight-interfaceHeight,0);$loaded.css({width:'',height:settings.h});publicMethod.position();trigger(event_open);settings.get('onOpen');$groupControls.add($title).hide();if(settings.get('trapFocus')){if(document.addEventListener){document.addEventListener('focus',trapFocus,true);$events.one(event_closed,function(){document.removeEventListener('focus',trapFocus,true);});}}
29
- if(settings.get('returnFocus')){$events.one(event_closed,function(){$(settings.el).focus();});}}
30
- var opacity=parseFloat(settings.get('opacity'));$overlay.css({opacity:opacity===opacity?opacity:'',cursor:settings.get('overlayClose')?'pointer':'',visibility:'visible'}).show();if(settings.get('closeButton')){$close.html(settings.get('close')).appendTo($content);}else{$close.appendTo('<div/>');}
31
- load();}}
32
- function appendHTML(options){if(!$box){init=false;$window=$(window);$box=$tag(div).attr({id:colorbox,'class':$.support.opacity===false?prefix+'IE':'',role:'dialog',tabindex:'-1'}).hide();$overlay=$tag(div,"Overlay").hide();$loadingOverlay=$([$tag(div,"LoadingOverlay")[0],$tag(div,"LoadingGraphic")[0]]);$wrap=$tag(div,"Wrapper");$content=$tag(div,"Content").append($title=$tag(div,"Title"),$current=$tag(div,"Current"),$prev=$('<button type="button"/>').attr({id:prefix+'Previous'}),$next=$('<button type="button"/>').attr({id:prefix+'Next'}),$slideshow=$tag('button',"Slideshow"),$loadingOverlay);$close=$('<button type="button"/>').attr({id:prefix+'Close'});$wrap.append($tag(div).append($tag(div,"TopLeft"),$topBorder=$tag(div,"TopCenter"),$tag(div,"TopRight")),$tag(div,false,'clear:left').append($leftBorder=$tag(div,"MiddleLeft"),$content,$rightBorder=$tag(div,"MiddleRight")),$tag(div,false,'clear:left').append($tag(div,"BottomLeft"),$bottomBorder=$tag(div,"BottomCenter"),$tag(div,"BottomRight"))).find('div div').css({'float':'left'});$loadingBay=$tag(div,false,'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');$groupControls=$next.add($prev).add($current).add($slideshow);}
33
- if(document.body&&!$box.parent().length){$(document.body).append($overlay,$box.append($wrap,$loadingBay));}
34
- if(typeof options==='object'){var popupId=options['popupId'];if(typeof popupId=='undefined'){popupId=0;}
35
- var customClass=defaults['customClass'];if(typeof options['className']!=='undefined'&&options['className']){customClass=options['className'];}
36
- if(typeof options['overlayCutsomClassName']!=='undefined'&&options['overlayCutsomClassName']){overlayCutsomClassName=options['overlayCutsomClassName'];}
37
- else{overlayCutsomClassName=defaults['overlayCutsomClassName'];}
38
- if(typeof options['contentCustomClassName']!=='undefined'&&options['contentCustomClassName']){contentCustomClassName=options['contentCustomClassName'];}
39
- else{contentCustomClassName=defaults['contentCustomClassName'];}
40
- $box.addClass(customClass).addClass(contentCustomClassName+' sg-popup-content-'+popupId);$overlay.addClass(customClass).addClass(overlayCutsomClassName+' sg-popup-overlay-'+popupId);}}
41
- function addBindings(){function clickHandler(e){if(!(e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey)){e.preventDefault();launch(this);}}
42
- if($box){if(!init){init=true;$next.click(function(){publicMethod.next();});$prev.click(function(){publicMethod.prev();});$close.click(function(){publicMethod.close();});$overlay.click(function(){if(settings.get('overlayClose')){publicMethod.close();}});$(document).bind('keydown.'+prefix,function(e){var key=e.keyCode;if(open&&settings.get('escKey')&&key===27){e.preventDefault();publicMethod.close();}
43
- if(open&&settings.get('arrowKey')&&$related[1]&&!e.altKey){if(key===37){e.preventDefault();$prev.click();}else if(key===39){e.preventDefault();$next.click();}}});if($.isFunction($.fn.on)){$(document).on('click.'+prefix,'.'+boxElement,clickHandler);}else{$('.'+boxElement).live('click.'+prefix,clickHandler);}}
44
- return true;}
45
- return false;}
46
- if($[colorbox]){return;}
47
- $(appendHTML);publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var settings;var $obj=this;options=options||{};if($.isFunction($obj)){$obj=$('<a/>');options.open=true;}
48
- if(!$obj[0]){return $obj;}
49
- appendHTML(options);if(addBindings()){if(callback){options.onComplete=callback;}
50
- $obj.each(function(){var old=$.data(this,colorbox)||{};$.data(this,colorbox,$.extend(old,options));}).addClass(boxElement);settings=new Settings($obj[0],options);if(settings.get('open')){launch($obj[0]);}}
51
- return $obj;};publicMethod.position=function(speed,loadedCallback){var
52
- css,top=0,left=0,offset=$box.offset(),scrollTop,scrollLeft;$window.unbind('resize.'+prefix);$box.css({top:-9e4,left:-9e4});scrollTop=$window.scrollTop();scrollLeft=$window.scrollLeft();if(settings.get('fixed')){offset.top-=scrollTop;offset.left-=scrollLeft;$box.css({position:'fixed'});}else{top=scrollTop;left=scrollLeft;$box.css({position:'absolute'});}
53
- if(settings.get('right')!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.get('right'),'x'),0);}else if(settings.get('left')!==false){left+=setSize(settings.get('left'),'x');}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2);}
54
- if(settings.get('bottom')!==false){top+=Math.max(winheight()-settings.h-loadedHeight-interfaceHeight-setSize(settings.get('bottom'),'y'),0);}else if(settings.get('top')!==false){top+=setSize(settings.get('top'),'y');}else{top+=Math.round(Math.max(winheight()-settings.h-loadedHeight-interfaceHeight,0)/2);}
55
- $box.css({top:offset.top,left:offset.left,visibility:'visible'});$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=(parseInt($box[0].style.width,10)-interfaceWidth)+'px';$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=(parseInt($box[0].style.height,10)-interfaceHeight)+'px';}
56
- css={width:settings.w+loadedWidth+interfaceWidth,height:settings.h+loadedHeight+interfaceHeight,top:top,left:left};if(speed){var tempSpeed=0;$.each(css,function(i){if(css[i]!==previousCSS[i]){tempSpeed=speed;return;}});speed=tempSpeed;}
57
- previousCSS=css;if(!speed){$box.css(css);}
58
- $box.dequeue().animate(css,{duration:speed||0,complete:function(){modalDimensions();active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(settings.get('reposition')){setTimeout(function(){$window.bind('resize.'+prefix,publicMethod.position);},1);}
59
- if($.isFunction(loadedCallback)){loadedCallback();}},step:modalDimensions});};publicMethod.sgpbResize=function(options){var scrolltop;if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;}
60
- if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');}
61
- $loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;}
62
- if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');}
63
- if(!options.innerHeight&&!options.height){scrolltop=$loaded.scrollTop();$loaded.css({height:"auto"});settings.h=$loaded.height();}
64
- $loaded.css({height:settings.h});if(scrolltop){}
65
- publicMethod.sgpbPosition(settings.get('transition')==="none"?0:settings.get('speed'));}};publicMethod.sgpbPosition=function(speed,loadedCallback){var
66
- css,top=0,left=0,offset=$box.offset(),scrollTop,scrollLeft;$window.unbind('resize.'+prefix);$box.css({top:-9e4,left:-9e4});scrollTop=$window.scrollTop();scrollLeft=$window.scrollLeft();if(settings.get('fixed')){offset.top-=scrollTop;offset.left-=scrollLeft;$box.css({position:'fixed'});}else{top=scrollTop;left=scrollLeft;$box.css({position:'absolute'});}
67
- if(settings.get('right')!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.get('right'),'x'),0);}else if(settings.get('left')!==false){left+=setSize(settings.get('left'),'x');}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2);}
68
- if(settings.get('bottom')!==false){top+=Math.max(winheight()-settings.h-loadedHeight-interfaceHeight-setSize(settings.get('bottom'),'y'),0);}else if(settings.get('top')!==false){top+=setSize(settings.get('top'),'y');}else{top+=Math.round(Math.max(winheight()-settings.h-loadedHeight-interfaceHeight,0)/2);}
69
- $box.css({top:offset.top,left:offset.left,visibility:'visible'});$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=(parseInt($box[0].style.width,10)-interfaceWidth)+'px';$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=(parseInt($box[0].style.height,10)-interfaceHeight)+'px';}
70
- css={width:settings.w+loadedWidth+interfaceWidth,height:settings.h+loadedHeight+interfaceHeight,top:top,left:left};if(speed){var tempSpeed=0;$.each(css,function(i){if(css[i]!==previousCSS[i]){tempSpeed=speed;return;}});speed=tempSpeed;}
71
- previousCSS=css;if(!speed){$box.css(css);}
72
- $box.dequeue().animate(css,{duration:speed||0,complete:function(){modalDimensions();active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if($.isFunction(loadedCallback)){loadedCallback();}},step:modalDimensions});};publicMethod.resize=function(options){var scrolltop;if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;}
73
- if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');}
74
- $loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;}
75
- if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');}
76
- if(!options.innerHeight&&!options.height){scrolltop=$loaded.scrollTop();$loaded.css({height:"auto"});settings.h=$loaded.height();}
77
- $loaded.css({height:settings.h});if(scrolltop){$loaded.scrollTop(scrolltop);}
78
- publicMethod.position(settings.get('transition')==="none"?0:settings.get('speed'));}};publicMethod.prep=function(object){if(!open){return;}
79
- var callback,speed=settings.get('transition')==="none"?0:settings.get('speed');$loaded.remove();$loaded=$tag(div,'LoadedContent').append(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w;}
80
- function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h;}
81
- $loaded.hide().appendTo($loadingBay.show()).css({width:getWidth(),overflow:settings.get('scrolling')?'auto':'hidden'}).css({height:getHeight()}).prependTo($content);$loadingBay.hide();$(photo).css({'float':'none'});setClass(settings.get('className'));callback=function(){var total=$related.length,iframe,complete;if(!open){return;}
82
- function removeFilter(){if($.support.opacity===false){$box[0].style.removeAttribute('filter');}}
83
- complete=function(){clearTimeout(loadingTimer);$loadingOverlay.hide();trigger(event_complete);settings.get('onComplete');};$title.html(settings.get('title')).show();$loaded.show();if(total>1){if(typeof settings.get('current')==="string"){$current.html(settings.get('current').replace('{current}',index+1).replace('{total}',total)).show();}
84
- $next[(settings.get('loop')||index<total-1)?"show":"hide"]().html(settings.get('next'));$prev[(settings.get('loop')||index)?"show":"hide"]().html(settings.get('previous'));slideshow();if(settings.get('preloading')){$.each([getIndex(-1),getIndex(1)],function(){var img,i=$related[this],settings=new Settings(i,$.data(i,colorbox)),src=settings.get('href');if(src&&isImage(settings,src)){src=retinaUrl(settings,src);img=document.createElement('img');img.src=src;}});}}else{$groupControls.hide();}
85
- if(settings.get('iframe')){iframe=settings.get('createIframe');if(!settings.get('scrolling')){iframe.scrolling="no";}
86
- $(iframe).attr({src:settings.get('href'),'class':prefix+'Iframe'}).one('load',complete).appendTo($loaded);$events.one(event_purge,function(){iframe.src="//about:blank";});if(settings.get('fastIframe')){$(iframe).trigger('load');}}else{complete();}
87
- if(settings.get('transition')==='fade'){$box.fadeTo(speed,1,removeFilter);}else{removeFilter();}};if(settings.get('transition')==='fade'){$box.fadeTo(speed,0,function(){publicMethod.position(0,callback);});}else{publicMethod.position(speed,callback);}};function load(){var href,setResize,prep=publicMethod.prep,$inline,request=++requests;active=true;photo=false;trigger(event_purge);trigger(event_load);settings.get('onLoad');settings.h=settings.get('height')?setSize(settings.get('height'),'y')-loadedHeight-interfaceHeight:settings.get('innerHeight')&&setSize(settings.get('innerHeight'),'y');settings.w=settings.get('width')?setSize(settings.get('width'),'x')-loadedWidth-interfaceWidth:settings.get('innerWidth')&&setSize(settings.get('innerWidth'),'x');settings.mw=settings.w;settings.mh=settings.h;if(settings.get('maxWidth')){settings.mw=setSize(settings.get('maxWidth'),'x')-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw;}
88
- if(settings.get('maxHeight')){settings.mh=setSize(settings.get('maxHeight'),'y')-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh;}
89
- href=settings.get('href');loadingTimer=setTimeout(function(){$loadingOverlay.show();},100);if(settings.get('inline')){var $target=$(href);$inline=$('<div>').hide().insertBefore($target);$events.one(event_purge,function(){$inline.replaceWith($target);});prep($target);}else if(settings.get('iframe')){prep(" ");}else if(settings.get('html')){prep(settings.get('html'));}else if(isImage(settings,href)){href=retinaUrl(settings,href);photo=settings.get('createImg');$(photo).addClass(prefix+'Photo').bind('error.'+prefix,function(){prep($tag(div,'Error').html(settings.get('imgError')));}).one('load',function(){if(request!==requests){return;}
90
- setTimeout(function(){var percent;if(settings.get('retinaImage')&&window.devicePixelRatio>1){photo.height=photo.height/window.devicePixelRatio;photo.width=photo.width/window.devicePixelRatio;}
91
- if(settings.get('scalePhotos')){setResize=function(){photo.height-=photo.height*percent;photo.width-=photo.width*percent;};if(settings.mw&&photo.width>settings.mw){percent=(photo.width-settings.mw)/photo.width;setResize();}
92
- if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize();}}
93
- if(settings.h){photo.style.marginTop=Math.max(settings.mh-photo.height,0)/2+'px';}
94
- if($related[1]&&(settings.get('loop')||$related[index+1])){photo.style.cursor='pointer';$(photo).bind('click.'+prefix,function(){publicMethod.next();});}
95
- photo.style.width=photo.width+'px';photo.style.height=photo.height+'px';prep(photo);},1);});photo.src=href;}else if(href){$loadingBay.load(href,settings.get('data'),function(data,status){if(request===requests){prep(status==='error'?$tag(div,'Error').html(settings.get('xhrError')):$(this).contents());}});}}
96
- publicMethod.next=function(){if(!active&&$related[1]&&(settings.get('loop')||$related[index+1])){index=getIndex(1);launch($related[index]);}};publicMethod.prev=function(){if(!active&&$related[1]&&(settings.get('loop')||index)){index=getIndex(-1);launch($related[index]);}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup);settings.get('onCleanup');$window.unbind('.'+prefix);$overlay.fadeTo(settings.get('fadeOut')||0,0);$box.stop().fadeTo(settings.get('fadeOut')||0,0,function(){$box.hide();$overlay.hide();trigger(event_purge);$loaded.remove();setTimeout(function(){closing=false;trigger(event_closed);settings.get('onClosed');},1);});}};publicMethod.remove=function(){if(!$box){return;}
97
- $box.stop();$[colorbox].close();$box.stop(false,true).remove();$overlay.remove();closing=false;$box=null;$('.'+boxElement).removeData(colorbox).removeClass(boxElement);$(document).unbind('click.'+prefix).unbind('keydown.'+prefix);};publicMethod.element=function(){return $(settings.el);};publicMethod.settings=defaults;}(jQuery,document,window));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/sg_popup_backend.js DELETED
@@ -1,655 +0,0 @@
1
- function beckend() {
2
-
3
- }
4
-
5
- beckend.prototype.sgInit = function() {
6
- this.imageUpload(); /* It's Image Upload function */
7
- this.soundUpload();
8
- this.soundPreview();
9
- this.deletePopup(); /* Delete popup */
10
- this.titleNotEmpty(); /* Check title is Empty */
11
- this.showThemePicture(); /* Show themes pictures */
12
- this.showEffects(); /* Show effect type */
13
- this.pageAcordion(); /* For page accordion divs */
14
- this.fixedPostionSelection(); /* Functionality for selected position */
15
- this.showInfo(); /* Show description options */
16
- this.opacityRange();
17
- this.subOptionContents();
18
- this.addCountries();
19
- this.showCloseTextFieldForTheme();
20
- this.popupReview();
21
- this.reviewPopup();
22
- this.colorPicekr(); /* Color picker */
23
- this.switchPopupActive();
24
- this.initAccordions();
25
- this.popupPreview();
26
- };
27
-
28
- beckend.prototype.switchPopupActive = function() {
29
- var that = this;
30
-
31
- jQuery(".sg-switch-checkbox").bind('change', function() {
32
- var dataOptions = {};
33
- var popupId = jQuery(this).attr('data-switch-id');
34
- var ajaxNonce = jQuery(this).attr('data-checkbox-ajaxNonce');
35
- dataOptions.ajaxNonce = ajaxNonce;
36
-
37
- if(jQuery(this).is(":checked")) {
38
- that.chengePopupStatus('on', popupId, dataOptions);
39
- }
40
- else {
41
- that.chengePopupStatus('off', popupId, dataOptions);
42
- }
43
- });
44
- };
45
-
46
- beckend.prototype.chengePopupStatus = function(status, popupId, dataOptions) {
47
- var data = {
48
- action: 'change_popup_status',
49
- ajaxNonce: dataOptions.ajaxNonce,
50
- popupId: popupId,
51
- popupStatus: status
52
- };
53
-
54
- jQuery.post(ajaxurl, data, function(response,d) {
55
-
56
- });
57
- };
58
-
59
- beckend.prototype.colorPicekr = function() {
60
- var that = this;
61
- var sgColorPicker = jQuery('.sgOverlayColor').wpColorPicker({
62
- change: function() {
63
- var sgColorpicker = jQuery(this);
64
- that.changeColor(sgColorpicker);
65
- }
66
- });
67
- jQuery(".wp-picker-holder").bind('click',function() {
68
- var selectedInput = jQuery(this).prev().find('.sgOverlayColor');
69
- that.changeColor(selectedInput);
70
- });
71
- };
72
-
73
- beckend.prototype.changeColor = function(elemet) {
74
- var selectedName = elemet.attr("name");
75
- var elementVal = elemet.val();
76
- if(selectedName == 'countdownNumbersTextColor') {
77
- jQuery("#sg-counts-text").remove();
78
- jQuery("body").append("<style id=\"sg-counts-text\">.flip-clock-wrapper ul li a div div.inn { color: "+elementVal+"; }</style>");
79
- }
80
- if(selectedName == 'countdownNumbersBgColor') {
81
- jQuery("#sg-counts-style").remove();
82
- jQuery("body").append("<style id=\"sg-counts-style\">.flip-clock-wrapper ul li a div div.inn { background-color: "+elementVal+"; }</style>");
83
- }
84
- };
85
-
86
- beckend.prototype.reviewPopup = function () {
87
-
88
- jQuery('#sgcolorbox').ready(function () {
89
- jQuery('#sgcolorbox').on('sgPopupCleanup', function () {
90
- var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
91
-
92
- var data = {
93
- action: 'change_review_popup_show_period',
94
- ajaxNonce: SGPB_AJAX_NONCE
95
- };
96
- jQuery.post(ajaxurl, data, function(response,d) {
97
- jQuery.sgcolorbox.close();
98
- });
99
- });
100
- });
101
-
102
- };
103
-
104
- beckend.prototype.popupReview = function() {
105
- jQuery(".sg-dont-show-agin").on("click", function() {
106
-
107
- var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
108
-
109
- var data = {
110
- action: 'close_review_panel',
111
- ajaxNonce: ajaxNonce
112
- };
113
- jQuery.post(ajaxurl, data, function(response,d) {
114
-
115
- });
116
- jQuery( ".sg-info-panel-wrapper" ).hide(300);
117
- });
118
-
119
- jQuery('.sg-info-close').on('click', function() {
120
- jQuery( ".sg-info-panel-wrapper" ).hide(300);
121
- });
122
- };
123
-
124
- beckend.prototype.checkboxAcordion = function(element) {
125
- if(!element.is(':checked')) {
126
- element.nextAll("div").first().css({'display': 'none'});
127
- }
128
- else {
129
- element.nextAll("div").first().css({'display':'inline-block'});
130
- }
131
- };
132
-
133
- beckend.prototype.soundUpload = function () {
134
-
135
- var custom_uploader;
136
- jQuery('#js-upload-open-sound-button').click(function(e) {
137
- e.preventDefault();
138
- /* If the uploader object has already been created, reopen the dialog */
139
- if (custom_uploader) {
140
- custom_uploader.open();
141
- return;
142
- }
143
- /* Extend the wp.media object */
144
- custom_uploader = wp.media.frames.file_frame = wp.media({
145
- titleFF: 'Change the sound',
146
- button: {
147
- text: 'Change the sound'
148
- },
149
- library : { type : ['audio/mpeg', 'audio/wav']},
150
- multiple: false
151
- });
152
- /* When a file is selected, grab the URL and set it as the text field's value */
153
- custom_uploader.on('select', function() {
154
- var attachment = custom_uploader.state().get('selection').first().toJSON();
155
- jQuery('#js-upload-open-sound').val(attachment.url);
156
- });
157
- /* Open the uploader dialog */
158
- custom_uploader.open();
159
- });
160
- };
161
-
162
- beckend.prototype.soundPreview = function () {
163
-
164
- var songValue = 1;
165
- var lastSong = undefined;
166
-
167
- jQuery('.sg-preview-sound').bind('click', function () {
168
-
169
- var uploadFile = jQuery('#js-upload-open-sound').val();
170
- if(typeof lastSong == 'undefined') {
171
- lastSong = new Audio(uploadFile);
172
- }
173
-
174
- /*
175
- * songValue == 1 should be song
176
- * songValue == 2 song should be pause
177
- * */
178
- if (songValue == 1) {
179
-
180
- lastSong.play();
181
- songValue = 2;
182
-
183
- } else if (songValue == 2) {
184
- lastSong.pause();
185
- songValue = 1;
186
-
187
- }
188
-
189
- lastSong.onended = function () {
190
- lastSong = undefined;
191
- songValue = 1;
192
- }
193
- });
194
-
195
- jQuery('#js-upload-open-sound').change(function () {
196
- if(typeof lastSong != 'undefined') {
197
- lastSong.pause();
198
- lastSong = undefined;
199
- }
200
- songValue = 1;
201
- });
202
-
203
- jQuery('#reset-to-default').click(function (e) {
204
- e.preventDefault();
205
- if(typeof lastSong != 'undefined') {
206
- lastSong.pause();
207
- lastSong = undefined;
208
- }
209
- songValue = 1;
210
-
211
- var defaultSong = jQuery(this).attr('data-default-song');
212
- jQuery('#js-upload-open-sound').val(defaultSong);
213
- });
214
- };
215
-
216
- beckend.prototype.imageUpload = function() {
217
- if(jQuery("#js-upload-image").val()) {
218
- jQuery(".show-image-contenier").html("");
219
- jQuery(".show-image-contenier").css({'background-image': 'url("' + jQuery("#js-upload-image").val() + '")'});
220
- }
221
- var custom_uploader;
222
- jQuery('#js-upload-image-button').click(function(e) {
223
- e.preventDefault();
224
-
225
- /* If the uploader object has already been created, reopen the dialog */
226
- if (custom_uploader) {
227
- custom_uploader.open();
228
- return;
229
- }
230
- /* Extend the wp.media object */
231
- custom_uploader = wp.media.frames.file_frame = wp.media({
232
- titleFF: 'Choose Image',
233
- button: {
234
- text: 'Choose Image'
235
- },
236
- multiple: false
237
- });
238
- /* When a file is selected, grab the URL and set it as the text field's value */
239
- custom_uploader.on('select', function() {
240
- var attachment = custom_uploader.state().get('selection').first().toJSON();
241
- jQuery(".show-image-contenier").css({'background-image': 'url("' + attachment.url + '")'});
242
- jQuery(".show-image-contenier").html("");
243
- jQuery('#js-upload-image').val(attachment.url);
244
- });
245
- /* Open the uploader dialog */
246
- custom_uploader.open();
247
- });
248
-
249
- /* its finish image uploader */
250
- };
251
-
252
- beckend.prototype.deletePopup = function() {
253
- jQuery(".sg-js-delete-link").bind('click',function() {
254
- var request = confirm("Are you sure?");
255
- if(!request) {
256
- return false;
257
- }
258
- var popup_id = jQuery(this).attr("data-sg-popup-id");
259
- var ajaxNonce = jQuery(this).attr('data-ajaxNonce');
260
-
261
- var data = {
262
- action: 'delete_popup',
263
- ajaxNonce: ajaxNonce,
264
- popup_id: popup_id
265
- };
266
-
267
- jQuery.post(ajaxurl, data, function(response,d) {
268
- location.reload();
269
- });
270
- });
271
- };
272
-
273
- beckend.prototype.titleNotEmpty = function() {
274
- jQuery("#add-form").submit(function() {
275
- var popupTitle = jQuery(".sg-js-popup-title").val();
276
- if(popupTitle == '' || popupTitle == ' ') {
277
- alert('Please fill in title field');
278
- return false;
279
- }
280
- });
281
- };
282
-
283
- beckend.prototype.showThemePicture = function() {
284
- jQuery(".popup_theme_name").bind("mouseover",function(e) {
285
- jQuery('.theme'+jQuery(this).attr("sgpoupnumber")+'').css('display', 'block');
286
- });
287
- };
288
-
289
- beckend.prototype.showEffects = function() {
290
- var effectTimer = '';
291
-
292
- jQuery('select[name="effect"]').bind('change', function() {
293
- if (effectTimer!='') {
294
- clearTimeout(effectTimer);
295
- }
296
- effectTimer = setTimeout(function() {
297
- jQuery("#effectShow").hide();
298
- effectTimer = '';
299
- },1400);
300
- jQuery("#effectShow").removeClass();
301
- jQuery("#effectShow").show();
302
- jQuery("#effectShow").addClass('sg-animated '+jQuery(this).val()+'');
303
- });
304
- jQuery('.js-preview-effect').click(function() {
305
- if (effectTimer!='') {
306
- clearTimeout(effectTimer);
307
- }
308
- effectTimer = setTimeout(function() {
309
- jQuery("#effectShow").hide();
310
- effectTimer = '';
311
- },1400);
312
- jQuery("#effectShow").removeClass();
313
- jQuery("#effectShow").show();
314
- jQuery("#effectShow").addClass('sg-animated '+jQuery('select[name="effect"] option:selected').val()+'');
315
- });
316
- };
317
-
318
- beckend.prototype.pageAcordion = function() {
319
- jQuery("#specialoptionsTitle").toggle(function(){
320
- jQuery('.specialOptionsContent').fadeOut();
321
- jQuery("#specialoptionsTitle > img").css("transform", 'rotate(0deg)');
322
- },function(){
323
- jQuery('.specialOptionsContent').fadeIn();
324
- jQuery("#specialoptionsTitle > img").css("transform", 'rotate(180deg)');
325
- });
326
-
327
- function acardionDivs(prama1,param2,param3) {
328
- jQuery(prama1).toggle(function() {
329
- jQuery(param2).addClass('closed');
330
- jQuery(param3).fadeOut();
331
-
332
- },function() {
333
- jQuery(param3).fadeIn();
334
- jQuery(param2).removeClass('closed');
335
- });
336
- }
337
-
338
- acardionDivs(".generalTitle",'.popupBuilder_general_postbox','.generalContent');
339
- acardionDivs(".effectTitle",'.popupBuilder_effect_postbox','.effectsContent');
340
- acardionDivs(".optionsTitle",'.popupBuilder_options_postbox','.optionsContent');
341
- acardionDivs(".dimentionsTitle",'.popupBuilder_dimention_postbox','.dimensionsContent');
342
- acardionDivs(".js-advanced-title",'.js-advanced-postbox','.advanced-options-content');
343
- acardionDivs(".js-special-title",'.popup-builder-special-postbox','.special-options-content');
344
- };
345
-
346
- beckend.prototype.fixedPostionSelection = function() {
347
- jQuery(".js-fixed-position-style").bind("click",function() {
348
- var sgelement = jQuery(this);
349
- var sgpos = sgelement.attr('data-sgvalue');
350
- jQuery(".js-fixed-position-style").css("backgroundColor","#FFFFFF");
351
- jQuery(this).css("backgroundColor","rgba(70,173,208,0.5)");
352
- jQuery(".js-fixed-postion").val(sgpos);
353
- });
354
-
355
- jQuery(".js-fixed-position-style").bind("mouseover",function() {
356
- jQuery(".js-fixed-position-style").css("backgroundColor","#FFFFFF");
357
- jQuery(this).css("backgroundColor","rgb(70,173,208)");
358
- jQuery(".js-fixed-position-style").each(function() {
359
- if (jQuery(this).attr("data-sgvalue") == jQuery('.js-fixed-postion').val())
360
- jQuery(this).css("backgroundColor","rgba(70,173,208,0.5)");
361
- });
362
- });
363
-
364
- jQuery(".js-fixed-position-style").bind("mouseout",function() {
365
- if(jQuery(".js-fixed-position-style").attr("data-sgvalue") !== jQuery(".js-fixed-postion").val() || jQuery(".js-fixed-postion").val() == 1) {
366
- jQuery(this).css("backgroundColor","#FFFFFF");
367
- }
368
- jQuery(".js-fixed-position-style").each(function() {
369
- if (jQuery(this).attr("data-sgvalue") == jQuery('.js-fixed-postion').val()) {
370
- jQuery(this).css("backgroundColor","rgba(70,173,208,0.5)");
371
- }
372
- });
373
- });
374
-
375
- if(jQuery('.js-fixed-postion').val()!='') {
376
- jQuery(".js-fixed-position-style").each(function(){
377
- if (jQuery(this).attr("data-sgvalue") == jQuery('.js-fixed-postion').val()) {
378
- jQuery(this).css("backgroundColor","rgba(70,173,208,0.5)");
379
- }
380
- });
381
- }
382
- };
383
-
384
- beckend.prototype.showInfo = function() {
385
- jQuery(".dashicons.dashicons-info").hover(
386
- function() {
387
- jQuery(this).next('span').css({"display": 'inline-block'});
388
- }, function() {
389
- jQuery(this).next('span').css({"display": 'none'});
390
- }
391
- );
392
- };
393
-
394
- beckend.prototype.opacityRange = function() {
395
- if (typeof Powerange != 'undefined') {
396
- var powerRangeSelectors = ['js-decimal', 'js-popup-content-opacity'];
397
-
398
- for(var i in powerRangeSelectors) {
399
-
400
- if(jQuery('.'+powerRangeSelectors[i]).length == 0) {
401
- continue;
402
- }
403
- this.powerRange(powerRangeSelectors[i]);
404
- }
405
- }
406
- };
407
-
408
- beckend.prototype.powerRange = function (cssSelectorName) {
409
- var dec = document.querySelector('.'+cssSelectorName);
410
- function displayDecimalValue() {
411
- var dec = document.querySelector('.'+cssSelectorName);
412
- document.getElementById(cssSelectorName).innerHTML = jQuery('.'+cssSelectorName).attr("value");
413
- }
414
- if(jQuery('#'+cssSelectorName).attr('data-init') == 'false') {
415
- jQuery('#'+cssSelectorName).attr('data-init', true);
416
- var initDec = new Powerange(dec, { decimal: true, callback: displayDecimalValue, max: 1, start: jQuery('.'+cssSelectorName).attr("value") });
417
- }
418
-
419
- };
420
-
421
- beckend.prototype.showOptionsInfo = function(cehckboxSelector, param2) {
422
- if(jQuery(""+cehckboxSelector+":checked").length == 0) {
423
- jQuery("."+param2+"").css({'display': 'none'});
424
- }
425
- else
426
- {
427
- jQuery("."+param2+"").css({'display':'inline-block'});
428
- }
429
-
430
- jQuery(""+cehckboxSelector+"").bind("click",function() {
431
- if(jQuery(""+cehckboxSelector+":checked").length == 0) {
432
- jQuery("."+param2+"").css({'display':'none'});
433
- }
434
- else {
435
- jQuery("."+param2+"").css({'display':'inline-block'});
436
- }
437
- });
438
- jQuery('input.popup_theme_name').bind('mouseout',function() {
439
- jQuery('.theme1').css('display', 'none');
440
- jQuery('.theme2').css('display', 'none');
441
- jQuery('.theme3').css('display', 'none');
442
- jQuery('.theme4').css('display', 'none');
443
- jQuery('.theme5').css('display', 'none');
444
- jQuery('.theme6').css('display', 'none');
445
- });
446
-
447
- };
448
-
449
- beckend.prototype.subOptionContents = function() {
450
- this.showOptionsInfo("#js-auto-close", "js-auto-close-content");
451
- this.showOptionsInfo("#js-scrolling-event-inp", "js-scrolling-content");
452
- this.showOptionsInfo("#js-inactivity-event-inp", "js-inactivity-content");
453
- this.showOptionsInfo("#js-countris", "js-countri-content");
454
- this.showOptionsInfo("#js-popup-only-once", "js-popup-only-once-content");
455
- this.showOptionsInfo(".js-on-all-pages", "js-all-pages-content");
456
- this.showOptionsInfo(".js-on-all-posts", "js-all-posts-content");
457
- this.showOptionsInfo(".js-on-all-custom-posts", "js-all-custom-posts-content");
458
- this.showOptionsInfo(".js-user-seperator", "js-user-seperator-content");
459
- this.showOptionsInfo(".js-checkbox-contnet-click", "js-content-click-wrraper");
460
- this.showOptionsInfo(".js-checkbox-contact-success-frequency-click", "js-checkbox-contact-success-frequency-wrraper");
461
- this.showOptionsInfo(".js-checkbox-sound-option", "js-checkbox-sound-option-wrapper");
462
- this.showOptionsInfo(".js-popup-content-bg-image", "js-popup-content-bg-image-wrapper");
463
-
464
- var that = this;
465
- var element = jQuery(".js-checkbox-acordion");
466
- element.each(function() {
467
- that.checkboxAcordion(jQuery(this));
468
- });
469
-
470
- element.click(function() {
471
- var elements = jQuery(this);
472
- that.checkboxAcordion(jQuery(this));
473
- });
474
-
475
- this.radioButtonAcordion(jQuery("[name='allPages']"),jQuery("[name='allPages']:checked"),"selected", jQuery('.js-pages-selectbox-content'));
476
- this.radioButtonAcordion(jQuery("[name='allPosts']"),jQuery("[name='allPosts']:checked"),"selected",jQuery('.js-posts-selectbox-content'));
477
- this.radioButtonAcordion(jQuery("[name='allPosts']"),jQuery("[name='allPosts']:checked"),"allCategories", jQuery(".js-all-categories-content"));
478
- this.radioButtonAcordion(jQuery("[name='allCustomPosts']"),jQuery("[name='allCustomPosts']:checked"),"selected", jQuery(".js-all-custompost-content"));
479
- this.radioButtonAcordion(jQuery("[name='content-click-behavior']"),jQuery("[name='content-click-behavior']:checked"),"redirect",jQuery(".js-readio-buttons-acordion-content"));
480
-
481
- this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"showMessage", jQuery('.js-subs-success-message-content'));
482
- this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"redirectToUrl", jQuery('.js-subs-success-redirect-content'));
483
- this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"openPopup", jQuery('.js-subs-success-popups-list-content'));
484
- };
485
-
486
- beckend.prototype.radioButtonAcordion = function(element, checkedElement,value, toggleContnet) {
487
- element.on("change", function() {
488
-
489
- if(jQuery(this).is(":checked") && jQuery(this).val() == value) {
490
- jQuery(this).after(toggleContnet.css({'display':'inline-block'}));
491
-
492
- }
493
- else {
494
- toggleContnet.css({'display': 'none'});
495
- }
496
- });
497
- if(checkedElement.val() == value) {
498
- checkedElement.after(toggleContnet.css({'display':'inline-block'}));
499
- }
500
- else {
501
- toggleContnet.css({'display': 'none'});
502
- }
503
- };
504
-
505
- beckend.prototype.initAccordions = function() {
506
- var radioButtonsList = [
507
- jQuery("[name='contact-success-behavior']"),
508
- jQuery("[name='popup-dimension-mode']")
509
- ];
510
-
511
- for(var radioButtonIndex in radioButtonsList) {
512
-
513
- var radioButton = radioButtonsList[radioButtonIndex];
514
-
515
- var that = this;
516
- radioButton.each(function () {
517
- that.buildAccordionActions(jQuery(this));
518
- });
519
- radioButton.on("change", function () {
520
- that.buildAccordionActions(jQuery(this), 'change');
521
- });
522
- }
523
- };
524
-
525
- beckend.prototype.buildAccordionActions = function (currentRadioButton, event) {
526
-
527
- if(event == 'change') {
528
- currentRadioButton.parents('.sg-radio-option-behavior').first().find('.js-radio-accordion').css({'display': 'none'});
529
- }
530
-
531
- var value = currentRadioButton.val();
532
- var toggleContent = jQuery('.js-accordion-'+value);
533
-
534
- if(currentRadioButton.is(':checked')) {
535
- currentRadioButton.after(toggleContent.css({'display':'inline-block'}));
536
- }
537
- else {
538
- toggleContent.css({'display': 'none'});
539
- }
540
- };
541
-
542
- beckend.prototype.addCountries = function() {
543
- var countyNames = [];
544
- if(!jQuery('#countryIso').length) {
545
- return;
546
- }
547
- var countryIsos = jQuery('#countryIso').val().split(',');
548
- function addCountry(name,iso) {
549
- countyNames.push(name);
550
- countryIsos.push(iso);
551
- jQuery("#countryIso").val(countryIsos.join(','));
552
- jQuery('#countryName').tagsinput('add', countyNames.join(','));
553
- }
554
- jQuery(".addCountry").bind('click',function(){
555
- var optionCountryName = jQuery(".optionsCountry option:selected").text();
556
- var optionCountryIso = jQuery(".optionsCountry option:selected").val();
557
- addCountry(optionCountryName,optionCountryIso);
558
- });
559
- jQuery('input').on('itemRemoved', function(event) {
560
- var removeCountryName = event.item;
561
- var countryNameIso = countyNames.indexOf(removeCountryName);
562
- countryIsos.splice(countryNameIso,1);
563
- countyNames.splice(countryNameIso,1);
564
- jQuery("#countryIso").val(countryIsos.join(','));
565
- });
566
-
567
- if(typeof popupCountries != "undefined" && typeof popupCountries != "undefined"){
568
- var sgCountryNameArray = popupCountries.sgCountryName.split(",");
569
- var sgCountryIsoArray = popupCountries.sgCountryIso.split(",");
570
- for(var i=0; i <= sgCountryIsoArray.length; i++) {
571
- addCountry(sgCountryNameArray[i],sgCountryIsoArray[i]);
572
- }
573
- }
574
- };
575
-
576
- beckend.prototype.showCloseTextFieldForTheme = function() {
577
- var that = this;
578
- jQuery("[name='theme']").each(function() {
579
- if(jQuery(this).prop("checked")) {
580
- that.sgAllowCustomizedThemes(jQuery(this));
581
- }
582
- });
583
-
584
- jQuery("[name='theme']").bind("change", function() {
585
- that.sgAllowCustomizedThemes(jQuery(this))
586
- });
587
-
588
- };
589
-
590
- beckend.prototype.sgAllowCustomizedThemes = function(cureentRadioButton) {
591
- var customizedThemes = ['2','3','4'];
592
- var themeNumber = cureentRadioButton.attr("sgpoupnumber");
593
- var isInCustomThemes = customizedThemes.indexOf(themeNumber);
594
- jQuery(".themes-suboptions").addClass("sg-hide");
595
- if(isInCustomThemes != -1) {
596
-
597
- if(cureentRadioButton.prop( "checked" )) {
598
- jQuery(".sg-popup-theme-"+themeNumber).removeClass("sg-hide");
599
- }
600
- else {
601
- jQuery(".sg-popup-theme-"+themeNumber).addClass("sg-hide");
602
- }
603
- }
604
- };
605
-
606
- beckend.prototype.updateQueryStringParameter = function (uri, key, value) {
607
- var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
608
- var separator = uri.indexOf('?') !== -1 ? "&" : "?";
609
- if (uri.match(re)) {
610
- return uri.replace(re, '$1' + key + "=" + value + '$2');
611
- }
612
- else {
613
- return uri + separator + key + "=" + value;
614
- }
615
- };
616
-
617
- beckend.prototype.popupPreview = function () {
618
- var that = this;
619
- jQuery('.sg-popup-preview').bind('click', function (e) {
620
- e.preventDefault();
621
- var previewButton = jQuery(this);
622
- /*checking if it's not null*/
623
- if(typeof tinymce != 'undefined' && !!tinymce.activeEditor) {
624
- jQuery("[name='"+tinymce.activeEditor.id+"']").html(tinymce.activeEditor.getContent());
625
- }
626
-
627
- var data = {
628
- action: 'save_popup_preview_data',
629
- ajaxNonce: backendLocalizedData.ajaxNonce,
630
- beforeSend: function () {
631
- previewButton.prop('disabled', true);
632
- previewButton.val('loading');
633
- },
634
- popupDta: jQuery("#add-form").serialize()
635
- };
636
- var newWindow = window.open('');
637
- jQuery.post(ajaxurl, data, function(response,d) {
638
- var popupId = parseInt(response);
639
- if(isNaN(popupId)) {
640
- console.log("it's not number");
641
- return;
642
- }
643
- previewButton.prop('disabled', false);
644
- previewButton.val('Preview');
645
- var pageUrl = previewButton.attr('data-page-url');
646
- var redirectUrl = that.updateQueryStringParameter(pageUrl, 'sg_popup_preview_id', popupId);
647
- newWindow.location = redirectUrl;
648
- });
649
- })
650
- };
651
-
652
- jQuery(document).ready(function($){
653
- var sgBeckeendObj = new beckend();
654
- sgBeckeendObj.sgInit();
655
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/sg_popup_core.js DELETED
@@ -1,6 +0,0 @@
1
- function sgAddEvent(element, eventName, fn) {
2
- if (element.addEventListener)
3
- element.addEventListener(eventName, fn, false);
4
- else if (element.attachEvent)
5
- element.attachEvent('on' + eventName, fn);
6
- }
 
 
 
 
 
 
javascript/sg_popup_frontend.js DELETED
@@ -1,1358 +0,0 @@
1
- function SGPopup() {
2
-
3
- this.positionLeft = '';
4
- this.positionTop = '';
5
- this.positionBottom = '';
6
- this.positionRight = '';
7
- this.initialPositionTop = '';
8
- this.initialPositionLeft = '';
9
- this.isOnLoad = '';
10
- this.openOnce = '';
11
- this.numberLimit = '';
12
- this.popupData = new Array();
13
- this.popupEscKey = true;
14
- this.popupOverlayClose = true;
15
- this.popupContentClick = false;
16
- this.popupCloseButton = true;
17
- this.sgTrapFocus = true;
18
- this.popupType = '';
19
- this.popupClassEvents = ['hover'];
20
- this.eventExecuteCountByClass = 0;
21
- this.sgEventExecuteCount = 0;
22
- this.resizeTimer = null;
23
- this.sgColorboxContentTypeReset();
24
- }
25
-
26
- SGPopup.prototype.sgColorboxContentTypeReset = function () {
27
-
28
- /*colorbox settings mode*/
29
- this.sgColorboxHtml = false;
30
- this.sgColorboxPhoto = false;
31
- this.sgColorboxIframe = false;
32
- this.sgColorboxHref = false;
33
- this.sgColorboxInline = false;
34
- };
35
-
36
- /*Popup thems default paddings where key is theme number value padding*/
37
- SGPopup.sgColorBoxDeafults = {1 : 70, 2: 34, 3: 30, 4 : 70, 5 : 62, 6: 70};
38
-
39
- SGPopup.prototype.popupOpenById = function (popupId) {
40
-
41
- var sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling'] : '';
42
- var sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus'] : '';
43
- var autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup'] : '';
44
-
45
- if (sgOnScrolling) {
46
- this.onScrolling(popupId);
47
- }
48
- else if (sgInActivity) {
49
- this.showPopupAfterInactivity(popupId);
50
- }
51
- else {
52
- this.showPopup(popupId, true);
53
- }
54
- };
55
-
56
- SGPopup.getCookie = function (cName) {
57
-
58
- var name = cName + "=";
59
- var ca = document.cookie.split(';');
60
- for (var i = 0; i < ca.length; i++) {
61
- var c = ca[i];
62
- while (c.charAt(0) == ' ') {
63
- c = c.substring(1);
64
- }
65
- if (c.indexOf(name) == 0) {
66
- return c.substring(name.length, c.length);
67
- }
68
- }
69
- return "";
70
- };
71
-
72
- SGPopup.deleteCookie = function (name) {
73
-
74
- document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
75
- };
76
-
77
- SGPopup.setCookie = function (cName, cValue, exDays, cPageLevel) {
78
-
79
- var expirationDate = new Date();
80
- var cookiePageLevel = '';
81
- var cookieExpirationData = 1;
82
- if (!exDays || isNaN(exDays)) {
83
- exDays = 365 * 50;
84
- }
85
- if (typeof cPageLevel == 'undefined') {
86
- cPageLevel = false;
87
- }
88
- expirationDate.setDate(expirationDate.getDate() + exDays);
89
- cookieExpirationData = expirationDate.toString();
90
- var expires = 'expires='+cookieExpirationData;
91
-
92
- if (exDays == -1) {
93
- expires = '';
94
- }
95
-
96
- if (cPageLevel) {
97
- cookiePageLevel = 'path=/;';
98
- }
99
-
100
- var value = cValue + ((exDays == null) ? ";" : "; " + expires + ";" + cookiePageLevel);
101
- document.cookie = cName + "=" + value;
102
- };
103
-
104
- SGPopup.prototype.init = function () {
105
-
106
- var that = this;
107
-
108
- this.onCompleate();
109
- this.popupOpenByCookie();
110
- this.attacheShortCodeEvent();
111
- this.attacheClickEvent();
112
- this.popupOpenByClickUrl();
113
- this.attacheIframeEvent();
114
- this.attacheConfirmEvent();
115
- this.popupClassEventsTrigger();
116
- };
117
-
118
- SGPopup.prototype.popupOpenByClickUrl = function () {
119
-
120
- var that = this;
121
- if(jQuery("a[href*=sg-popup-id-]").length) {
122
- jQuery("a[href*=sg-popup-id-]").each(function () {
123
- jQuery(this).bind('click', function (e) {
124
- e.preventDefault();
125
- var href = jQuery(this).attr('href');
126
- var splitData = href.split("sg-popup-id-");
127
-
128
- if(typeof splitData[1] != 'undefined') {
129
- var popupId = parseInt(splitData[1]);
130
- that.showPopup(popupId, false);
131
- }
132
- })
133
- });
134
- }
135
- };
136
-
137
- SGPopup.prototype.attacheShortCodeEvent = function () {
138
-
139
- var that = this;
140
-
141
- jQuery(".sg-show-popup").each(function () {
142
- var popupEvent = jQuery(this).attr("data-popup-event");
143
- if (typeof popupEvent == 'undefined') {
144
- popupEvent = 'click';
145
- }
146
- /* For counting execute and did it one time for popup open */
147
- that.sgEventExecuteCount = 0;
148
- jQuery(this).bind(popupEvent, function () {
149
- that.sgEventExecuteCount += 1;
150
- if (that.sgEventExecuteCount > 1) {
151
- return;
152
- }
153
- var sgPopupID = jQuery(this).attr("data-sgpopupid");
154
- that.showPopup(sgPopupID, false);
155
- });
156
- });
157
- };
158
-
159
- SGPopup.prototype.attacheConfirmEvent = function () {
160
-
161
- var that = this;
162
-
163
- jQuery("[class*='sg-confirm-popup-']").each(function () {
164
- jQuery(this).bind("click", function (e) {
165
- e.preventDefault();
166
- var currentLink = jQuery(this);
167
- var className = jQuery(this).attr("class");
168
-
169
- var sgPopupId = that.findPopupIdFromClassNames(className, "sg-confirm-popup-");
170
-
171
- jQuery('#sgcolorbox').bind("sgPopupClose", function () {
172
- var target = currentLink.attr("target");
173
-
174
- if (typeof target == 'undefined') {
175
- target = "self";
176
- }
177
- var href = currentLink.attr("href");
178
-
179
- if (target == "_blank") {
180
- window.open(href);
181
- }
182
- else {
183
- window.location.href = href;
184
- }
185
- });
186
- that.showPopup(sgPopupId, false);
187
- })
188
- });
189
- };
190
-
191
- SGPopup.prototype.attacheIframeEvent = function () {
192
-
193
- var that = this;
194
- /* When user set popup by class name */
195
- jQuery("[class*='sg-iframe-popup-']").each(function () {
196
- var currentLink = jQuery(this);
197
- jQuery(this).bind("click", function (e) {
198
- e.preventDefault();
199
- var className = jQuery(this).attr("class");
200
-
201
- var sgPopupId = that.findPopupIdFromClassNames(className, "sg-iframe-popup-");
202
-
203
- /*This update for dynamic open iframe url for same popup*/
204
- var linkUrl = currentLink.attr("href");
205
-
206
- if (typeof linkUrl == 'undefined') {
207
- var childLinkTag = currentLink.find('a');
208
- linkUrl = childLinkTag.attr("href");
209
- }
210
-
211
- SG_POPUP_DATA[sgPopupId]['iframe'] = linkUrl;
212
-
213
- that.showPopup(sgPopupId, false);
214
- });
215
- });
216
- };
217
-
218
- SGPopup.prototype.attacheClickEvent = function () {
219
-
220
- var that = this;
221
- /* When user set popup by class name */
222
- jQuery("[class*='sg-popup-id-']").each(function () {
223
- jQuery(this).bind("click", function (e) {
224
- e.preventDefault();
225
- var className = jQuery(this).attr("class");
226
- var sgPopupId = that.findPopupIdFromClassNames(className, "sg-popup-id-");
227
-
228
- that.showPopup(sgPopupId, false);
229
- })
230
- });
231
- };
232
-
233
- SGPopup.prototype.popupClassEventsTrigger = function () {
234
-
235
- var popupEvents = this.popupClassEvents;
236
- var that = this;
237
-
238
- if(popupEvents.length > 0) {
239
-
240
- for (var i in popupEvents) {
241
- var eventName = popupEvents[i];
242
-
243
- that.attacheCustomEvent(eventName);
244
- }
245
- }
246
- };
247
-
248
- SGPopup.prototype.attacheCustomEvent = function (eventName) {
249
-
250
- if(typeof eventName == 'undefined' || typeof eventName == 'function' || eventName == '') {
251
- return;
252
- }
253
- var that = this;
254
-
255
- jQuery("[class*='sg-popup-"+eventName+"-']").each(function () {
256
- var eventCount = that.eventExecuteCountByClass;
257
- jQuery(this).bind(eventName, function () {
258
- eventCount = ++that.eventExecuteCountByClass;
259
- if (eventCount > 1) {
260
- return;
261
- }
262
- var className = jQuery(this).attr("class");
263
- var sgPopupId = that.findPopupIdFromClassNames(className, 'sg-popup-'+eventName+'-');
264
-
265
- that.showPopup(sgPopupId, false);
266
- })
267
- });
268
- };
269
-
270
- SGPopup.prototype.popupOpenByCookie = function () {
271
-
272
- var popupId = SGPopup.getCookie("sgSubmitReloadingForm");
273
- popupId = parseInt(popupId);
274
-
275
- if (typeof popupId == 'number') {
276
- this.showPopup(popupId, false);
277
- }
278
- };
279
-
280
- SGPopup.prototype.findPopupIdFromClassNames = function (className, classKey) {
281
-
282
- var classSplitArray = className.split(classKey);
283
- var classIdString = classSplitArray['1'];
284
- /*Get first all number from string*/
285
- var popupId = classIdString.match(/^\d+/);
286
-
287
- return popupId;
288
- };
289
-
290
- SGPopup.prototype.hexToRgba = function (hex, opacity){
291
-
292
- var c;
293
- if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
294
- c = hex.substring(1).split('');
295
-
296
- if(c.length == 3){
297
- c= [c[0], c[0], c[1], c[1], c[2], c[2]];
298
- }
299
- c = '0x'+c.join('');
300
- return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+','+opacity+')';
301
- }
302
- throw new Error('Bad Hex');
303
- };
304
-
305
-
306
- SGPopup.prototype.sgCustomizeThemes = function (popupId) {
307
-
308
- var popupData = SG_POPUP_DATA[popupId];
309
- var borderRadiues = popupData['sg3ThemeBorderRadiues'];
310
- var popupContentOpacity = popupData['popup-background-opacity'];
311
- var popupContentColor = jQuery('#sgcboxContent').css('background-color');
312
- var contentBackgroundColor = popupData['sg-content-background-color'];
313
- var changedColor = popupContentColor.replace(')', ', '+popupContentOpacity+')').replace('rgb', 'rgba');
314
-
315
- if(typeof contentBackgroundColor != 'undefined' && contentBackgroundColor != '') {
316
- changedColor = this.hexToRgba(contentBackgroundColor, popupContentOpacity);
317
- }
318
-
319
-
320
- if (popupData['theme'] == "colorbox3.css") {
321
- var borderColor = popupData['sgTheme3BorderColor'];
322
- var borderRadiues = popupData['sgTheme3BorderRadius'];
323
- jQuery("#sgcboxLoadedContent").css({'border-color': borderColor});
324
- jQuery("#sgcboxLoadedContent").css({'border-radius': borderRadiues + "%"});
325
- jQuery("#sgcboxContent").css({'border-radius': borderRadiues + "%"})
326
- }
327
-
328
- jQuery('#sgcboxContent').css({'background-color': changedColor});
329
- jQuery('#sgcboxLoadedContent').css({'background-color': changedColor})
330
-
331
- };
332
-
333
- SGPopup.prototype.onCompleate = function () {
334
-
335
- jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function () {
336
-
337
- /* Scroll only inside popup */
338
- jQuery('#sgcboxLoadedContent').isolatedScroll();
339
- });
340
- this.isolatedScroll();
341
- };
342
-
343
- SGPopup.prototype.isolatedScroll = function () {
344
-
345
- jQuery.fn.isolatedScroll = function () {
346
- this.bind('mousewheel DOMMouseScroll', function (e) {
347
- var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail,
348
- bottomOverflow = this.scrollTop + jQuery(this).outerHeight() - this.scrollHeight >= 0,
349
- topOverflow = this.scrollTop <= 0;
350
-
351
- if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) {
352
- e.preventDefault();
353
- }
354
- });
355
- return this;
356
- };
357
- };
358
-
359
- SGPopup.prototype.sgPopupScalingDimensions = function () {
360
-
361
- var popupWrapper = jQuery("#sgcboxWrapper").outerWidth();
362
- var screenWidth = jQuery(window).width();
363
- /*popupWrapper != 9999 for resizing case when colorbox is calculated popup dimensions*/
364
- if (popupWrapper > screenWidth && popupWrapper != 9999) {
365
- var scaleDegree = screenWidth / popupWrapper;
366
- jQuery("#sgcboxWrapper").css({
367
- "transform-origin": "0 0",
368
- 'transform': "scale(" + scaleDegree + ", 1)"
369
- });
370
- popupWrapper = 0;
371
- }
372
- else {
373
- jQuery("#sgcboxWrapper").css({
374
- "transform-origin": "0 0",
375
- 'transform': "scale(1, 1)"
376
- })
377
- }
378
- };
379
-
380
- SGPopup.prototype.sgPopupScaling = function () {
381
-
382
- var that = this;
383
- jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function () {
384
- that.sgPopupScalingDimensions();
385
- });
386
- jQuery(window).resize(function () {
387
- setTimeout(function () {
388
- that.sgPopupScalingDimensions();
389
- }, 1000);
390
- });
391
- };
392
-
393
- SGPopup.prototype.varToBool = function (optionName) {
394
-
395
- var returnValue = (optionName) ? true : false;
396
- return returnValue;
397
- };
398
-
399
- SGPopup.prototype.canOpenPopup = function (id, openOnce, isOnLoad) {
400
-
401
- if (!isOnLoad) {
402
- return true;
403
- }
404
-
405
- var currentCookies = SGPopup.getCookie('sgPopupCookieList');
406
- if (currentCookies) {
407
- currentCookies = JSON.parse(currentCookies);
408
-
409
- for (var cookieIndex in currentCookies) {
410
- var cookieName = currentCookies[cookieIndex];
411
- var cookieData = SGPopup.getCookie(cookieName + id);
412
-
413
- if (cookieData) {
414
- return false;
415
- }
416
- }
417
- }
418
-
419
- var popupCookie = SGPopup.getCookie('sgPopupDetails' + id);
420
- var popupType = this.popupType;
421
-
422
- /*for popup this often case */
423
- if (openOnce && popupCookie != '') {
424
- return this.canOpenOnce(id);
425
- }
426
-
427
- var dontShow = SGPopup.getCookie('sgPopupDontShow' + id);
428
-
429
- if (dontShow) {
430
- return false;
431
- }
432
-
433
- return true;
434
- };
435
-
436
- SGPopup.prototype.canOpenOnce = function(id) {
437
-
438
- var cookieData = SGPopup.getCookie('sgPopupDetails'+id);
439
- if(!cookieData) {
440
- return true;
441
- }
442
- var cookieData = JSON.parse(cookieData);
443
-
444
- if(cookieData.popupId == id && cookieData.openCounter >= this.numberLimit) {
445
- return false;
446
- }
447
- else {
448
- return true
449
- }
450
-
451
- };
452
-
453
-
454
- SGPopup.prototype.setFixedPosition = function (sgPositionLeft, sgPositionTop, sgPositionBottom, sgPositionRight, sgFixedPositionTop, sgFixedPositionLeft) {
455
-
456
- this.positionLeft = sgPositionLeft;
457
- this.positionTop = sgPositionTop;
458
- this.positionBottom = sgPositionBottom;
459
- this.positionRight = sgPositionRight;
460
- this.initialPositionTop = sgFixedPositionTop;
461
- this.initialPositionLeft = sgFixedPositionLeft;
462
- };
463
-
464
- SGPopup.prototype.percentToPx = function (percentDimention, screenDimension) {
465
-
466
- var dimension = parseInt(percentDimention) * screenDimension / 100;
467
- return dimension;
468
- };
469
-
470
- SGPopup.prototype.getPositionPercent = function (needPercent, screenDimension, dimension) {
471
-
472
- var sgPosition = (((this.percentToPx(needPercent, screenDimension) - dimension / 2) / screenDimension) * 100) + "%";
473
- return sgPosition;
474
- };
475
-
476
- SGPopup.prototype.getPreviewPopupId = function(popupId)
477
- {
478
- var currentUrl = window.location.href;
479
-
480
- var classSplitArray = currentUrl.split('sg_popup_preview_id=');
481
- var classIdString = classSplitArray['1'];
482
-
483
- if (typeof classIdString == 'undefined') {
484
- return false;
485
- }
486
- /*Get first all number from string*/
487
- var urlId = classIdString.match(/^\d+/);
488
-
489
- return urlId;
490
- };
491
-
492
- SGPopup.prototype.currentPopupId = false;
493
-
494
- SGPopup.prototype.restrictIfThereIsPreviewPopup = function(popupId)
495
- {
496
- var previewPopupId = this.getPreviewPopupId();
497
- if (previewPopupId) {
498
- if (popupId != previewPopupId) {
499
- return false;
500
- }
501
-
502
- if (this.currentPopupId) {
503
- return false;
504
- }
505
- }
506
-
507
- return true;
508
- };
509
-
510
- SGPopup.prototype.showPopup = function (id, isOnLoad) {
511
-
512
- var that = this;
513
-
514
- /*When id does not exist*/
515
- if (!id) {
516
- return;
517
- }
518
-
519
- if (typeof SG_POPUP_DATA[id] == "undefined") {
520
- return;
521
- }
522
-
523
- if (!this.restrictIfThereIsPreviewPopup(id)) {
524
- return false;
525
- }
526
-
527
- this.popupData = SG_POPUP_DATA[id];
528
- this.popupType = this.popupData['type'];
529
- this.isOnLoad = isOnLoad;
530
- this.openOnce = this.varToBool(this.popupData['repeatPopup']);
531
- this.numberLimit = this.popupData['popup-appear-number-limit'];
532
-
533
- if (typeof that.removeCookie !== 'undefined') {
534
- that.removeCookie(this.openOnce);
535
- }
536
-
537
- if (!this.canOpenPopup(this.popupData['id'], this.openOnce, isOnLoad)) {
538
- return;
539
- }
540
-
541
- popupColorboxUrl = SG_APP_POPUP_URL + '/style/sgcolorbox/sgthemes.css';
542
- head = document.getElementsByTagName('head')[0];
543
- link = document.createElement('link');
544
- link.type = "text/css";
545
- link.id = "sg_colorbox_theme-css";
546
- link.rel = "stylesheet";
547
- link.href = popupColorboxUrl;
548
- document.getElementsByTagName('head')[0].appendChild(link);
549
- var img = document.createElement('img');
550
- sgAddEvent(img, "error", function () {
551
- that.sgShowColorboxWithOptions();
552
- });
553
- setTimeout(function () {
554
- img.src = popupColorboxUrl;
555
- }, 0);
556
- };
557
-
558
- SGPopup.setToPopupsCookiesList = function (cookieName) {
559
-
560
- var currentCookies = SGPopup.getCookie('sgPopupCookieList');
561
-
562
- if (!currentCookies) {
563
- currentCookies = [];
564
- }
565
- else {
566
- currentCookies = JSON.parse(currentCookies);
567
- }
568
-
569
- if (jQuery.inArray(cookieName, currentCookies) == -1) {
570
- cookieName = currentCookies.push(cookieName);
571
- }
572
-
573
- SGPopup.deleteCookie('sgPopupCookieList');
574
- var currentCookies = JSON.stringify(currentCookies);
575
- SGPopup.setCookie('sgPopupCookieList', currentCookies, 365, true);
576
- };
577
-
578
- SGPopup.prototype.popupThemeDefaultMeasure = function () {
579
-
580
- var themeName = this.popupData['theme'];
581
- var defaults = SGPopup.sgColorBoxDeafults;
582
- /*return theme id*/
583
- var themeId = themeName.replace( /(^.+\D)(\d+)(\D.+$)/i,'$2');
584
-
585
- return defaults[themeId];
586
- };
587
-
588
- SGPopup.prototype.changePopupSettings = function () {
589
-
590
- var popupData = this.popupData;
591
- var popupDimensionMode = popupData['popup-dimension-mode'];
592
- var maxWidth = popupData['maxWidth'];
593
- var screenWidth = jQuery(window).width();
594
- var popupResponsiveDimensionMeasure = popupData['popup-responsive-dimension-measure'];
595
- var isMaxWidthInPercent = maxWidth.indexOf("%") != -1 ? true: false;
596
-
597
- if(popupDimensionMode == 'responsiveMode') {
598
-
599
- if(popupResponsiveDimensionMeasure == 'auto') {
600
- this.popupMaxWidth = '100%';
601
-
602
- /*When max with in px*/
603
- if(maxWidth && !isMaxWidthInPercent && parseInt(maxWidth) < screenWidth) {
604
- this.popupMaxWidth = parseInt(maxWidth);
605
- }
606
- else if(isMaxWidthInPercent && parseInt(maxWidth) < 100) { /*For example when max width is 800% */
607
- this.popupMaxWidth = maxWidth;
608
- }
609
-
610
- }
611
- }
612
- };
613
-
614
- SGPopup.prototype.resizePopup = function (settings) {
615
-
616
- var that = this;
617
- /*Initial window dimensions*/
618
- window.sgpbInitialWindowWith = window.innerWidth;
619
- window.sgpbInitialWindowHeight = window.innerHeight;
620
-
621
- function resizeColorBox () {
622
- var currentWindow = jQuery(this);
623
- var windowWidth = currentWindow.width();
624
- var windowHeight = currentWindow.height();
625
-
626
- var maxWidth = that.popupData['maxWidth'];
627
- var maxHeight = that.popupData['maxHeight'];
628
-
629
- if(!maxWidth) {
630
- maxWidth = '100%';
631
- }
632
-
633
- if(!maxHeight) {
634
- maxHeight = '100%';
635
- }
636
-
637
- if (that.resizeTimer) clearTimeout(that.resizeTimer);
638
- that.resizeTimer = setTimeout(function() {
639
- if (jQuery('#sgcboxOverlay').is(':visible')) {
640
- if (window.sgpbFullScreen === true) {
641
- window.sgpbShouldResize = false;
642
- window.sgpbFullScreen = false;
643
- }
644
- else {
645
- window.sgpbShouldResize = true;
646
- }
647
-
648
- if ((window.innerHeight == screen.height) || (!window.screenTop && !window.screenY)) {
649
- window.sgpbShouldResize = false;
650
- }
651
-
652
- if (maxWidth.indexOf("%") != -1) {
653
- maxWidth = that.percentToPx(maxWidth, windowWidth);
654
- }
655
- else {
656
- maxWidth = parseInt(maxWidth);
657
- }
658
-
659
- if (maxHeight.indexOf("%") != -1) {
660
- maxHeight = that.percentToPx(maxHeight, windowHeight);
661
- }
662
- else {
663
- maxHeight = parseInt(maxHeight);
664
- }
665
-
666
- if(maxWidth > windowWidth) {
667
- maxWidth = windowWidth;
668
- }
669
-
670
- if(maxHeight > windowHeight) {
671
- maxHeight = windowHeight;
672
- }
673
-
674
- settings.maxWidth = maxWidth;
675
- settings.maxHeight = maxHeight;
676
- var hasFocusedInput = false;
677
- jQuery('#sgcboxLoadedContent input,#sgcboxLoadedContent textarea').each(function() {
678
-
679
- if(jQuery(this).is(':focus')) {
680
- hasFocusedInput = true;
681
- }
682
- });
683
- /*For mobile when has some focused input popup does not resize*/
684
- if( /Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && hasFocusedInput ) {
685
- window.sgpbShouldResize = false;
686
- }
687
- /*For just call resize*/
688
- if (currentWindow.width() == window.sgpbInitialWindowWith && currentWindow.height() == window.sgpbInitialWindowHeight) {
689
- window.sgpbShouldResize = false;
690
- }
691
-
692
- if(window.sgpbShouldResize) {
693
- jQuery.sgcolorbox(settings);
694
- jQuery('#sgcboxLoadingGraphic').css({'display': 'none'});
695
- }
696
- }
697
- }, 500);
698
- }
699
-
700
- jQuery(window).resize(resizeColorBox);
701
- window.addEventListener("orientationchange", resizeColorBox, false);
702
-
703
- document.addEventListener("fullscreenchange", function() {
704
- window.sgpbFullScreen = true;
705
- }, false);
706
-
707
- document.addEventListener("msfullscreenchange", function() {
708
- window.sgpbFullScreen = true;
709
- }, false);
710
-
711
- document.addEventListener("mozfullscreenchange", function() {
712
- window.sgpbFullScreen = true;
713
- }, false);
714
-
715
- document.addEventListener("webkitfullscreenchange", function() {
716
- window.sgpbFullScreen = true;
717
- }, false);
718
- };
719
-
720
- SGPopup.prototype.resizeAfterContentResizing = function () {
721
-
722
- var visibilityClasses = [".js-validate-required", ".js-sgpb-visibility"];
723
- var maxHeight = this.popupData['maxHeight'];
724
- var diffContentHight = jQuery("#sgcboxWrapper").height() - jQuery("#sgcboxLoadedContent").height();
725
- for(var index in visibilityClasses) {
726
- jQuery(visibilityClasses[index]).visibilityChanged({
727
- callback: function(element, visible) {
728
- if(maxHeight !== '' && parseInt(maxHeight) < (jQuery("#sgcboxLoadedContent").prop('scrollHeight') + diffContentHight)) {
729
- return false;
730
- }
731
- jQuery.sgcolorbox.resize();
732
- },
733
- runOnLoad: false,
734
- frequency: 2000
735
- });
736
- }
737
-
738
- new ResizeSensor(jQuery('#sgcboxLoadedContent'), function(){
739
- if(maxHeight !== '' && parseInt(maxHeight) < (jQuery("#sgcboxLoadedContent").prop('scrollHeight') + diffContentHight)) {
740
- return false;
741
- }
742
- jQuery.sgcolorbox.resize();
743
- });
744
-
745
- };
746
-
747
- SGPopup.prototype.sgColorboxContentMode = function() {
748
-
749
- var that = this;
750
-
751
- this.sgColorboxContentTypeReset();
752
- var popupType = this.popupData['type'];
753
- var popupHtml = (this.popupData['html'] == '') ? '&nbsp;' : this.popupData['html'];
754
- var popupImage = this.popupData['image'];
755
- var popupIframeUrl = this.popupData['iframe'];
756
- var popupVideo = this.popupData['video'];
757
- var popupId = this.popupData['id'];
758
-
759
- popupImage = (popupImage) ? popupImage : false;
760
- popupVideo = (popupVideo) ? popupVideo : false;
761
- popupIframeUrl = (popupIframeUrl) ? popupIframeUrl : false;
762
-
763
- if(popupType == 'image') {
764
- this.sgColorboxPhoto = true;
765
- this.sgColorboxHref = popupImage;
766
- }
767
-
768
- if(popupIframeUrl) {
769
- this.sgColorboxIframe = true;
770
- this.sgColorboxHref = popupIframeUrl;
771
- }
772
-
773
- if(popupVideo) {
774
- this.sgColorboxIframe = true;
775
- this.sgColorboxHref = popupVideo;
776
- }
777
-
778
- /*this condition jQuery('#sg-popup-content-wrapper-'+popupId).length != 0 for backward compatibility*/
779
- if(popupHtml && jQuery('#sg-popup-content-wrapper-'+popupId).length != 0) {
780
- this.sgColorboxInline = true;
781
- this.sgColorboxHref = '#sg-popup-content-wrapper-'+popupId;
782
- }
783
- else {
784
- this.sgColorboxHtml = popupHtml;
785
- }
786
- };
787
-
788
- SGPopup.prototype.addToCounter = function (popupId) {
789
-
790
- var params = {};
791
- params.popupId = popupId;
792
-
793
- var data = {
794
- action: 'send_to_open_counter',
795
- ajaxNonce: SGPBParams.ajaxNonce,
796
- params: params
797
- };
798
-
799
- jQuery.post(SGPBParams.ajaxUrl, data, function(response,d) {
800
-
801
- });
802
- };
803
- SGPopup.soundValue = 1;
804
-
805
- SGPopup.prototype.contentClickRedirect = function () {
806
-
807
- var popupData = this.popupData;
808
- var contentClickBehavior = popupData['content-click-behavior'];
809
- var clickRedirectToUrl = popupData['click-redirect-to-url'];
810
- var redirectToNewTab = popupData['redirect-to-new-tab'];
811
-
812
- /* If has url for redirect */
813
- if ((contentClickBehavior !== 'close' || clickRedirectToUrl !== '') && typeof contentClickBehavior !== 'undefined') {
814
- jQuery('#sgcolorbox').css({
815
- "cursor": 'pointer'
816
- });
817
- }
818
-
819
- jQuery(".sg-current-popup-" + popupData['id']).bind('click', function () {
820
- if (contentClickBehavior == 'close' || clickRedirectToUrl == '' || typeof contentClickBehavior == 'undefined') {
821
- jQuery.sgcolorbox.close();
822
- }
823
- else {
824
- if (!redirectToNewTab) {
825
- window.location = clickRedirectToUrl;
826
- }
827
- else {
828
- window.open(clickRedirectToUrl);
829
- }
830
- }
831
-
832
- });
833
- };
834
-
835
- SGPopup.prototype.closeButtonDelay = function (buttonDelayValue) {
836
- setTimeout(function(){
837
- jQuery('#sgcboxClose').attr('style', 'display: block !important;');
838
- },
839
- buttonDelayValue * 1000 /* received values covert to seconds */
840
- );
841
- }
842
-
843
- SGPopup.prototype.htmlIframeFilterForOpen = function (popupEventName) {
844
-
845
- var popupId = this.popupData['id'];
846
- var popupContentWrapper = jQuery('#sg-popup-content-wrapper-'+popupId);
847
-
848
- if(!popupContentWrapper.length || typeof this.popupData['htmlIframeUrl'] == 'undefined') {
849
- return;
850
- }
851
-
852
- if(!popupContentWrapper.find('iframe').length) {
853
- return;
854
- }
855
-
856
- if(popupEventName == 'open') {
857
- var iframeUrl = this.popupData['htmlIframeUrl'];
858
- popupContentWrapper.find('iframe').attr('src', iframeUrl);
859
- return;
860
- }
861
-
862
- popupContentWrapper.find('iframe').attr('src', ' ');
863
- return;
864
- };
865
-
866
- SGPopup.prototype.getSearchDataFromContent = function(content)
867
- {
868
- var pattern = /\[(\[?)(pbvariable)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]\*+(?:\[(?!\/\2\])[^\[]\*+)\*+)\[\/\2\])?)(\]?)/gi;
869
- var match;
870
- var collectedData = [];
871
-
872
- while (match = pattern.exec(content)) {
873
- var currentSearchData = [];
874
- currentSearchData['replaceString'] = match[0];
875
- var parseAttributes = /\s(\w+?)="(.+?)"/g;
876
- var attributes;
877
- var attributesKeyValue = [];
878
- while (attributes = parseAttributes.exec(match[3])) {
879
- attributesKeyValue[attributes[1]] = attributes[2];
880
- }
881
- currentSearchData['searchData'] = attributesKeyValue;
882
- collectedData.push(currentSearchData);
883
- }
884
-
885
- return collectedData;
886
- };
887
-
888
- SGPopup.prototype.replaceWithCustomShortcode = function(popupId)
889
- {
890
- var currentHtmlContent = jQuery('#sg-popup-content-wrapper-'+popupId).html();
891
- var searchData = this.getSearchDataFromContent(currentHtmlContent);
892
- var that = this;
893
-
894
- if (!searchData.length) {
895
- return false;
896
- }
897
-
898
- for (var index in searchData) {
899
- var currentSearchData = searchData[index];
900
- var searchAttributes = currentSearchData['searchData'];
901
-
902
- if (typeof searchAttributes['selector'] == 'undefined' || typeof searchAttributes['attribute'] == 'undefined') {
903
- that.replaceShortCode(currentSearchData['replaceString'], '');
904
- continue;
905
- }
906
-
907
- try {
908
- if (!jQuery(searchAttributes['selector']).length) {
909
- that.replaceShortCode(currentSearchData['replaceString'], '');
910
- continue;
911
- }
912
- }
913
- catch (e) {
914
- that.replaceShortCode(currentSearchData['replaceString'], '');
915
- continue;
916
- }
917
-
918
- var replaceName = jQuery(searchAttributes['selector']).attr(searchAttributes['attribute']);
919
-
920
- if (typeof replaceName == 'undefined') {
921
- that.replaceShortCode(currentSearchData['replaceString'], '');
922
- continue;
923
- }
924
-
925
- that.replaceShortCode(currentSearchData['replaceString'], replaceName);
926
- }
927
- };
928
-
929
- SGPopup.prototype.replaceShortCode = function(shortCode, replaceText)
930
- {
931
- var popupId = parseInt(this.popupData['id']);
932
- var popupContentWrapper = jQuery('#sg-popup-content-wrapper-'+popupId);
933
-
934
- if (!popupContentWrapper.length) {
935
- return false;
936
- }
937
-
938
- var currentHtmlContent = popupContentWrapper.contents();
939
-
940
- if (!currentHtmlContent.length) {
941
- return false;
942
- }
943
-
944
- for (var index in currentHtmlContent) {
945
- var currentChild = currentHtmlContent[index];
946
- var currentChildNodeValue = currentChild.nodeValue;
947
- var currentChildNodeType = currentChild.nodeType;
948
-
949
- if (currentChildNodeType != Node.TEXT_NODE) {
950
- continue;
951
- }
952
-
953
- if (currentChildNodeValue.indexOf(shortCode) != -1) {
954
- currentChild.nodeValue = currentChildNodeValue.replace(shortCode, replaceText);
955
- }
956
- }
957
-
958
- return true;
959
- };
960
-
961
- SGPopup.prototype.colorboxEventsListener = function ()
962
- {
963
- var that = this;
964
- var disablePageScrolling = this.varToBool(this.popupData['disable-page-scrolling']);
965
- var popupOpenSound = this.varToBool(this.popupData['popupOpenSound']);
966
- var popupContentBgImage = this.varToBool(this.popupData['popupContentBgImage']);
967
- var popupOpenSoundFile = this.popupData['popupOpenSoundFile'];
968
- var popupContentBgImageUrl = this.popupData['popupContentBgImageUrl'];
969
- var popupContentBackgroundSize = this.popupData['popupContentBackgroundSize'];
970
- var popupContentBackgroundRepeat = this.popupData['popupContentBackgroundRepeat'];
971
- var repetitivePopup = this.popupData['repetitivePopup'];
972
- var repetitivePopupPeriod = this.popupData['repetitivePopupPeriod'];
973
- var buttonDelayValue = this.popupData['buttonDelayValue'];
974
- /*this.popupCloseButton*/
975
- repetitivePopupPeriod = parseInt(repetitivePopupPeriod)*1000;
976
- var repetitiveTimeout = null;
977
-
978
- if(popupOpenSound && popupOpenSoundFile && typeof that.audio == 'undefined') {
979
- that.audio = new Audio(popupOpenSoundFile);
980
- }
981
- jQuery('#sgcolorbox').one("sgColorboxOnOpen", function (e, args) {
982
- var popupId = args.popupId;
983
- that.replaceWithCustomShortcode(popupId);
984
- if(disablePageScrolling) {
985
- jQuery('html').addClass('sgpb-disable-page-scrolling');
986
- }
987
- });
988
-
989
- jQuery('#sgcolorbox').one("sgColorboxOnCompleate", function (e, args) {
990
-
991
- var popupId = args.popupId;
992
- that.addToCounter(popupId);
993
-
994
- if(that.popupData['type'] == 'html') {
995
- that.htmlIframeFilterForOpen('open');
996
- }
997
-
998
- /* if close button is set to be shown and has delay value */
999
- if (that.popupCloseButton && buttonDelayValue) {
1000
- that.closeButtonDelay(buttonDelayValue);
1001
- }
1002
-
1003
- if(that.popupContentClick) {
1004
- that.contentClickRedirect();
1005
- }
1006
-
1007
- clearInterval(repetitiveTimeout);
1008
- if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
1009
- /*
1010
- * SGPopup.soundValue -> 1 sound should play
1011
- * SGPopup.soundValue -> 2 sound should pause
1012
- * */
1013
- if (SGPopup.soundValue == 1) {
1014
-
1015
- that.audio.play();
1016
- SGPopup.soundValue = 2;
1017
-
1018
- } else if (SGPopup.soundValue == 2) {
1019
- that.audio.pause();
1020
- SGPopup.soundValue = 1;
1021
- }
1022
- }
1023
- if(popupContentBgImage) {
1024
- jQuery('#sgcboxLoadedContent').css({
1025
- 'background-image': 'url('+popupContentBgImageUrl+')',
1026
- 'background-size': popupContentBackgroundSize,
1027
- 'background-repeat': popupContentBackgroundRepeat
1028
- });
1029
- }
1030
- });
1031
-
1032
- jQuery('#sgcolorbox').one("sgPopupCleanup", function () {
1033
- if(repetitivePopup) {
1034
- repetitiveTimeout = setTimeout(function() {
1035
- var sgPoupFrontendObj = new SGPopup();
1036
- sgPoupFrontendObj.popupOpenById(that.popupData['id']);
1037
- }, repetitivePopupPeriod);
1038
- }
1039
- if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
1040
- if(typeof that.audio != 'undefined') {
1041
- that.audio.pause();
1042
- delete that.audio;
1043
- }
1044
-
1045
- SGPopup.soundValue = 1;
1046
- }
1047
- });
1048
-
1049
- jQuery('#sgcolorbox').one("sgPopupClose", function () {
1050
- if(disablePageScrolling) {
1051
- jQuery('html').removeClass('sgpb-disable-page-scrolling');
1052
- }
1053
- if(that.popupData['type'] == 'html') {
1054
- that.htmlIframeFilterForOpen('close');
1055
- }
1056
- });
1057
- };
1058
-
1059
- SGPopup.prototype.sgShowColorboxWithOptions = function () {
1060
-
1061
- var that = this;
1062
- setTimeout(function () {
1063
-
1064
- that.colorboxEventsListener();
1065
- var sgPopupFixed = that.varToBool(that.popupData['popupFixed']);
1066
- var popupId = that.popupData['id'];
1067
- that.popupOverlayClose = that.varToBool(that.popupData['overlayClose']);
1068
- that.popupContentClick = that.varToBool(that.popupData['contentClick']);
1069
- var popupReposition = that.varToBool(that.popupData['reposition']);
1070
- var popupScrolling = that.varToBool(that.popupData['scrolling']);
1071
- var popupScaling = that.varToBool(that.popupData['scaling']);
1072
- that.popupEscKey = that.varToBool(that.popupData['escKey']);
1073
- that.popupCloseButton = that.varToBool(that.popupData['closeButton']);
1074
- var countryStatus = that.varToBool(that.popupData['countryStatus']);
1075
- var popupForMobile = that.varToBool(that.popupData['forMobile']);
1076
- var onlyMobile = that.varToBool(that.popupData['openMobile']);
1077
- var popupCantClose = that.varToBool(that.popupData['disablePopup']);
1078
- var disablePopupOverlay = that.varToBool(that.popupData['disablePopupOverlay']);
1079
- var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
1080
- var saveCookiePageLevel = that.varToBool(that.popupData['save-cookie-page-level']);
1081
- var popupClosingTimer = that.popupData['popupClosingTimer'];
1082
-
1083
- if (popupScaling) {
1084
- that.sgPopupScaling();
1085
- }
1086
- if (popupCantClose) {
1087
- that.cantPopupClose();
1088
- }
1089
- that.popupMaxWidth = (!that.popupData['maxWidth']) ? '100%' : that.popupData['maxWidth'];
1090
- var popupPosition = sgPopupFixed ? that.popupData['fixedPostion'] : '';
1091
- var popupVideo = that.popupData['video'];
1092
- var popupOverlayColor = that.popupData['sgOverlayColor'];
1093
- var contentBackgroundColor = that.popupData['sg-content-background-color'];
1094
- var popupDimensionMode = that.popupData['popup-dimension-mode'];
1095
- var popupResponsiveDimensionMeasure = that.popupData['popup-responsive-dimension-measure'];
1096
- var popupWidth = that.popupData['width'];
1097
- var popupHeight = that.popupData['height'];
1098
- var popupOpacity = that.popupData['opacity'];
1099
- var popupMaxHeight = (!that.popupData['maxHeight']) ? '100%' : that.popupData['maxHeight'];
1100
- var popupInitialWidth = that.popupData['initialWidth'];
1101
- var popupInitialHeight = that.popupData['initialHeight'];
1102
- var popupEffectDuration = that.popupData['duration'];
1103
- var popupEffect = that.popupData['effect'];
1104
- var pushToBottom = that.popupData['pushToBottom'];
1105
- var onceExpiresTime = parseInt(that.popupData['onceExpiresTime']);
1106
- var sgType = that.popupData['type'];
1107
- var overlayCustomClass = that.popupData['sgOverlayCustomClasss'];
1108
- var contentCustomClass = that.popupData['sgContentCustomClasss'];
1109
- var popupTheme = that.popupData['theme'];
1110
- var themeStringLength = popupTheme.length;
1111
- var customClassName = popupTheme.substring(0, themeStringLength - 4);
1112
- var closeButtonText = that.popupData['theme-close-text'];
1113
-
1114
- that.sgColorboxContentMode();
1115
-
1116
- if(popupDimensionMode == 'responsiveMode') {
1117
-
1118
- popupWidth = '';
1119
- if(popupResponsiveDimensionMeasure != 'auto') {
1120
- popupWidth = parseInt(popupResponsiveDimensionMeasure)+'%';
1121
- }
1122
-
1123
- if(that.popupData['type'] != 'iframe' && that.popupData['type'] != 'video') {
1124
- popupHeight = '';
1125
- }
1126
- }
1127
-
1128
- var sgScreenWidth = jQuery(window).width();
1129
- var sgScreenHeight = jQuery(window).height();
1130
-
1131
- var sgIsWidthInPercent = popupWidth.indexOf("%");
1132
- var sgIsHeightInPercent = popupHeight.indexOf("%");
1133
- var sgPopupHeightPx = popupHeight;
1134
- var sgPopupWidthPx = popupWidth;
1135
- if (sgIsWidthInPercent != -1) {
1136
- sgPopupWidthPx = that.percentToPx(popupWidth, sgScreenWidth);
1137
- }
1138
- if (sgIsHeightInPercent != -1) {
1139
- sgPopupHeightPx = that.percentToPx(popupHeight, sgScreenHeight);
1140
- }
1141
- /*for when width or height in px*/
1142
- sgPopupWidthPx = parseInt(sgPopupWidthPx);
1143
- sgPopupHeightPx = parseInt(sgPopupHeightPx);
1144
-
1145
- var staticPositionWidth = sgPopupWidthPx;
1146
- if(staticPositionWidth > sgScreenWidth) {
1147
- staticPositionWidth = sgScreenWidth;
1148
- }
1149
-
1150
- var popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
1151
- var popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, staticPositionWidth);
1152
- var posTopForSettings = popupPositionTop;
1153
-
1154
- if (popupPosition == 1) {
1155
- that.setFixedPosition('0%', '3%', false, false, 0, 0);
1156
- } else if (popupPosition == 2) {
1157
- that.setFixedPosition(popupPositionLeft, '3%', false, false, 0, 50);
1158
- } else if (popupPosition == 3) {
1159
- that.setFixedPosition(false, '3%', false, '0%', 0, 90);
1160
- } else if (popupPosition == 4) {
1161
-
1162
- if(isNaN(popupPositionTop)) {
1163
- posTopForSettings = false;
1164
- }
1165
- that.setFixedPosition('0%', posTopForSettings, false, false, posTopForSettings, 0);
1166
- } else if (popupPosition == 5) {
1167
- sgPopupFixed = true;
1168
- that.setFixedPosition(false, false, false, false, 50, 50);
1169
- } else if (popupPosition == 6) {
1170
- if(isNaN(popupPositionTop)) {
1171
- posTopForSettings = false;
1172
- }
1173
- that.setFixedPosition('0%', posTopForSettings, false, '0%', 50, 90);
1174
- } else if (popupPosition == 7) {
1175
- that.setFixedPosition('0%', false, '0%', false, 90, 0);
1176
- } else if (popupPosition == 8) {
1177
- that.setFixedPosition(popupPositionLeft, false, '0%', false, 90, 50);
1178
- } else if (popupPosition == 9) {
1179
- that.setFixedPosition(false, false, '0%', '0%', 90, 90);
1180
- }
1181
- if (!sgPopupFixed) {
1182
- that.setFixedPosition(false, false, false, false, 50, 50);
1183
- }
1184
-
1185
- var userDevice = false;
1186
- if (popupForMobile) {
1187
- userDevice = that.forMobile();
1188
- }
1189
-
1190
- if (popupAutoClosePopup) {
1191
- setTimeout(that.autoClosePopup, popupClosingTimer * 1000);
1192
- }
1193
-
1194
- if (disablePopupOverlay) {
1195
- that.sgTrapFocus = false;
1196
- that.disablePopupOverlay();
1197
- }
1198
-
1199
- if (onlyMobile) {
1200
- var openOnlyMobile = false;
1201
- openOnlyMobile = that.forMobile();
1202
- if (openOnlyMobile == false) {
1203
- return;
1204
- }
1205
- }
1206
-
1207
- if (userDevice) {
1208
- return;
1209
- }
1210
- that.changePopupSettings();
1211
- SG_POPUP_SETTINGS = {
1212
- popupId: popupId,
1213
- html: that.sgColorboxHtml,
1214
- photo: that.sgColorboxPhoto,
1215
- iframe: that.sgColorboxIframe,
1216
- href: that.sgColorboxHref,
1217
- inline: that.sgColorboxInline,
1218
- width: popupWidth,
1219
- height: popupHeight,
1220
- className: customClassName,
1221
- close: closeButtonText,
1222
- overlayCutsomClassName: overlayCustomClass,
1223
- contentCustomClassName: contentCustomClass,
1224
- onOpen: function () {
1225
- that.currentPopupId = popupId;
1226
- if(that.sgColorboxInline) {
1227
- var contentImage = jQuery(that.sgColorboxHref).find('img').first();
1228
- if(contentImage.length) {
1229
- var height = contentImage.attr('height');
1230
- height = parseInt(height);
1231
- contentImage.attr('style', 'height: '+height+' !important');
1232
- }
1233
- }
1234
- jQuery('#sgcolorbox').removeAttr('style');
1235
- jQuery('#sgcolorbox').removeAttr('left');
1236
- jQuery('#sgcolorbox').css('top', '' + that.initialPositionTop + '%');
1237
- jQuery('#sgcolorbox').css('left', '' + that.initialPositionLeft + '%');
1238
- jQuery('#sgcolorbox').css('animation-duration', popupEffectDuration + "s");
1239
- jQuery('#sgcolorbox').css('-webkit-animation-duration', popupEffectDuration + "s");
1240
- jQuery("#sgcolorbox").addClass('sg-animated ' + popupEffect + '');
1241
- jQuery("#sgcboxOverlay").addClass("sgcboxOverlayBg");
1242
- jQuery("#sgcboxOverlay").removeAttr('style');
1243
-
1244
- if (popupOverlayColor) {
1245
- jQuery("#sgcboxOverlay").css({'background': 'none', 'background-color': popupOverlayColor});
1246
- }
1247
- var openArgs = {
1248
- popupId: popupId
1249
- };
1250
-
1251
- jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", openArgs);
1252
-
1253
- },
1254
- onLoad: function () {
1255
- },
1256
- onComplete: function () {
1257
- if (contentBackgroundColor) {
1258
- jQuery("#sgcboxLoadedContent").css({'background-color': contentBackgroundColor});
1259
- }
1260
- jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-" + that.popupData['id']);
1261
- var completeArgs = {
1262
- pushToBottom: pushToBottom,
1263
- popupId: popupId
1264
- };
1265
-
1266
- jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", completeArgs);
1267
-
1268
- var sgpopupInit = new SgPopupInit(that.popupData);
1269
- sgpopupInit.overallInit();
1270
- /* For specific popup Like Countdown AgeRestcion popups */
1271
- sgpopupInit.initByPopupType();
1272
- that.sgCustomizeThemes(that.popupData['id']);
1273
- if(popupDimensionMode == 'responsiveMode') {
1274
- /* it's temporary deactivated for colorbox resize good work that.resizeAfterContentResizing(); */
1275
- that.resizePopup(SG_POPUP_SETTINGS);
1276
- jQuery('#sgcboxLoadingGraphic').remove()
1277
- }
1278
- },
1279
- onCleanup: function () {
1280
- jQuery('#sgcolorbox').trigger("sgPopupCleanup", []);
1281
- },
1282
- onClosed: function () {
1283
- that.currentPopupId = false;
1284
- jQuery("#sgcboxLoadedContent").removeClass("sg-current-popup-" + that.popupData['id']);
1285
- jQuery('#sgcolorbox').trigger("sgPopupClose", []);
1286
- },
1287
- trapFocus: that.sgTrapFocus,
1288
- opacity: popupOpacity,
1289
- escKey: that.popupEscKey,
1290
- closeButton: that.popupCloseButton,
1291
- fixed: sgPopupFixed,
1292
- top: that.positionTop,
1293
- bottom: that.positionBottom,
1294
- left: that.positionLeft,
1295
- right: that.positionRight,
1296
- scrolling: popupScrolling,
1297
- reposition: popupReposition,
1298
- overlayClose: that.popupOverlayClose,
1299
- maxWidth: that.popupMaxWidth,
1300
- maxHeight: popupMaxHeight,
1301
- initialWidth: popupInitialWidth,
1302
- initialHeight: popupInitialHeight
1303
- };
1304
-
1305
- if(popupDimensionMode == 'responsiveMode') {
1306
- /*colorbox open speed*/
1307
- SG_POPUP_SETTINGS.speed = 10;
1308
- }
1309
- if (!that.currentPopupId) {
1310
- jQuery.sgcolorbox(SG_POPUP_SETTINGS);
1311
- }
1312
-
1313
- if (countryStatus == true && typeof SgUserData != "undefined") {
1314
- jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, {expires: 365});
1315
- }
1316
- /* Cookie can't be set here as it's set in Age Restriction popup when the user clicks "yes" */
1317
- if (that.popupData['id'] && that.isOnLoad == true && that.openOnce != '' && that.popupData['type'] != "ageRestriction") {
1318
- var sgCookieData = '';
1319
-
1320
- var currentCookie = SGPopup.getCookie('sgPopupDetails' + that.popupData['id']);
1321
-
1322
- if (!currentCookie) {
1323
- var openCounter = 1;
1324
- }
1325
- else {
1326
- var currentCookie = JSON.parse(currentCookie);
1327
- var openCounter = currentCookie.openCounter += 1;
1328
- }
1329
- sgCookieData = {
1330
- 'popupId': that.popupData['id'],
1331
- 'openCounter': openCounter,
1332
- 'openLimit': that.numberLimit
1333
- };
1334
-
1335
- /*!saveCookiePageLevel it's mean for all site level*/
1336
- SGPopup.setCookie("sgPopupDetails"+that.popupData['id'],JSON.stringify(sgCookieData), onceExpiresTime, !saveCookiePageLevel);
1337
- }
1338
-
1339
-
1340
- jQuery('#sgcolorbox').bind('sgPopupClose', function (e) {
1341
- /* reset event execute count for popup open */
1342
- that.sgEventExecuteCount = 0;
1343
- that.eventExecuteCountByClass = 0;
1344
- jQuery('#sgcolorbox').removeClass(customClassName);
1345
- /* Remove custom class for another popup */
1346
- jQuery('#sgcboxOverlay').removeClass(customClassName);
1347
- jQuery('#sgcolorbox').removeClass(popupEffect);
1348
- /* Remove animated effect for another popup */
1349
- });
1350
-
1351
- }, this.popupData['delay'] * 1000);
1352
- };
1353
-
1354
- jQuery(document).ready(function ($) {
1355
-
1356
- var popupObj = new SGPopup();
1357
- popupObj.init();
1358
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/sg_popup_init.js DELETED
@@ -1,8 +0,0 @@
1
- function SgPopupInit(popupData){this.popupData=popupData;this.shortcodeInPopupContent();this.reopenPopupAfterSubmission();this.dontShowClick();}
2
- SgPopupInit.prototype.reopenPopupAfterSubmission=function(){var that=this;var reopenSubmission=this.popupData['reopenAfterSubmission'];var currentPopupId=this.popupData['id'];SGPopup.deleteCookie('sgSubmitReloadingForm');if(reopenSubmission){jQuery("#sgcboxLoadedContent form").submit(function(){SGPopup.setCookie('sgSubmitReloadingForm',currentPopupId);});}};SgPopupInit.prototype.dontShowClick=function()
3
- {var dontShowPopup=jQuery('#sgcboxLoadedContent [class^=sg-dont-show-popup]');if(!dontShowPopup.length){return false;}
4
- var popupData=this.popupData;dontShowPopup.each(function(){jQuery(this).bind('click',function(e){e.preventDefault();var expireTime=365;var classNameSearch=jQuery(this).attr('class').match(/^sg-dont-show-popup/);var className=classNameSearch['input'];var numberMatched=className.match(/^sg-dont-show-popup-(\d+$)/);if(numberMatched){expireTime=parseInt(numberMatched[1]);}
5
- var popupId=parseInt(popupData['id']);SGPopup.setCookie('sgPopupDontShow'+popupId,expireTime,expireTime,true);jQuery.sgcolorbox.close();});});};SgPopupInit.prototype.shortcodeInPopupContent=function(){jQuery(".sg-show-popup").bind('click',function(){var sgPopupID=jQuery(this).attr("data-sgpopupid");var sgInsidePopup=jQuery(this).attr("insidepopup");if(typeof sgInsidePopup=='undefined'||sgInsidePopup!='on'){return false;}
6
- jQuery.sgcolorbox.close();jQuery('#sgcolorbox').bind("sgPopupClose",function(){if(sgPopupID==''){return;}
7
- var sgPoupFrontendObj=new SGPopup();sgPoupFrontendObj.showPopup(sgPopupID,false);sgPopupID='';});});};SgPopupInit.prototype.overallInit=function(){jQuery('.sg-popup-close').bind('click',function(){jQuery.sgcolorbox.close();});if(jQuery('#sg-facebook-like').length&&typeof FB!=='undefined'){FB.XFBML.parse();}};SgPopupInit.prototype.initByPopupType=function(){var data=this.popupData;var popupObj={};var popupType=data['type'];var popupId=data['id'];switch(popupType){case'countdown':var popupObj=new SGCountdown();popupObj.init();break;case'contactForm':popupObj=new SgContactForm(popupId);popupObj.buildStyle();break;case'social':popupObj=new SgSocialFront();popupObj.init();break;case'subscription':popupObj=new SgSubscription();popupObj.init();break;case'ageRestriction':popupObj=new SGAgeRestriction();popupObj.setPopupId(popupId);popupObj.init();break;}
8
- return popupObj;};
 
 
 
 
 
 
 
 
javascript/sg_popup_javascript.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
-
3
- function sg_set_admin_url($hook) {
4
- if ('popup-builder_page_create-popup' == $hook) {
5
- echo '<script type="text/javascript">SG_ADMIN_URL = "'.admin_url()."admin.php?page=create-popup".'";</script>';
6
- }
7
- }
8
-
9
- function sg_popup_admin_scripts($hook) {
10
-
11
- if ( 'popup-builder_page_edit-popup' == $hook
12
- || 'popup-builder_page_create-popup' == $hook
13
- || 'popup-builder_page_subscribers' == $hook
14
- || 'popup-builder_page_newsletter' == $hook) {
15
-
16
- wp_enqueue_media();
17
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
18
- wp_enqueue_script('jquery');
19
- wp_enqueue_script('javascript');
20
- $localizedData = array(
21
- 'ajaxNonce' => wp_create_nonce('popup-builder-ajax', 'sgpbAjaxNonce')
22
- );
23
- wp_localize_script('javascript', 'backendLocalizedData', $localizedData);
24
-
25
- if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
26
- wp_register_script('sg_popup_pro', SG_APP_POPUP_URL . '/javascript/sg_popup_backend_pro.js');
27
- wp_enqueue_script('sg_popup_pro');
28
- }
29
- }
30
- else if('toplevel_page_PopupBuilder' == $hook || $hook == 'toplevel_page_popup-settings'){
31
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
32
- wp_enqueue_script('jquery');
33
- wp_enqueue_script('javascript');
34
- if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
35
- wp_register_script('sg_popup_pro', SG_APP_POPUP_URL . '/javascript/sg_popup_backend_pro.js');
36
- wp_enqueue_script('sg_popup_pro');
37
- wp_enqueue_media();
38
- }
39
- wp_enqueue_script('jquery');
40
- }
41
- if('popup-builder_page_edit-popup' == $hook) {
42
- wp_register_script('sg_popup_rangeslider', SG_APP_POPUP_URL . '/javascript/sg_popup_rangeslider.js', array('jquery'));
43
- wp_enqueue_script('sg_popup_rangeslider');
44
- wp_enqueue_script('jquery');
45
- if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_PLATINUM) {
46
- wp_register_script('sg_popup_tagsinput', SG_APP_POPUP_URL . '/javascript/bootstrap-tagsinput.js', array('jquery'));
47
- wp_enqueue_script('sg_popup_tagsinput');
48
- }
49
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
50
- wp_register_script('jssocials.min', SG_APP_POPUP_URL . '/javascript/jssocials.min.js');
51
- wp_enqueue_script('jssocials.min');
52
- wp_register_script('sg_social_backend', SG_APP_POPUP_URL . '/javascript/sg_social_backend.js',array('jquery'));
53
- wp_enqueue_script('sg_social_backend');
54
- }
55
- if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
56
- wp_register_script('datetimepicker', SG_APP_POPUP_URL . '/javascript/jquery.datetimepicker.full.min.js');
57
- wp_enqueue_script('datetimepicker');
58
- wp_enqueue_script('jquery-ui-datepicker');
59
- wp_enqueue_script( 'sg_libs_handle', plugins_url('javascript/sg_datapickers.js',dirname(__FILE__)), array('wp-color-picker'));
60
- wp_register_script('sg_popup_pro', SG_APP_POPUP_URL . '/javascript/sg_popup_backend_pro.js');
61
- wp_enqueue_script('sg_popup_pro');
62
- }
63
- wp_enqueue_style( 'wp-color-picker' );
64
-
65
- }
66
- }
67
-
68
- add_action('admin_enqueue_scripts', 'sg_set_admin_url');
69
- add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
70
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/sg_popup_support_plugins.js DELETED
@@ -1,49 +0,0 @@
1
- jQuery(document).ready(function() {
2
- jQuery('#sgcolorbox').bind("sgColorboxOnCompleate", function() {
3
-
4
- // if(jQuery('div.wpcf7 > form').length) { Contact form 7
5
- // jQuery('div.wpcf7 > form').wpcf7InitForm();
6
- // }
7
-
8
- if(jQuery('.myStat').length) { /* Percent to Infograph */
9
- jQuery('.myStat').circliful();
10
- }
11
-
12
- if(jQuery("form[name ^= 'form']").length > 0) { /* for Form Maker plugin */
13
- formMakerId = jQuery("form[name ^= 'form']").attr('name').match(/\d/g);
14
- if(jQuery(".captcha_refresh").length > 0) {
15
- jQuery(".captcha_refresh").bind('click', function() {
16
- captcha_refresh("wd_captcha", formMakerId);
17
- });
18
- captcha_refresh("wd_captcha", formMakerId);
19
- }
20
- }
21
-
22
- if(typeof wpcr3 != "undefined") { /* WP Customer Reviews */
23
- wpcr3.init();
24
- }
25
-
26
- if(jQuery('.pdfemb-viewer').length != 0) { /* PDF Embedder pluguin */
27
- PDFJS.workerSrc = pdfemb_trans.worker_src;
28
- PDFJS.cMapUrl = pdfemb_trans.cmap_url;
29
- PDFJS.cMapPacked = true;
30
- jQuery('.pdfemb-viewer').pdfEmbedder();
31
- }
32
-
33
- /* Google Maps Easy */
34
- if(typeof(gmpAllMapsInfo) !== 'undefined' && gmpAllMapsInfo && gmpAllMapsInfo.length) {
35
- for(var i = 0; i < gmpAllMapsInfo.length; i++) {
36
- if(jQuery('#'+ gmpAllMapsInfo[i].view_html_id).size()) {
37
- gmpInitMapOnPage( gmpAllMapsInfo[i] );
38
- }
39
- }
40
- }
41
- });
42
-
43
- /* Gravity forms Supprt when happen ajax call our js init */
44
- jQuery(document).bind('gform_post_render', function(event, formId){
45
- var obj = new SGPopup();
46
- obj.init();
47
- });
48
-
49
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/sg_resize.js DELETED
@@ -1,266 +0,0 @@
1
- /**
2
- * Copyright Marc J. Schmidt. See the LICENSE file at the top-level
3
- * directory of this distribution and at
4
- * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
5
- */
6
- ;
7
- (function (root, factory) {
8
- if (typeof define === "function" && define.amd) {
9
- define(factory);
10
- } else if (typeof exports === "object") {
11
- module.exports = factory();
12
- } else {
13
- root.ResizeSensor = factory();
14
- }
15
- }(this, function () {
16
-
17
- // Make sure it does not throw in a SSR (Server Side Rendering) situation
18
- if (typeof window === "undefined") {
19
- return null;
20
- }
21
- // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor.
22
- // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
23
- // would generate too many unnecessary events.
24
- var requestAnimationFrame = window.requestAnimationFrame ||
25
- window.mozRequestAnimationFrame ||
26
- window.webkitRequestAnimationFrame ||
27
- function (fn) {
28
- return window.setTimeout(fn, 20);
29
- };
30
-
31
- /**
32
- * Iterate over each of the provided element(s).
33
- *
34
- * @param {HTMLElement|HTMLElement[]} elements
35
- * @param {Function} callback
36
- */
37
- function forEachElement(elements, callback){
38
- var elementsType = Object.prototype.toString.call(elements);
39
- var isCollectionTyped = ('[object Array]' === elementsType
40
- || ('[object NodeList]' === elementsType)
41
- || ('[object HTMLCollection]' === elementsType)
42
- || ('[object Object]' === elementsType)
43
- || ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery
44
- || ('undefined' !== typeof Elements && elements instanceof Elements) //mootools
45
- );
46
- var i = 0, j = elements.length;
47
- if (isCollectionTyped) {
48
- for (; i < j; i++) {
49
- callback(elements[i]);
50
- }
51
- } else {
52
- callback(elements);
53
- }
54
- }
55
-
56
- /**
57
- * Class for dimension change detection.
58
- *
59
- * @param {Element|Element[]|Elements|jQuery} element
60
- * @param {Function} callback
61
- *
62
- * @constructor
63
- */
64
- var ResizeSensor = function(element, callback) {
65
- /**
66
- *
67
- * @constructor
68
- */
69
- function EventQueue() {
70
- var q = [];
71
- this.add = function(ev) {
72
- q.push(ev);
73
- };
74
-
75
- var i, j;
76
- this.call = function() {
77
- for (i = 0, j = q.length; i < j; i++) {
78
- q[i].call();
79
- }
80
- };
81
-
82
- this.remove = function(ev) {
83
- var newQueue = [];
84
- for(i = 0, j = q.length; i < j; i++) {
85
- if(q[i] !== ev) newQueue.push(q[i]);
86
- }
87
- q = newQueue;
88
- }
89
-
90
- this.length = function() {
91
- return q.length;
92
- }
93
- }
94
-
95
- /**
96
- * @param {HTMLElement} element
97
- * @param {String} prop
98
- * @returns {String|Number}
99
- */
100
- function getComputedStyle(element, prop) {
101
- if (element.currentStyle) {
102
- return element.currentStyle[prop];
103
- }
104
- if (window.getComputedStyle) {
105
- return window.getComputedStyle(element, null).getPropertyValue(prop);
106
- }
107
-
108
- return element.style[prop];
109
- }
110
-
111
- /**
112
- *
113
- * @param {HTMLElement} element
114
- * @param {Function} resized
115
- */
116
- function attachResizeEvent(element, resized) {
117
- if (!element) return;
118
- if (element.resizedAttached) {
119
- element.resizedAttached.add(resized);
120
- return;
121
- }
122
-
123
- element.resizedAttached = new EventQueue();
124
- element.resizedAttached.add(resized);
125
-
126
- element.resizeSensor = document.createElement('div');
127
- element.resizeSensor.className = 'resize-sensor';
128
- var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
129
- var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;';
130
-
131
- element.resizeSensor.style.cssText = style;
132
- element.resizeSensor.innerHTML =
133
- '<div class="resize-sensor-expand" style="' + style + '">' +
134
- '<div style="' + styleChild + '"></div>' +
135
- '</div>' +
136
- '<div class="resize-sensor-shrink" style="' + style + '">' +
137
- '<div style="' + styleChild + ' width: 200%; height: 200%"></div>' +
138
- '</div>';
139
- element.appendChild(element.resizeSensor);
140
-
141
- if (getComputedStyle(element, 'position') == 'static') {
142
- element.style.position = 'relative';
143
- }
144
-
145
- var expand = element.resizeSensor.childNodes[0];
146
- var expandChild = expand.childNodes[0];
147
- var shrink = element.resizeSensor.childNodes[1];
148
- var dirty, rafId, newWidth, newHeight;
149
- var lastWidth = element.offsetWidth;
150
- var lastHeight = element.offsetHeight;
151
-
152
- var reset = function() {
153
- expandChild.style.width = '100000px';
154
- expandChild.style.height = '100000px';
155
-
156
- expand.scrollLeft = 100000;
157
- expand.scrollTop = 100000;
158
-
159
- shrink.scrollLeft = 100000;
160
- shrink.scrollTop = 100000;
161
- };
162
-
163
- reset();
164
-
165
- var onResized = function() {
166
- rafId = 0;
167
-
168
- if (!dirty) return;
169
-
170
- lastWidth = newWidth;
171
- lastHeight = newHeight;
172
-
173
- if (element.resizedAttached) {
174
- element.resizedAttached.call();
175
- }
176
- };
177
-
178
- var onScroll = function() {
179
- newWidth = element.offsetWidth;
180
- newHeight = element.offsetHeight;
181
- dirty = newWidth != lastWidth || newHeight != lastHeight;
182
-
183
- if (dirty && !rafId) {
184
- rafId = requestAnimationFrame(onResized);
185
- }
186
-
187
- reset();
188
- };
189
-
190
- var addEvent = function(el, name, cb) {
191
- if (el.attachEvent) {
192
- el.attachEvent('on' + name, cb);
193
- } else {
194
- el.addEventListener(name, cb);
195
- }
196
- };
197
-
198
- addEvent(expand, 'scroll', onScroll);
199
- addEvent(shrink, 'scroll', onScroll);
200
- }
201
-
202
- forEachElement(element, function(elem){
203
- attachResizeEvent(elem, callback);
204
- });
205
-
206
- this.detach = function(ev) {
207
- ResizeSensor.detach(element, ev);
208
- };
209
- };
210
-
211
- ResizeSensor.detach = function(element, ev) {
212
- forEachElement(element, function(elem){
213
- if (!elem) return
214
- if(elem.resizedAttached && typeof ev == "function"){
215
- elem.resizedAttached.remove(ev);
216
- if(elem.resizedAttached.length()) return;
217
- }
218
- if (elem.resizeSensor) {
219
- if (elem.contains(elem.resizeSensor)) {
220
- elem.removeChild(elem.resizeSensor);
221
- }
222
- delete elem.resizeSensor;
223
- delete elem.resizedAttached;
224
- }
225
- });
226
- };
227
-
228
- return ResizeSensor;
229
-
230
- }));
231
-
232
- (function ($) {
233
- var defaults = {
234
- callback: function () { },
235
- runOnLoad: true,
236
- frequency: 2000,
237
- previousVisibility : null
238
- };
239
-
240
- var methods = {};
241
- methods.checkVisibility = function (element, options) {
242
- if (jQuery.contains(document, element[0])) {
243
- var previousVisibility = options.previousVisibility;
244
- var isVisible = element.is(':visible');
245
- options.previousVisibility = isVisible;
246
- if (previousVisibility == null) {
247
- if (options.runOnLoad) {
248
- options.callback(element, isVisible);
249
- }
250
- } else if (previousVisibility !== isVisible) {
251
- options.callback(element, isVisible);
252
- }
253
-
254
- setTimeout(function() {
255
- methods.checkVisibility(element, options);
256
- }, options.frequency);
257
- }
258
- };
259
-
260
- $.fn.visibilityChanged = function (options) {
261
- var settings = $.extend({}, defaults, options);
262
- return this.each(function () {
263
- methods.checkVisibility($(this), settings);
264
- });
265
- };
266
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
popup-builder.php CHANGED
@@ -3,439 +3,28 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
- * Version: 2.6.7.6
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
10
  */
11
 
12
- require_once(dirname(__FILE__) . "/config.php");
13
- require_once(SG_APP_POPUP_HELPERS . '/Helper_functions.php');
14
- HelperFunctions::checkRequirements();
15
-
16
- require_once(SG_APP_POPUP_PATH . "/classes/SGPBExtensionManager.php");
17
- require_once(SG_APP_POPUP_PATH . "/classes/SGPBExtensionsConnector.php");
18
- require_once(SG_APP_POPUP_CLASSES . '/SGPopupBuilderMain.php');
19
-
20
- $mainPopupObj = new SGPopupBuilderMain();
21
- $mainPopupObj->init();
22
-
23
- require_once(SG_APP_POPUP_CLASSES . '/SgRegistry.php');
24
- require_once(SG_APP_POPUP_CLASSES . '/SGPopup.php');
25
- require_once(SG_APP_POPUP_CLASSES . '/SGPBExtension.php');
26
- require_once(SG_APP_POPUP_FILES . '/sg_functions.php');
27
- require_once(SG_APP_POPUP_HELPERS . '/Integrate_external_settings.php');
28
- require_once(SG_APP_POPUP_HELPERS . '/SgPopupGetData.php');
29
-
30
- require_once(SG_APP_POPUP_CLASSES . '/PopupInstaller.php'); //cretae tables
31
-
32
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
33
- require_once(SG_APP_POPUP_CLASSES . '/PopupProInstaller.php'); //uninstall tables
34
- require_once(SG_APP_POPUP_FILES . "/sg_popup_pro.php"); // Pro functions
35
- }
36
- require_once(SG_APP_POPUP_PATH . '/style/sg_popup_style.php'); //include our css file
37
- require_once(SG_APP_POPUP_JS . '/sg_popup_javascript.php'); //include our js file
38
- require_once(SG_APP_POPUP_FILES . '/sg_popup_page_selection.php'); // include here in page button for select popup every page
39
-
40
- register_activation_hook(__FILE__, 'sgPopupActivate');
41
- add_action('wpmu_new_blog', 'sgNewBlogPopup', 10, 6);
42
-
43
- function sgPopupActivate() {
44
-
45
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
46
- PopupInstaller::install();
47
-
48
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
49
- try {
50
- PopupProInstaller::addExtensionToPluginSection();
51
- }
52
- catch (Exception $e) {
53
- echo $e->getMessage();
54
- }
55
- PopupProInstaller::install();
56
- }
57
-
58
- $extensionConnectionObj = new SGPBExtensionsConnector();
59
- $extensionConnectionObj->activate(true);
60
- }
61
-
62
- function sgNewBlogPopup() {
63
-
64
- PopupInstaller::install();
65
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
66
- PopupProInstaller::install();
67
- }
68
- }
69
-
70
- function sgRegisterScripts()
71
- {
72
- SGPopup::$registeredScripts = true;
73
- wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
74
- wp_enqueue_style('sg_animate');
75
- wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery', 'sg_resize'), SG_POPUP_VERSION);
76
- wp_enqueue_script('sg_popup_frontend');
77
- wp_localize_script('sg_popup_frontend', 'SGPBParams',SgPopupBuilderConfig::getFrontendScriptLocalizedData());
78
- wp_register_script('sg_resize', SG_APP_POPUP_URL . '/javascript/sg_resize.js', array('jquery'), SG_POPUP_VERSION);
79
- wp_enqueue_script('sg_resize');
80
- wp_register_script('sg_popup_init', SG_APP_POPUP_URL . '/javascript/sg_popup_init.js', array('jquery'), SG_POPUP_VERSION);
81
- wp_enqueue_script('sg_popup_init');
82
- wp_enqueue_script('jquery');
83
- wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), SG_POPUP_VERSION);
84
- wp_enqueue_script('sg_colorbox');
85
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
86
- wp_register_script('sgPopupPro', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js', array(), SG_POPUP_VERSION);
87
- wp_enqueue_script('sgPopupPro');
88
- wp_register_script('sg_cookie', SG_APP_POPUP_URL . '/javascript/jquery_cookie.js', array('jquery'), SG_POPUP_VERSION);
89
- wp_enqueue_script('sg_cookie');
90
- wp_register_script('sg_popup_queue', SG_APP_POPUP_URL . '/javascript/sg_popup_queue.js', array(), SG_POPUP_VERSION);
91
- wp_enqueue_script('sg_popup_queue');
92
- }
93
- /* For ajax case */
94
- if (defined('DOING_AJAX') && DOING_AJAX && !is_admin()) {
95
- wp_print_scripts('sg_popup_frontend');
96
- wp_print_scripts('sg_colorbox');
97
- wp_print_scripts('sg_popup_support_plugins');
98
- wp_print_scripts('sgPopupPro');
99
- wp_print_scripts('sg_cookie');
100
- wp_print_scripts('sg_popup_queue');
101
- wp_print_scripts('sg_animate');
102
- wp_print_scripts('sg_popup_init');
103
- }
104
- }
105
-
106
- function sgRenderPopupScript($id)
107
- {
108
- if (SGPopup::$registeredScripts == false) {
109
- sgRegisterScripts();
110
- }
111
- $extensionManagerObj = new SGPBExtensionManager();
112
- $extensionManagerObj->includeExtensionScripts($id);
113
- wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/sgthemes.css", array(), SG_POPUP_VERSION);
114
- wp_enqueue_style('sg_colorbox_theme');
115
- sgFindPopupData($id);
116
- }
117
-
118
- function sgFindPopupData($id)
119
- {
120
- $obj = SGPopup::findById($id);
121
- if (!empty($obj)) {
122
- $content = $obj->render();
123
- }
124
-
125
- if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_PLATINUM) {
126
- $userCountryIso = SGFunctions::getUserLocationData($id);
127
- if (!is_bool($userCountryIso)) {
128
- echo "<script type='text/javascript'>SgUserData = {
129
- 'countryIsoName': '$userCountryIso'
130
- }</script>";
131
- }
132
- }
133
-
134
- echo "<script type='text/javascript'>";
135
- echo @$content;
136
- echo "</script>";
137
- }
138
-
139
- function sgShowShortCode($args, $content)
140
- {
141
- ob_start();
142
- $obj = SGPopup::findById($args['id']);
143
- if (!$obj) {
144
- return $content;
145
- }
146
- /*When inside popup short code content is empty*/
147
- if (isset($args['insidepopup']) && empty($content)) {
148
- return;
149
- }
150
- if (!empty($content)) {
151
- $attr = '';
152
- $eventName = @$args['event'];
153
-
154
- if (isset($args['insidepopup'])) {
155
- $attr .= 'insidePopup="on"';
156
- global $SGPB_INSIDE_POPUPS;
157
- if (!in_array($args['id'], $SGPB_INSIDE_POPUPS)) {
158
- $SGPB_INSIDE_POPUPS[] = $args['id'];
159
- sgRenderPopupScript($args['id']);
160
- }
161
- }
162
- else {
163
- sgRenderPopupScript($args['id']);
164
- }
165
- if (@$args['event'] == 'onload') {
166
- $content = '';
167
- }
168
- if (!isset($args['event'])) {
169
- $eventName = 'click';
170
- }
171
- if (isset($args["wrap"])) {
172
- echo "<" . $args["wrap"] . " class='sg-show-popup' data-sgpopupid=" . @$args['id'] . " $attr data-popup-event=" . $eventName . ">" . $content . "</" . $args["wrap"] . " >";
173
- } else {
174
- echo "<a href='javascript:void(0)' class='sg-show-popup' data-sgpopupid=" . @$args['id'] . " $attr data-popup-event=" . $eventName . ">" . $content . "</a>";
175
- }
176
- } else {
177
- /* Free user does not have QUEUE possibility */
178
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
179
- $page = get_queried_object_id();
180
- $popupsId = SgPopupPro::allowPopupInAllPages($page, 'page');
181
-
182
- /* Add shordcode popup id in the QUEUE for php side */
183
- array_push($popupsId, $args['id']);
184
- /* Add shordcode popup id at the first in the QUEUE for javascript side */
185
- echo "<script type=\"text/javascript\">SG_POPUPS_QUEUE.splice(0, 0, " . $args['id'] . ");</script>";
186
- update_option("SG_MULTIPLE_POPUP", $popupsId);
187
- showPopupInPage($args['id']);
188
- } else {
189
- echo showPopupInPage($args['id']);
190
- }
191
-
192
- }
193
- $shortcodeContent = ob_get_contents();
194
- ob_end_clean();
195
- return do_shortcode($shortcodeContent);
196
- }
197
-
198
- add_shortcode('sg_popup', 'sgShowShortCode');
199
-
200
- function sgRenderPopupOpen($popupId)
201
- {
202
- sgRenderPopupScript($popupId);
203
-
204
- echo "<script type=\"text/javascript\">
205
-
206
- sgAddEvent(window, 'load',function() {
207
- var sgPoupFrontendObj = new SGPopup();
208
- sgPoupFrontendObj.popupOpenById($popupId)
209
- });
210
- </script>";
211
- }
212
-
213
- function showPopupInPage($popupId)
214
- {
215
-
216
- $isActivePopup = SgPopupGetData::isActivePopup($popupId);
217
-
218
- if (!$isActivePopup) {
219
- return false;
220
- }
221
-
222
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
223
-
224
- $popupInTimeRange = SgPopupPro::popupInTimeRange($popupId);
225
-
226
- if (!$popupInTimeRange) {
227
- return false;
228
- }
229
-
230
- $isInSchedule = SgPopupPro::popupInSchedule($popupId);
231
-
232
- if (!$isInSchedule) {
233
- return;
234
- }
235
-
236
- $showUser = SgPopupPro::showUserResolution($popupId);
237
- if (!$showUser) return false;
238
-
239
- if (!SGPopup::showPopupForCounrty($popupId)) { /* Sended popupId and function return true or false */
240
- return;
241
- }
242
- }
243
- redenderScriptMode($popupId);
244
- }
245
-
246
- function redenderScriptMode($popupId)
247
- {
248
- /* If user delete popup */
249
- $obj = SGPopup::findById($popupId);
250
-
251
- if (empty($obj)) {
252
- return;
253
- }
254
-
255
- $multiplePopup = get_option('SG_MULTIPLE_POPUP');
256
- $hasEvent = SGPBExtension::hasPopupEvent($popupId);
257
-
258
- if ($hasEvent != 0) {
259
- sgRenderPopupScript($popupId);
260
- return;
261
- }
262
- if ($multiplePopup && @in_array($popupId, $multiplePopup)) {
263
- sgRenderPopupScript($popupId);
264
- return;
265
- }
266
-
267
-
268
- sgRenderPopupOpen($popupId);
269
- }
270
-
271
- function getPopupIdFromContentByClass($content)
272
- {
273
- $popupsID = array();
274
- $popupClasses = array(
275
- 'sg-popup-id-',
276
- 'sg-iframe-popup-',
277
- 'sg-confirm-popup-',
278
- 'sg-popup-hover-'
279
- );
280
-
281
- foreach ($popupClasses as $popupClassName) {
282
-
283
- preg_match_all("/" . $popupClassName . "+[0-9]+/i", $content, $matchers);
284
-
285
- foreach ($matchers['0'] as $value) {
286
- $ids = explode($popupClassName, $value);
287
- $id = @$ids[1];
288
-
289
- if (!empty($id)) {
290
- array_push($popupsID, $id);
291
- }
292
- }
293
- }
294
-
295
- return $popupsID;
296
- }
297
-
298
- function getPopupIdInPageByClass($pageId)
299
- {
300
-
301
- $postContentObj = get_post($pageId);
302
-
303
- if (isset($postContentObj)) {
304
- $content = $postContentObj->post_content;
305
-
306
- /*this will return template for the current page*/
307
- $templatePath = get_page_template();
308
-
309
- if (!empty($templatePath)) {
310
- $content .= file_get_contents($templatePath);
311
- }
312
-
313
- if (isset($postContentObj->post_excerpt)) {
314
- $content .= $postContentObj->post_excerpt;
315
- }
316
- return getPopupIdFromContentByClass($content);
317
- }
318
-
319
- return 0;
320
  }
321
 
322
-
323
- /**
324
- * Get popup id from url
325
- *
326
- * @since 3.1.5
327
- *
328
- * @return int if popup not found->0 otherwise->popupId
329
- *
330
- */
331
-
332
- function getPopupIdFromUrl()
333
- {
334
-
335
- $popupId = 0;
336
- if (!isset($_SERVER['REQUEST_URI'])) {
337
- return $popupId;
338
- }
339
-
340
- $pageUrl = @$_SERVER['REQUEST_URI'];
341
- $byUrlkeys = array('sg_popup_id', 'sg_popup_preview_id');
342
-
343
- foreach ($byUrlkeys as $urlkey) {
344
- preg_match("/".$urlkey."=+[0-9]+/i", $pageUrl, $match);
345
-
346
- if (!empty($match)) {
347
- $matchingNumber = explode("=", $match[0]);
348
- if (!empty($matchingNumber[1])) {
349
- $popupId = (int)$matchingNumber[1];
350
- return $popupId;
351
- }
352
- return 0;
353
- }
354
- }
355
-
356
- return 0;
357
  }
358
 
359
- function sgOnloadPopup()
360
- {
361
- $page = get_queried_object_id();
362
- $postType = get_post_type();
363
- echo SgPopupBuilderConfig::popupJsDataInit();
364
- $popup = "sg_promotional_popup";
365
- /* If popup is set on page load */
366
- $popupId = SGPopup::getPagePopupId($page, $popup);
367
- /* get all popups id which set in current page by class */
368
- $popupsIdByClass = getPopupIdInPageByClass($page);
369
- /* get popup id in page url */
370
- $popupIdInPageUrl = getPopupIdFromUrl();
371
-
372
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
373
- delete_option("SG_MULTIPLE_POPUP");
374
-
375
- /* Retrun all popups id width selected On All Pages */
376
- $popupsId = SgPopupPro::allowPopupInAllPages($page, 'page');
377
- $categories = SgPopupPro::allowPopupInAllCategories($page);
378
-
379
- $popupsId = array_merge($popupsId, $categories);
380
-
381
- $sgpbAllPosts = get_option("SG_ALL_POSTS");
382
-
383
- $popupsInAllPosts = SgPopupPro::popupsIdInAllCategories($postType);
384
- $popupsId = array_merge($popupsInAllPosts, $popupsId);
385
-
386
- /* $popupsId[0] its last selected popup id */
387
- if (isset($popupsId[0])) {
388
- if (count($popupsId) > 0) {
389
- update_option("SG_MULTIPLE_POPUP", $popupsId);
390
- }
391
- foreach ($popupsId as $queuePupupId) {
392
-
393
- showPopupInPage($queuePupupId);
394
- }
395
- $popupsId = json_encode($popupsId);
396
- } else {
397
- $popupsId = json_encode(array());
398
- }
399
- $popupsId = SgPopupPro::filterForRandomIds($popupsId);
400
-
401
- echo '<script type="text/javascript">SG_POPUPS_QUEUE = '.$popupsId.';</script>';
402
- }
403
-
404
- //If popup is set for all pages
405
- if ($popupId != 0) {
406
- showPopupInPage($popupId);
407
- }
408
-
409
- if (!empty($popupsIdByClass)) {
410
- foreach ($popupsIdByClass as $popupId) {
411
- sgRenderPopupScript($popupId);
412
- }
413
- }
414
- if ($popupIdInPageUrl) {
415
- showPopupInPage($popupIdInPageUrl);
416
- }
417
- return false;
418
  }
419
 
420
- add_filter('wp_nav_menu_items', 'getPopupIdByClassFromMenu');
421
- function getPopupIdByClassFromMenu($items)
422
- {
423
- $popupsID = getPopupIdFromContentByClass($items);
424
- if (!empty($popupsID)) {
425
- foreach ($popupsID as $popupId) {
426
- sgRenderPopupScript($popupId);
427
- }
428
- }
429
- return $items;
430
  }
431
 
432
- add_action('wp_head', 'sgOnloadPopup');
433
- require_once(SG_APP_POPUP_FILES . '/sg_popup_media_button.php');
434
- require_once(SG_APP_POPUP_FILES . '/sg_popup_save.php'); // saving form data
435
- require_once(SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
436
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
437
- require_once(SG_APP_POPUP_FILES . '/sg_popup_ajax_pro.php');
438
- }
439
- require_once(SG_APP_POPUP_FILES . '/sg_admin_post.php');
440
- require_once(SG_APP_POPUP_FILES . '/sg_popup_filetrs.php');
441
- require_once(SG_APP_POPUP_FILES . '/sg_popup_actions.php');
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.0.2
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
10
  */
11
 
12
+ /*If this file is called directly, abort.*/
13
+ if (!defined('WPINC')) {
14
+ die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
+ if (class_exists('SgpbPopupConfig')) {
18
+ wp_die('Please, deactivate the FREE version of Popup Builder plugin before upgrading to PRO.');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
+ if (!defined('SG_POPUP_FILE_NAME')) {
22
+ define('SG_POPUP_FILE_NAME', plugin_basename(__FILE__));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
 
25
+ if (!defined('SG_POPUP_FOLDER_NAME')) {
26
+ define('SG_POPUP_FOLDER_NAME', plugin_basename(dirname(__FILE__)));
 
 
 
 
 
 
 
 
27
  }
28
 
29
+ require_once(plugin_dir_path(__FILE__).'com/boot.php');
30
+ require_once(plugin_dir_path(__FILE__).'PopupBuilderInit.php');
 
 
 
 
 
 
 
 
public/css/ResetFormStyle.css ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ----------------------------------------------------------------------------------------------------
2
+ Super Form Reset
3
+ ----------------------------------------------------------------------------------------------------*/
4
+
5
+ .sgpb-form-wrapper input,
6
+ .sgpb-form-wrapper label,
7
+ .sgpb-form-wrapper select,
8
+ .sgpb-form-wrapper button,
9
+ .sgpb-form-wrapper textarea {
10
+ margin: 0;
11
+ border: 0;
12
+ padding: 0;
13
+ display: inline-block;
14
+ vertical-align: middle;
15
+ white-space: normal;
16
+ background: none;
17
+ line-height: 1;
18
+ max-width: 100% !important;
19
+ /* Browsers have different default form fonts */
20
+ font-size: 13px;
21
+ font-family: Arial;
22
+ }
23
+
24
+ /* Remove the stupid outer glow in Webkit */
25
+ .sgpb-form-wrapper input:focus {
26
+ outline: 0;
27
+ }
28
+
29
+ /* Box Sizing Reset
30
+ -----------------------------------------------*/
31
+
32
+ /* All of our custom controls should be what we expect them to be */
33
+ .sgpb-form-wrapper input,
34
+ .sgpb-form-wrapper textarea {
35
+ -webkit-box-sizing: content-box;
36
+ -moz-box-sizing: content-box;
37
+ box-sizing: content-box;
38
+ }
39
+
40
+ /* These elements are usually rendered a certain way by the browser */
41
+ .sgpb-form-wrapper button,
42
+ .sgpb-form-wrapper input[type=reset],
43
+ .sgpb-form-wrapper input[type=button],
44
+ .sgpb-form-wrapper input[type=submit],
45
+ .sgpb-form-wrapper input[type=checkbox],
46
+ .sgpb-form-wrapper input[type=radio],
47
+ .sgpb-form-wrapper select {
48
+ -webkit-box-sizing: border-box;
49
+ -moz-box-sizing: border-box;
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ /* Button Controls
54
+ -----------------------------------------------*/
55
+
56
+ .sgpb-form-wrapper input[type=checkbox],
57
+ .sgpb-form-wrapper input[type=radio] {
58
+ width: 13px;
59
+ height: 13px;
60
+ }
61
+
62
+ /* Search Input
63
+ -----------------------------------------------*/
64
+
65
+ /* Make webkit render the search input like a normal text field */
66
+ .sgpb-form-wrapper input[type=search] {
67
+ -webkit-appearance: textfield;
68
+ -webkit-box-sizing: content-box;
69
+ }
70
+
71
+ /* Turn off the recent search for webkit. It adds about 15px padding on the left */
72
+ .sgpb-form-wrapper ::-webkit-search-decoration {
73
+ display: none;
74
+ }
75
+
76
+ /* Buttons
77
+ -----------------------------------------------*/
78
+
79
+ .sgpb-form-wrapper button,
80
+ .sgpb-form-wrapper input[type="reset"],
81
+ .sgpb-form-wrapper input[type="button"],
82
+ .sgpb-form-wrapper input[type="submit"] {
83
+ /* Fix IE7 display bug */
84
+ overflow: visible;
85
+ width: auto;
86
+ }
87
+
88
+ /* IE8 and FF freak out if this rule is within another selector */
89
+ .sgpb-form-wrapper ::-webkit-file-upload-button {
90
+ padding: 0;
91
+ border: 0;
92
+ background: none;
93
+ }
94
+
95
+ /* Textarea
96
+ -----------------------------------------------*/
97
+
98
+ .sgpb-form-wrapper textarea {
99
+ /* Move the label to the top */
100
+ vertical-align: top;
101
+
102
+ /* Turn off scroll bars in IE unless needed */
103
+ overflow: auto;
104
+ }
105
+
106
+ /* Selects
107
+ -----------------------------------------------*/
108
+
109
+ .sgpb-form-wrapper select[multiple] {
110
+ /* Move the label to the top */
111
+ vertical-align: top;
112
+ }
113
+
114
+ /*Our reset styles*/
115
+ .sgpb-form-wrapper input[type="text"],
116
+ .sgpb-form-wrapper input[type="email"],
117
+ .sgpb-form-wrapper input[type="submit"],
118
+ .sgpb-form-wrapper input[type="button"] {
119
+ max-width: 100% !important;
120
+ padding: 10px !important;
121
+ box-sizing: border-box;
122
+ font-size: 14px !important;
123
+ border-radius: 4px !important;
124
+ box-shadow: none !important;
125
+ margin: 5px auto !important;
126
+ display: inline-block !important;
127
+ font-weight: bold !important;
128
+ background-image: none !important;
129
+ }
130
+
131
+ .sgpb-form-wrapper input[type="submit"],
132
+ .sgpb-form-wrapper input[type="button"] {
133
+ line-height: 0.4 !important;
134
+ font-size: 18px !important;
135
+ box-shadow: inset 0 1px 3px #ddd !important;
136
+ border: none !important;
137
+ }
138
+
139
+ .sg-js-hide {
140
+ display: none;
141
+ }
public/css/SubscriptionForm.css ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .sgpb-form-wrapper input,
2
+ .sgpb-form-wrapper textarea {
3
+ padding: 15px;
4
+ border: 1px solid #ccc;
5
+ margin-bottom: 10px;
6
+ width: 100%;
7
+ box-sizing: border-box;
8
+ font-family: Arial;
9
+ color: #2C3E50;
10
+ font-size: 13px;
11
+ }
12
+
13
+ .sgpb-form-wrapper input[type="submit"],
14
+ .sgpb-form-wrapper input[type="button"] {
15
+ cursor: pointer;
16
+ }
17
+
18
+ .sgpb-form-wrapper input[type="submit"]:hover {
19
+ filter: brightness(90%);
20
+ -ms-filter: brightness(90%);
21
+ }
22
+
23
+ .sgpb-form-wrapper {
24
+ text-align: center;
25
+ }
26
+
27
+ .sgpb-subscription-form label.error {
28
+ text-align: inherit;
29
+ color: red;
30
+ display: block;
31
+ margin: 5px 0;
32
+ }
33
+
34
+ .sgpb-form-wrapper input[type="text"],
35
+ .sgpb-form-wrapper input[type="email"] {
36
+ border: 2px solid;
37
+ }
38
+
39
+ .sgpb-inputs-wrapper.form-group {
40
+ margin: 0;
41
+ padding: 0;
42
+ }
43
+
44
+ .sgpb-subscription-form #sgpb-form {
45
+ margin: 0;
46
+ }
47
+
48
+ /*Subscription form messages*/
49
+ .sgpb-alert {
50
+ padding: 15px;
51
+ border: 1px solid transparent;
52
+ border-radius: 4px;
53
+ text-align: center;
54
+ }
55
+
56
+ .sgpb-alert-info {
57
+ color: #31708f;
58
+ background-color: #d9edf7;
59
+ border-color: #bce8f1;
60
+ }
61
+
62
+ .sgpb-alert-success {
63
+ color: #3c763d;
64
+ background-color: #dff0d8;
65
+ border-color: #d6e9c6;
66
+ }
67
+
68
+ .sgpb-alert-danger {
69
+ color: #a94442;
70
+ background-color: #f2dede;
71
+ border-color: #ebccd1;
72
+ }
73
+
74
+ .sgpb-alert p {
75
+ margin-bottom: 0px;
76
+ }
77
+
78
+ #sgpb-gdpr-field-label {
79
+ margin: 4px 0 0 0;
80
+ max-width: 5% !important;
81
+ font-weight: bold;
82
+ }
83
+
84
+ .sgpb-gdpr-label-wrapper {
85
+ margin: 0 auto !important;
86
+ text-align: left !important;
87
+ }
88
+
89
+ #sgpb-gdpr-field-label + label {
90
+ margin: 4px 0 0 5px;
91
+ width: 80% !important;
92
+ text-align: left !important;
93
+ }
94
+
95
+ .sgpb-gdpr-info {
96
+ margin-bottom: 0;
97
+ margin-top: 5px;
98
+ text-align: left;
99
+ border: none;
100
+ background: transparent;
101
+ padding: 0;
102
+ display: inline-block;
103
+ overflow-wrap: break-word;
104
+ line-height: 1.4em;
105
+ font-size: 13px;
106
+ font-family: BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
107
+ }
{style → public/css}/animate.css RENAMED
File without changes
public/css/fonts/FontAwesome.otf ADDED
Binary file
public/css/fonts/fontawesome-webfont.eot ADDED
Binary file
public/css/fonts/fontawesome-webfont.svg ADDED
@@ -0,0 +1,640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
4
+ <metadata></metadata>
5
+ <defs>
6
+ <font id="fontawesomeregular" horiz-adv-x="1536" >
7
+ <font-face units-per-em="1792" ascent="1536" descent="-256" />
8
+ <missing-glyph horiz-adv-x="448" />
9
+ <glyph unicode=" " horiz-adv-x="448" />
10
+ <glyph unicode="&#x09;" horiz-adv-x="448" />
11
+ <glyph unicode="&#xa0;" horiz-adv-x="448" />
12
+ <glyph unicode="&#xa8;" horiz-adv-x="1792" />
13
+ <glyph unicode="&#xa9;" horiz-adv-x="1792" />
14
+ <glyph unicode="&#xae;" horiz-adv-x="1792" />
15
+ <glyph unicode="&#xb4;" horiz-adv-x="1792" />
16
+ <glyph unicode="&#xc6;" horiz-adv-x="1792" />
17
+ <glyph unicode="&#xd8;" horiz-adv-x="1792" />
18
+ <glyph unicode="&#x2000;" horiz-adv-x="768" />
19
+ <glyph unicode="&#x2001;" horiz-adv-x="1537" />
20
+ <glyph unicode="&#x2002;" horiz-adv-x="768" />
21
+ <glyph unicode="&#x2003;" horiz-adv-x="1537" />
22
+ <glyph unicode="&#x2004;" horiz-adv-x="512" />
23
+ <glyph unicode="&#x2005;" horiz-adv-x="384" />
24
+ <glyph unicode="&#x2006;" horiz-adv-x="256" />
25
+ <glyph unicode="&#x2007;" horiz-adv-x="256" />
26
+ <glyph unicode="&#x2008;" horiz-adv-x="192" />
27
+ <glyph unicode="&#x2009;" horiz-adv-x="307" />
28
+ <glyph unicode="&#x200a;" horiz-adv-x="85" />
29
+ <glyph unicode="&#x202f;" horiz-adv-x="307" />
30
+ <glyph unicode="&#x205f;" horiz-adv-x="384" />
31
+ <glyph unicode="&#x2122;" horiz-adv-x="1792" />
32
+ <glyph unicode="&#x221e;" horiz-adv-x="1792" />
33
+ <glyph unicode="&#x2260;" horiz-adv-x="1792" />
34
+ <glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
35
+ <glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
36
+ <glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
37
+ <glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
38
+ <glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
39
+ <glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
40
+ <glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
41
+ <glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
42
+ <glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
43
+ <glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
44
+ <glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
45
+ <glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
46
+ <glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
47
+ <glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
48
+ <glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
49
+ <glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
50
+ <glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
51
+ <glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
52
+ <glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
53
+ <glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
54
+ <glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
55
+ <glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
56
+ <glyph unicode="&#xf016;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z " />
57
+ <glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
58
+ <glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
59
+ <glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
60
+ <glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
61
+ <glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
62
+ <glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
63
+ <glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
64
+ <glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
65
+ <glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
66
+ <glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
67
+ <glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
68
+ <glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
69
+ <glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
70
+ <glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
71
+ <glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
72
+ <glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
73
+ <glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
74
+ <glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
75
+ <glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
76
+ <glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
77
+ <glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
78
+ <glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
79
+ <glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
80
+ <glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
81
+ <glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q33 0 136.5 -2t160.5 -2q19 0 57 2q-87 253 -184 452zM0 -128l2 79q23 7 56 12.5t57 10.5t49.5 14.5t44.5 29t31 50.5l237 616l280 724h75h53q8 -14 11 -21l205 -480q33 -78 106 -257.5t114 -274.5q15 -34 58 -144.5t72 -168.5q20 -45 35 -57 q19 -15 88 -29.5t84 -20.5q6 -38 6 -57q0 -4 -0.5 -13t-0.5 -13q-63 0 -190 8t-191 8q-76 0 -215 -7t-178 -8q0 43 4 78l131 28q1 0 12.5 2.5t15.5 3.5t14.5 4.5t15 6.5t11 8t9 11t2.5 14q0 16 -31 96.5t-72 177.5t-42 100l-450 2q-26 -58 -76.5 -195.5t-50.5 -162.5 q0 -22 14 -37.5t43.5 -24.5t48.5 -13.5t57 -8.5t41 -4q1 -19 1 -58q0 -9 -2 -27q-58 0 -174.5 10t-174.5 10q-8 0 -26.5 -4t-21.5 -4q-80 -14 -188 -14z" />
82
+ <glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q74 -32 140 -32q376 0 376 335q0 114 -41 180q-27 44 -61.5 74t-67.5 46.5t-80.5 25t-84 10.5t-94.5 2q-73 0 -101 -10q0 -53 -0.5 -159t-0.5 -158q0 -8 -1 -67.5t-0.5 -96.5t4.5 -83.5t12 -66.5zM541 761q42 -7 109 -7q82 0 143 13t110 44.5t74.5 89.5t25.5 142 q0 70 -29 122.5t-79 82t-108 43.5t-124 14q-50 0 -130 -13q0 -50 4 -151t4 -152q0 -27 -0.5 -80t-0.5 -79q0 -46 1 -69zM0 -128l2 94q15 4 85 16t106 27q7 12 12.5 27t8.5 33.5t5.5 32.5t3 37.5t0.5 34v35.5v30q0 982 -22 1025q-4 8 -22 14.5t-44.5 11t-49.5 7t-48.5 4.5 t-30.5 3l-4 83q98 2 340 11.5t373 9.5q23 0 68.5 -0.5t67.5 -0.5q70 0 136.5 -13t128.5 -42t108 -71t74 -104.5t28 -137.5q0 -52 -16.5 -95.5t-39 -72t-64.5 -57.5t-73 -45t-84 -40q154 -35 256.5 -134t102.5 -248q0 -100 -35 -179.5t-93.5 -130.5t-138 -85.5t-163.5 -48.5 t-176 -14q-44 0 -132 3t-132 3q-106 0 -307 -11t-231 -12z" />
83
+ <glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q6 2 81.5 21.5t111.5 37.5q28 35 41 101q1 7 62 289t114 543.5t52 296.5v25q-24 13 -54.5 18.5t-69.5 8t-58 5.5l19 103q33 -2 120 -6.5t149.5 -7t120.5 -2.5q48 0 98.5 2.5t121 7t98.5 6.5q-5 -39 -19 -89q-30 -10 -101.5 -28.5t-108.5 -33.5 q-8 -19 -14 -42.5t-9 -40t-7.5 -45.5t-6.5 -42q-27 -148 -87.5 -419.5t-77.5 -355.5q-2 -9 -13 -58t-20 -90t-16 -83.5t-6 -57.5l1 -18q17 -4 185 -31q-3 -44 -16 -99q-11 0 -32.5 -1.5t-32.5 -1.5q-29 0 -87 10t-86 10q-138 2 -206 2q-51 0 -143 -9t-121 -11z" />
84
+ <glyph unicode="&#xf034;" horiz-adv-x="1792" d="M1744 128q33 0 42 -18.5t-11 -44.5l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80zM81 1407l54 -27q12 -5 211 -5q44 0 132 2 t132 2q36 0 107.5 -0.5t107.5 -0.5h293q6 0 21 -0.5t20.5 0t16 3t17.5 9t15 17.5l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 48t-14.5 73.5t-7.5 35.5q-6 8 -12 12.5t-15.5 6t-13 2.5t-18 0.5t-16.5 -0.5 q-17 0 -66.5 0.5t-74.5 0.5t-64 -2t-71 -6q-9 -81 -8 -136q0 -94 2 -388t2 -455q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q19 42 19 383q0 101 -3 303t-3 303v117q0 2 0.5 15.5t0.5 25t-1 25.5t-3 24t-5 14q-11 12 -162 12q-33 0 -93 -12t-80 -26q-19 -13 -34 -72.5t-31.5 -111t-42.5 -53.5q-42 26 -56 44v383z" />
85
+ <glyph unicode="&#xf035;" d="M81 1407l54 -27q12 -5 211 -5q44 0 132 2t132 2q70 0 246.5 1t304.5 0.5t247 -4.5q33 -1 56 31l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 47.5t-15 73.5t-7 36q-10 13 -27 19q-5 2 -66 2q-30 0 -93 1t-103 1 t-94 -2t-96 -7q-9 -81 -8 -136l1 -152v52q0 -55 1 -154t1.5 -180t0.5 -153q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q7 16 11.5 74t6 145.5t1.5 155t-0.5 153.5t-0.5 89q0 7 -2.5 21.5t-2.5 22.5q0 7 0.5 44t1 73t0 76.5t-3 67.5t-6.5 32q-11 12 -162 12q-41 0 -163 -13.5t-138 -24.5q-19 -12 -34 -71.5t-31.5 -111.5t-42.5 -54q-42 26 -56 44v383zM1310 125q12 0 42 -19.5t57.5 -41.5 t59.5 -49t36 -30q26 -21 26 -49t-26 -49q-4 -3 -36 -30t-59.5 -49t-57.5 -41.5t-42 -19.5q-13 0 -20.5 10.5t-10 28.5t-2.5 33.5t1.5 33t1.5 19.5h-1024q0 -2 1.5 -19.5t1.5 -33t-2.5 -33.5t-10 -28.5t-20.5 -10.5q-12 0 -42 19.5t-57.5 41.5t-59.5 49t-36 30q-26 21 -26 49 t26 49q4 3 36 30t59.5 49t57.5 41.5t42 19.5q13 0 20.5 -10.5t10 -28.5t2.5 -33.5t-1.5 -33t-1.5 -19.5h1024q0 2 -1.5 19.5t-1.5 33t2.5 33.5t10 28.5t20.5 10.5z" />
86
+ <glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
87
+ <glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
88
+ <glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
89
+ <glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
90
+ <glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
91
+ <glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
92
+ <glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
93
+ <glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
94
+ <glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
95
+ <glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
96
+ <glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
97
+ <glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
98
+ <glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
99
+ <glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
100
+ <glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
101
+ <glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
102
+ <glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
103
+ <glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
104
+ <glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
105
+ <glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
106
+ <glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
107
+ <glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
108
+ <glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
109
+ <glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
110
+ <glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
111
+ <glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
112
+ <glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
113
+ <glyph unicode="&#xf053;" horiz-adv-x="1280" d="M1171 1235l-531 -531l531 -531q19 -19 19 -45t-19 -45l-166 -166q-19 -19 -45 -19t-45 19l-742 742q-19 19 -19 45t19 45l742 742q19 19 45 19t45 -19l166 -166q19 -19 19 -45t-19 -45z" />
114
+ <glyph unicode="&#xf054;" horiz-adv-x="1280" d="M1107 659l-742 -742q-19 -19 -45 -19t-45 19l-166 166q-19 19 -19 45t19 45l531 531l-531 531q-19 19 -19 45t19 45l166 166q19 19 45 19t45 -19l742 -742q19 -19 19 -45t-19 -45z" />
115
+ <glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
116
+ <glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
117
+ <glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
118
+ <glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
119
+ <glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
120
+ <glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
121
+ <glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
122
+ <glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
123
+ <glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
124
+ <glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
125
+ <glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
126
+ <glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
127
+ <glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
128
+ <glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
129
+ <glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
130
+ <glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
131
+ <glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
132
+ <glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
133
+ <glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
134
+ <glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
135
+ <glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
136
+ <glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
137
+ <glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
138
+ <glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
139
+ <glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
140
+ <glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
141
+ <glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
142
+ <glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
143
+ <glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
144
+ <glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
145
+ <glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
146
+ <glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
147
+ <glyph unicode="&#xf077;" horiz-adv-x="1792" d="M1683 205l-166 -165q-19 -19 -45 -19t-45 19l-531 531l-531 -531q-19 -19 -45 -19t-45 19l-166 165q-19 19 -19 45.5t19 45.5l742 741q19 19 45 19t45 -19l742 -741q19 -19 19 -45.5t-19 -45.5z" />
148
+ <glyph unicode="&#xf078;" horiz-adv-x="1792" d="M1683 728l-742 -741q-19 -19 -45 -19t-45 19l-742 741q-19 19 -19 45.5t19 45.5l166 165q19 19 45 19t45 -19l531 -531l531 531q19 19 45 19t45 -19l166 -165q19 -19 19 -45.5t-19 -45.5z" />
149
+ <glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
150
+ <glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1536 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1664 1088v-512q0 -24 -16.5 -42.5t-40.5 -21.5l-1044 -122q13 -60 13 -70q0 -16 -24 -64h920q26 0 45 -19t19 -45 t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 11 8 31.5t16 36t21.5 40t15.5 29.5l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t19.5 -15.5t13 -24.5t8 -26t5.5 -29.5t4.5 -26h1201q26 0 45 -19t19 -45z" />
151
+ <glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
152
+ <glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
153
+ <glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
154
+ <glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
155
+ <glyph unicode="&#xf080;" horiz-adv-x="2048" d="M640 640v-512h-256v512h256zM1024 1152v-1024h-256v1024h256zM2048 0v-128h-2048v1536h128v-1408h1920zM1408 896v-768h-256v768h256zM1792 1280v-1152h-256v1152h256z" />
156
+ <glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
157
+ <glyph unicode="&#xf082;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-188v595h199l30 232h-229v148q0 56 23.5 84t91.5 28l122 1v207q-63 9 -178 9q-136 0 -217.5 -80t-81.5 -226v-171h-200v-232h200v-595h-532q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960z" />
158
+ <glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
159
+ <glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
160
+ <glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
161
+ <glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
162
+ <glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
163
+ <glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
164
+ <glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
165
+ <glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
166
+ <glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
167
+ <glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
168
+ <glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
169
+ <glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
170
+ <glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
171
+ <glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
172
+ <glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
173
+ <glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
174
+ <glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
175
+ <glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
176
+ <glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
177
+ <glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
178
+ <glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
179
+ <glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
180
+ <glyph unicode="&#xf09a;" horiz-adv-x="1024" d="M959 1524v-264h-157q-86 0 -116 -36t-30 -108v-189h293l-39 -296h-254v-759h-306v759h-255v296h255v218q0 186 104 288.5t277 102.5q147 0 228 -12z" />
181
+ <glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
182
+ <glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
183
+ <glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
184
+ <glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
185
+ <glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
186
+ <glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
187
+ <glyph unicode="&#xf0a2;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM246 128h1300q-266 300 -266 832q0 51 -24 105t-69 103t-121.5 80.5t-169.5 31.5t-169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -532 -266 -832z M1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5 t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
188
+ <glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
189
+ <glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
190
+ <glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
191
+ <glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
192
+ <glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
193
+ <glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
194
+ <glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
195
+ <glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
196
+ <glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
197
+ <glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-15 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q-15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" />
198
+ <glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
199
+ <glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
200
+ <glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
201
+ <glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
202
+ <glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
203
+ <glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
204
+ <glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
205
+ <glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
206
+ <glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
207
+ <glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
208
+ <glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
209
+ <glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
210
+ <glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
211
+ <glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
212
+ <glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
213
+ <glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
214
+ <glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
215
+ <glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
216
+ <glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
217
+ <glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
218
+ <glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
219
+ <glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
220
+ <glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
221
+ <glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
222
+ <glyph unicode="&#xf0d4;" d="M829 318q0 -76 -58.5 -112.5t-139.5 -36.5q-41 0 -80.5 9.5t-75.5 28.5t-58 53t-22 78q0 46 25 80t65.5 51.5t82 25t84.5 7.5q20 0 31 -2q2 -1 23 -16.5t26 -19t23 -18t24.5 -22t19 -22.5t17 -26t9 -26.5t4.5 -31.5zM755 863q0 -60 -33 -99.5t-92 -39.5q-53 0 -93 42.5 t-57.5 96.5t-17.5 106q0 61 32 104t92 43q53 0 93.5 -45t58 -101t17.5 -107zM861 1120l88 64h-265q-85 0 -161 -32t-127.5 -98t-51.5 -153q0 -93 64.5 -154.5t158.5 -61.5q22 0 43 3q-13 -29 -13 -54q0 -44 40 -94q-175 -12 -257 -63q-47 -29 -75.5 -73t-28.5 -95 q0 -43 18.5 -77.5t48.5 -56.5t69 -37t77.5 -21t76.5 -6q60 0 120.5 15.5t113.5 46t86 82.5t33 117q0 49 -20 89.5t-49 66.5t-58 47.5t-49 44t-20 44.5t15.5 42.5t37.5 39.5t44 42t37.5 59.5t15.5 82.5q0 60 -22.5 99.5t-72.5 90.5h83zM1152 672h128v64h-128v128h-64v-128 h-128v-64h128v-160h64v160zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
223
+ <glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M735 740q0 -36 32 -70.5t77.5 -68t90.5 -73.5t77 -104t32 -142q0 -90 -48 -173q-72 -122 -211 -179.5t-298 -57.5q-132 0 -246.5 41.5t-171.5 137.5q-37 60 -37 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 42 -47.5 74t-15.5 73q0 36 21 85q-46 -4 -68 -4 q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q77 66 182.5 98t217.5 32h418l-138 -88h-131q74 -63 112 -133t38 -160q0 -72 -24.5 -129.5t-59 -93t-69.5 -65t-59.5 -61.5t-24.5 -66zM589 836q38 0 78 16.5t66 43.5q53 57 53 159q0 58 -17 125t-48.5 129.5 t-84.5 103.5t-117 41q-42 0 -82.5 -19.5t-65.5 -52.5q-47 -59 -47 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26zM591 -37q58 0 111.5 13t99 39t73 73t27.5 109q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -48 2 q-53 0 -105 -7t-107.5 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -70 35 -123.5t91.5 -83t119 -44t127.5 -14.5zM1401 839h213v-108h-213v-219h-105v219h-212v108h212v217h105v-217z" />
224
+ <glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
225
+ <glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
226
+ <glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
227
+ <glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
228
+ <glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
229
+ <glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
230
+ <glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
231
+ <glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
232
+ <glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
233
+ <glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
234
+ <glyph unicode="&#xf0e1;" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" />
235
+ <glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
236
+ <glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
237
+ <glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
238
+ <glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
239
+ <glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
240
+ <glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
241
+ <glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
242
+ <glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
243
+ <glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
244
+ <glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
245
+ <glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
246
+ <glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
247
+ <glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
248
+ <glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
249
+ <glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
250
+ <glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
251
+ <glyph unicode="&#xf0f3;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5 t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
252
+ <glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
253
+ <glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
254
+ <glyph unicode="&#xf0f6;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M384 736q0 14 9 23t23 9h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64zM1120 512q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704zM1120 256q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704 q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704z" />
255
+ <glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
256
+ <glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
257
+ <glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
258
+ <glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
259
+ <glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" />
260
+ <glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
261
+ <glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
262
+ <glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
263
+ <glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
264
+ <glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
265
+ <glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
266
+ <glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
267
+ <glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
268
+ <glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
269
+ <glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
270
+ <glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
271
+ <glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
272
+ <glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
273
+ <glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
274
+ <glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
275
+ <glyph unicode="&#xf10c;" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" />
276
+ <glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
277
+ <glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
278
+ <glyph unicode="&#xf110;" horiz-adv-x="1792" d="M526 142q0 -53 -37.5 -90.5t-90.5 -37.5q-52 0 -90 38t-38 90q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1024 -64q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -53 -37.5 -90.5t-90.5 -37.5 t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1522 142q0 -52 -38 -90t-90 -38q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM558 1138q0 -66 -47 -113t-113 -47t-113 47t-47 113t47 113t113 47t113 -47t47 -113z M1728 640q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1088 1344q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1618 1138q0 -93 -66 -158.5t-158 -65.5q-93 0 -158.5 65.5t-65.5 158.5 q0 92 65.5 158t158.5 66q92 0 158 -66t66 -158z" />
279
+ <glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
280
+ <glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
281
+ <glyph unicode="&#xf113;" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
282
+ <glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
283
+ <glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
284
+ <glyph unicode="&#xf116;" horiz-adv-x="1792" />
285
+ <glyph unicode="&#xf117;" horiz-adv-x="1792" />
286
+ <glyph unicode="&#xf118;" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
287
+ <glyph unicode="&#xf119;" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
288
+ <glyph unicode="&#xf11a;" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
289
+ <glyph unicode="&#xf11b;" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" />
290
+ <glyph unicode="&#xf11c;" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" />
291
+ <glyph unicode="&#xf11d;" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
292
+ <glyph unicode="&#xf11e;" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
293
+ <glyph unicode="&#xf120;" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" />
294
+ <glyph unicode="&#xf121;" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" />
295
+ <glyph unicode="&#xf122;" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" />
296
+ <glyph unicode="&#xf123;" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" />
297
+ <glyph unicode="&#xf124;" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" />
298
+ <glyph unicode="&#xf125;" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" />
299
+ <glyph unicode="&#xf126;" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" />
300
+ <glyph unicode="&#xf127;" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
301
+ <glyph unicode="&#xf128;" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" />
302
+ <glyph unicode="&#xf129;" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" />
303
+ <glyph unicode="&#xf12a;" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" />
304
+ <glyph unicode="&#xf12b;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" />
305
+ <glyph unicode="&#xf12c;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" />
306
+ <glyph unicode="&#xf12d;" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" />
307
+ <glyph unicode="&#xf12e;" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" />
308
+ <glyph unicode="&#xf130;" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" />
309
+ <glyph unicode="&#xf131;" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" />
310
+ <glyph unicode="&#xf132;" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
311
+ <glyph unicode="&#xf133;" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
312
+ <glyph unicode="&#xf134;" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" />
313
+ <glyph unicode="&#xf135;" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" />
314
+ <glyph unicode="&#xf136;" horiz-adv-x="1792" d="M1745 763l-164 -763h-334l178 832q13 56 -15 88q-27 33 -83 33h-169l-204 -953h-334l204 953h-286l-204 -953h-334l204 953l-153 327h1276q101 0 189.5 -40.5t147.5 -113.5q60 -73 81 -168.5t0 -194.5z" />
315
+ <glyph unicode="&#xf137;" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
316
+ <glyph unicode="&#xf138;" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
317
+ <glyph unicode="&#xf139;" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
318
+ <glyph unicode="&#xf13a;" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
319
+ <glyph unicode="&#xf13b;" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" />
320
+ <glyph unicode="&#xf13c;" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" />
321
+ <glyph unicode="&#xf13d;" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1792 352v-352q0 -22 -20 -30q-8 -2 -12 -2q-13 0 -23 9l-93 93q-119 -143 -318.5 -226.5t-429.5 -83.5t-429.5 83.5t-318.5 226.5l-93 -93q-9 -9 -23 -9q-4 0 -12 2q-20 8 -20 30v352 q0 14 9 23t23 9h352q22 0 30 -20q8 -19 -7 -35l-100 -100q67 -91 189.5 -153.5t271.5 -82.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19 t19 -45v-128q0 -26 -19 -45t-45 -19h-192v-647q149 20 271.5 82.5t189.5 153.5l-100 100q-15 16 -7 35q8 20 30 20h352q14 0 23 -9t9 -23z" />
322
+ <glyph unicode="&#xf13e;" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736z" />
323
+ <glyph unicode="&#xf140;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
324
+ <glyph unicode="&#xf141;" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
325
+ <glyph unicode="&#xf142;" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
326
+ <glyph unicode="&#xf143;" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
327
+ <glyph unicode="&#xf144;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" />
328
+ <glyph unicode="&#xf145;" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" />
329
+ <glyph unicode="&#xf146;" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
330
+ <glyph unicode="&#xf147;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
331
+ <glyph unicode="&#xf148;" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" />
332
+ <glyph unicode="&#xf149;" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" />
333
+ <glyph unicode="&#xf14a;" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
334
+ <glyph unicode="&#xf14b;" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
335
+ <glyph unicode="&#xf14c;" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
336
+ <glyph unicode="&#xf14d;" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
337
+ <glyph unicode="&#xf14e;" d="M640 448l256 128l-256 128v-256zM1024 1039v-542l-512 -256v542zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
338
+ <glyph unicode="&#xf150;" d="M1145 861q18 -35 -5 -66l-320 -448q-19 -27 -52 -27t-52 27l-320 448q-23 31 -5 66q17 35 57 35h640q40 0 57 -35zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
339
+ <glyph unicode="&#xf151;" d="M1145 419q-17 -35 -57 -35h-640q-40 0 -57 35q-18 35 5 66l320 448q19 27 52 27t52 -27l320 -448q23 -31 5 -66zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
340
+ <glyph unicode="&#xf152;" d="M1088 640q0 -33 -27 -52l-448 -320q-31 -23 -66 -5q-35 17 -35 57v640q0 40 35 57q35 18 66 -5l448 -320q27 -19 27 -52zM1280 160v960q0 14 -9 23t-23 9h-960q-14 0 -23 -9t-9 -23v-960q0 -14 9 -23t23 -9h960q14 0 23 9t9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
341
+ <glyph unicode="&#xf153;" horiz-adv-x="1024" d="M976 229l35 -159q3 -12 -3 -22.5t-17 -14.5l-5 -1q-4 -2 -10.5 -3.5t-16 -4.5t-21.5 -5.5t-25.5 -5t-30 -5t-33.5 -4.5t-36.5 -3t-38.5 -1q-234 0 -409 130.5t-238 351.5h-95q-13 0 -22.5 9.5t-9.5 22.5v113q0 13 9.5 22.5t22.5 9.5h66q-2 57 1 105h-67q-14 0 -23 9 t-9 23v114q0 14 9 23t23 9h98q67 210 243.5 338t400.5 128q102 0 194 -23q11 -3 20 -15q6 -11 3 -24l-43 -159q-3 -13 -14 -19.5t-24 -2.5l-4 1q-4 1 -11.5 2.5l-17.5 3.5t-22.5 3.5t-26 3t-29 2.5t-29.5 1q-126 0 -226 -64t-150 -176h468q16 0 25 -12q10 -12 7 -26 l-24 -114q-5 -26 -32 -26h-488q-3 -37 0 -105h459q15 0 25 -12q9 -12 6 -27l-24 -112q-2 -11 -11 -18.5t-20 -7.5h-387q48 -117 149.5 -185.5t228.5 -68.5q18 0 36 1.5t33.5 3.5t29.5 4.5t24.5 5t18.5 4.5l12 3l5 2q13 5 26 -2q12 -7 15 -21z" />
342
+ <glyph unicode="&#xf154;" horiz-adv-x="1024" d="M1020 399v-367q0 -14 -9 -23t-23 -9h-956q-14 0 -23 9t-9 23v150q0 13 9.5 22.5t22.5 9.5h97v383h-95q-14 0 -23 9.5t-9 22.5v131q0 14 9 23t23 9h95v223q0 171 123.5 282t314.5 111q185 0 335 -125q9 -8 10 -20.5t-7 -22.5l-103 -127q-9 -11 -22 -12q-13 -2 -23 7 q-5 5 -26 19t-69 32t-93 18q-85 0 -137 -47t-52 -123v-215h305q13 0 22.5 -9t9.5 -23v-131q0 -13 -9.5 -22.5t-22.5 -9.5h-305v-379h414v181q0 13 9 22.5t23 9.5h162q14 0 23 -9.5t9 -22.5z" />
343
+ <glyph unicode="&#xf155;" horiz-adv-x="1024" d="M978 351q0 -153 -99.5 -263.5t-258.5 -136.5v-175q0 -14 -9 -23t-23 -9h-135q-13 0 -22.5 9.5t-9.5 22.5v175q-66 9 -127.5 31t-101.5 44.5t-74 48t-46.5 37.5t-17.5 18q-17 21 -2 41l103 135q7 10 23 12q15 2 24 -9l2 -2q113 -99 243 -125q37 -8 74 -8q81 0 142.5 43 t61.5 122q0 28 -15 53t-33.5 42t-58.5 37.5t-66 32t-80 32.5q-39 16 -61.5 25t-61.5 26.5t-62.5 31t-56.5 35.5t-53.5 42.5t-43.5 49t-35.5 58t-21 66.5t-8.5 78q0 138 98 242t255 134v180q0 13 9.5 22.5t22.5 9.5h135q14 0 23 -9t9 -23v-176q57 -6 110.5 -23t87 -33.5 t63.5 -37.5t39 -29t15 -14q17 -18 5 -38l-81 -146q-8 -15 -23 -16q-14 -3 -27 7q-3 3 -14.5 12t-39 26.5t-58.5 32t-74.5 26t-85.5 11.5q-95 0 -155 -43t-60 -111q0 -26 8.5 -48t29.5 -41.5t39.5 -33t56 -31t60.5 -27t70 -27.5q53 -20 81 -31.5t76 -35t75.5 -42.5t62 -50 t53 -63.5t31.5 -76.5t13 -94z" />
344
+ <glyph unicode="&#xf156;" horiz-adv-x="898" d="M898 1066v-102q0 -14 -9 -23t-23 -9h-168q-23 -144 -129 -234t-276 -110q167 -178 459 -536q14 -16 4 -34q-8 -18 -29 -18h-195q-16 0 -25 12q-306 367 -498 571q-9 9 -9 22v127q0 13 9.5 22.5t22.5 9.5h112q132 0 212.5 43t102.5 125h-427q-14 0 -23 9t-9 23v102 q0 14 9 23t23 9h413q-57 113 -268 113h-145q-13 0 -22.5 9.5t-9.5 22.5v133q0 14 9 23t23 9h832q14 0 23 -9t9 -23v-102q0 -14 -9 -23t-23 -9h-233q47 -61 64 -144h171q14 0 23 -9t9 -23z" />
345
+ <glyph unicode="&#xf157;" horiz-adv-x="1027" d="M603 0h-172q-13 0 -22.5 9t-9.5 23v330h-288q-13 0 -22.5 9t-9.5 23v103q0 13 9.5 22.5t22.5 9.5h288v85h-288q-13 0 -22.5 9t-9.5 23v104q0 13 9.5 22.5t22.5 9.5h214l-321 578q-8 16 0 32q10 16 28 16h194q19 0 29 -18l215 -425q19 -38 56 -125q10 24 30.5 68t27.5 61 l191 420q8 19 29 19h191q17 0 27 -16q9 -14 1 -31l-313 -579h215q13 0 22.5 -9.5t9.5 -22.5v-104q0 -14 -9.5 -23t-22.5 -9h-290v-85h290q13 0 22.5 -9.5t9.5 -22.5v-103q0 -14 -9.5 -23t-22.5 -9h-290v-330q0 -13 -9.5 -22.5t-22.5 -9.5z" />
346
+ <glyph unicode="&#xf158;" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" />
347
+ <glyph unicode="&#xf159;" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" />
348
+ <glyph unicode="&#xf15a;" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" />
349
+ <glyph unicode="&#xf15b;" d="M1024 1024v472q22 -14 36 -28l408 -408q14 -14 28 -36h-472zM896 992q0 -40 28 -68t68 -28h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544z" />
350
+ <glyph unicode="&#xf15c;" d="M1468 1060q14 -14 28 -36h-472v472q22 -14 36 -28zM992 896h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544q0 -40 28 -68t68 -28zM1152 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23z" />
351
+ <glyph unicode="&#xf15d;" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" />
352
+ <glyph unicode="&#xf15e;" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" />
353
+ <glyph unicode="&#xf160;" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" />
354
+ <glyph unicode="&#xf161;" horiz-adv-x="1792" d="M1216 -32v-192q0 -14 -9 -23t-23 -9h-256q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192 q14 0 23 -9t9 -23zM1408 480v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1600 992v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1792 1504v-192q0 -14 -9 -23t-23 -9h-832 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832q14 0 23 -9t9 -23z" />
355
+ <glyph unicode="&#xf162;" d="M1346 223q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23 zM1486 165q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5 t82 -252.5zM1456 882v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165z" />
356
+ <glyph unicode="&#xf163;" d="M1346 1247q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9 t9 -23zM1456 -142v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165zM1486 1189q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13 q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5t82 -252.5z" />
357
+ <glyph unicode="&#xf164;" horiz-adv-x="1664" d="M256 192q0 26 -19 45t-45 19q-27 0 -45.5 -19t-18.5 -45q0 -27 18.5 -45.5t45.5 -18.5q26 0 45 18.5t19 45.5zM416 704v-640q0 -26 -19 -45t-45 -19h-288q-26 0 -45 19t-19 45v640q0 26 19 45t45 19h288q26 0 45 -19t19 -45zM1600 704q0 -86 -55 -149q15 -44 15 -76 q3 -76 -43 -137q17 -56 0 -117q-15 -57 -54 -94q9 -112 -49 -181q-64 -76 -197 -78h-36h-76h-17q-66 0 -144 15.5t-121.5 29t-120.5 39.5q-123 43 -158 44q-26 1 -45 19.5t-19 44.5v641q0 25 18 43.5t43 20.5q24 2 76 59t101 121q68 87 101 120q18 18 31 48t17.5 48.5 t13.5 60.5q7 39 12.5 61t19.5 52t34 50q19 19 45 19q46 0 82.5 -10.5t60 -26t40 -40.5t24 -45t12 -50t5 -45t0.5 -39q0 -38 -9.5 -76t-19 -60t-27.5 -56q-3 -6 -10 -18t-11 -22t-8 -24h277q78 0 135 -57t57 -135z" />
358
+ <glyph unicode="&#xf165;" horiz-adv-x="1664" d="M256 960q0 -26 -19 -45t-45 -19q-27 0 -45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45 -18.5t19 -45.5zM416 448v640q0 26 -19 45t-45 19h-288q-26 0 -45 -19t-19 -45v-640q0 -26 19 -45t45 -19h288q26 0 45 19t19 45zM1545 597q55 -61 55 -149q-1 -78 -57.5 -135 t-134.5 -57h-277q4 -14 8 -24t11 -22t10 -18q18 -37 27 -57t19 -58.5t10 -76.5q0 -24 -0.5 -39t-5 -45t-12 -50t-24 -45t-40 -40.5t-60 -26t-82.5 -10.5q-26 0 -45 19q-20 20 -34 50t-19.5 52t-12.5 61q-9 42 -13.5 60.5t-17.5 48.5t-31 48q-33 33 -101 120q-49 64 -101 121 t-76 59q-25 2 -43 20.5t-18 43.5v641q0 26 19 44.5t45 19.5q35 1 158 44q77 26 120.5 39.5t121.5 29t144 15.5h17h76h36q133 -2 197 -78q58 -69 49 -181q39 -37 54 -94q17 -61 0 -117q46 -61 43 -137q0 -32 -15 -76z" />
359
+ <glyph unicode="&#xf166;" d="M919 233v157q0 50 -29 50q-17 0 -33 -16v-224q16 -16 33 -16q29 0 29 49zM1103 355h66v34q0 51 -33 51t-33 -51v-34zM532 621v-70h-80v-423h-74v423h-78v70h232zM733 495v-367h-67v40q-39 -45 -76 -45q-33 0 -42 28q-6 16 -6 54v290h66v-270q0 -24 1 -26q1 -15 15 -15 q20 0 42 31v280h67zM985 384v-146q0 -52 -7 -73q-12 -42 -53 -42q-35 0 -68 41v-36h-67v493h67v-161q32 40 68 40q41 0 53 -42q7 -21 7 -74zM1236 255v-9q0 -29 -2 -43q-3 -22 -15 -40q-27 -40 -80 -40q-52 0 -81 38q-21 27 -21 86v129q0 59 20 86q29 38 80 38t78 -38 q21 -28 21 -86v-76h-133v-65q0 -51 34 -51q24 0 30 26q0 1 0.5 7t0.5 16.5v21.5h68zM785 1079v-156q0 -51 -32 -51t-32 51v156q0 52 32 52t32 -52zM1318 366q0 177 -19 260q-10 44 -43 73.5t-76 34.5q-136 15 -412 15q-275 0 -411 -15q-44 -5 -76.5 -34.5t-42.5 -73.5 q-20 -87 -20 -260q0 -176 20 -260q10 -43 42.5 -73t75.5 -35q137 -15 412 -15t412 15q43 5 75.5 35t42.5 73q20 84 20 260zM563 1017l90 296h-75l-51 -195l-53 195h-78l24 -69t23 -69q35 -103 46 -158v-201h74v201zM852 936v130q0 58 -21 87q-29 38 -78 38q-51 0 -78 -38 q-21 -29 -21 -87v-130q0 -58 21 -87q27 -38 78 -38q49 0 78 38q21 27 21 87zM1033 816h67v370h-67v-283q-22 -31 -42 -31q-15 0 -16 16q-1 2 -1 26v272h-67v-293q0 -37 6 -55q11 -27 43 -27q36 0 77 45v-40zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
360
+ <glyph unicode="&#xf167;" d="M971 292v-211q0 -67 -39 -67q-23 0 -45 22v301q22 22 45 22q39 0 39 -67zM1309 291v-46h-90v46q0 68 45 68t45 -68zM343 509h107v94h-312v-94h105v-569h100v569zM631 -60h89v494h-89v-378q-30 -42 -57 -42q-18 0 -21 21q-1 3 -1 35v364h-89v-391q0 -49 8 -73 q12 -37 58 -37q48 0 102 61v-54zM1060 88v197q0 73 -9 99q-17 56 -71 56q-50 0 -93 -54v217h-89v-663h89v48q45 -55 93 -55q54 0 71 55q9 27 9 100zM1398 98v13h-91q0 -51 -2 -61q-7 -36 -40 -36q-46 0 -46 69v87h179v103q0 79 -27 116q-39 51 -106 51q-68 0 -107 -51 q-28 -37 -28 -116v-173q0 -79 29 -116q39 -51 108 -51q72 0 108 53q18 27 21 54q2 9 2 58zM790 1011v210q0 69 -43 69t-43 -69v-210q0 -70 43 -70t43 70zM1509 260q0 -234 -26 -350q-14 -59 -58 -99t-102 -46q-184 -21 -555 -21t-555 21q-58 6 -102.5 46t-57.5 99 q-26 112 -26 350q0 234 26 350q14 59 58 99t103 47q183 20 554 20t555 -20q58 -7 102.5 -47t57.5 -99q26 -112 26 -350zM511 1536h102l-121 -399v-271h-100v271q-14 74 -61 212q-37 103 -65 187h106l71 -263zM881 1203v-175q0 -81 -28 -118q-37 -51 -106 -51q-67 0 -105 51 q-28 38 -28 118v175q0 80 28 117q38 51 105 51q69 0 106 -51q28 -37 28 -117zM1216 1365v-499h-91v55q-53 -62 -103 -62q-46 0 -59 37q-8 24 -8 75v394h91v-367q0 -33 1 -35q3 -22 21 -22q27 0 57 43v381h91z" />
361
+ <glyph unicode="&#xf168;" horiz-adv-x="1408" d="M597 869q-10 -18 -257 -456q-27 -46 -65 -46h-239q-21 0 -31 17t0 36l253 448q1 0 0 1l-161 279q-12 22 -1 37q9 15 32 15h239q40 0 66 -45zM1403 1511q11 -16 0 -37l-528 -934v-1l336 -615q11 -20 1 -37q-10 -15 -32 -15h-239q-42 0 -66 45l-339 622q18 32 531 942 q25 45 64 45h241q22 0 31 -15z" />
362
+ <glyph unicode="&#xf169;" d="M685 771q0 1 -126 222q-21 34 -52 34h-184q-18 0 -26 -11q-7 -12 1 -29l125 -216v-1l-196 -346q-9 -14 0 -28q8 -13 24 -13h185q31 0 50 36zM1309 1268q-7 12 -24 12h-187q-30 0 -49 -35l-411 -729q1 -2 262 -481q20 -35 52 -35h184q18 0 25 12q8 13 -1 28l-260 476v1 l409 723q8 16 0 28zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
363
+ <glyph unicode="&#xf16a;" horiz-adv-x="1792" d="M1280 640q0 37 -30 54l-512 320q-31 20 -65 2q-33 -18 -33 -56v-640q0 -38 33 -56q16 -8 31 -8q20 0 34 10l512 320q30 17 30 54zM1792 640q0 -96 -1 -150t-8.5 -136.5t-22.5 -147.5q-16 -73 -69 -123t-124 -58q-222 -25 -671 -25t-671 25q-71 8 -124.5 58t-69.5 123 q-14 65 -21.5 147.5t-8.5 136.5t-1 150t1 150t8.5 136.5t22.5 147.5q16 73 69 123t124 58q222 25 671 25t671 -25q71 -8 124.5 -58t69.5 -123q14 -65 21.5 -147.5t8.5 -136.5t1 -150z" />
364
+ <glyph unicode="&#xf16b;" horiz-adv-x="1792" d="M402 829l494 -305l-342 -285l-490 319zM1388 274v-108l-490 -293v-1l-1 1l-1 -1v1l-489 293v108l147 -96l342 284v2l1 -1l1 1v-2l343 -284zM554 1418l342 -285l-494 -304l-338 270zM1390 829l338 -271l-489 -319l-343 285zM1239 1418l489 -319l-338 -270l-494 304z" />
365
+ <glyph unicode="&#xf16c;" horiz-adv-x="1408" d="M928 135v-151l-707 -1v151zM1169 481v-701l-1 -35v-1h-1132l-35 1h-1v736h121v-618h928v618h120zM241 393l704 -65l-13 -150l-705 65zM309 709l683 -183l-39 -146l-683 183zM472 1058l609 -360l-77 -130l-609 360zM832 1389l398 -585l-124 -85l-399 584zM1285 1536 l121 -697l-149 -26l-121 697z" />
366
+ <glyph unicode="&#xf16d;" d="M1362 110v648h-135q20 -63 20 -131q0 -126 -64 -232.5t-174 -168.5t-240 -62q-197 0 -337 135.5t-140 327.5q0 68 20 131h-141v-648q0 -26 17.5 -43.5t43.5 -17.5h1069q25 0 43 17.5t18 43.5zM1078 643q0 124 -90.5 211.5t-218.5 87.5q-127 0 -217.5 -87.5t-90.5 -211.5 t90.5 -211.5t217.5 -87.5q128 0 218.5 87.5t90.5 211.5zM1362 1003v165q0 28 -20 48.5t-49 20.5h-174q-29 0 -49 -20.5t-20 -48.5v-165q0 -29 20 -49t49 -20h174q29 0 49 20t20 49zM1536 1211v-1142q0 -81 -58 -139t-139 -58h-1142q-81 0 -139 58t-58 139v1142q0 81 58 139 t139 58h1142q81 0 139 -58t58 -139z" />
367
+ <glyph unicode="&#xf16e;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM698 640q0 88 -62 150t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150zM1262 640q0 88 -62 150 t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150z" />
368
+ <glyph unicode="&#xf170;" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
369
+ <glyph unicode="&#xf171;" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" />
370
+ <glyph unicode="&#xf172;" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
371
+ <glyph unicode="&#xf173;" horiz-adv-x="1024" d="M944 207l80 -237q-23 -35 -111 -66t-177 -32q-104 -2 -190.5 26t-142.5 74t-95 106t-55.5 120t-16.5 118v544h-168v215q72 26 129 69.5t91 90t58 102t34 99t15 88.5q1 5 4.5 8.5t7.5 3.5h244v-424h333v-252h-334v-518q0 -30 6.5 -56t22.5 -52.5t49.5 -41.5t81.5 -14 q78 2 134 29z" />
372
+ <glyph unicode="&#xf174;" d="M1136 75l-62 183q-44 -22 -103 -22q-36 -1 -62 10.5t-38.5 31.5t-17.5 40.5t-5 43.5v398h257v194h-256v326h-188q-8 0 -9 -10q-5 -44 -17.5 -87t-39 -95t-77 -95t-118.5 -68v-165h130v-418q0 -57 21.5 -115t65 -111t121 -85.5t176.5 -30.5q69 1 136.5 25t85.5 50z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
373
+ <glyph unicode="&#xf175;" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" />
374
+ <glyph unicode="&#xf176;" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" />
375
+ <glyph unicode="&#xf177;" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" />
376
+ <glyph unicode="&#xf178;" horiz-adv-x="1792" d="M1728 643q0 -14 -10 -24l-384 -354q-16 -14 -35 -6q-19 9 -19 29v224h-1248q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h1248v224q0 21 19 29t35 -5l384 -350q10 -10 10 -23z" />
377
+ <glyph unicode="&#xf179;" horiz-adv-x="1408" d="M1393 321q-39 -125 -123 -250q-129 -196 -257 -196q-49 0 -140 32q-86 32 -151 32q-61 0 -142 -33q-81 -34 -132 -34q-152 0 -301 259q-147 261 -147 503q0 228 113 374q112 144 284 144q72 0 177 -30q104 -30 138 -30q45 0 143 34q102 34 173 34q119 0 213 -65 q52 -36 104 -100q-79 -67 -114 -118q-65 -94 -65 -207q0 -124 69 -223t158 -126zM1017 1494q0 -61 -29 -136q-30 -75 -93 -138q-54 -54 -108 -72q-37 -11 -104 -17q3 149 78 257q74 107 250 148q1 -3 2.5 -11t2.5 -11q0 -4 0.5 -10t0.5 -10z" />
378
+ <glyph unicode="&#xf17a;" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" />
379
+ <glyph unicode="&#xf17b;" horiz-adv-x="1408" d="M493 1053q16 0 27.5 11.5t11.5 27.5t-11.5 27.5t-27.5 11.5t-27 -11.5t-11 -27.5t11 -27.5t27 -11.5zM915 1053q16 0 27 11.5t11 27.5t-11 27.5t-27 11.5t-27.5 -11.5t-11.5 -27.5t11.5 -27.5t27.5 -11.5zM103 869q42 0 72 -30t30 -72v-430q0 -43 -29.5 -73t-72.5 -30 t-73 30t-30 73v430q0 42 30 72t73 30zM1163 850v-666q0 -46 -32 -78t-77 -32h-75v-227q0 -43 -30 -73t-73 -30t-73 30t-30 73v227h-138v-227q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73l-1 227h-74q-46 0 -78 32t-32 78v666h918zM931 1255q107 -55 171 -153.5t64 -215.5 h-925q0 117 64 215.5t172 153.5l-71 131q-7 13 5 20q13 6 20 -6l72 -132q95 42 201 42t201 -42l72 132q7 12 20 6q12 -7 5 -20zM1408 767v-430q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73v430q0 43 30 72.5t72 29.5q43 0 73 -29.5t30 -72.5z" />
380
+ <glyph unicode="&#xf17c;" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" />
381
+ <glyph unicode="&#xf17d;" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
382
+ <glyph unicode="&#xf17e;" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" />
383
+ <glyph unicode="&#xf180;" horiz-adv-x="1280" d="M1000 1102l37 194q5 23 -9 40t-35 17h-712q-23 0 -38.5 -17t-15.5 -37v-1101q0 -7 6 -1l291 352q23 26 38 33.5t48 7.5h239q22 0 37 14.5t18 29.5q24 130 37 191q4 21 -11.5 40t-36.5 19h-294q-29 0 -48 19t-19 48v42q0 29 19 47.5t48 18.5h346q18 0 35 13.5t20 29.5z M1227 1324q-15 -73 -53.5 -266.5t-69.5 -350t-35 -173.5q-6 -22 -9 -32.5t-14 -32.5t-24.5 -33t-38.5 -21t-58 -10h-271q-13 0 -22 -10q-8 -9 -426 -494q-22 -25 -58.5 -28.5t-48.5 5.5q-55 22 -55 98v1410q0 55 38 102.5t120 47.5h888q95 0 127 -53t10 -159zM1227 1324 l-158 -790q4 17 35 173.5t69.5 350t53.5 266.5z" />
384
+ <glyph unicode="&#xf181;" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
385
+ <glyph unicode="&#xf182;" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
386
+ <glyph unicode="&#xf183;" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
387
+ <glyph unicode="&#xf184;" d="M773 234l350 473q16 22 24.5 59t-6 85t-61.5 79q-40 26 -83 25.5t-73.5 -17.5t-54.5 -45q-36 -40 -96 -40q-59 0 -95 40q-24 28 -54.5 45t-73.5 17.5t-84 -25.5q-46 -31 -60.5 -79t-6 -85t24.5 -59zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
388
+ <glyph unicode="&#xf185;" horiz-adv-x="1792" d="M1472 640q0 117 -45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5zM1748 363q-4 -15 -20 -20l-292 -96v-306q0 -16 -13 -26q-15 -10 -29 -4 l-292 94l-180 -248q-10 -13 -26 -13t-26 13l-180 248l-292 -94q-14 -6 -29 4q-13 10 -13 26v306l-292 96q-16 5 -20 20q-5 17 4 29l180 248l-180 248q-9 13 -4 29q4 15 20 20l292 96v306q0 16 13 26q15 10 29 4l292 -94l180 248q9 12 26 12t26 -12l180 -248l292 94 q14 6 29 -4q13 -10 13 -26v-306l292 -96q16 -5 20 -20q5 -16 -4 -29l-180 -248l180 -248q9 -12 4 -29z" />
389
+ <glyph unicode="&#xf186;" d="M1262 233q-54 -9 -110 -9q-182 0 -337 90t-245 245t-90 337q0 192 104 357q-201 -60 -328.5 -229t-127.5 -384q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51q144 0 273.5 61.5t220.5 171.5zM1465 318q-94 -203 -283.5 -324.5t-413.5 -121.5q-156 0 -298 61 t-245 164t-164 245t-61 298q0 153 57.5 292.5t156 241.5t235.5 164.5t290 68.5q44 2 61 -39q18 -41 -15 -72q-86 -78 -131.5 -181.5t-45.5 -218.5q0 -148 73 -273t198 -198t273 -73q118 0 228 51q41 18 72 -13q14 -14 17.5 -34t-4.5 -38z" />
390
+ <glyph unicode="&#xf187;" horiz-adv-x="1792" d="M1088 704q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45t19 -45t45 -19h256q26 0 45 19t19 45zM1664 896v-960q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v960q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1728 1344v-256q0 -26 -19 -45t-45 -19h-1536 q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1536q26 0 45 -19t19 -45z" />
391
+ <glyph unicode="&#xf188;" horiz-adv-x="1664" d="M1632 576q0 -26 -19 -45t-45 -19h-224q0 -171 -67 -290l208 -209q19 -19 19 -45t-19 -45q-18 -19 -45 -19t-45 19l-198 197q-5 -5 -15 -13t-42 -28.5t-65 -36.5t-82 -29t-97 -13v896h-128v-896q-51 0 -101.5 13.5t-87 33t-66 39t-43.5 32.5l-15 14l-183 -207 q-20 -21 -48 -21q-24 0 -43 16q-19 18 -20.5 44.5t15.5 46.5l202 227q-58 114 -58 274h-224q-26 0 -45 19t-19 45t19 45t45 19h224v294l-173 173q-19 19 -19 45t19 45t45 19t45 -19l173 -173h844l173 173q19 19 45 19t45 -19t19 -45t-19 -45l-173 -173v-294h224q26 0 45 -19 t19 -45zM1152 1152h-640q0 133 93.5 226.5t226.5 93.5t226.5 -93.5t93.5 -226.5z" />
392
+ <glyph unicode="&#xf189;" horiz-adv-x="1920" d="M1917 1016q23 -64 -150 -294q-24 -32 -65 -85q-78 -100 -90 -131q-17 -41 14 -81q17 -21 81 -82h1l1 -1l1 -1l2 -2q141 -131 191 -221q3 -5 6.5 -12.5t7 -26.5t-0.5 -34t-25 -27.5t-59 -12.5l-256 -4q-24 -5 -56 5t-52 22l-20 12q-30 21 -70 64t-68.5 77.5t-61 58 t-56.5 15.5q-3 -1 -8 -3.5t-17 -14.5t-21.5 -29.5t-17 -52t-6.5 -77.5q0 -15 -3.5 -27.5t-7.5 -18.5l-4 -5q-18 -19 -53 -22h-115q-71 -4 -146 16.5t-131.5 53t-103 66t-70.5 57.5l-25 24q-10 10 -27.5 30t-71.5 91t-106 151t-122.5 211t-130.5 272q-6 16 -6 27t3 16l4 6 q15 19 57 19l274 2q12 -2 23 -6.5t16 -8.5l5 -3q16 -11 24 -32q20 -50 46 -103.5t41 -81.5l16 -29q29 -60 56 -104t48.5 -68.5t41.5 -38.5t34 -14t27 5q2 1 5 5t12 22t13.5 47t9.5 81t0 125q-2 40 -9 73t-14 46l-6 12q-25 34 -85 43q-13 2 5 24q17 19 38 30q53 26 239 24 q82 -1 135 -13q20 -5 33.5 -13.5t20.5 -24t10.5 -32t3.5 -45.5t-1 -55t-2.5 -70.5t-1.5 -82.5q0 -11 -1 -42t-0.5 -48t3.5 -40.5t11.5 -39t22.5 -24.5q8 -2 17 -4t26 11t38 34.5t52 67t68 107.5q60 104 107 225q4 10 10 17.5t11 10.5l4 3l5 2.5t13 3t20 0.5l288 2 q39 5 64 -2.5t31 -16.5z" />
393
+ <glyph unicode="&#xf18a;" horiz-adv-x="1792" d="M675 252q21 34 11 69t-45 50q-34 14 -73 1t-60 -46q-22 -34 -13 -68.5t43 -50.5t74.5 -2.5t62.5 47.5zM769 373q8 13 3.5 26.5t-17.5 18.5q-14 5 -28.5 -0.5t-21.5 -18.5q-17 -31 13 -45q14 -5 29 0.5t22 18.5zM943 266q-45 -102 -158 -150t-224 -12 q-107 34 -147.5 126.5t6.5 187.5q47 93 151.5 139t210.5 19q111 -29 158.5 -119.5t2.5 -190.5zM1255 426q-9 96 -89 170t-208.5 109t-274.5 21q-223 -23 -369.5 -141.5t-132.5 -264.5q9 -96 89 -170t208.5 -109t274.5 -21q223 23 369.5 141.5t132.5 264.5zM1563 422 q0 -68 -37 -139.5t-109 -137t-168.5 -117.5t-226 -83t-270.5 -31t-275 33.5t-240.5 93t-171.5 151t-65 199.5q0 115 69.5 245t197.5 258q169 169 341.5 236t246.5 -7q65 -64 20 -209q-4 -14 -1 -20t10 -7t14.5 0.5t13.5 3.5l6 2q139 59 246 59t153 -61q45 -63 0 -178 q-2 -13 -4.5 -20t4.5 -12.5t12 -7.5t17 -6q57 -18 103 -47t80 -81.5t34 -116.5zM1489 1046q42 -47 54.5 -108.5t-6.5 -117.5q-8 -23 -29.5 -34t-44.5 -4q-23 8 -34 29.5t-4 44.5q20 63 -24 111t-107 35q-24 -5 -45 8t-25 37q-5 24 8 44.5t37 25.5q60 13 119 -5.5t101 -65.5z M1670 1209q87 -96 112.5 -222.5t-13.5 -241.5q-9 -27 -34 -40t-52 -4t-40 34t-5 52q28 82 10 172t-80 158q-62 69 -148 95.5t-173 8.5q-28 -6 -52 9.5t-30 43.5t9.5 51.5t43.5 29.5q123 26 244 -11.5t208 -134.5z" />
394
+ <glyph unicode="&#xf18b;" d="M1133 -34q-171 -94 -368 -94q-196 0 -367 94q138 87 235.5 211t131.5 268q35 -144 132.5 -268t235.5 -211zM638 1394v-485q0 -252 -126.5 -459.5t-330.5 -306.5q-181 215 -181 495q0 187 83.5 349.5t229.5 269.5t325 137zM1536 638q0 -280 -181 -495 q-204 99 -330.5 306.5t-126.5 459.5v485q179 -30 325 -137t229.5 -269.5t83.5 -349.5z" />
395
+ <glyph unicode="&#xf18c;" horiz-adv-x="1408" d="M1402 433q-32 -80 -76 -138t-91 -88.5t-99 -46.5t-101.5 -14.5t-96.5 8.5t-86.5 22t-69.5 27.5t-46 22.5l-17 10q-113 -228 -289.5 -359.5t-384.5 -132.5q-19 0 -32 13t-13 32t13 31.5t32 12.5q173 1 322.5 107.5t251.5 294.5q-36 -14 -72 -23t-83 -13t-91 2.5t-93 28.5 t-92 59t-84.5 100t-74.5 146q114 47 214 57t167.5 -7.5t124.5 -56.5t88.5 -77t56.5 -82q53 131 79 291q-7 -1 -18 -2.5t-46.5 -2.5t-69.5 0.5t-81.5 10t-88.5 23t-84 42.5t-75 65t-54.5 94.5t-28.5 127.5q70 28 133.5 36.5t112.5 -1t92 -30t73.5 -50t56 -61t42 -63t27.5 -56 t16 -39.5l4 -16q12 122 12 195q-8 6 -21.5 16t-49 44.5t-63.5 71.5t-54 93t-33 112.5t12 127t70 138.5q73 -25 127.5 -61.5t84.5 -76.5t48 -85t20.5 -89t-0.5 -85.5t-13 -76.5t-19 -62t-17 -42l-7 -15q1 -5 1 -50.5t-1 -71.5q3 7 10 18.5t30.5 43t50.5 58t71 55.5t91.5 44.5 t112 14.5t132.5 -24q-2 -78 -21.5 -141.5t-50 -104.5t-69.5 -71.5t-81.5 -45.5t-84.5 -24t-80 -9.5t-67.5 1t-46.5 4.5l-17 3q-23 -147 -73 -283q6 7 18 18.5t49.5 41t77.5 52.5t99.5 42t117.5 20t129 -23.5t137 -77.5z" />
396
+ <glyph unicode="&#xf18d;" horiz-adv-x="1280" d="M1259 283v-66q0 -85 -57.5 -144.5t-138.5 -59.5h-57l-260 -269v269h-529q-81 0 -138.5 59.5t-57.5 144.5v66h1238zM1259 609v-255h-1238v255h1238zM1259 937v-255h-1238v255h1238zM1259 1077v-67h-1238v67q0 84 57.5 143.5t138.5 59.5h846q81 0 138.5 -59.5t57.5 -143.5z " />
397
+ <glyph unicode="&#xf18e;" d="M1152 640q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
398
+ <glyph unicode="&#xf190;" d="M1152 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-192q0 -14 -9 -23t-23 -9q-12 0 -24 10l-319 319q-9 9 -9 23t9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h352q13 0 22.5 -9.5t9.5 -22.5zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
399
+ <glyph unicode="&#xf191;" d="M1024 960v-640q0 -26 -19 -45t-45 -19q-20 0 -37 12l-448 320q-27 19 -27 52t27 52l448 320q17 12 37 12q26 0 45 -19t19 -45zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
400
+ <glyph unicode="&#xf192;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5 t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
401
+ <glyph unicode="&#xf193;" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
402
+ <glyph unicode="&#xf194;" d="M1292 898q10 216 -161 222q-231 8 -312 -261q44 19 82 19q85 0 74 -96q-4 -57 -74 -167t-105 -110q-43 0 -82 169q-13 54 -45 255q-30 189 -160 177q-59 -7 -164 -100l-81 -72l-81 -72l52 -67q76 52 87 52q57 0 107 -179q15 -55 45 -164.5t45 -164.5q68 -179 164 -179 q157 0 383 294q220 283 226 444zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
403
+ <glyph unicode="&#xf195;" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
404
+ <glyph unicode="&#xf196;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
405
+ <glyph unicode="&#xf197;" horiz-adv-x="2176" d="M620 416q-110 -64 -268 -64h-128v64h-64q-13 0 -22.5 23.5t-9.5 56.5q0 24 7 49q-58 2 -96.5 10.5t-38.5 20.5t38.5 20.5t96.5 10.5q-7 25 -7 49q0 33 9.5 56.5t22.5 23.5h64v64h128q158 0 268 -64h1113q42 -7 106.5 -18t80.5 -14q89 -15 150 -40.5t83.5 -47.5t22.5 -40 t-22.5 -40t-83.5 -47.5t-150 -40.5q-16 -3 -80.5 -14t-106.5 -18h-1113zM1739 668q53 -36 53 -92t-53 -92l81 -30q68 48 68 122t-68 122zM625 400h1015q-217 -38 -456 -80q-57 0 -113 -24t-83 -48l-28 -24l-288 -288q-26 -26 -70.5 -45t-89.5 -19h-96l-93 464h29 q157 0 273 64zM352 816h-29l93 464h96q46 0 90 -19t70 -45l288 -288q4 -4 11 -10.5t30.5 -23t48.5 -29t61.5 -23t72.5 -10.5l456 -80h-1015q-116 64 -273 64z" />
406
+ <glyph unicode="&#xf198;" horiz-adv-x="1664" d="M1519 760q62 0 103.5 -40.5t41.5 -101.5q0 -97 -93 -130l-172 -59l56 -167q7 -21 7 -47q0 -59 -42 -102t-101 -43q-47 0 -85.5 27t-53.5 72l-55 165l-310 -106l55 -164q8 -24 8 -47q0 -59 -42 -102t-102 -43q-47 0 -85 27t-53 72l-55 163l-153 -53q-29 -9 -50 -9 q-61 0 -101.5 40t-40.5 101q0 47 27.5 85t71.5 53l156 53l-105 313l-156 -54q-26 -8 -48 -8q-60 0 -101 40.5t-41 100.5q0 47 27.5 85t71.5 53l157 53l-53 159q-8 24 -8 47q0 60 42 102.5t102 42.5q47 0 85 -27t53 -72l54 -160l310 105l-54 160q-8 24 -8 47q0 59 42.5 102 t101.5 43q47 0 85.5 -27.5t53.5 -71.5l53 -161l162 55q21 6 43 6q60 0 102.5 -39.5t42.5 -98.5q0 -45 -30 -81.5t-74 -51.5l-157 -54l105 -316l164 56q24 8 46 8zM725 498l310 105l-105 315l-310 -107z" />
407
+ <glyph unicode="&#xf199;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM1280 352v436q-31 -35 -64 -55q-34 -22 -132.5 -85t-151.5 -99q-98 -69 -164 -69v0v0q-66 0 -164 69 q-46 32 -141.5 92.5t-142.5 92.5q-12 8 -33 27t-31 27v-436q0 -40 28 -68t68 -28h832q40 0 68 28t28 68zM1280 925q0 41 -27.5 70t-68.5 29h-832q-40 0 -68 -28t-28 -68q0 -37 30.5 -76.5t67.5 -64.5q47 -32 137.5 -89t129.5 -83q3 -2 17 -11.5t21 -14t21 -13t23.5 -13 t21.5 -9.5t22.5 -7.5t20.5 -2.5t20.5 2.5t22.5 7.5t21.5 9.5t23.5 13t21 13t21 14t17 11.5l267 174q35 23 66.5 62.5t31.5 73.5z" />
408
+ <glyph unicode="&#xf19a;" horiz-adv-x="1792" d="M127 640q0 163 67 313l367 -1005q-196 95 -315 281t-119 411zM1415 679q0 -19 -2.5 -38.5t-10 -49.5t-11.5 -44t-17.5 -59t-17.5 -58l-76 -256l-278 826q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-75 1 -202 10q-12 1 -20.5 -5t-11.5 -15t-1.5 -18.5t9 -16.5 t19.5 -8l80 -8l120 -328l-168 -504l-280 832q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-7 0 -23 0.5t-26 0.5q105 160 274.5 253.5t367.5 93.5q147 0 280.5 -53t238.5 -149h-10q-55 0 -92 -40.5t-37 -95.5q0 -12 2 -24t4 -21.5t8 -23t9 -21t12 -22.5t12.5 -21 t14.5 -24t14 -23q63 -107 63 -212zM909 573l237 -647q1 -6 5 -11q-126 -44 -255 -44q-112 0 -217 32zM1570 1009q95 -174 95 -369q0 -209 -104 -385.5t-279 -278.5l235 678q59 169 59 276q0 42 -6 79zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286 t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 -215q173 0 331.5 68t273 182.5t182.5 273t68 331.5t-68 331.5t-182.5 273t-273 182.5t-331.5 68t-331.5 -68t-273 -182.5t-182.5 -273t-68 -331.5t68 -331.5t182.5 -273 t273 -182.5t331.5 -68z" />
409
+ <glyph unicode="&#xf19b;" horiz-adv-x="1792" d="M1086 1536v-1536l-272 -128q-228 20 -414 102t-293 208.5t-107 272.5q0 140 100.5 263.5t275 205.5t391.5 108v-172q-217 -38 -356.5 -150t-139.5 -255q0 -152 154.5 -267t388.5 -145v1360zM1755 954l37 -390l-525 114l147 83q-119 70 -280 99v172q277 -33 481 -157z" />
410
+ <glyph unicode="&#xf19c;" horiz-adv-x="2048" d="M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" />
411
+ <glyph unicode="&#xf19d;" horiz-adv-x="2304" d="M1774 700l18 -316q4 -69 -82 -128t-235 -93.5t-323 -34.5t-323 34.5t-235 93.5t-82 128l18 316l574 -181q22 -7 48 -7t48 7zM2304 1024q0 -23 -22 -31l-1120 -352q-4 -1 -10 -1t-10 1l-652 206q-43 -34 -71 -111.5t-34 -178.5q63 -36 63 -109q0 -69 -58 -107l58 -433 q2 -14 -8 -25q-9 -11 -24 -11h-192q-15 0 -24 11q-10 11 -8 25l58 433q-58 38 -58 107q0 73 65 111q11 207 98 330l-333 104q-22 8 -22 31t22 31l1120 352q4 1 10 1t10 -1l1120 -352q22 -8 22 -31z" />
412
+ <glyph unicode="&#xf19e;" d="M859 579l13 -707q-62 11 -105 11q-41 0 -105 -11l13 707q-40 69 -168.5 295.5t-216.5 374.5t-181 287q58 -15 108 -15q43 0 111 15q63 -111 133.5 -229.5t167 -276.5t138.5 -227q37 61 109.5 177.5t117.5 190t105 176t107 189.5q54 -14 107 -14q56 0 114 14v0 q-28 -39 -60 -88.5t-49.5 -78.5t-56.5 -96t-49 -84q-146 -248 -353 -610z" />
413
+ <glyph unicode="&#xf1a0;" horiz-adv-x="1280" d="M981 197q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -49 2q-53 0 -104.5 -7t-107 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -56 23.5 -102t61 -75.5t87 -50t100 -29t101.5 -8.5q58 0 111.5 13t99 39t73 73t27.5 109zM864 1055 q0 59 -17 125.5t-48 129t-84 103.5t-117 41q-42 0 -82.5 -19.5t-66.5 -52.5q-46 -59 -46 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26q37 0 77.5 16.5t65.5 43.5q53 56 53 159zM752 1536h417l-137 -88h-132q75 -63 113 -133t38 -160q0 -72 -24.5 -129.5 t-59.5 -93t-69.5 -65t-59 -61.5t-24.5 -66q0 -36 32 -70.5t77 -68t90.5 -73.5t77.5 -104t32 -142q0 -91 -49 -173q-71 -122 -209.5 -179.5t-298.5 -57.5q-132 0 -246.5 41.5t-172.5 137.5q-36 59 -36 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 41 -47.5 73.5 t-15.5 73.5q0 40 21 85q-46 -4 -68 -4q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q76 66 182 98t218 32z" />
414
+ <glyph unicode="&#xf1a1;" horiz-adv-x="1792" d="M1095 369q16 -16 0 -31q-62 -62 -199 -62t-199 62q-16 15 0 31q6 6 15 6t15 -6q48 -49 169 -49q120 0 169 49q6 6 15 6t15 -6zM788 550q0 -37 -26 -63t-63 -26t-63.5 26t-26.5 63q0 38 26.5 64t63.5 26t63 -26.5t26 -63.5zM1183 550q0 -37 -26.5 -63t-63.5 -26t-63 26 t-26 63t26 63.5t63 26.5t63.5 -26t26.5 -64zM1434 670q0 49 -35 84t-85 35t-86 -36q-130 90 -311 96l63 283l200 -45q0 -37 26 -63t63 -26t63.5 26.5t26.5 63.5t-26.5 63.5t-63.5 26.5q-54 0 -80 -50l-221 49q-19 5 -25 -16l-69 -312q-180 -7 -309 -97q-35 37 -87 37 q-50 0 -85 -35t-35 -84q0 -35 18.5 -64t49.5 -44q-6 -27 -6 -56q0 -142 140 -243t337 -101q198 0 338 101t140 243q0 32 -7 57q30 15 48 43.5t18 63.5zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191 t348 71t348 -71t286 -191t191 -286t71 -348z" />
415
+ <glyph unicode="&#xf1a2;" d="M939 407q13 -13 0 -26q-53 -53 -171 -53t-171 53q-13 13 0 26q5 6 13 6t13 -6q42 -42 145 -42t145 42q5 6 13 6t13 -6zM676 563q0 -31 -23 -54t-54 -23t-54 23t-23 54q0 32 22.5 54.5t54.5 22.5t54.5 -22.5t22.5 -54.5zM1014 563q0 -31 -23 -54t-54 -23t-54 23t-23 54 q0 32 22.5 54.5t54.5 22.5t54.5 -22.5t22.5 -54.5zM1229 666q0 42 -30 72t-73 30q-42 0 -73 -31q-113 78 -267 82l54 243l171 -39q1 -32 23.5 -54t53.5 -22q32 0 54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5q-48 0 -69 -43l-189 42q-17 5 -21 -13l-60 -268q-154 -6 -265 -83 q-30 32 -74 32q-43 0 -73 -30t-30 -72q0 -30 16 -55t42 -38q-5 -25 -5 -48q0 -122 120 -208.5t289 -86.5q170 0 290 86.5t120 208.5q0 25 -6 49q25 13 40.5 37.5t15.5 54.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
416
+ <glyph unicode="&#xf1a3;" d="M866 697l90 27v62q0 79 -58 135t-138 56t-138 -55.5t-58 -134.5v-283q0 -20 -14 -33.5t-33 -13.5t-32.5 13.5t-13.5 33.5v120h-151v-122q0 -82 57.5 -139t139.5 -57q81 0 138.5 56.5t57.5 136.5v280q0 19 13.5 33t33.5 14q19 0 32.5 -14t13.5 -33v-54zM1199 502v122h-150 v-126q0 -20 -13.5 -33.5t-33.5 -13.5q-19 0 -32.5 14t-13.5 33v123l-90 -26l-60 28v-123q0 -80 58 -137t139 -57t138.5 57t57.5 139zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103 t385.5 -103t279.5 -279.5t103 -385.5z" />
417
+ <glyph unicode="&#xf1a4;" horiz-adv-x="1920" d="M1062 824v118q0 42 -30 72t-72 30t-72 -30t-30 -72v-612q0 -175 -126 -299t-303 -124q-178 0 -303.5 125.5t-125.5 303.5v266h328v-262q0 -43 30 -72.5t72 -29.5t72 29.5t30 72.5v620q0 171 126.5 292t301.5 121q176 0 302 -122t126 -294v-136l-195 -58zM1592 602h328 v-266q0 -178 -125.5 -303.5t-303.5 -125.5q-177 0 -303 124.5t-126 300.5v268l131 -61l195 58v-270q0 -42 30 -71.5t72 -29.5t72 29.5t30 71.5v275z" />
418
+ <glyph unicode="&#xf1a5;" d="M1472 160v480h-704v704h-480q-93 0 -158.5 -65.5t-65.5 -158.5v-480h704v-704h480q93 0 158.5 65.5t65.5 158.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
419
+ <glyph unicode="&#xf1a6;" horiz-adv-x="2048" d="M328 1254h204v-983h-532v697h328v286zM328 435v369h-123v-369h123zM614 968v-697h205v697h-205zM614 1254v-204h205v204h-205zM901 968h533v-942h-533v163h328v82h-328v697zM1229 435v369h-123v-369h123zM1516 968h532v-942h-532v163h327v82h-327v697zM1843 435v369h-123 v-369h123z" />
420
+ <glyph unicode="&#xf1a7;" d="M1046 516q0 -64 -38 -109t-91 -45q-43 0 -70 15v277q28 17 70 17q53 0 91 -45.5t38 -109.5zM703 944q0 -64 -38 -109.5t-91 -45.5q-43 0 -70 15v277q28 17 70 17q53 0 91 -45t38 -109zM1265 513q0 134 -88 229t-213 95q-20 0 -39 -3q-23 -78 -78 -136q-87 -95 -211 -101 v-636l211 41v206q51 -19 117 -19q125 0 213 95t88 229zM922 940q0 134 -88.5 229t-213.5 95q-74 0 -141 -36h-186v-840l211 41v206q55 -19 116 -19q125 0 213.5 95t88.5 229zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
421
+ <glyph unicode="&#xf1a8;" horiz-adv-x="2038" d="M1222 607q75 3 143.5 -20.5t118 -58.5t101 -94.5t84 -108t75.5 -120.5q33 -56 78.5 -109t75.5 -80.5t99 -88.5q-48 -30 -108.5 -57.5t-138.5 -59t-114 -47.5q-44 37 -74 115t-43.5 164.5t-33 180.5t-42.5 168.5t-72.5 123t-122.5 48.5l-10 -2l-6 -4q4 -5 13 -14 q6 -5 28 -23.5t25.5 -22t19 -18t18 -20.5t11.5 -21t10.5 -27.5t4.5 -31t4 -40.5l1 -33q1 -26 -2.5 -57.5t-7.5 -52t-12.5 -58.5t-11.5 -53q-35 1 -101 -9.5t-98 -10.5q-39 0 -72 10q-2 16 -2 47q0 74 3 96q2 13 31.5 41.5t57 59t26.5 51.5q-24 2 -43 -24 q-36 -53 -111.5 -99.5t-136.5 -46.5q-25 0 -75.5 63t-106.5 139.5t-84 96.5q-6 4 -27 30q-482 -112 -513 -112q-16 0 -28 11t-12 27q0 15 8.5 26.5t22.5 14.5l486 106q-8 14 -8 25t5.5 17.5t16 11.5t20 7t23 4.5t18.5 4.5q4 1 15.5 7.5t17.5 6.5q15 0 28 -16t20 -33 q163 37 172 37q17 0 29.5 -11t12.5 -28q0 -15 -8.5 -26t-23.5 -14l-182 -40l-1 -16q-1 -26 81.5 -117.5t104.5 -91.5q47 0 119 80t72 129q0 36 -23.5 53t-51 18.5t-51 11.5t-23.5 34q0 16 10 34l-68 19q43 44 43 117q0 26 -5 58q82 16 144 16q44 0 71.5 -1.5t48.5 -8.5 t31 -13.5t20.5 -24.5t15.5 -33.5t17 -47.5t24 -60l50 25q-3 -40 -23 -60t-42.5 -21t-40 -6.5t-16.5 -20.5zM1282 842q-5 5 -13.5 15.5t-12 14.5t-10.5 11.5t-10 10.5l-8 8t-8.5 7.5t-8 5t-8.5 4.5q-7 3 -14.5 5t-20.5 2.5t-22 0.5h-32.5h-37.5q-126 0 -217 -43 q16 30 36 46.5t54 29.5t65.5 36t46 36.5t50 55t43.5 50.5q12 -9 28 -31.5t32 -36.5t38 -13l12 1v-76l22 -1q247 95 371 190q28 21 50 39t42.5 37.5t33 31t29.5 34t24 31t24.5 37t23 38t27 47.5t29.5 53l7 9q-2 -53 -43 -139q-79 -165 -205 -264t-306 -142q-14 -3 -42 -7.5 t-50 -9.5t-39 -14q3 -19 24.5 -46t21.5 -34q0 -11 -26 -30zM1061 -79q39 26 131.5 47.5t146.5 21.5q9 0 22.5 -15.5t28 -42.5t26 -50t24 -51t14.5 -33q-121 -45 -244 -45q-61 0 -125 11zM822 568l48 12l109 -177l-73 -48zM1323 51q3 -15 3 -16q0 -7 -17.5 -14.5t-46 -13 t-54 -9.5t-53.5 -7.5t-32 -4.5l-7 43q21 2 60.5 8.5t72 10t60.5 3.5h14zM866 679l-96 -20l-6 17q10 1 32.5 7t34.5 6q19 0 35 -10zM1061 45h31l10 -83l-41 -12v95zM1950 1535v1v-1zM1950 1535l-1 -5l-2 -2l1 3zM1950 1535l1 1z" />
422
+ <glyph unicode="&#xf1a9;" d="M1167 -50q-5 19 -24 5q-30 -22 -87 -39t-131 -17q-129 0 -193 49q-5 4 -13 4q-11 0 -26 -12q-7 -6 -7.5 -16t7.5 -20q34 -32 87.5 -46t102.5 -12.5t99 4.5q41 4 84.5 20.5t65 30t28.5 20.5q12 12 7 29zM1128 65q-19 47 -39 61q-23 15 -76 15q-47 0 -71 -10 q-29 -12 -78 -56q-26 -24 -12 -44q9 -8 17.5 -4.5t31.5 23.5q3 2 10.5 8.5t10.5 8.5t10 7t11.5 7t12.5 5t15 4.5t16.5 2.5t20.5 1q27 0 44.5 -7.5t23 -14.5t13.5 -22q10 -17 12.5 -20t12.5 1q23 12 14 34zM1483 346q0 22 -5 44.5t-16.5 45t-34 36.5t-52.5 14 q-33 0 -97 -41.5t-129 -83.5t-101 -42q-27 -1 -63.5 19t-76 49t-83.5 58t-100 49t-111 19q-115 -1 -197 -78.5t-84 -178.5q-2 -112 74 -164q29 -20 62.5 -28.5t103.5 -8.5q57 0 132 32.5t134 71t120 70.5t93 31q26 -1 65 -31.5t71.5 -67t68 -67.5t55.5 -32q35 -3 58.5 14 t55.5 63q28 41 42.5 101t14.5 106zM1536 506q0 -164 -62 -304.5t-166 -236t-242.5 -149.5t-290.5 -54t-293 57.5t-247.5 157t-170.5 241.5t-64 302q0 89 19.5 172.5t49 145.5t70.5 118.5t78.5 94t78.5 69.5t64.5 46.5t42.5 24.5q14 8 51 26.5t54.5 28.5t48 30t60.5 44 q36 28 58 72.5t30 125.5q129 -155 186 -193q44 -29 130 -68t129 -66q21 -13 39 -25t60.5 -46.5t76 -70.5t75 -95t69 -122t47 -148.5t19.5 -177.5z" />
423
+ <glyph unicode="&#xf1aa;" d="M1070 463l-160 -160l-151 -152l-30 -30q-65 -64 -151.5 -87t-171.5 -2q-16 -70 -72 -115t-129 -45q-85 0 -145 60.5t-60 145.5q0 72 44.5 128t113.5 72q-22 86 1 173t88 152l12 12l151 -152l-11 -11q-37 -37 -37 -89t37 -90q37 -37 89 -37t89 37l30 30l151 152l161 160z M729 1145l12 -12l-152 -152l-12 12q-37 37 -89 37t-89 -37t-37 -89.5t37 -89.5l29 -29l152 -152l160 -160l-151 -152l-161 160l-151 152l-30 30q-68 67 -90 159.5t5 179.5q-70 15 -115 71t-45 129q0 85 60 145.5t145 60.5q76 0 133.5 -49t69.5 -123q84 20 169.5 -3.5 t149.5 -87.5zM1536 78q0 -85 -60 -145.5t-145 -60.5q-74 0 -131 47t-71 118q-86 -28 -179.5 -6t-161.5 90l-11 12l151 152l12 -12q37 -37 89 -37t89 37t37 89t-37 89l-30 30l-152 152l-160 160l152 152l160 -160l152 -152l29 -30q64 -64 87.5 -150.5t2.5 -171.5 q76 -11 126.5 -68.5t50.5 -134.5zM1534 1202q0 -77 -51 -135t-127 -69q26 -85 3 -176.5t-90 -158.5l-12 -12l-151 152l12 12q37 37 37 89t-37 89t-89 37t-89 -37l-30 -30l-152 -152l-160 -160l-152 152l161 160l152 152l29 30q67 67 159 89.5t178 -3.5q11 75 68.5 126 t135.5 51q85 0 145 -60.5t60 -145.5z" />
424
+ <glyph unicode="&#xf1ab;" d="M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z" />
425
+ <glyph unicode="&#xf1ac;" horiz-adv-x="1792" d="M288 1152q66 0 113 -47t47 -113v-1088q0 -66 -47 -113t-113 -47h-128q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h128zM1664 989q58 -34 93 -93t35 -128v-768q0 -106 -75 -181t-181 -75h-864q-66 0 -113 47t-47 113v1536q0 40 28 68t68 28h672q40 0 88 -20t76 -48 l152 -152q28 -28 48 -76t20 -88v-163zM928 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 512v128q0 14 -9 23 t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128 q14 0 23 9t9 23zM1184 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 256v128q0 14 -9 23t-23 9h-128 q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1536 896v256h-160q-40 0 -68 28t-28 68v160h-640v-512h896z" />
426
+ <glyph unicode="&#xf1ad;" d="M1344 1536q26 0 45 -19t19 -45v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280zM512 1248v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 992v-64q0 -14 9 -23t23 -9h64q14 0 23 9 t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 736v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 480v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM384 160v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM384 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 -96v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9 t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM896 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 928v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 160v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9 t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23z" />
427
+ <glyph unicode="&#xf1ae;" horiz-adv-x="1280" d="M1188 988l-292 -292v-824q0 -46 -33 -79t-79 -33t-79 33t-33 79v384h-64v-384q0 -46 -33 -79t-79 -33t-79 33t-33 79v824l-292 292q-28 28 -28 68t28 68t68 28t68 -28l228 -228h368l228 228q28 28 68 28t68 -28t28 -68t-28 -68zM864 1152q0 -93 -65.5 -158.5 t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
428
+ <glyph unicode="&#xf1b0;" horiz-adv-x="1664" d="M780 1064q0 -60 -19 -113.5t-63 -92.5t-105 -39q-76 0 -138 57.5t-92 135.5t-30 151q0 60 19 113.5t63 92.5t105 39q77 0 138.5 -57.5t91.5 -135t30 -151.5zM438 581q0 -80 -42 -139t-119 -59q-76 0 -141.5 55.5t-100.5 133.5t-35 152q0 80 42 139.5t119 59.5 q76 0 141.5 -55.5t100.5 -134t35 -152.5zM832 608q118 0 255 -97.5t229 -237t92 -254.5q0 -46 -17 -76.5t-48.5 -45t-64.5 -20t-76 -5.5q-68 0 -187.5 45t-182.5 45q-66 0 -192.5 -44.5t-200.5 -44.5q-183 0 -183 146q0 86 56 191.5t139.5 192.5t187.5 146t193 59zM1071 819 q-61 0 -105 39t-63 92.5t-19 113.5q0 74 30 151.5t91.5 135t138.5 57.5q61 0 105 -39t63 -92.5t19 -113.5q0 -73 -30 -151t-92 -135.5t-138 -57.5zM1503 923q77 0 119 -59.5t42 -139.5q0 -74 -35 -152t-100.5 -133.5t-141.5 -55.5q-77 0 -119 59t-42 139q0 74 35 152.5 t100.5 134t141.5 55.5z" />
429
+ <glyph unicode="&#xf1b1;" horiz-adv-x="768" d="M704 1008q0 -145 -57 -243.5t-152 -135.5l45 -821q2 -26 -16 -45t-44 -19h-192q-26 0 -44 19t-16 45l45 821q-95 37 -152 135.5t-57 243.5q0 128 42.5 249.5t117.5 200t160 78.5t160 -78.5t117.5 -200t42.5 -249.5z" />
430
+ <glyph unicode="&#xf1b2;" horiz-adv-x="1792" d="M896 -93l640 349v636l-640 -233v-752zM832 772l698 254l-698 254l-698 -254zM1664 1024v-768q0 -35 -18 -65t-49 -47l-704 -384q-28 -16 -61 -16t-61 16l-704 384q-31 17 -49 47t-18 65v768q0 40 23 73t61 47l704 256q22 8 44 8t44 -8l704 -256q38 -14 61 -47t23 -73z " />
431
+ <glyph unicode="&#xf1b3;" horiz-adv-x="2304" d="M640 -96l384 192v314l-384 -164v-342zM576 358l404 173l-404 173l-404 -173zM1664 -96l384 192v314l-384 -164v-342zM1600 358l404 173l-404 173l-404 -173zM1152 651l384 165v266l-384 -164v-267zM1088 1030l441 189l-441 189l-441 -189zM2176 512v-416q0 -36 -19 -67 t-52 -47l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-5 2 -7 4q-2 -2 -7 -4l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-33 16 -52 47t-19 67v416q0 38 21.5 70t56.5 48l434 186v400q0 38 21.5 70t56.5 48l448 192q23 10 50 10t50 -10l448 -192q35 -16 56.5 -48t21.5 -70 v-400l434 -186q36 -16 57 -48t21 -70z" />
432
+ <glyph unicode="&#xf1b4;" horiz-adv-x="2048" d="M1848 1197h-511v-124h511v124zM1596 771q-90 0 -146 -52.5t-62 -142.5h408q-18 195 -200 195zM1612 186q63 0 122 32t76 87h221q-100 -307 -427 -307q-214 0 -340.5 132t-126.5 347q0 208 130.5 345.5t336.5 137.5q138 0 240.5 -68t153 -179t50.5 -248q0 -17 -2 -47h-658 q0 -111 57.5 -171.5t166.5 -60.5zM277 236h296q205 0 205 167q0 180 -199 180h-302v-347zM277 773h281q78 0 123.5 36.5t45.5 113.5q0 144 -190 144h-260v-294zM0 1282h594q87 0 155 -14t126.5 -47.5t90 -96.5t31.5 -154q0 -181 -172 -263q114 -32 172 -115t58 -204 q0 -75 -24.5 -136.5t-66 -103.5t-98.5 -71t-121 -42t-134 -13h-611v1260z" />
433
+ <glyph unicode="&#xf1b5;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM499 1041h-371v-787h382q117 0 197 57.5t80 170.5q0 158 -143 200q107 52 107 164q0 57 -19.5 96.5 t-56.5 60.5t-79 29.5t-97 8.5zM477 723h-176v184h163q119 0 119 -90q0 -94 -106 -94zM486 388h-185v217h189q124 0 124 -113q0 -104 -128 -104zM1136 356q-68 0 -104 38t-36 107h411q1 10 1 30q0 132 -74.5 220.5t-203.5 88.5q-128 0 -210 -86t-82 -216q0 -135 79 -217 t213 -82q205 0 267 191h-138q-11 -34 -47.5 -54t-75.5 -20zM1126 722q113 0 124 -122h-254q4 56 39 89t91 33zM964 988h319v-77h-319v77z" />
434
+ <glyph unicode="&#xf1b6;" horiz-adv-x="1792" d="M1582 954q0 -101 -71.5 -172.5t-172.5 -71.5t-172.5 71.5t-71.5 172.5t71.5 172.5t172.5 71.5t172.5 -71.5t71.5 -172.5zM812 212q0 104 -73 177t-177 73q-27 0 -54 -6l104 -42q77 -31 109.5 -106.5t1.5 -151.5q-31 -77 -107 -109t-152 -1q-21 8 -62 24.5t-61 24.5 q32 -60 91 -96.5t130 -36.5q104 0 177 73t73 177zM1642 953q0 126 -89.5 215.5t-215.5 89.5q-127 0 -216.5 -89.5t-89.5 -215.5q0 -127 89.5 -216t216.5 -89q126 0 215.5 89t89.5 216zM1792 953q0 -189 -133.5 -322t-321.5 -133l-437 -319q-12 -129 -109 -218t-229 -89 q-121 0 -214 76t-118 192l-230 92v429l389 -157q79 48 173 48q13 0 35 -2l284 407q2 187 135.5 319t320.5 132q188 0 321.5 -133.5t133.5 -321.5z" />
435
+ <glyph unicode="&#xf1b7;" d="M1242 889q0 80 -57 136.5t-137 56.5t-136.5 -57t-56.5 -136q0 -80 56.5 -136.5t136.5 -56.5t137 56.5t57 136.5zM632 301q0 -83 -58 -140.5t-140 -57.5q-56 0 -103 29t-72 77q52 -20 98 -40q60 -24 120 1.5t85 86.5q24 60 -1.5 120t-86.5 84l-82 33q22 5 42 5 q82 0 140 -57.5t58 -140.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v153l172 -69q20 -92 93.5 -152t168.5 -60q104 0 181 70t87 173l345 252q150 0 255.5 105.5t105.5 254.5q0 150 -105.5 255.5t-255.5 105.5 q-148 0 -253 -104.5t-107 -252.5l-225 -322q-9 1 -28 1q-75 0 -137 -37l-297 119v468q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5zM1289 887q0 -100 -71 -170.5t-171 -70.5t-170.5 70.5t-70.5 170.5t70.5 171t170.5 71q101 0 171.5 -70.5t70.5 -171.5z " />
436
+ <glyph unicode="&#xf1b8;" horiz-adv-x="1792" d="M836 367l-15 -368l-2 -22l-420 29q-36 3 -67 31.5t-47 65.5q-11 27 -14.5 55t4 65t12 55t21.5 64t19 53q78 -12 509 -28zM449 953l180 -379l-147 92q-63 -72 -111.5 -144.5t-72.5 -125t-39.5 -94.5t-18.5 -63l-4 -21l-190 357q-17 26 -18 56t6 47l8 18q35 63 114 188 l-140 86zM1680 436l-188 -359q-12 -29 -36.5 -46.5t-43.5 -20.5l-18 -4q-71 -7 -219 -12l8 -164l-230 367l211 362l7 -173q170 -16 283 -5t170 33zM895 1360q-47 -63 -265 -435l-317 187l-19 12l225 356q20 31 60 45t80 10q24 -2 48.5 -12t42 -21t41.5 -33t36 -34.5 t36 -39.5t32 -35zM1550 1053l212 -363q18 -37 12.5 -76t-27.5 -74q-13 -20 -33 -37t-38 -28t-48.5 -22t-47 -16t-51.5 -14t-46 -12q-34 72 -265 436l313 195zM1407 1279l142 83l-220 -373l-419 20l151 86q-34 89 -75 166t-75.5 123.5t-64.5 80t-47 46.5l-17 13l405 -1 q31 3 58 -10.5t39 -28.5l11 -15q39 -61 112 -190z" />
437
+ <glyph unicode="&#xf1b9;" horiz-adv-x="2048" d="M480 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM516 768h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5zM1888 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM2048 544v-384 q0 -14 -9 -23t-23 -9h-96v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-1024v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5t179 63.5h768q98 0 179 -63.5t104 -157.5 l105 -419h28q93 0 158.5 -65.5t65.5 -158.5z" />
438
+ <glyph unicode="&#xf1ba;" horiz-adv-x="2048" d="M1824 640q93 0 158.5 -65.5t65.5 -158.5v-384q0 -14 -9 -23t-23 -9h-96v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-1024v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5 t179 63.5h128v224q0 14 9 23t23 9h448q14 0 23 -9t9 -23v-224h128q98 0 179 -63.5t104 -157.5l105 -419h28zM320 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM516 640h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5z M1728 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47z" />
439
+ <glyph unicode="&#xf1bb;" d="M1504 64q0 -26 -19 -45t-45 -19h-462q1 -17 6 -87.5t5 -108.5q0 -25 -18 -42.5t-43 -17.5h-320q-25 0 -43 17.5t-18 42.5q0 38 5 108.5t6 87.5h-462q-26 0 -45 19t-19 45t19 45l402 403h-229q-26 0 -45 19t-19 45t19 45l402 403h-197q-26 0 -45 19t-19 45t19 45l384 384 q19 19 45 19t45 -19l384 -384q19 -19 19 -45t-19 -45t-45 -19h-197l402 -403q19 -19 19 -45t-19 -45t-45 -19h-229l402 -403q19 -19 19 -45z" />
440
+ <glyph unicode="&#xf1bc;" d="M1127 326q0 32 -30 51q-193 115 -447 115q-133 0 -287 -34q-42 -9 -42 -52q0 -20 13.5 -34.5t35.5 -14.5q5 0 37 8q132 27 243 27q226 0 397 -103q19 -11 33 -11q19 0 33 13.5t14 34.5zM1223 541q0 40 -35 61q-237 141 -548 141q-153 0 -303 -42q-48 -13 -48 -64 q0 -25 17.5 -42.5t42.5 -17.5q7 0 37 8q122 33 251 33q279 0 488 -124q24 -13 38 -13q25 0 42.5 17.5t17.5 42.5zM1331 789q0 47 -40 70q-126 73 -293 110.5t-343 37.5q-204 0 -364 -47q-23 -7 -38.5 -25.5t-15.5 -48.5q0 -31 20.5 -52t51.5 -21q11 0 40 8q133 37 307 37 q159 0 309.5 -34t253.5 -95q21 -12 40 -12q29 0 50.5 20.5t21.5 51.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
441
+ <glyph unicode="&#xf1bd;" horiz-adv-x="1024" d="M1024 1233l-303 -582l24 -31h279v-415h-507l-44 -30l-142 -273l-30 -30h-301v303l303 583l-24 30h-279v415h507l44 30l142 273l30 30h301v-303z" />
442
+ <glyph unicode="&#xf1be;" horiz-adv-x="2304" d="M784 164l16 241l-16 523q-1 10 -7.5 17t-16.5 7q-9 0 -16 -7t-7 -17l-14 -523l14 -241q1 -10 7.5 -16.5t15.5 -6.5q22 0 24 23zM1080 193l11 211l-12 586q0 16 -13 24q-8 5 -16 5t-16 -5q-13 -8 -13 -24l-1 -6l-10 -579q0 -1 11 -236v-1q0 -10 6 -17q9 -11 23 -11 q11 0 20 9q9 7 9 20zM35 533l20 -128l-20 -126q-2 -9 -9 -9t-9 9l-17 126l17 128q2 9 9 9t9 -9zM121 612l26 -207l-26 -203q-2 -9 -10 -9q-9 0 -9 10l-23 202l23 207q0 9 9 9q8 0 10 -9zM401 159zM213 650l25 -245l-25 -237q0 -11 -11 -11q-10 0 -12 11l-21 237l21 245 q2 12 12 12q11 0 11 -12zM307 657l23 -252l-23 -244q-2 -13 -14 -13q-13 0 -13 13l-21 244l21 252q0 13 13 13q12 0 14 -13zM401 639l21 -234l-21 -246q-2 -16 -16 -16q-6 0 -10.5 4.5t-4.5 11.5l-20 246l20 234q0 6 4.5 10.5t10.5 4.5q14 0 16 -15zM784 164zM495 785 l21 -380l-21 -246q0 -7 -5 -12.5t-12 -5.5q-16 0 -18 18l-18 246l18 380q2 18 18 18q7 0 12 -5.5t5 -12.5zM589 871l19 -468l-19 -244q0 -8 -5.5 -13.5t-13.5 -5.5q-18 0 -20 19l-16 244l16 468q2 19 20 19q8 0 13.5 -5.5t5.5 -13.5zM687 911l18 -506l-18 -242 q-2 -21 -22 -21q-19 0 -21 21l-16 242l16 506q0 9 6.5 15.5t14.5 6.5q9 0 15 -6.5t7 -15.5zM1079 169v0v0zM881 915l15 -510l-15 -239q0 -10 -7.5 -17.5t-17.5 -7.5t-17 7t-8 18l-14 239l14 510q0 11 7.5 18t17.5 7t17.5 -7t7.5 -18zM980 896l14 -492l-14 -236q0 -11 -8 -19 t-19 -8t-19 8t-9 19l-12 236l12 492q1 12 9 20t19 8t18.5 -8t8.5 -20zM1192 404l-14 -231v0q0 -13 -9 -22t-22 -9t-22 9t-10 22l-6 114l-6 117l12 636v3q2 15 12 24q9 7 20 7q8 0 15 -5q14 -8 16 -26zM2304 423q0 -117 -83 -199.5t-200 -82.5h-786q-13 2 -22 11t-9 22v899 q0 23 28 33q85 34 181 34q195 0 338 -131.5t160 -323.5q53 22 110 22q117 0 200 -83t83 -201z" />
443
+ <glyph unicode="&#xf1c0;" d="M768 768q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 0q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127 t443 -43zM768 384q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 1536q208 0 385 -34.5t280 -93.5t103 -128v-128q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5 t-103 128v128q0 69 103 128t280 93.5t385 34.5z" />
444
+ <glyph unicode="&#xf1c1;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M894 465q33 -26 84 -56q59 7 117 7q147 0 177 -49q16 -22 2 -52q0 -1 -1 -2l-2 -2v-1q-6 -38 -71 -38q-48 0 -115 20t-130 53q-221 -24 -392 -83q-153 -262 -242 -262q-15 0 -28 7l-24 12q-1 1 -6 5q-10 10 -6 36q9 40 56 91.5t132 96.5q14 9 23 -6q2 -2 2 -4q52 85 107 197 q68 136 104 262q-24 82 -30.5 159.5t6.5 127.5q11 40 42 40h21h1q23 0 35 -15q18 -21 9 -68q-2 -6 -4 -8q1 -3 1 -8v-30q-2 -123 -14 -192q55 -164 146 -238zM318 54q52 24 137 158q-51 -40 -87.5 -84t-49.5 -74zM716 974q-15 -42 -2 -132q1 7 7 44q0 3 7 43q1 4 4 8 q-1 1 -1 2t-0.5 1.5t-0.5 1.5q-1 22 -13 36q0 -1 -1 -2v-2zM592 313q135 54 284 81q-2 1 -13 9.5t-16 13.5q-76 67 -127 176q-27 -86 -83 -197q-30 -56 -45 -83zM1238 329q-24 24 -140 24q76 -28 124 -28q14 0 18 1q0 1 -2 3z" />
445
+ <glyph unicode="&#xf1c2;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M233 768v-107h70l164 -661h159l128 485q7 20 10 46q2 16 2 24h4l3 -24q1 -3 3.5 -20t5.5 -26l128 -485h159l164 661h70v107h-300v-107h90l-99 -438q-5 -20 -7 -46l-2 -21h-4l-3 21q-1 5 -4 21t-5 25l-144 545h-114l-144 -545q-2 -9 -4.5 -24.5t-3.5 -21.5l-4 -21h-4l-2 21 q-2 26 -7 46l-99 438h90v107h-300z" />
446
+ <glyph unicode="&#xf1c3;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M429 106v-106h281v106h-75l103 161q5 7 10 16.5t7.5 13.5t3.5 4h2q1 -4 5 -10q2 -4 4.5 -7.5t6 -8t6.5 -8.5l107 -161h-76v-106h291v106h-68l-192 273l195 282h67v107h-279v-107h74l-103 -159q-4 -7 -10 -16.5t-9 -13.5l-2 -3h-2q-1 4 -5 10q-6 11 -17 23l-106 159h76v107 h-290v-107h68l189 -272l-194 -283h-68z" />
447
+ <glyph unicode="&#xf1c4;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M416 106v-106h327v106h-93v167h137q76 0 118 15q67 23 106.5 87t39.5 146q0 81 -37 141t-100 87q-48 19 -130 19h-368v-107h92v-555h-92zM769 386h-119v268h120q52 0 83 -18q56 -33 56 -115q0 -89 -62 -120q-31 -15 -78 -15z" />
448
+ <glyph unicode="&#xf1c5;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M1280 320v-320h-1024v192l192 192l128 -128l384 384zM448 512q-80 0 -136 56t-56 136t56 136t136 56t136 -56t56 -136t-56 -136t-136 -56z" />
449
+ <glyph unicode="&#xf1c6;" d="M640 1152v128h-128v-128h128zM768 1024v128h-128v-128h128zM640 896v128h-128v-128h128zM768 768v128h-128v-128h128zM1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400 v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-128v-128h-128v128h-512v-1536h1280zM781 593l107 -349q8 -27 8 -52q0 -83 -72.5 -137.5t-183.5 -54.5t-183.5 54.5t-72.5 137.5q0 25 8 52q21 63 120 396v128h128v-128h79 q22 0 39 -13t23 -34zM640 128q53 0 90.5 19t37.5 45t-37.5 45t-90.5 19t-90.5 -19t-37.5 -45t37.5 -45t90.5 -19z" />
450
+ <glyph unicode="&#xf1c7;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M620 686q20 -8 20 -30v-544q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-166 167h-131q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h131l166 167q16 15 35 7zM1037 -3q31 0 50 24q129 159 129 363t-129 363q-16 21 -43 24t-47 -14q-21 -17 -23.5 -43.5t14.5 -47.5 q100 -123 100 -282t-100 -282q-17 -21 -14.5 -47.5t23.5 -42.5q18 -15 40 -15zM826 145q27 0 47 20q87 93 87 219t-87 219q-18 19 -45 20t-46 -17t-20 -44.5t18 -46.5q52 -57 52 -131t-52 -131q-19 -20 -18 -46.5t20 -44.5q20 -17 44 -17z" />
451
+ <glyph unicode="&#xf1c8;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M768 768q52 0 90 -38t38 -90v-384q0 -52 -38 -90t-90 -38h-384q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h384zM1260 766q20 -8 20 -30v-576q0 -22 -20 -30q-8 -2 -12 -2q-14 0 -23 9l-265 266v90l265 266q9 9 23 9q4 0 12 -2z" />
452
+ <glyph unicode="&#xf1c9;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M480 768q8 11 21 12.5t24 -6.5l51 -38q11 -8 12.5 -21t-6.5 -24l-182 -243l182 -243q8 -11 6.5 -24t-12.5 -21l-51 -38q-11 -8 -24 -6.5t-21 12.5l-226 301q-14 19 0 38zM1282 467q14 -19 0 -38l-226 -301q-8 -11 -21 -12.5t-24 6.5l-51 38q-11 8 -12.5 21t6.5 24l182 243 l-182 243q-8 11 -6.5 24t12.5 21l51 38q11 8 24 6.5t21 -12.5zM662 6q-13 2 -20.5 13t-5.5 24l138 831q2 13 13 20.5t24 5.5l63 -10q13 -2 20.5 -13t5.5 -24l-138 -831q-2 -13 -13 -20.5t-24 -5.5z" />
453
+ <glyph unicode="&#xf1ca;" d="M1497 709v-198q-101 -23 -198 -23q-65 -136 -165.5 -271t-181.5 -215.5t-128 -106.5q-80 -45 -162 3q-28 17 -60.5 43.5t-85 83.5t-102.5 128.5t-107.5 184t-105.5 244t-91.5 314.5t-70.5 390h283q26 -218 70 -398.5t104.5 -317t121.5 -235.5t140 -195q169 169 287 406 q-142 72 -223 220t-81 333q0 192 104 314.5t284 122.5q178 0 273 -105.5t95 -297.5q0 -159 -58 -286q-7 -1 -19.5 -3t-46 -2t-63 6t-62 25.5t-50.5 51.5q31 103 31 184q0 87 -29 132t-79 45q-53 0 -85 -49.5t-32 -140.5q0 -186 105 -293.5t267 -107.5q62 0 121 14z" />
454
+ <glyph unicode="&#xf1cb;" horiz-adv-x="1792" d="M216 367l603 -402v359l-334 223zM154 511l193 129l-193 129v-258zM973 -35l603 402l-269 180l-334 -223v-359zM896 458l272 182l-272 182l-272 -182zM485 733l334 223v359l-603 -402zM1445 640l193 -129v258zM1307 733l269 180l-603 402v-359zM1792 913v-546 q0 -41 -34 -64l-819 -546q-21 -13 -43 -13t-43 13l-819 546q-34 23 -34 64v546q0 41 34 64l819 546q21 13 43 13t43 -13l819 -546q34 -23 34 -64z" />
455
+ <glyph unicode="&#xf1cc;" horiz-adv-x="2048" d="M1800 764q111 -46 179.5 -145.5t68.5 -221.5q0 -164 -118 -280.5t-285 -116.5q-4 0 -11.5 0.5t-10.5 0.5h-1209h-1h-2h-5q-170 10 -288 125.5t-118 280.5q0 110 55 203t147 147q-12 39 -12 82q0 115 82 196t199 81q95 0 172 -58q75 154 222.5 248t326.5 94 q166 0 306 -80.5t221.5 -218.5t81.5 -301q0 -6 -0.5 -18t-0.5 -18zM468 498q0 -122 84 -193t208 -71q137 0 240 99q-16 20 -47.5 56.5t-43.5 50.5q-67 -65 -144 -65q-55 0 -93.5 33.5t-38.5 87.5q0 53 38.5 87t91.5 34q44 0 84.5 -21t73 -55t65 -75t69 -82t77 -75t97 -55 t121.5 -21q121 0 204.5 71.5t83.5 190.5q0 121 -84 192t-207 71q-143 0 -241 -97q14 -16 29.5 -34t34.5 -40t29 -34q66 64 142 64q52 0 92 -33t40 -84q0 -57 -37 -91.5t-94 -34.5q-43 0 -82.5 21t-72 55t-65.5 75t-69.5 82t-77.5 75t-96.5 55t-118.5 21q-122 0 -207 -70.5 t-85 -189.5z" />
456
+ <glyph unicode="&#xf1cd;" horiz-adv-x="1792" d="M896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 1408q-190 0 -361 -90l194 -194q82 28 167 28t167 -28l194 194q-171 90 -361 90zM218 279l194 194 q-28 82 -28 167t28 167l-194 194q-90 -171 -90 -361t90 -361zM896 -128q190 0 361 90l-194 194q-82 -28 -167 -28t-167 28l-194 -194q171 -90 361 -90zM896 256q159 0 271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5 t271.5 -112.5zM1380 473l194 -194q90 171 90 361t-90 361l-194 -194q28 -82 28 -167t-28 -167z" />
457
+ <glyph unicode="&#xf1ce;" horiz-adv-x="1792" d="M1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348q0 222 101 414.5t276.5 317t390.5 155.5v-260q-221 -45 -366.5 -221t-145.5 -406q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 q0 230 -145.5 406t-366.5 221v260q215 -31 390.5 -155.5t276.5 -317t101 -414.5z" />
458
+ <glyph unicode="&#xf1d0;" horiz-adv-x="1792" d="M19 662q8 217 116 406t305 318h5q0 -1 -1 -3q-8 -8 -28 -33.5t-52 -76.5t-60 -110.5t-44.5 -135.5t-14 -150.5t39 -157.5t108.5 -154q50 -50 102 -69.5t90.5 -11.5t69.5 23.5t47 32.5l16 16q39 51 53 116.5t6.5 122.5t-21 107t-26.5 80l-14 29q-10 25 -30.5 49.5t-43 41 t-43.5 29.5t-35 19l-13 6l104 115q39 -17 78 -52t59 -61l19 -27q1 48 -18.5 103.5t-40.5 87.5l-20 31l161 183l160 -181q-33 -46 -52.5 -102.5t-22.5 -90.5l-4 -33q22 37 61.5 72.5t67.5 52.5l28 17l103 -115q-44 -14 -85 -50t-60 -65l-19 -29q-31 -56 -48 -133.5t-7 -170 t57 -156.5q33 -45 77.5 -60.5t85 -5.5t76 26.5t57.5 33.5l21 16q60 53 96.5 115t48.5 121.5t10 121.5t-18 118t-37 107.5t-45.5 93t-45 72t-34.5 47.5l-13 17q-14 13 -7 13l10 -3q40 -29 62.5 -46t62 -50t64 -58t58.5 -65t55.5 -77t45.5 -88t38 -103t23.5 -117t10.5 -136 q3 -259 -108 -465t-312 -321t-456 -115q-185 0 -351 74t-283.5 198t-184 293t-60.5 353z" />
459
+ <glyph unicode="&#xf1d1;" horiz-adv-x="1792" d="M874 -102v-66q-208 6 -385 109.5t-283 275.5l58 34q29 -49 73 -99l65 57q148 -168 368 -212l-17 -86q65 -12 121 -13zM276 428l-83 -28q22 -60 49 -112l-57 -33q-98 180 -98 385t98 385l57 -33q-30 -56 -49 -112l82 -28q-35 -100 -35 -212q0 -109 36 -212zM1528 251 l58 -34q-106 -172 -283 -275.5t-385 -109.5v66q56 1 121 13l-17 86q220 44 368 212l65 -57q44 50 73 99zM1377 805l-233 -80q14 -42 14 -85t-14 -85l232 -80q-31 -92 -98 -169l-185 162q-57 -67 -147 -85l48 -241q-52 -10 -98 -10t-98 10l48 241q-90 18 -147 85l-185 -162 q-67 77 -98 169l232 80q-14 42 -14 85t14 85l-233 80q33 93 99 169l185 -162q59 68 147 86l-48 240q44 10 98 10t98 -10l-48 -240q88 -18 147 -86l185 162q66 -76 99 -169zM874 1448v-66q-65 -2 -121 -13l17 -86q-220 -42 -368 -211l-65 56q-38 -42 -73 -98l-57 33 q106 172 282 275.5t385 109.5zM1705 640q0 -205 -98 -385l-57 33q27 52 49 112l-83 28q36 103 36 212q0 112 -35 212l82 28q-19 56 -49 112l57 33q98 -180 98 -385zM1585 1063l-57 -33q-35 56 -73 98l-65 -56q-148 169 -368 211l17 86q-56 11 -121 13v66q209 -6 385 -109.5 t282 -275.5zM1748 640q0 173 -67.5 331t-181.5 272t-272 181.5t-331 67.5t-331 -67.5t-272 -181.5t-181.5 -272t-67.5 -331t67.5 -331t181.5 -272t272 -181.5t331 -67.5t331 67.5t272 181.5t181.5 272t67.5 331zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71 t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
460
+ <glyph unicode="&#xf1d2;" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -25.5t19 -63.5zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -53 41 -77v-3q-113 -37 -113 -139q0 -45 20 -78.5t54 -51t72 -25.5t81 -8q224 0 224 188q0 67 -48 99t-126 46q-27 5 -51.5 20.5t-24.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q37 9 49 13zM771 350h137q-2 27 -2 82v387q0 46 2 69h-137q3 -23 3 -71v-392 q0 -50 -3 -75zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q3 0 11 -0.5t12 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
461
+ <glyph unicode="&#xf1d3;" horiz-adv-x="1792" d="M595 22q0 100 -165 100q-158 0 -158 -104q0 -101 172 -101q151 0 151 105zM536 777q0 61 -30 102t-89 41q-124 0 -124 -145q0 -135 124 -135q119 0 119 137zM805 1101v-202q-36 -12 -79 -22q16 -43 16 -84q0 -127 -73 -216.5t-197 -112.5q-40 -8 -59.5 -27t-19.5 -58 q0 -31 22.5 -51.5t58 -32t78.5 -22t86 -25.5t78.5 -37.5t58 -64t22.5 -98.5q0 -304 -363 -304q-69 0 -130 12.5t-116 41t-87.5 82t-32.5 127.5q0 165 182 225v4q-67 41 -67 126q0 109 63 137v4q-72 24 -119.5 108.5t-47.5 165.5q0 139 95 231.5t235 92.5q96 0 178 -47 q98 0 218 47zM1123 220h-222q4 45 4 134v609q0 94 -4 128h222q-4 -33 -4 -124v-613q0 -89 4 -134zM1724 442v-196q-71 -39 -174 -39q-62 0 -107 20t-70 50t-39.5 78t-18.5 92t-4 103v351h2v4q-7 0 -19 1t-18 1q-21 0 -59 -6v190h96v76q0 54 -6 89h227q-6 -41 -6 -165h171 v-190q-15 0 -43.5 2t-42.5 2h-85v-365q0 -131 87 -131q61 0 109 33zM1148 1389q0 -58 -39 -101.5t-96 -43.5q-58 0 -98 43.5t-40 101.5q0 59 39.5 103t98.5 44q58 0 96.5 -44.5t38.5 -102.5z" />
462
+ <glyph unicode="&#xf1d4;" d="M809 532l266 499h-112l-157 -312q-24 -48 -44 -92l-42 92l-155 312h-120l263 -493v-324h101v318zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
463
+ <glyph unicode="&#xf1d5;" horiz-adv-x="1280" d="M842 964q0 -80 -57 -136.5t-136 -56.5q-60 0 -111 35q-62 -67 -115 -146q-247 -371 -202 -859q1 -22 -12.5 -38.5t-34.5 -18.5h-5q-20 0 -35 13.5t-17 33.5q-14 126 -3.5 247.5t29.5 217t54 186t69 155.5t74 125q61 90 132 165q-16 35 -16 77q0 80 56.5 136.5t136.5 56.5 t136.5 -56.5t56.5 -136.5zM1223 953q0 -158 -78 -292t-212.5 -212t-292.5 -78q-64 0 -131 14q-21 5 -32.5 23.5t-6.5 39.5q5 20 23 31.5t39 7.5q51 -13 108 -13q97 0 186 38t153 102t102 153t38 186t-38 186t-102 153t-153 102t-186 38t-186 -38t-153 -102t-102 -153 t-38 -186q0 -114 52 -218q10 -20 3.5 -40t-25.5 -30t-39.5 -3t-30.5 26q-64 123 -64 265q0 119 46.5 227t124.5 186t186 124t226 46q158 0 292.5 -78t212.5 -212.5t78 -292.5z" />
464
+ <glyph unicode="&#xf1d6;" horiz-adv-x="1792" d="M270 730q-8 19 -8 52q0 20 11 49t24 45q-1 22 7.5 53t22.5 43q0 139 92.5 288.5t217.5 209.5q139 66 324 66q133 0 266 -55q49 -21 90 -48t71 -56t55 -68t42 -74t32.5 -84.5t25.5 -89.5t22 -98l1 -5q55 -83 55 -150q0 -14 -9 -40t-9 -38q0 -1 1.5 -3.5t3.5 -5t2 -3.5 q77 -114 120.5 -214.5t43.5 -208.5q0 -43 -19.5 -100t-55.5 -57q-9 0 -19.5 7.5t-19 17.5t-19 26t-16 26.5t-13.5 26t-9 17.5q-1 1 -3 1l-5 -4q-59 -154 -132 -223q20 -20 61.5 -38.5t69 -41.5t35.5 -65q-2 -4 -4 -16t-7 -18q-64 -97 -302 -97q-53 0 -110.5 9t-98 20 t-104.5 30q-15 5 -23 7q-14 4 -46 4.5t-40 1.5q-41 -45 -127.5 -65t-168.5 -20q-35 0 -69 1.5t-93 9t-101 20.5t-74.5 40t-32.5 64q0 40 10 59.5t41 48.5q11 2 40.5 13t49.5 12q4 0 14 2q2 2 2 4l-2 3q-48 11 -108 105.5t-73 156.5l-5 3q-4 0 -12 -20q-18 -41 -54.5 -74.5 t-77.5 -37.5h-1q-4 0 -6 4.5t-5 5.5q-23 54 -23 100q0 275 252 466z" />
465
+ <glyph unicode="&#xf1d7;" horiz-adv-x="2048" d="M580 1075q0 41 -25 66t-66 25q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 66 24.5t25 65.5zM1323 568q0 28 -25.5 50t-65.5 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q40 0 65.5 22t25.5 51zM1087 1075q0 41 -24.5 66t-65.5 25 q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 65.5 24.5t24.5 65.5zM1722 568q0 28 -26 50t-65 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q39 0 65 22t26 51zM1456 965q-31 4 -70 4q-169 0 -311 -77t-223.5 -208.5t-81.5 -287.5 q0 -78 23 -152q-35 -3 -68 -3q-26 0 -50 1.5t-55 6.5t-44.5 7t-54.5 10.5t-50 10.5l-253 -127l72 218q-290 203 -290 490q0 169 97.5 311t264 223.5t363.5 81.5q176 0 332.5 -66t262 -182.5t136.5 -260.5zM2048 404q0 -117 -68.5 -223.5t-185.5 -193.5l55 -181l-199 109 q-150 -37 -218 -37q-169 0 -311 70.5t-223.5 191.5t-81.5 264t81.5 264t223.5 191.5t311 70.5q161 0 303 -70.5t227.5 -192t85.5 -263.5z" />
466
+ <glyph unicode="&#xf1d8;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-453 185l-242 -295q-18 -23 -49 -23q-13 0 -22 4q-19 7 -30.5 23.5t-11.5 36.5v349l864 1059l-1069 -925l-395 162q-37 14 -40 55q-2 40 32 59l1664 960q15 9 32 9q20 0 36 -11z" />
467
+ <glyph unicode="&#xf1d9;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-527 215l-298 -327q-18 -21 -47 -21q-14 0 -23 4q-19 7 -30 23.5t-11 36.5v452l-472 193q-37 14 -40 55q-3 39 32 59l1664 960q35 21 68 -2zM1422 26l221 1323l-1434 -827l336 -137 l863 639l-478 -797z" />
468
+ <glyph unicode="&#xf1da;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298zM896 928v-448q0 -14 -9 -23 t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23z" />
469
+ <glyph unicode="&#xf1db;" d="M768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
470
+ <glyph unicode="&#xf1dc;" horiz-adv-x="1792" d="M1682 -128q-44 0 -132.5 3.5t-133.5 3.5q-44 0 -132 -3.5t-132 -3.5q-24 0 -37 20.5t-13 45.5q0 31 17 46t39 17t51 7t45 15q33 21 33 140l-1 391q0 21 -1 31q-13 4 -50 4h-675q-38 0 -51 -4q-1 -10 -1 -31l-1 -371q0 -142 37 -164q16 -10 48 -13t57 -3.5t45 -15 t20 -45.5q0 -26 -12.5 -48t-36.5 -22q-47 0 -139.5 3.5t-138.5 3.5q-43 0 -128 -3.5t-127 -3.5q-23 0 -35.5 21t-12.5 45q0 30 15.5 45t36 17.5t47.5 7.5t42 15q33 23 33 143l-1 57v813q0 3 0.5 26t0 36.5t-1.5 38.5t-3.5 42t-6.5 36.5t-11 31.5t-16 18q-15 10 -45 12t-53 2 t-41 14t-18 45q0 26 12 48t36 22q46 0 138.5 -3.5t138.5 -3.5q42 0 126.5 3.5t126.5 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17 -43.5t-38.5 -14.5t-49.5 -4t-43 -13q-35 -21 -35 -160l1 -320q0 -21 1 -32q13 -3 39 -3h699q25 0 38 3q1 11 1 32l1 320q0 139 -35 160 q-18 11 -58.5 12.5t-66 13t-25.5 49.5q0 26 12.5 48t37.5 22q44 0 132 -3.5t132 -3.5q43 0 129 3.5t129 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17.5 -44t-40 -14.5t-51.5 -3t-44 -12.5q-35 -23 -35 -161l1 -943q0 -119 34 -140q16 -10 46 -13.5t53.5 -4.5t41.5 -15.5t18 -44.5 q0 -26 -12 -48t-36 -22z" />
471
+ <glyph unicode="&#xf1dd;" horiz-adv-x="1280" d="M1278 1347v-73q0 -29 -18.5 -61t-42.5 -32q-50 0 -54 -1q-26 -6 -32 -31q-3 -11 -3 -64v-1152q0 -25 -18 -43t-43 -18h-108q-25 0 -43 18t-18 43v1218h-143v-1218q0 -25 -17.5 -43t-43.5 -18h-108q-26 0 -43.5 18t-17.5 43v496q-147 12 -245 59q-126 58 -192 179 q-64 117 -64 259q0 166 88 286q88 118 209 159q111 37 417 37h479q25 0 43 -18t18 -43z" />
472
+ <glyph unicode="&#xf1de;" d="M352 128v-128h-352v128h352zM704 256q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM864 640v-128h-864v128h864zM224 1152v-128h-224v128h224zM1536 128v-128h-736v128h736zM576 1280q26 0 45 -19t19 -45v-256 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1216 768q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1536 640v-128h-224v128h224zM1536 1152v-128h-864v128h864z" />
473
+ <glyph unicode="&#xf1e0;" d="M1216 512q133 0 226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5q0 12 2 34l-360 180q-92 -86 -218 -86q-133 0 -226.5 93.5t-93.5 226.5t93.5 226.5t226.5 93.5q126 0 218 -86l360 180q-2 22 -2 34q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5q-126 0 -218 86l-360 -180q2 -22 2 -34t-2 -34l360 -180q92 86 218 86z" />
474
+ <glyph unicode="&#xf1e1;" d="M1280 341q0 88 -62.5 151t-150.5 63q-84 0 -145 -58l-241 120q2 16 2 23t-2 23l241 120q61 -58 145 -58q88 0 150.5 63t62.5 151t-62.5 150.5t-150.5 62.5t-151 -62.5t-63 -150.5q0 -7 2 -23l-241 -120q-62 57 -145 57q-88 0 -150.5 -62.5t-62.5 -150.5t62.5 -150.5 t150.5 -62.5q83 0 145 57l241 -120q-2 -16 -2 -23q0 -88 63 -150.5t151 -62.5t150.5 62.5t62.5 150.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
475
+ <glyph unicode="&#xf1e2;" horiz-adv-x="1792" d="M571 947q-10 25 -34 35t-49 0q-108 -44 -191 -127t-127 -191q-10 -25 0 -49t35 -34q13 -5 24 -5q42 0 60 40q34 84 98.5 148.5t148.5 98.5q25 11 35 35t0 49zM1513 1303l46 -46l-244 -243l68 -68q19 -19 19 -45.5t-19 -45.5l-64 -64q89 -161 89 -343q0 -143 -55.5 -273.5 t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5q182 0 343 -89l64 64q19 19 45.5 19t45.5 -19l68 -68zM1521 1359q-10 -10 -22 -10q-13 0 -23 10l-91 90q-9 10 -9 23t9 23q10 9 23 9t23 -9l90 -91 q10 -9 10 -22.5t-10 -22.5zM1751 1129q-11 -9 -23 -9t-23 9l-90 91q-10 9 -10 22.5t10 22.5q9 10 22.5 10t22.5 -10l91 -90q9 -10 9 -23t-9 -23zM1792 1312q0 -14 -9 -23t-23 -9h-96q-14 0 -23 9t-9 23t9 23t23 9h96q14 0 23 -9t9 -23zM1600 1504v-96q0 -14 -9 -23t-23 -9 t-23 9t-9 23v96q0 14 9 23t23 9t23 -9t9 -23zM1751 1449l-91 -90q-10 -10 -22 -10q-13 0 -23 10q-10 9 -10 22.5t10 22.5l90 91q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
476
+ <glyph unicode="&#xf1e3;" horiz-adv-x="1792" d="M609 720l287 208l287 -208l-109 -336h-355zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM1515 186q149 203 149 454v3l-102 -89l-240 224l63 323 l134 -12q-150 206 -389 282l53 -124l-287 -159l-287 159l53 124q-239 -76 -389 -282l135 12l62 -323l-240 -224l-102 89v-3q0 -251 149 -454l30 132l326 -40l139 -298l-116 -69q117 -39 240 -39t240 39l-116 69l139 298l326 40z" />
477
+ <glyph unicode="&#xf1e4;" horiz-adv-x="1792" d="M448 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM256 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM832 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM66 768q-28 0 -47 19t-19 46v129h514v-129q0 -27 -19 -46t-46 -19h-383zM1216 224v-192q0 -14 -9 -23t-23 -9h-192 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1600 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23 zM1408 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1016v-13h-514v10q0 104 -382 102q-382 -1 -382 -102v-10h-514v13q0 17 8.5 43t34 64t65.5 75.5t110.5 76t160 67.5t224 47.5t293.5 18.5t293 -18.5t224 -47.5 t160.5 -67.5t110.5 -76t65.5 -75.5t34 -64t8.5 -43zM1792 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 962v-129q0 -27 -19 -46t-46 -19h-384q-27 0 -46 19t-19 46v129h514z" />
478
+ <glyph unicode="&#xf1e5;" horiz-adv-x="1792" d="M704 1216v-768q0 -26 -19 -45t-45 -19v-576q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v512l249 873q7 23 31 23h424zM1024 1216v-704h-256v704h256zM1792 320v-512q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v576q-26 0 -45 19t-19 45v768h424q24 0 31 -23z M736 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23zM1408 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23z" />
479
+ <glyph unicode="&#xf1e6;" horiz-adv-x="1792" d="M1755 1083q37 -37 37 -90t-37 -91l-401 -400l150 -150l-160 -160q-163 -163 -389.5 -186.5t-411.5 100.5l-362 -362h-181v181l362 362q-124 185 -100.5 411.5t186.5 389.5l160 160l150 -150l400 401q38 37 91 37t90 -37t37 -90.5t-37 -90.5l-400 -401l234 -234l401 400 q38 37 91 37t90 -37z" />
480
+ <glyph unicode="&#xf1e7;" horiz-adv-x="1792" d="M873 796q0 -83 -63.5 -142.5t-152.5 -59.5t-152.5 59.5t-63