Newsletter - Version 4.5.5

Version Description

  • New unified themes and composer selection screen
  • Fixed the WP integration panel (incompatibility with WP 4.5.3)
  • Removed few notices
  • More warning fix
  • Fix "isHTML" error
  • jQuery conflict fix
  • Escape fix
  • Warning fix
  • Fixed the mime header
Download this release

Release Info

Developer webagile
Plugin Icon 128x128 Newsletter
Version 4.5.5
Comparing to
See all releases

Code changes from version 4.7.8 to 4.5.5

Files changed (259) hide show
  1. admin.css +11 -245
  2. api/add.php +46 -0
  3. api/delete.php +13 -0
  4. css/dropdown.css +1 -2
  5. do/change.php +48 -0
  6. do/confirm.php +6 -0
  7. do/profile.php +7 -0
  8. do/save.php +10 -0
  9. do/subscribe.php +6 -0
  10. do/subscription.php +26 -0
  11. do/unlock.php +6 -0
  12. do/unsubscribe.php +5 -0
  13. do/unsubscription.php +6 -0
  14. do/view.php +3 -0
  15. emails/composer.php +0 -5
  16. emails/cpreview.php +14 -27
  17. emails/create.php +54 -0
  18. emails/css.php +17 -0
  19. emails/edit.php +31 -53
  20. emails/emails.php +7 -132
  21. emails/index.php +2 -5
  22. emails/new.php +29 -29
  23. emails/preview-text.php +15 -0
  24. emails/preview.php +13 -0
  25. emails/theme.php +4 -6
  26. emails/themes/blank/theme-options.php +5 -8
  27. emails/themes/blank/theme-text.php +0 -3
  28. emails/themes/blank/theme.php +1 -3
  29. emails/themes/cta-2015/theme-options.php +7 -10
  30. emails/themes/cta-2015/theme.php +159 -166
  31. emails/themes/default/footer.php +7 -10
  32. emails/themes/default/images/instagram.png +0 -0
  33. emails/themes/default/images/pinterest.png +0 -0
  34. emails/themes/default/images/tumblr.png +0 -0
  35. emails/themes/default/social-options.php +38 -45
  36. emails/themes/default/social.php +55 -62
  37. emails/themes/default/social_main.php +43 -50
  38. emails/themes/default/theme-options.php +78 -60
  39. emails/themes/default/theme-text.php +1 -3
  40. emails/themes/default/theme.php +4 -6
  41. emails/themes/linear/theme-options.php +17 -21
  42. emails/themes/linear/theme-text.php +1 -4
  43. emails/themes/linear/theme.php +1 -4
  44. emails/themes/pint/theme-options.php +14 -18
  45. emails/themes/pint/theme-text.php +1 -4
  46. emails/themes/pint/theme.php +0 -2
  47. emails/themes/simple/theme-text.php +1 -4
  48. emails/themes/simple/theme.php +0 -3
  49. emails/themes/theme-1/theme-options.php +42 -46
  50. emails/themes/theme-1/theme-text.php +0 -3
  51. emails/themes/theme-1/theme.php +0 -3
  52. emails/themes/theme-3/theme-options.php +43 -47
  53. emails/themes/theme-3/theme-text.php +0 -3
  54. emails/themes/theme-3/theme.php +0 -3
  55. emails/themes/vimeo-like/theme-options.php +60 -64
  56. emails/themes/vimeo-like/theme-text.php +1 -4
  57. emails/themes/vimeo-like/theme.php +0 -3
  58. emails/themes/xmas-2014/theme.php +121 -124
  59. emails/tnp-composer/_css/newsletter-builder.css +0 -1
  60. emails/tnp-composer/_scripts/newsletter-builder.js +354 -361
  61. emails/tnp-composer/blocks/{content-01-hero.block.php → content-01-hero.block} +1 -1
  62. emails/tnp-composer/blocks/{content-01-hero.block.png → content-01-hero.png} +0 -0
  63. emails/tnp-composer/blocks/{content-02-heading.block.php → content-02-heading.block} +1 -1
  64. emails/tnp-composer/blocks/{content-02-heading.block.png → content-02-heading.png} +0 -0
  65. emails/tnp-composer/blocks/{content-03-text.block.php → content-03-text.block} +1 -1
  66. emails/tnp-composer/blocks/{content-03-text.block.png → content-03-text.png} +0 -0
  67. emails/tnp-composer/blocks/{content-04-cta.block.php → content-04-cta.block} +0 -0
  68. emails/tnp-composer/blocks/{content-04-cta.block.png → content-04-cta.png} +0 -0
  69. emails/tnp-composer/blocks/{content-05-image.block.php → content-05-image.block} +1 -1
  70. emails/tnp-composer/blocks/{content-05-image.block.png → content-05-image.png} +0 -0
  71. emails/tnp-composer/blocks/{content-06-posts.block.php → content-06-posts.block} +2 -2
  72. emails/tnp-composer/blocks/{content-06-posts.block.png → content-06-posts.png} +0 -0
  73. emails/tnp-composer/blocks/{content-07-twocols.block.php → content-07-twocols.block} +1 -1
  74. emails/tnp-composer/blocks/{content-07-twocols.block.png → content-07-twocols.png} +0 -0
  75. emails/tnp-composer/blocks/{footer-01-footer.block.php → footer-01-footer.block} +0 -0
  76. emails/tnp-composer/blocks/{footer-01-footer.block.png → footer-01-footer.png} +0 -0
  77. emails/tnp-composer/blocks/{footer-02-canspam.block.php → footer-02-canspam.block} +0 -0
  78. emails/tnp-composer/blocks/{footer-02-canspam.block.png → footer-02-canspam.png} +0 -0
  79. emails/tnp-composer/blocks/{footer-03-social.block.php → footer-03-social.block} +0 -5
  80. emails/tnp-composer/blocks/{footer-03-social.block.png → footer-03-social.png} +0 -0
  81. emails/tnp-composer/blocks/{header-01-header.block.php → header-01-header.block} +0 -0
  82. emails/tnp-composer/blocks/{header-01-header.block.png → header-01-header.png} +0 -0
  83. emails/tnp-composer/edit.php +42 -50
  84. emails/tnp-composer/index.php +85 -87
  85. feed/feed.php +26 -0
  86. feed/index.php +26 -0
  87. header-extension.php +28 -31
  88. includes/class-tgm-plugin-activation.php +0 -3853
  89. includes/controls.php +82 -109
  90. includes/helper.php +0 -2
  91. includes/logger.php +77 -84
  92. includes/module.php +26 -21
  93. includes/store.php +2 -3
  94. includes/themes.php +217 -218
  95. lock/index.php +0 -2
  96. lock/lock.php +0 -1
  97. main/diagnostic.php +276 -74
  98. main/extensions.php +13 -93
  99. main/index.php +1 -3
  100. main/info.php +191 -202
  101. main/main.php +14 -47
  102. main/smtp.php +0 -2
  103. main/startup.php +161 -163
  104. main/status.php +0 -892
  105. plugin.php +95 -228
  106. readme.txt +4 -125
  107. statistics/index.php +7 -8
  108. statistics/link.php +69 -0
  109. statistics/newsletters.php +3 -5
  110. statistics/open.php +21 -0
  111. statistics/settings.php +0 -2
  112. statistics/statistics.php +16 -112
  113. statistics/view-retarget.php +0 -2
  114. statistics/view-urls.php +0 -2
  115. statistics/view-users.php +0 -2
  116. statistics/view.php +4 -16
  117. subscription/forms.php +0 -2
  118. subscription/languages/en_US.php +2 -2
  119. subscription/lists.php +0 -2
  120. subscription/options.php +14 -60
  121. subscription/page.php +1 -1
  122. subscription/profile.php +20 -4
  123. subscription/style.css +0 -261
  124. subscription/styles/gray.css +34 -0
  125. subscription/styles/neutral.css +62 -0
  126. subscription/styles/shortcode/default.css +36 -0
  127. subscription/styles/white.css +34 -0
  128. subscription/styles/widget-neutral.css +54 -0
  129. subscription/styles/widget-neutral/button.png +0 -0
  130. subscription/subscription.php +439 -498
  131. subscription/template.php +6 -29
  132. subscription/unsubscription.php +0 -2
  133. subscription/validate.js +0 -31
  134. tnp-footer.php +0 -3
  135. tnp-header.php +26 -8
  136. trunk/admin.css +1120 -0
  137. trunk/admin.js +41 -0
  138. trunk/api/add.php +46 -0
  139. trunk/api/delete.php +13 -0
  140. trunk/css/dropdown.css +150 -0
  141. trunk/css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  142. trunk/css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  143. trunk/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  144. trunk/css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  145. trunk/css/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  146. trunk/css/jquery-ui/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  147. trunk/css/jquery-ui/images/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  148. trunk/css/jquery-ui/images/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  149. trunk/css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  150. trunk/css/jquery-ui/images/ui-icons_0073ea_256x240.png +0 -0
  151. trunk/css/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  152. trunk/css/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
  153. trunk/css/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
  154. trunk/css/jquery-ui/images/ui-icons_666666_256x240.png +0 -0
  155. trunk/css/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
  156. trunk/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
  157. trunk/css/jquery-ui/images/ui-icons_ff0084_256x240.png +0 -0
  158. trunk/css/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
  159. trunk/css/jquery-ui/jquery-ui.css +1225 -0
  160. trunk/css/jqvmap.css +50 -0
  161. trunk/do/change.php +48 -0
  162. trunk/do/confirm.php +6 -0
  163. trunk/do/profile.php +7 -0
  164. trunk/do/save.php +10 -0
  165. trunk/do/subscribe.php +6 -0
  166. trunk/do/subscription.php +26 -0
  167. trunk/do/unlock.php +6 -0
  168. trunk/do/unsubscribe.php +5 -0
  169. trunk/do/unsubscription.php +6 -0
  170. trunk/do/view.php +3 -0
  171. trunk/editor.css +4 -0
  172. trunk/emails/composer.php +107 -0
  173. trunk/emails/cpreview.php +480 -0
  174. trunk/emails/create.php +54 -0
  175. trunk/emails/css.php +17 -0
  176. trunk/emails/edit.php +486 -0
  177. trunk/emails/editor.css +4 -0
  178. trunk/emails/emails.php +152 -0
  179. trunk/emails/index.php +155 -0
  180. trunk/emails/languages/en_US.php +7 -0
  181. trunk/emails/languages/en_US.po +172 -0
  182. trunk/emails/languages/it_IT.mo +0 -0
  183. trunk/emails/languages/it_IT.po +180 -0
  184. trunk/emails/new.php +172 -0
  185. trunk/emails/preview-text.php +15 -0
  186. trunk/emails/preview.php +13 -0
  187. trunk/emails/theme.php +89 -0
  188. trunk/emails/themes/blank/screenshot.png +0 -0
  189. trunk/emails/themes/blank/theme-options.php +6 -0
  190. trunk/emails/themes/blank/theme-text.php +8 -0
  191. trunk/emails/themes/blank/theme.php +43 -0
  192. trunk/emails/themes/composer.gif +0 -0
  193. trunk/emails/themes/cta-2015/images/facebook.png +0 -0
  194. trunk/emails/themes/cta-2015/images/flickr.png +0 -0
  195. trunk/emails/themes/cta-2015/images/googleplus.png +0 -0
  196. trunk/emails/themes/cta-2015/images/instagram.png +0 -0
  197. trunk/emails/themes/cta-2015/images/linkedin.png +0 -0
  198. trunk/emails/themes/cta-2015/images/pinterest.png +0 -0
  199. trunk/emails/themes/cta-2015/images/twitter.png +0 -0
  200. trunk/emails/themes/cta-2015/images/vimeo.png +0 -0
  201. trunk/emails/themes/cta-2015/images/youtube.png +0 -0
  202. trunk/emails/themes/cta-2015/screenshot.png +0 -0
  203. trunk/emails/themes/cta-2015/theme-options.php +8 -0
  204. trunk/emails/themes/cta-2015/theme.php +160 -0
  205. trunk/emails/themes/default/footer.php +8 -0
  206. trunk/emails/themes/default/images/facebook.png +0 -0
  207. trunk/emails/themes/default/images/googleplus.png +0 -0
  208. trunk/emails/themes/default/images/linkedin.png +0 -0
  209. trunk/emails/themes/default/images/pinterest.png +0 -0
  210. trunk/emails/themes/default/images/soundcloud.png +0 -0
  211. trunk/emails/themes/default/images/tumblr.png +0 -0
  212. trunk/emails/themes/default/images/twitter.png +0 -0
  213. trunk/emails/themes/default/images/vimeo.png +0 -0
  214. trunk/emails/themes/default/images/youtube.png +0 -0
  215. trunk/emails/themes/default/screenshot.png +0 -0
  216. trunk/emails/themes/default/social-options.php +39 -0
  217. trunk/emails/themes/default/social.php +56 -0
  218. trunk/emails/themes/default/social_main.php +44 -0
  219. trunk/emails/themes/default/theme-options.php +78 -0
  220. trunk/emails/themes/default/theme-text.php +8 -0
  221. trunk/emails/themes/default/theme.php +116 -0
  222. trunk/emails/themes/linear/images/facebook.png +0 -0
  223. trunk/emails/themes/linear/images/purple.png +0 -0
  224. trunk/emails/themes/linear/images/twitter.png +0 -0
  225. trunk/emails/themes/linear/images/youtube.png +0 -0
  226. trunk/emails/themes/linear/screenshot.png +0 -0
  227. trunk/emails/themes/linear/theme-options.php +18 -0
  228. trunk/emails/themes/linear/theme-text.php +8 -0
  229. trunk/emails/themes/linear/theme.php +118 -0
  230. trunk/emails/themes/pint/images/bg.jpg +0 -0
  231. trunk/emails/themes/pint/screenshot.png +0 -0
  232. trunk/emails/themes/pint/theme-options.php +15 -0
  233. trunk/emails/themes/pint/theme-text.php +8 -0
  234. trunk/emails/themes/pint/theme.php +83 -0
  235. trunk/emails/themes/simple/screenshot.png +0 -0
  236. trunk/emails/themes/simple/theme-options.php +1 -0
  237. trunk/emails/themes/simple/theme-text.php +8 -0
  238. trunk/emails/themes/simple/theme.php +155 -0
  239. trunk/emails/themes/theme-1/screenshot.png +0 -0
  240. trunk/emails/themes/theme-1/theme-options.php +42 -0
  241. trunk/emails/themes/theme-1/theme-text.php +46 -0
  242. trunk/emails/themes/theme-1/theme.php +110 -0
  243. trunk/emails/themes/theme-3/header.jpg +0 -0
  244. trunk/emails/themes/theme-3/screenshot.png +0 -0
  245. trunk/emails/themes/theme-3/theme-options.php +43 -0
  246. trunk/emails/themes/theme-3/theme-text.php +46 -0
  247. trunk/emails/themes/theme-3/theme.php +121 -0
  248. trunk/emails/themes/vimeo-like/bg_header_email.gif +0 -0
  249. trunk/emails/themes/vimeo-like/screenshot.png +0 -0
  250. trunk/emails/themes/vimeo-like/theme-options.php +60 -0
  251. trunk/emails/themes/vimeo-like/theme-text.php +8 -0
  252. trunk/emails/themes/vimeo-like/theme.php +152 -0
  253. trunk/emails/themes/xmas-2014/images/footer.png +0 -0
  254. trunk/emails/themes/xmas-2014/images/header.png +0 -0
  255. trunk/emails/themes/xmas-2014/screenshot.png +0 -0
  256. trunk/emails/themes/xmas-2014/theme.php +122 -0
  257. trunk/emails/tnp-composer/_assets/background.png +0 -0
  258. trunk/emails/tnp-composer/_css/Icomoon/icomoon.eot +0 -0
  259. trunk/emails/tnp-composer/_css/Icomoon/icomoon.svg +939 -0
admin.css CHANGED
@@ -1,7 +1,7 @@
1
 
2
  @import url(//fonts.googleapis.com/css?family=Montserrat:400,700);
3
  @import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:700);
4
- @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);
5
  @import url(css/dropdown.css);
6
  @import url(css/jquery-ui/jquery-ui.css);
7
  @import url(statistics/css/tnp-statistics.css);
@@ -106,10 +106,6 @@
106
  border-bottom: 1px solid #ddd;
107
  }
108
 
109
- .ui-tabs-panel {
110
- padding: 15px!important;
111
- }
112
-
113
  /* HEADER *********************************************************************/
114
  #tnp-header {
115
  text-align: left;
@@ -256,7 +252,7 @@
256
  }
257
 
258
 
259
- div.submit {
260
  margin-top: 5px;
261
  padding: 5px;
262
  }
@@ -708,11 +704,11 @@ p.description {
708
 
709
  #tnp-body {
710
  padding: 10px;
711
- background-color: #28313C;
712
- border-color: #28313C;
 
713
  border-width: 10px;
714
  border-style: solid;
715
- overflow: auto;
716
  }
717
 
718
  .tnp-darkbg {
@@ -720,7 +716,7 @@ p.description {
720
  }
721
 
722
  #tnp-body h3 {
723
- margin-top: 25px;
724
  clear: both;
725
  }
726
 
@@ -733,7 +729,7 @@ p.description {
733
 
734
  #tnp-heading {
735
  padding: 10px;
736
- background-color: #28313C;
737
  margin-bottom: 10px;
738
  border-radius: 5px;
739
  }
@@ -852,10 +848,6 @@ p.description {
852
 
853
  /* Dashboard Box */
854
 
855
- .metabox-holder {
856
- width: 100%;
857
- }
858
-
859
  .postbox {
860
  border: none;
861
  }
@@ -943,7 +935,8 @@ p.description {
943
  #tnp-footer {
944
  margin-top: 10px;
945
  padding: 20px 10px 10px 40px;
946
- background-color: #28313C;
 
947
  font-family: "Montserrat", sans-serif;
948
  }
949
 
@@ -977,7 +970,7 @@ p.description {
977
  /* Wrapper Background */
978
 
979
  #wpwrap {
980
- background-color: #222B36 !important;
981
  }
982
 
983
  /* Global buttons styles */
@@ -1124,231 +1117,4 @@ span.wp-media-buttons-icon:before {
1124
 
1125
  .tnp-chart {
1126
  border: 1px solid #eee;
1127
- }
1128
-
1129
- .tnp-db-table {
1130
- width: auto;
1131
- background-color: #fff;
1132
- }
1133
-
1134
- .tnp-db-table thead {
1135
- border-bottom: 1px solid #eee;
1136
- }
1137
-
1138
- .tnp-db-table th {
1139
- font-weight: bold;
1140
- }
1141
-
1142
- .tnp-db-table td, .tnp-db-table th {
1143
- padding: 3px;
1144
- font-family: monospace;
1145
- border: 0;
1146
- }
1147
-
1148
- /* STATUS PANEL */
1149
-
1150
- .tnp-main-status h3, .tnp-main-status h4 {
1151
- color: #fff;
1152
- }
1153
-
1154
- #tnp-status-table .tnp-ok {
1155
- font-weight: bold;
1156
- color: white;
1157
- font-size: 14px;
1158
- background-color: #27AE60;
1159
- padding: 2px 10px;
1160
- border-radius: 10px;
1161
- }
1162
-
1163
- #tnp-status-table .tnp-ko {
1164
- font-weight: bold;
1165
- color: white;
1166
- font-size: 14px;
1167
- background-color: #E74C41;
1168
- padding: 2px 10px;
1169
- border-radius: 10px;
1170
- }
1171
-
1172
- #tnp-status-table .tnp-maybe {
1173
- font-weight: bold;
1174
- color: white;
1175
- font-size: 14px;
1176
- background-color: #F1C40F;
1177
- padding: 2px 10px;
1178
- border-radius: 10px;
1179
- }
1180
-
1181
- .tnp-main-status .tnp-log-files li {
1182
- padding-left: 15px;
1183
- }
1184
-
1185
- .tnp-main-status .tnp-log-files li, .tnp-main-status .tnp-log-files li a {
1186
- color: #fff;
1187
- }
1188
-
1189
- .tnp-main-status .tnp-log-files .tnp-log-size {
1190
- font-style: italic;
1191
- }
1192
-
1193
- table.widefat {
1194
- border: 0;
1195
- box-shadow: none;
1196
- }
1197
-
1198
- #tnp-status-table tbody tr:nth-child(2n+1) {
1199
- background-color: #ECF0F1;
1200
- border-radius: 2px;
1201
- margin: 5px;
1202
- }
1203
-
1204
- #tnp-parameters-table tbody tr:nth-child(2n+1) {
1205
- background-color: #ECF0F1;
1206
- border-radius: 2px;
1207
- margin: 5px;
1208
- }
1209
-
1210
-
1211
-
1212
-
1213
- /* Extension Panel */
1214
-
1215
-
1216
-
1217
- .tnp-extension-premium-box, .tnp-extension-free-box, .tnp-integration-box {
1218
- width: 300px;
1219
- height: 220px;
1220
- background-color: #222B36;
1221
- text-align: center;
1222
- margin: 20px;
1223
- float: left;
1224
- position: relative;
1225
- }
1226
-
1227
- .tnp-extension-premium-box:hover, .tnp-extension-free-box:hover, .tnp-integration-box:hover {
1228
- background-color: #232C35;
1229
- box-shadow: 1px 1px 15px #222B36;
1230
- }
1231
-
1232
- .tnp-extension-premium-box p, .tnp-extension-free-box p, .tnp-integration-box p {
1233
- padding: 5px 10px;
1234
- color: #72777c;
1235
- font-size: 14px;
1236
- margin-top: 0px;
1237
- }
1238
-
1239
- /*.tnp-extension-premium-box {
1240
- border-top: 10px solid #F39C12;
1241
- }
1242
-
1243
- .tnp-extension-free-box {
1244
- border-top: 10px solid #2ECC71;
1245
- }
1246
-
1247
- .tnp-integration-box {
1248
- border-top: 10px solid #3498DB;
1249
- }*/
1250
-
1251
- .tnp-extension-premium-box h3 {
1252
- font-family: "Montserrat", sans-serif;
1253
- padding: 5px 8px;
1254
- border-radius: 3px;
1255
- display: inline-block;
1256
- font-size: 16px;
1257
- color: #fff;
1258
- margin-bottom: 0px;
1259
- margin-top: 0px;
1260
- font-weight: 300;
1261
- }
1262
-
1263
- .tnp-extension-free-box h3 {
1264
- font-family: "Montserrat", sans-serif;
1265
- padding: 5px 8px;
1266
- border-radius: 3px;
1267
- display: inline-block;
1268
- font-size: 16px;
1269
- color: #fff;
1270
- margin-bottom: 0;
1271
- margin-top: 0px;
1272
- font-weight: 300;
1273
- }
1274
-
1275
- .tnp-integration-box h3 {
1276
- font-family: "Montserrat", sans-serif;
1277
- padding: 5px 8px;
1278
- border-radius: 3px;
1279
- display: inline-block;
1280
- font-size: 16px;
1281
- color: #fff;
1282
- margin-bottom: 0;
1283
- margin-top: 0px;
1284
- font-weight: 300;
1285
- }
1286
-
1287
- .tnp-extension-premium-action {
1288
- bottom: 0;
1289
- position: absolute;
1290
- width: 100%;
1291
- padding: 12px;
1292
- font-family: "Montserrat", sans-serif;
1293
- }
1294
-
1295
- .tnp-extension-free-action {
1296
- bottom: 0;
1297
- position: absolute;
1298
- width: 100%;
1299
- padding: 12px;
1300
- font-family: "Montserrat", sans-serif;
1301
- }
1302
-
1303
- .tnp-integration-action {
1304
- bottom: 0;
1305
- position: absolute;
1306
- width: 100%;
1307
- padding: 12px;
1308
- font-family: "Montserrat", sans-serif;
1309
- }
1310
-
1311
-
1312
- .tnp-extension-premium-action span {
1313
- color: #27AE60;
1314
- }
1315
-
1316
- .tnp-extension-free-action span {
1317
- color: #27AE60;
1318
- }
1319
-
1320
- .tnp-integration-action span {
1321
- color: #27AE60;
1322
- }
1323
-
1324
- .tnp-extension-activate {
1325
- color: #1ABC9C;
1326
- padding: 5px 8px;
1327
- text-decoration: none;
1328
- cursor: pointer;
1329
- }
1330
-
1331
- .tnp-extension-install {
1332
- color: #2980B9;
1333
- padding: 5px 8px;
1334
- text-decoration: none;
1335
- cursor: pointer;
1336
- }
1337
-
1338
- .tnp-extension-buy {
1339
- color: #F1C40F;
1340
- padding: 5px 8px;
1341
- text-decoration: none;
1342
- cursor: pointer;
1343
- }
1344
-
1345
- .tnp-extension-free {
1346
- color: #D35400;
1347
- padding: 5px 8px;
1348
- text-decoration: none;
1349
- cursor: pointer;
1350
- }
1351
-
1352
- .tnp-extensions-image img {
1353
- margin: 25px 0px -10px;
1354
- }
1
 
2
  @import url(//fonts.googleapis.com/css?family=Montserrat:400,700);
3
  @import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:700);
4
+ @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css);
5
  @import url(css/dropdown.css);
6
  @import url(css/jquery-ui/jquery-ui.css);
7
  @import url(statistics/css/tnp-statistics.css);
106
  border-bottom: 1px solid #ddd;
107
  }
108
 
 
 
 
 
109
  /* HEADER *********************************************************************/
110
  #tnp-header {
111
  text-align: left;
252
  }
253
 
254
 
255
+ p.submit {
256
  margin-top: 5px;
257
  padding: 5px;
258
  }
704
 
705
  #tnp-body {
706
  padding: 10px;
707
+ background-color: #34495E;
708
+ border-radius: 5px;
709
+ border-color: #34495E;
710
  border-width: 10px;
711
  border-style: solid;
 
712
  }
713
 
714
  .tnp-darkbg {
716
  }
717
 
718
  #tnp-body h3 {
719
+ margin-top: 15px;
720
  clear: both;
721
  }
722
 
729
 
730
  #tnp-heading {
731
  padding: 10px;
732
+ background-color: #34495E;
733
  margin-bottom: 10px;
734
  border-radius: 5px;
735
  }
848
 
849
  /* Dashboard Box */
850
 
 
 
 
 
851
  .postbox {
852
  border: none;
853
  }
935
  #tnp-footer {
936
  margin-top: 10px;
937
  padding: 20px 10px 10px 40px;
938
+ background-color: #34495E;
939
+ border-radius: 5px;
940
  font-family: "Montserrat", sans-serif;
941
  }
942
 
970
  /* Wrapper Background */
971
 
972
  #wpwrap {
973
+ background-color: #2C3E50;
974
  }
975
 
976
  /* Global buttons styles */
1117
 
1118
  .tnp-chart {
1119
  border: 1px solid #eee;
1120
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
api/add.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $key = stripslashes($_REQUEST['nk']);
8
+ if (empty($newsletter->options['api_key']) || $key != $newsletter->options['api_key']) {
9
+ die('Wrong API key');
10
+ }
11
+
12
+ if (!is_email($_REQUEST['ne'])) {
13
+ die('Wrong email');
14
+ }
15
+
16
+ $subscriber = array();
17
+ $subscriber['name'] = stripslashes($_REQUEST['nn']);
18
+ $subscriber['surname'] = stripslashes($_REQUEST['ns']);
19
+ $subscriber['email'] = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
20
+
21
+ if (is_array($_REQUEST['nl'])) {
22
+ foreach ($_REQUEST['nl'] as $add_list) {
23
+ $subscriber['list_' . $add_list] = 1;
24
+ }
25
+ }
26
+ else if (!empty($_REQUEST['nl'])) {
27
+ $add_lists = explode('|', $_REQUEST['nl']);
28
+ foreach ($add_lists as $add_list) {
29
+ $subscriber['list_' . $add_list] = 1;
30
+ }
31
+ }
32
+
33
+ $options_feed = get_option('newsletter_feed', array());
34
+ if ($options_feed['add_new'] == 1) $subscriber['feed'] = 1;
35
+
36
+ $options_followup = get_option('newsletter_followup', array());
37
+ if ($options_followup['add_new'] == 1) {
38
+ $subscriber['followup'] = 1;
39
+ $subscriber['followup_time'] = time() + $options_followup['interval'] * 3600;
40
+ }
41
+
42
+ $subscriber['status'] = 'C';
43
+
44
+ // TODO: add control for already subscribed emails
45
+ NewsletterUsers::instance()->save_user($subscriber);
46
+ die('ok');
api/delete.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $key = stripslashes($_REQUEST['nk']);
8
+ if (empty(trim($newsletter->options['api_key'])) || $key != $newsletter->options['api_key'])
9
+ die('Wrong API key');
10
+
11
+ $email = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
12
+ $r = $wpdb->query($wpdb->prepare("delete from " . NEWSLETTER_USERS_TABLE . " where email=%s", $email));
13
+ die($r = 0 ? 'ko' : 'ok');
css/dropdown.css CHANGED
@@ -2,9 +2,8 @@
2
  margin: 0; padding: 0; border: 0;
3
  }
4
 
5
- /* Removed by Stefano */
6
  .tnp-drowpdown li {
7
- /*min-width: 150px;*/
8
  }
9
 
10
  .tnp-drowpdown {
2
  margin: 0; padding: 0; border: 0;
3
  }
4
 
 
5
  .tnp-drowpdown li {
6
+ min-width: 150px;
7
  }
8
 
9
  .tnp-drowpdown {
do/change.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header('Content-Type: text/html;charset=UTF-8');
4
+ header('X-Robots-Tag: noindex,nofollow,noarchive');
5
+ header('Cache-Control: no-cache,no-store,private');
6
+ include '../../../../wp-load.php';
7
+
8
+ $user = Newsletter::instance()->get_user_from_request(true);
9
+ $field = $_REQUEST['nf'];
10
+ $value = $_REQUEST['nv'];
11
+ $url = $_REQUEST['nu'];
12
+
13
+
14
+ switch ($field) {
15
+ case 'sex':
16
+ if (!in_array($value, array('f', 'm', 'n')))
17
+ die('Invalid sex value');
18
+ NewsletterUsers::instance()->set_user_field($user->id, 'sex', $value);
19
+ break;
20
+ // Should be managed by Feed by Mail
21
+ case 'feed':
22
+ if (isset($value) && ($value === '0' || $value === '1')) {
23
+ NewsletterUsers::instance()->set_user_field($user->id, 'feed', $value);
24
+ } else
25
+ die('Invalid feed value');
26
+ break;
27
+ }
28
+
29
+ if (strpos($field, 'preference_') === 0) {
30
+ $idx = (int) substr($field, 11);
31
+ $options_profile = get_option('newsletter_profile');
32
+
33
+ if ($options_profile['list_' . $idx . '_status'] == 0) {
34
+ die('Not allowed field.');
35
+ }
36
+
37
+ if (isset($value) && ($value === '0' || $value === '1')) {
38
+ NewsletterUsers::instance()->set_user_field($user->id, 'list_' . $idx, $value);
39
+ } else {
40
+ die('Invalid preference value');
41
+ }
42
+ }
43
+
44
+ if (isset($url)) {
45
+ header("Location: $url");
46
+ } else {
47
+ NewsletterSubscription::instance()->show_message('profile', $user, NewsletterSubscription::instance()->options['profile_saved']);
48
+ }
do/confirm.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'c';
5
+ require_once '../../../../wp-load.php';
6
+ }
do/profile.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'p';
5
+ require_once '../../../../wp-load.php';
6
+ }
7
+
do/save.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header('Content-Type: text/html;charset=UTF-8');
4
+ header('X-Robots-Tag: noindex,nofollow,noarchive');
5
+ header('Cache-Control: no-cache,no-store,private');
6
+ include '../../../../wp-load.php';
7
+
8
+ $user = NewsletterSubscription::instance()->save_profile();
9
+ // $user->alert is a temporary field
10
+ NewsletterSubscription::instance()->show_message('profile', $user, $user->alert);
do/subscribe.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ $_GET['na'] = 's';
5
+ require_once '../../../../wp-load.php';
6
+
do/subscription.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $options_main = get_option('newsletter_main', array());
8
+
9
+ if (!empty($options_main['url'])) {
10
+ header('Location: ' . $options_main['url']);
11
+ die();
12
+ }
13
+
14
+ $options = get_option('newsletter', array());
15
+
16
+ if (stripos($options['subscription_text'], '<form') !== false) {
17
+ $message = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" onsubmit="return newsletter_check(this)"', $options['subscription_text']);
18
+ $message = $this->replace_lists($message);
19
+ } else {
20
+ $form = $newsletter->subscription_form();
21
+
22
+ if (strpos($options['subscription_text'], '{subscription_form}') !== false)
23
+ $message = str_replace('{subscription_form}', $form, $options['subscription_text']);
24
+ else $message = $options['subscription_text'] . $form;
25
+ }
26
+ include NEWSLETTER_DIR . '/page.php';
do/unlock.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'ul';
5
+ include '../../../../wp-load.php';
6
+ }
do/unsubscribe.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ $_GET['na'] = 'uc';
4
+ require_once '../../../../wp-load.php';
5
+ }
do/unsubscription.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'u';
5
+ require_once '../../../../wp-load.php';
6
+ }
do/view.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ $_GET['na'] = 'v';
3
+ require_once '../../../../wp-load.php';
emails/composer.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterEmails::instance();
@@ -21,7 +19,6 @@ if (($controls->is_action('save') || $controls->is_action('preview')) && !$_GET[
21
  $email['status'] = 'new';
22
  $email['subject'] = __('Here the email subject', 'newsletter');
23
  $email['track'] = 1;
24
- $email['token'] = $module->get_token();
25
 
26
  $email['message'] = $controls->data['body'];
27
  $email['subject'] = $controls->data['subject'];
@@ -37,8 +34,6 @@ To change your subscription follow: {profile_url}.';
37
 
38
  $email['type'] = 'message';
39
  $email['send_on'] = time();
40
- $email['query'] = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
41
-
42
  $email = Newsletter::instance()->save_email($email, ARRAY_A);
43
  } elseif (isset($_GET['id'])) {
44
 
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
19
  $email['status'] = 'new';
20
  $email['subject'] = __('Here the email subject', 'newsletter');
21
  $email['track'] = 1;
 
22
 
23
  $email['message'] = $controls->data['body'];
24
  $email['subject'] = $controls->data['subject'];
34
 
35
  $email['type'] = 'message';
36
  $email['send_on'] = time();
 
 
37
  $email = Newsletter::instance()->save_email($email, ARRAY_A);
38
  } elseif (isset($_GET['id'])) {
39
 
emails/cpreview.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterEmails::instance();
@@ -110,26 +108,19 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
110
  }
111
  }
112
 
113
- if (isset($controls->data['sex'])) {
114
- $sex = $controls->data['sex'];
115
- if (is_array($sex)) {
116
- $query .= " and sex in (";
117
- foreach ($sex as $x) {
118
- $query .= "'" . $x . "', ";
119
- }
120
- $query = substr($query, 0, -2);
121
- $query .= ")";
122
  }
 
 
123
  }
124
 
125
  $email['query'] = $query;
126
- if ($email['status'] == 'sent') {
127
- $email['total'] = $email['sent'];
128
- } else {
129
- $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
130
- }
131
-
132
-
133
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
134
  $controls->data['send_on'] = time();
135
  }
@@ -245,7 +236,7 @@ if ($controls->is_action('test')) {
245
 
246
  <p class="submit">
247
  <?php $controls->button_back('?page=newsletter_emails_composer&id=' . $email['id']) ?>
248
- <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_save(); ?>
249
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
250
 
251
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
@@ -313,7 +304,7 @@ if ($controls->is_action('test')) {
313
 
314
  <input id="options-message" name="options[message]" type="hidden">
315
 
316
- <div id="tnpc-html-editor"><?php echo esc_html($email['message']) ?></div>
317
  <script src="<?php echo plugins_url('newsletter') ?>/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
318
  <script>
319
  var editor = ace.edit("tnpc-html-editor");
@@ -443,20 +434,16 @@ echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
443
  <table class="form-table">
444
  <tr valign="top">
445
  <th>Email status</th>
446
- <td><?php echo $email['status'] ?></td>
447
  </tr>
448
  <tr valign="top">
449
  <th>Messages sent</th>
450
- <td><?php echo $email['sent'] ?> of <?php echo $email['total'] ?></td>
451
  </tr>
452
  <tr valign="top">
453
  <th>Query (tech)</th>
454
- <td><?php echo esc_html($email['query']) ?></td>
455
  </tr>
456
- <tr valign="top">
457
- <th>Token (tech)</th>
458
- <td><?php echo esc_html($email['token']) ?></td>
459
- </tr>
460
  </table>
461
  </div>
462
 
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
108
  }
109
  }
110
 
111
+ $sex = $controls->data['sex'];
112
+ if (is_array($sex)) {
113
+ $query .= " and sex in (";
114
+ foreach ($sex as $x) {
115
+ $query .= "'" . $x . "', ";
 
 
 
 
116
  }
117
+ $query = substr($query, 0, -2);
118
+ $query .= ")";
119
  }
120
 
121
  $email['query'] = $query;
122
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
123
+
 
 
 
 
 
124
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
125
  $controls->data['send_on'] = time();
126
  }
236
 
237
  <p class="submit">
238
  <?php $controls->button_back('?page=newsletter_emails_composer&id=' . $email['id']) ?>
239
+ <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
240
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
241
 
242
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
304
 
305
  <input id="options-message" name="options[message]" type="hidden">
306
 
307
+ <div id="tnpc-html-editor"><?php echo htmlentities($email['message']) ?></div>
308
  <script src="<?php echo plugins_url('newsletter') ?>/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
309
  <script>
310
  var editor = ace.edit("tnpc-html-editor");
434
  <table class="form-table">
435
  <tr valign="top">
436
  <th>Email status</th>
437
+ <td><?php echo $email['status']; ?></td>
438
  </tr>
439
  <tr valign="top">
440
  <th>Messages sent</th>
441
+ <td><?php echo $email['sent']; ?> of <?php echo $email['total']; ?></td>
442
  </tr>
443
  <tr valign="top">
444
  <th>Query (tech)</th>
445
+ <td><?php echo $email['query']; ?></td>
446
  </tr>
 
 
 
 
447
  </table>
448
  </div>
449
 
emails/create.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Stops WP Super Cache which removes the logged_in cookie
4
+ $_GET['preview'] = 'true';
5
+
6
+ require_once '../../../../wp-load.php';
7
+
8
+ if (!is_user_logged_in()) {
9
+ die('No logged in user found. A plugin is almost surely removing the authentication cookies, usually a cache plugin. Try to report the issue on http://www.thenewsletterplugin.com forum.');
10
+ }
11
+
12
+ if (!current_user_can('manage_categories')) {
13
+ die('Not enough privileges');
14
+ }
15
+
16
+ if (Newsletter::instance()->options['editor'] != 1 && !current_user_can('manage_options')) {
17
+ die('Not enough privileges');
18
+ }
19
+
20
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
21
+ $controls = new NewsletterControls();
22
+ $module = NewsletterEmails::instance();
23
+
24
+ if ($controls->is_action('create')) {
25
+ $module->save_options($controls->data);
26
+
27
+ $email = array();
28
+ $email['status'] = 'new';
29
+ $email['subject'] = ''; //__('Here the email subject', 'newsletter');
30
+ $email['track'] = 1;
31
+
32
+ $theme_options = $module->get_current_theme_options();
33
+
34
+ $theme_url = $module->get_current_theme_url();
35
+ $theme_subject = '';
36
+
37
+ ob_start();
38
+ include $module->get_current_theme_file_path('theme.php');
39
+ $email['message'] = ob_get_clean();
40
+
41
+ if (!empty($theme_subject)) {
42
+ $email['subject'] = $theme_subject;
43
+ }
44
+
45
+ ob_start();
46
+ include $module->get_current_theme_file_path('theme-text.php');
47
+ $email['message_text'] = ob_get_clean();
48
+
49
+ $email['type'] = 'message';
50
+ $email['send_on'] = time();
51
+ $email = Newsletter::instance()->save_email($email);
52
+
53
+ header('Location: ' . $module->get_admin_page_url('edit') . '&id=' . $email->id);
54
+ }
emails/css.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ $email_id = (int)$_GET['id'];
6
+
7
+ $body = Newsletter::instance()->get_email_field($email_id, 'message');
8
+
9
+ $x = strpos($body, '<style');
10
+ if ($x === false) return;
11
+
12
+ $x = strpos($body, '>', $x);
13
+ $y = strpos($body, '</style>');
14
+
15
+ header('Content-Type: text/css');
16
+
17
+ echo substr($body, $x+1, $y-$x-1);
emails/edit.php CHANGED
@@ -32,8 +32,6 @@ if (!$controls->is_action()) {
32
  if ($controls->is_action('test') || $controls->is_action('save') || $controls->is_action('send') || $controls->is_action('editor')) {
33
 
34
  // If we were editing with visual editor (==0), we must read the extra <body> content
35
- $controls->data['message'] = str_ireplace('<script', '<noscript', $controls->data['message']);
36
- $controls->data['message'] = str_ireplace('</script', '</noscript', $controls->data['message']);
37
  if ($email['editor'] == 0) {
38
  $x = strpos($email['message'], '<body');
39
  if ($x !== false) {
@@ -45,7 +43,7 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
45
  } else {
46
  $email['message'] = $controls->data['message'];
47
  }
48
- $email['message_text'] = str_ireplace('<script', '', $controls->data['message_text']);
49
  $email['subject'] = $controls->data['subject'];
50
  $email['track'] = $controls->data['track'];
51
  $email['private'] = $controls->data['private'];
@@ -113,24 +111,19 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
113
  }
114
  }
115
 
116
- if (isset($controls->data['sex'])) {
117
- $sex = $controls->data['sex'];
118
- if (is_array($sex)) {
119
- $query .= " and sex in (";
120
- foreach ($sex as $x) {
121
- $query .= "'" . esc_sql($x) . "', ";
122
- }
123
- $query = substr($query, 0, -2);
124
- $query .= ")";
125
  }
 
 
126
  }
127
 
128
  $email['query'] = $query;
129
- if ($email['status'] == 'sent') {
130
- $email['total'] = $email['sent'];
131
- } else {
132
- $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
133
- }
134
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
135
  $controls->data['send_on'] = time();
136
  }
@@ -239,28 +232,21 @@ if ($email['editor'] == 0) {
239
  theme_advanced_resizing: true,
240
  theme_advanced_toolbar_location: "top",
241
  document_base_url: "<?php echo get_option('home'); ?>/",
242
- content_css: ["<?php echo plugins_url('newsletter') ?>/emails/editor.css", "<?php echo home_url('/') . '?na=emails-css&id=' . $email_id . '&' . time(); ?>"]
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  });
244
-
245
- function tnp_media(name) {
246
- var tnp_uploader = wp.media({
247
- title: "Select an image",
248
- button: {
249
- text: "Select"
250
- },
251
- library: {
252
- type: 'image'
253
- },
254
- displaySettings: true,
255
- multiple: false,
256
- displayUserSettings: false
257
- }).on("select", function() {
258
- var media = tnp_uploader.state().get("selection").first();
259
- if (media.attributes.url.indexOf("http") !== 0) media.attributes.url = "http:" + media.attributes.url;
260
- tinyMCE.execCommand('mceInsertContent', false, '<img src="' + media.attributes.url + '" />');
261
-
262
- }).open();
263
- }
264
 
265
  function template_refresh() {
266
  var d = document.getElementById('options_preview').contentWindow.document;
@@ -293,9 +279,9 @@ if ($email['editor'] == 0) {
293
  <form method="post" action="" id="newsletter-form">
294
  <?php $controls->init(array('cookie_name' => 'newsletter_emails_edit_tab')); ?>
295
 
296
- <div class="tnp-submit">
297
  <?php $controls->button_back('?page=newsletter_emails_index') ?>
298
- <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_save(); ?>
299
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
300
 
301
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
@@ -303,7 +289,7 @@ if ($email['editor'] == 0) {
303
  <?php if ($email['status'] == 'paused') $controls->button_confirm('continue', __('Continue', 'newsletter'), 'Continue the delivery?'); ?>
304
  <?php if ($email['status'] == 'paused') $controls->button_confirm('abort', __('Stop', 'newsletter'), __('This totally stop the delivery, ok?', 'newsletter')); ?>
305
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source' : 'visual') . ' editor', 'Sure?'); ?>
306
- </div>
307
 
308
  <div id="tabs">
309
  <ul>
@@ -321,7 +307,7 @@ if ($email['editor'] == 0) {
321
 
322
 
323
 
324
- <input type="button" value="Add media" onclick="tnp_media()">
325
 
326
  <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
327
 
@@ -410,11 +396,7 @@ if ($email['editor'] == 0) {
410
  </th>
411
  <td>
412
  <?php
413
- if ($email['status'] != 'sent') {
414
- echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
415
- } else {
416
- echo $email['sent'];
417
- }
418
  ?>
419
  <p class="description">
420
  <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
@@ -459,7 +441,7 @@ if ($email['editor'] == 0) {
459
  <table class="form-table">
460
  <tr valign="top">
461
  <th>Email status</th>
462
- <td><?php echo esc_html($email['status']); ?></td>
463
  </tr>
464
  <tr valign="top">
465
  <th>Messages sent</th>
@@ -467,11 +449,7 @@ if ($email['editor'] == 0) {
467
  </tr>
468
  <tr valign="top">
469
  <th>Query (tech)</th>
470
- <td><?php echo esc_html($email['query']); ?></td>
471
- </tr>
472
- <tr valign="top">
473
- <th>Token (tech)</th>
474
- <td><?php echo esc_html($email['token']); ?></td>
475
  </tr>
476
  </table>
477
  </div>
32
  if ($controls->is_action('test') || $controls->is_action('save') || $controls->is_action('send') || $controls->is_action('editor')) {
33
 
34
  // If we were editing with visual editor (==0), we must read the extra <body> content
 
 
35
  if ($email['editor'] == 0) {
36
  $x = strpos($email['message'], '<body');
37
  if ($x !== false) {
43
  } else {
44
  $email['message'] = $controls->data['message'];
45
  }
46
+ $email['message_text'] = $controls->data['message_text'];
47
  $email['subject'] = $controls->data['subject'];
48
  $email['track'] = $controls->data['track'];
49
  $email['private'] = $controls->data['private'];
111
  }
112
  }
113
 
114
+ $sex = $controls->data['sex'];
115
+ if (is_array($sex)) {
116
+ $query .= " and sex in (";
117
+ foreach ($sex as $x) {
118
+ $query .= "'" . esc_sql($x) . "', ";
 
 
 
 
119
  }
120
+ $query = substr($query, 0, -2);
121
+ $query .= ")";
122
  }
123
 
124
  $email['query'] = $query;
125
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
126
+
 
 
 
127
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
128
  $controls->data['send_on'] = time();
129
  }
232
  theme_advanced_resizing: true,
233
  theme_advanced_toolbar_location: "top",
234
  document_base_url: "<?php echo get_option('home'); ?>/",
235
+ content_css: ["<?php echo plugins_url('newsletter') ?>/emails/editor.css", "<?php echo plugins_url('newsletter') . '/emails/css.php?id=' . $email_id . '&' . time(); ?>"]
236
+ });
237
+
238
+ jQuery(document).ready(function () {
239
+ jQuery('#upload_image_button').click(function () {
240
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
241
+ return false;
242
+ });
243
+
244
+ window.send_to_editor = function (html) {
245
+ var imgURL = html.match(/src=\"(.*?)\"/);
246
+ tinyMCE.execCommand('mceInsertContent', false, '<img src="' + imgURL[1] + '" />');
247
+ tb_remove();
248
+ }
249
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
  function template_refresh() {
252
  var d = document.getElementById('options_preview').contentWindow.document;
279
  <form method="post" action="" id="newsletter-form">
280
  <?php $controls->init(array('cookie_name' => 'newsletter_emails_edit_tab')); ?>
281
 
282
+ <p class="submit">
283
  <?php $controls->button_back('?page=newsletter_emails_index') ?>
284
+ <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
285
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
286
 
287
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
289
  <?php if ($email['status'] == 'paused') $controls->button_confirm('continue', __('Continue', 'newsletter'), 'Continue the delivery?'); ?>
290
  <?php if ($email['status'] == 'paused') $controls->button_confirm('abort', __('Stop', 'newsletter'), __('This totally stop the delivery, ok?', 'newsletter')); ?>
291
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source' : 'visual') . ' editor', 'Sure?'); ?>
292
+ </p>
293
 
294
  <div id="tabs">
295
  <ul>
307
 
308
 
309
 
310
+ <input id="upload_image_button" type="button" value="Choose or upload an image" />
311
 
312
  <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
313
 
396
  </th>
397
  <td>
398
  <?php
399
+ echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
 
 
 
 
400
  ?>
401
  <p class="description">
402
  <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
441
  <table class="form-table">
442
  <tr valign="top">
443
  <th>Email status</th>
444
+ <td><?php echo $email['status']; ?></td>
445
  </tr>
446
  <tr valign="top">
447
  <th>Messages sent</th>
449
  </tr>
450
  <tr valign="top">
451
  <th>Query (tech)</th>
452
+ <td><?php echo $email['query']; ?></td>
 
 
 
 
453
  </tr>
454
  </table>
455
  </div>
emails/emails.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
5
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
@@ -20,15 +19,12 @@ class NewsletterEmails extends NewsletterModule {
20
 
21
  function __construct() {
22
  $this->themes = new NewsletterThemes('emails');
23
- parent::__construct('emails', '1.1.5');
24
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
25
  }
26
 
27
  function hook_wp_loaded() {
28
- global $wpdb;
29
-
30
- $newsletter = Newsletter::instance();
31
-
32
  switch ($newsletter->action) {
33
  case 'v':
34
  // TODO: Change to Newsletter::instance()->get:email(), not urgent
@@ -36,17 +32,15 @@ class NewsletterEmails extends NewsletterModule {
36
  if (empty($email)) {
37
  die('Email not found');
38
  }
39
-
40
  if ($email->private == 1) {
41
- die('No available for online view');
42
  }
43
 
44
  $user = NewsletterSubscription::instance()->get_user_from_request();
45
  header('Content-Type: text/html;charset=UTF-8');
46
  header('X-Robots-Tag: noindex,nofollow,noarchive');
47
  header('Cache-Control: no-cache,no-store,private');
48
-
49
- // TODO: To be removed
50
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/view.php')) {
51
  include WP_CONTENT_DIR . '/extensions/newsletter/view.php';
52
  die();
@@ -55,121 +49,6 @@ class NewsletterEmails extends NewsletterModule {
55
  echo $newsletter->replace($email->message, $user, $email->id);
56
 
57
  die();
58
- break;
59
-
60
- case 'emails-css':
61
- $email_id = (int) $_GET['id'];
62
-
63
- $body = Newsletter::instance()->get_email_field($email_id, 'message');
64
-
65
- $x = strpos($body, '<style');
66
- if ($x === false)
67
- return;
68
-
69
- $x = strpos($body, '>', $x);
70
- $y = strpos($body, '</style>');
71
-
72
- header('Content-Type: text/css;charset=UTF-8');
73
-
74
- echo substr($body, $x + 1, $y - $x - 1);
75
-
76
- die();
77
- break;
78
-
79
- case 'emails-preview':
80
- if (!current_user_can('manage_categories')) {
81
- die('Not enough privileges');
82
- }
83
-
84
- if (Newsletter::instance()->options['editor'] != 1 && !current_user_can('manage_options')) {
85
- die('Not enough privileges');
86
- }
87
- if (!check_admin_referer('view')) {
88
- die();
89
- }
90
-
91
- // Used by theme code
92
- $theme_options = $this->get_current_theme_options();
93
- $theme_url = $this->get_current_theme_url();
94
- header('Content-Type: text/html;charset=UTF-8');
95
-
96
- include($this->get_current_theme_file_path('theme.php'));
97
-
98
- die();
99
- break;
100
-
101
- case 'emails-preview-text':
102
- header('Content-Type: text/plain;charset=UTF-8');
103
- if (!current_user_can('manage_categories')) {
104
- die('Not enough privileges');
105
- }
106
-
107
- if (Newsletter::instance()->options['editor'] != 1 && !current_user_can('manage_options')) {
108
- die('Not enough privileges');
109
- }
110
-
111
- if (!check_admin_referer('view')) {
112
- die();
113
- }
114
-
115
- // Used by theme code
116
- $theme_options = $this->get_current_theme_options();
117
-
118
- $file = $this->get_current_theme_file_path('theme-text.php');
119
- if (is_file($file)) {
120
- include($this->get_current_theme_file_path('theme-text.php'));
121
- }
122
-
123
- die();
124
- break;
125
-
126
-
127
- case 'emails-create':
128
-
129
- if (!current_user_can('manage_categories')) {
130
- die('Not enough privileges');
131
- }
132
-
133
- if ($newsletter->options['editor'] != 1 && !current_user_can('manage_options')) {
134
- die('Not enough privileges');
135
- }
136
-
137
- require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
138
- $controls = new NewsletterControls();
139
-
140
- if ($controls->is_action('create')) {
141
- $this->save_options($controls->data);
142
-
143
- $email = array();
144
- $email['status'] = 'new';
145
- $email['subject'] = ''; //__('Here the email subject', 'newsletter');
146
- $email['track'] = 1;
147
-
148
- $theme_options = $this->get_current_theme_options();
149
-
150
- $theme_url = $this->get_current_theme_url();
151
- $theme_subject = '';
152
-
153
- ob_start();
154
- include $this->get_current_theme_file_path('theme.php');
155
- $email['message'] = ob_get_clean();
156
-
157
- if (!empty($theme_subject)) {
158
- $email['subject'] = $theme_subject;
159
- }
160
-
161
- ob_start();
162
- include $this->get_current_theme_file_path('theme-text.php');
163
- $email['message_text'] = ob_get_clean();
164
-
165
- $email['type'] = 'message';
166
- $email['send_on'] = time();
167
- $email = $newsletter->save_email($email);
168
-
169
- header('Location: ' . $this->get_admin_page_url('edit') . '&id=' . $email->id);
170
- }
171
- die();
172
- break;
173
  }
174
  }
175
 
@@ -181,16 +60,12 @@ class NewsletterEmails extends NewsletterModule {
181
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " change column `type` `type` varchar(50) not null default ''");
182
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column token varchar(10) not null default ''");
183
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column visibility");
 
184
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column private tinyint(1) not null default 0");
185
 
186
  // Force a token to email without one already set.
187
- //$token = self::get_token();
188
- //$wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
189
- if ($this->old_version < '1.1.5') {
190
- $this->upgrade_query("update " . NEWSLETTER_EMAILS_TABLE . " set type='message' where type=''");
191
- $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token=''");
192
- }
193
- $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set total=sent where status='sent' and type='message'");
194
 
195
  return true;
196
  }
1
  <?php
 
2
 
3
  require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
4
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
19
 
20
  function __construct() {
21
  $this->themes = new NewsletterThemes('emails');
22
+ parent::__construct('emails', '1.1.2');
23
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
24
  }
25
 
26
  function hook_wp_loaded() {
27
+ global $newsletter, $wpdb;
 
 
 
28
  switch ($newsletter->action) {
29
  case 'v':
30
  // TODO: Change to Newsletter::instance()->get:email(), not urgent
32
  if (empty($email)) {
33
  die('Email not found');
34
  }
35
+
36
  if ($email->private == 1) {
37
+ die('Email not found');
38
  }
39
 
40
  $user = NewsletterSubscription::instance()->get_user_from_request();
41
  header('Content-Type: text/html;charset=UTF-8');
42
  header('X-Robots-Tag: noindex,nofollow,noarchive');
43
  header('Cache-Control: no-cache,no-store,private');
 
 
44
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/view.php')) {
45
  include WP_CONTENT_DIR . '/extensions/newsletter/view.php';
46
  die();
49
  echo $newsletter->replace($email->message, $user, $email->id);
50
 
51
  die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
  }
54
 
60
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " change column `type` `type` varchar(50) not null default ''");
61
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column token varchar(10) not null default ''");
62
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column visibility");
63
+ $this->upgrade_query("update " . NEWSLETTER_EMAILS_TABLE . " set type='message' where type=''");
64
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column private tinyint(1) not null default 0");
65
 
66
  // Force a token to email without one already set.
67
+ $token = self::get_token();
68
+ $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
 
 
 
 
 
69
 
70
  return true;
71
  }
emails/index.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterEmails::instance();
@@ -103,7 +101,7 @@ $emails = Newsletter::instance()->get_emails('message');
103
  </thead>
104
 
105
  <tbody>
106
- <?php foreach ($emails as $email) {
107
  $email_options = unserialize($email->options);
108
  ?>
109
  <tr>
@@ -114,8 +112,7 @@ $emails = Newsletter::instance()->get_emails('message');
114
  echo htmlspecialchars($email->subject);
115
  else
116
  echo "Newsletter #" . $email->id;
117
- ?>
118
- </td>
119
 
120
  <td>
121
  <?php
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
101
  </thead>
102
 
103
  <tbody>
104
+ <?php foreach ($emails as &$email) {
105
  $email_options = unserialize($email->options);
106
  ?>
107
  <tr>
112
  echo htmlspecialchars($email->subject);
113
  else
114
  echo "Newsletter #" . $email->id;
115
+ ?></td>
 
116
 
117
  <td>
118
  <?php
emails/new.php CHANGED
@@ -13,7 +13,6 @@ if ($controls->is_action('theme')) {
13
  $email['status'] = 'new';
14
  $email['subject'] = __('Here the email subject', 'newsletter');
15
  $email['track'] = 1;
16
- $email['token'] = $module->get_token();
17
 
18
  $theme_options = $module->get_current_theme_options();
19
  $theme_url = $module->get_current_theme_url();
@@ -125,6 +124,7 @@ function newsletter_emails_get_theme_options($theme) {
125
 
126
  <div class="wrap" id="tnp-wrap">
127
 
 
128
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
129
 
130
  <div id="tnp-heading">
@@ -138,34 +138,34 @@ function newsletter_emails_get_theme_options($theme) {
138
  </div>
139
 
140
  <div id="tnp-body" class="tnp-body-lite">
141
-
142
- <form method="post" action="<?php echo $module->get_admin_page_url('new'); ?>">
143
- <?php $controls->init(); ?>
144
- <?php $controls->hidden('theme'); ?>
145
-
146
- <table style="width: 100%; border-collapse: collapse">
147
- <tr>
148
- <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
149
- <div style="float: right; margin-left: 15px;"><?php $controls->button_primary('save', __('Refresh the preview', 'newsletter')); ?></div>
150
-
151
- </td>
152
- <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
153
- <div style="float: right"><?php $controls->button_primary('create', 'Proceed to edit &raquo;', 'this.form.action=\'' . home_url('/') . '?na=emails-create\';this.form.submit()'); ?></div>
154
- <img style="position: relative; left: 5px; top: 10px;"src="<?php echo plugins_url('newsletter') ?>/images/arrow.png" height="35">
155
- </td>
156
- </tr>
157
- <tr>
158
- <td style="width: 600px; vertical-align: top; padding-top: 10px">
159
- <?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
160
- </td>
161
- <td style="vertical-align: top; padding-top: 15px; padding-left: 15px">
162
- <iframe src="<?php echo wp_nonce_url(home_url('/') . '?na=emails-preview&ts=' . time(), 'view'); ?>" height="700" style="width: 100%; border: 1px solid #ccc"></iframe>
163
- </td>
164
- </tr>
165
- </table>
166
-
167
- </form>
168
- </div>
169
 
170
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
171
 
13
  $email['status'] = 'new';
14
  $email['subject'] = __('Here the email subject', 'newsletter');
15
  $email['track'] = 1;
 
16
 
17
  $theme_options = $module->get_current_theme_options();
18
  $theme_url = $module->get_current_theme_url();
124
 
125
  <div class="wrap" id="tnp-wrap">
126
 
127
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
128
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
129
 
130
  <div id="tnp-heading">
138
  </div>
139
 
140
  <div id="tnp-body" class="tnp-body-lite">
141
+
142
+ <form method="post" action="<?php echo $module->get_admin_page_url('new'); ?>">
143
+ <?php $controls->init(); ?>
144
+ <?php $controls->hidden('theme'); ?>
145
+
146
+ <table style="width: 100%; border-collapse: collapse">
147
+ <tr>
148
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
149
+ <div style="float: right; margin-left: 15px;"><?php $controls->button_primary('save', __('Refresh the preview', 'newsletter')); ?></div>
150
+
151
+ </td>
152
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
153
+ <div style="float: right"><?php $controls->button_primary('create', 'Proceed to edit &raquo;', 'this.form.action=\'' . plugins_url('newsletter') . '/emails/create.php\';this.form.submit()'); ?></div>
154
+ <img style="position: relative; left: 5px; top: 10px;"src="<?php echo plugins_url('newsletter') ?>/images/arrow.png" height="35">
155
+ </td>
156
+ </tr>
157
+ <tr>
158
+ <td style="width: 600px; vertical-align: top; padding-top: 10px">
159
+ <?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
160
+ </td>
161
+ <td style="vertical-align: top; padding-top: 15px; padding-left: 15px">
162
+ <iframe src="<?php echo wp_nonce_url(plugins_url('newsletter') . '/emails/preview.php?' . time(), 'view'); ?>" height="700" style="width: 100%; border: 1px solid #ccc"></iframe>
163
+ </td>
164
+ </tr>
165
+ </table>
166
+
167
+ </form>
168
+ </div>
169
 
170
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
171
 
emails/preview-text.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ header('Content-Type: text/plain;charset=UTF-8');
3
+
4
+ include '../../../../wp-load.php';
5
+
6
+ if (!check_admin_referer('view'))
7
+ die('Only the administrator can view the preview');
8
+
9
+ // Used by theme code
10
+ $theme_options = NewsletterEmails::instance()->get_current_theme_options();
11
+
12
+ $file = NewsletterEmails::instance()->get_current_theme_file_path('theme-text.php');
13
+ if (is_file($file)) {
14
+ include(NewsletterEmails::instance()->get_current_theme_file_path('theme-text.php'));
15
+ }
emails/preview.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!check_admin_referer('view'))
6
+ die('Only the administrator can view the preview');
7
+
8
+ // Used by theme code
9
+ $theme_options = NewsletterEmails::instance()->get_current_theme_options();
10
+ $theme_url = NewsletterEmails::instance()->get_current_theme_url();
11
+ header('Content-Type: text/html;charset=UTF-8');
12
+
13
+ include(NewsletterEmails::instance()->get_current_theme_file_path('theme.php'));
emails/theme.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterEmails::instance();
@@ -71,15 +69,15 @@ $themes = $module->themes->get_all_with_data();
71
  </a>
72
  </div>
73
 
74
- <?php foreach ($themes as $key => $data) { ?>
75
  <div class="tnp-theme-preview">
76
- <p><?php echo esc_html($data['name']) ?></p>
77
  <a href="#" onclick="var f = document.getElementById('newsletter-form');
78
  f.act.value = 'theme';
79
- f.elements['options[theme]'].value = '<?php echo esc_js($data['id']) ?>';
80
  f.submit();
81
  return false;" style="margin-right: 20px; margin-bottom: 20px">
82
- <img src="<?php echo esc_attr($data['screenshot']) ?>" width="200" height="200">
83
  </a>
84
  </div>
85
  <?php } ?>
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
69
  </a>
70
  </div>
71
 
72
+ <?php foreach ($themes as $key => &$data) { ?>
73
  <div class="tnp-theme-preview">
74
+ <p><?php echo $data['name']; ?></p>
75
  <a href="#" onclick="var f = document.getElementById('newsletter-form');
76
  f.act.value = 'theme';
77
+ f.elements['options[theme]'].value = '<?php echo $data['id']; ?>';
78
  f.submit();
79
  return false;" style="margin-right: 20px; margin-bottom: 20px">
80
+ <img src="<?php echo $data['screenshot'] ?>" width="200" height="200">
81
  </a>
82
  </div>
83
  <?php } ?>
emails/themes/blank/theme-options.php CHANGED
@@ -1,9 +1,6 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
- <table class="form-table">
5
- <tr>
6
- <th>Disable social links</th>
7
- <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
8
- </tr>
9
  </table>
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Disable social links</th>
4
+ <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
5
+ </tr>
 
 
 
6
  </table>
emails/themes/blank/theme-text.php CHANGED
@@ -1,6 +1,3 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
  This email requires a modern e-mail reader but you can view the email online here:
5
 
6
  {email_url}.
 
 
 
1
  This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
emails/themes/blank/theme.php CHANGED
@@ -1,6 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?><html>
4
  <head>
5
  <style>
6
  body {
1
+ <html>
 
 
2
  <head>
3
  <style>
4
  body {
emails/themes/cta-2015/theme-options.php CHANGED
@@ -1,11 +1,8 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
- <table class="form-table">
5
- <tr>
6
- <th>Main color</th>
7
- <td>
8
- <?php $controls->color('theme_color'); ?> (eg. #87aa14)
9
- </td>
10
- </tr>
11
  </table>
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Main color</th>
4
+ <td>
5
+ <?php $controls->color('theme_color'); ?> (eg. #87aa14)
6
+ </td>
7
+ </tr>
 
 
 
8
  </table>
emails/themes/cta-2015/theme.php CHANGED
@@ -1,167 +1,160 @@
1
- <?php
2
- /*
3
- * Name: CTA 2015
4
- * Type: standard
5
- * Description: Single call to action marketing template
6
- */
7
-
8
- if (!defined('ABSPATH')) exit;
9
-
10
- $color = '#87aa14';
11
- if (!empty($theme_options['theme_color'])) {
12
- $color = $theme_options['theme_color'];
13
- }
14
-
15
- $header = '';
16
- $header_color = '#000000';
17
- if (!empty($theme_options['main_header_logo']['url'])) {
18
- $header = '<img src="' . $theme_options['main_header_logo']['url'] . '" style="max-width: 500px">';
19
- } else {
20
- if (!empty($theme_options['main_header_title'])) {
21
- $header = '<h2 style="color: ' . $header_color . '">' . $theme_options['main_header_title'] . '</h2>';
22
- } else {
23
- $header = '<h2 style="color: ' . $header_color . '">' . get_option('blogname') . '</h2>';
24
- }
25
- if (!empty($theme_options['main_header_sub'])) {
26
- $header .= '<p style="color: #666666">' . $theme_options['main_header_sub'] . '</p>';
27
- }
28
- }
29
- $font_family = 'Verdana';
30
- //$cta_bgcolor = '#008800';
31
- //if (!empty($theme_options['theme_cta_bgcolor'])) {
32
- // $cta_bgcolor = $theme_options['theme_cta_bgcolor'];
33
- //}
34
- $social_icon_url = plugins_url('newsletter') . '/emails/themes/cta-2015/images';
35
- ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
36
- <html>
37
- <head>
38
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
39
- <title></title>
40
- </head>
41
- <body bgcolor="#ffffff">
42
- <table width="500" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0">
43
- <tr>
44
- <td align="center" style="font-family: Verdana">
45
- <table cellpadding="10" cellspacing="0" border="0" width="100%">
46
- <tr>
47
- <td style="font-size: 12px" align="center">
48
- <a href="{email_url}" style="text-decoration: none">View online</a>
49
- </td>
50
- </tr>
51
- </table>
52
- </td>
53
- </tr>
54
-
55
- <!-- header -->
56
- <tr>
57
- <td align="center" style="font-family: Verdana">
58
- <?php echo $header; ?>
59
- </td>
60
- </tr>
61
-
62
- <!-- body -->
63
- <tr>
64
- <td style="font-family: Verdana">
65
-
66
- <!-- main text -->
67
- <table cellpadding="15" cellspacing="0" align="center" border="0" width="100%">
68
- <tr>
69
- <td style="font-size: 15px" align="center">
70
- <h1>Super catching title</h1>
71
- <p>
72
- Here you should introduce your incredible offer. Remeber the golden rule: write
73
- something useful for your readers, not for yourself.
74
- </p>
75
- <p>
76
- If a reader ask the question: what's here for me, the content is answering?
77
- </p>
78
- </td>
79
- </tr>
80
- </table>
81
-
82
- <!-- cta -->
83
- <table cellpadding="15" cellspacing="0" align="center" bgcolor="<?php echo $color ?>" border="0" style="border-radius: 5px">
84
- <tr>
85
- <td><a href="#" style="font-size: 15px; color: #ffffff; text-decoration: none">Call to action</a></td>
86
- </tr>
87
- </table>
88
-
89
- <!-- spacer -->
90
- <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
91
- <tr>
92
- <td>
93
- &nbsp;
94
- </td>
95
- </tr>
96
- </table>
97
-
98
- <!-- social -->
99
- <table cellpadding="5" align="center">
100
- <tr>
101
- <?php if (!empty($theme_options['main_facebook_url'])) { ?>
102
- <td align="center" valign="top">
103
- <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
104
- </td>
105
- <?php } ?>
106
-
107
- <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
108
- <td align="center" valign="top">
109
- <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
110
- </td>
111
- <?php } ?>
112
-
113
- <?php if (!empty($theme_options['main_twitter_url'])) { ?>
114
- <td align="center" valign="top">
115
- <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
116
- </td>
117
- <?php } ?>
118
-
119
- <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
120
- <td align="center" valign="top">
121
- <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
122
- </td>
123
- <?php } ?>
124
-
125
- <?php if (!empty($theme_options['main_youtube_url'])) { ?>
126
- <td align="center" valign="top">
127
- <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
128
- </td>
129
- <?php } ?>
130
-
131
- <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
132
- <td align="center" valign="top">
133
- <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
134
- </td>
135
- <?php } ?>
136
- <?php if (!empty($theme_options['main_instagram_url'])) { ?>
137
- <td align="center" valign="top">
138
- <a href="<?php echo $theme_options['main_instagram_url'] ?>"><img src="<?php echo $social_icon_url ?>/instagram.png"></a>
139
- </td>
140
- <?php } ?>
141
- </tr>
142
- </table>
143
-
144
- <!-- spacer -->
145
- <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
146
- <tr>
147
- <td>
148
- &nbsp;
149
- </td>
150
- </tr>
151
- </table>
152
-
153
- <!-- footer -->
154
- <table cellpadding="15" cellspacing="0" align="center" width="100%" bgcolor="#eeeeee" border="0">
155
- <tr>
156
- <td style="font-size: 12px">
157
- <p><a href="{profile_url}">Manage your subscription</a></p>
158
- <p><?php echo $theme_options['main_footer_contact'] ?></p>
159
- <p><?php echo $theme_options['main_footer_legal'] ?></p>
160
- </td>
161
- </tr>
162
- </table>
163
- </td>
164
- </tr>
165
- </table>
166
- </body>
167
  </html>
1
+ <?php
2
+ /*
3
+ * Name: CTA 2015
4
+ * Type: standard
5
+ * Description: Single call to action marketing template
6
+ */
7
+
8
+ $color = '#87aa14';
9
+ if (!empty($theme_options['theme_color'])) {
10
+ $color = $theme_options['theme_color'];
11
+ }
12
+
13
+ $header = '';
14
+ $header_color = '#000000';
15
+ if (!empty($theme_options['main_header_logo']['url'])) {
16
+ $header = '<img src="' . $theme_options['main_header_logo']['url'] . '" style="max-width: 500px">';
17
+ } else {
18
+ if (!empty($theme_options['main_header_title'])) {
19
+ $header = '<h2 style="color: ' . $header_color . '">' . $theme_options['main_header_title'] . '</h2>';
20
+ } else {
21
+ $header = '<h2 style="color: ' . $header_color . '">' . get_option('blogname') . '</h2>';
22
+ }
23
+ if (!empty($theme_options['main_header_sub'])) {
24
+ $header .= '<p style="color: #666666">' . $theme_options['main_header_sub'] . '</p>';
25
+ }
26
+ }
27
+ $font_family = 'Verdana';
28
+ //$cta_bgcolor = '#008800';
29
+ //if (!empty($theme_options['theme_cta_bgcolor'])) {
30
+ // $cta_bgcolor = $theme_options['theme_cta_bgcolor'];
31
+ //}
32
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/cta-2015/images';
33
+ ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
34
+ <html>
35
+ <head>
36
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37
+ <title></title>
38
+ </head>
39
+ <body bgcolor="#ffffff">
40
+ <table width="500" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0">
41
+ <tr>
42
+ <td align="center" style="font-family: Verdana">
43
+ <table cellpadding="10" cellspacing="0" border="0" width="100%">
44
+ <tr>
45
+ <td style="font-size: 12px" align="center">
46
+ <a href="{email_url}" style="text-decoration: none">View online</a>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+
53
+ <!-- header -->
54
+ <tr>
55
+ <td align="center" style="font-family: Verdana">
56
+ <?php echo $header; ?>
57
+ </td>
58
+ </tr>
59
+
60
+ <!-- body -->
61
+ <tr>
62
+ <td style="font-family: Verdana">
63
+
64
+ <!-- main text -->
65
+ <table cellpadding="15" cellspacing="0" align="center" border="0" width="100%">
66
+ <tr>
67
+ <td style="font-size: 15px" align="center">
68
+ <h1>Super catching title</h1>
69
+ <p>
70
+ Here you should introduce your incredible offer. Remeber the golden rule: write
71
+ something useful for your readers, not for yourself.
72
+ </p>
73
+ <p>
74
+ If a reader ask the question: what's here for me, the content is answering?
75
+ </p>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+
80
+ <!-- cta -->
81
+ <table cellpadding="15" cellspacing="0" align="center" bgcolor="<?php echo $color ?>" border="0" style="border-radius: 5px">
82
+ <tr>
83
+ <td><a href="#" style="font-size: 15px; color: #ffffff; text-decoration: none">Call to action</a></td>
84
+ </tr>
85
+ </table>
86
+
87
+ <!-- spacer -->
88
+ <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
89
+ <tr>
90
+ <td>
91
+ &nbsp;
92
+ </td>
93
+ </tr>
94
+ </table>
95
+
96
+ <!-- social -->
97
+ <table cellpadding="5" align="center">
98
+ <tr>
99
+ <?php if (!empty($theme_options['main_facebook_url'])) { ?>
100
+ <td align="center" valign="top">
101
+ <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
102
+ </td>
103
+ <?php } ?>
104
+
105
+ <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
106
+ <td align="center" valign="top">
107
+ <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
108
+ </td>
109
+ <?php } ?>
110
+
111
+ <?php if (!empty($theme_options['main_twitter_url'])) { ?>
112
+ <td align="center" valign="top">
113
+ <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
114
+ </td>
115
+ <?php } ?>
116
+
117
+ <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
118
+ <td align="center" valign="top">
119
+ <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
120
+ </td>
121
+ <?php } ?>
122
+
123
+ <?php if (!empty($theme_options['main_youtube_url'])) { ?>
124
+ <td align="center" valign="top">
125
+ <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
126
+ </td>
127
+ <?php } ?>
128
+
129
+ <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
130
+ <td align="center" valign="top">
131
+ <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
132
+ </td>
133
+ <?php } ?>
134
+ </tr>
135
+ </table>
136
+
137
+ <!-- spacer -->
138
+ <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
139
+ <tr>
140
+ <td>
141
+ &nbsp;
142
+ </td>
143
+ </tr>
144
+ </table>
145
+
146
+ <!-- footer -->
147
+ <table cellpadding="15" cellspacing="0" align="center" width="100%" bgcolor="#eeeeee" border="0">
148
+ <tr>
149
+ <td style="font-size: 12px">
150
+ <p><a href="{profile_url}">Manage your subscription</a></p>
151
+ <p><?php echo $theme_options['main_footer_contact'] ?></p>
152
+ <p><?php echo $theme_options['main_footer_legal'] ?></p>
153
+ </td>
154
+ </tr>
155
+ </table>
156
+ </td>
157
+ </tr>
158
+ </table>
159
+ </body>
 
 
 
 
 
 
 
160
  </html>
emails/themes/default/footer.php CHANGED
@@ -1,11 +1,8 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
- <!-- Footer -->
5
- <div style="text-align: center; font-weight: bold; margin: 40px 0 10px;"><?php echo $theme_options['main_footer_title'] ?></div>
6
- <div style="text-align: center; margin: 10px 0 20px;"><?php echo $theme_options['main_footer_contact'] ?></div>
7
-
8
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
9
-
10
- <div style="text-align: center; color: #888; margin-top: 20px;"><?php echo $theme_options['main_footer_legal'] ?></div>
11
  <div style="text-align: center; color: #888">To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.</div>
1
+ <!-- Footer -->
2
+ <div style="text-align: center; font-weight: bold; margin: 40px 0 10px;"><?php echo $theme_options['main_footer_title'] ?></div>
3
+ <div style="text-align: center; margin: 10px 0 20px;"><?php echo $theme_options['main_footer_contact'] ?></div>
4
+
5
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
6
+
7
+ <div style="text-align: center; color: #888; margin-top: 20px;"><?php echo $theme_options['main_footer_legal'] ?></div>
 
 
 
8
  <div style="text-align: center; color: #888">To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.</div>
emails/themes/default/images/instagram.png DELETED
Binary file
emails/themes/default/images/pinterest.png CHANGED
Binary file
emails/themes/default/images/tumblr.png CHANGED
Binary file
emails/themes/default/social-options.php CHANGED
@@ -1,46 +1,39 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
- <h3>Social icons</h3>
5
- <table class="form-table">
6
- <tr>
7
- <th>Social block</th>
8
- <td><?php $controls->checkbox('theme_social_disable'); ?> Disable</td>
9
- </tr>
10
- <tr>
11
- <th>Facebook</th>
12
- <td><?php $controls->text_url('theme_facebook', 30); ?></td>
13
- </tr>
14
- <tr>
15
- <th>Twitter</th>
16
- <td><?php $controls->text_url('theme_twitter', 30); ?></td>
17
- </tr>
18
- <tr>
19
- <th>Pinterest</th>
20
- <td><?php $controls->text_url('theme_pinterest', 30); ?></td>
21
- </tr>
22
- <tr>
23
- <th>Google+</th>
24
- <td><?php $controls->text_url('theme_googleplus', 30); ?></td>
25
- </tr>
26
- <tr>
27
- <th>LinkedIn</th>
28
- <td><?php $controls->text_url('theme_linkedin', 30); ?></td>
29
- </tr>
30
- <tr>
31
- <th>Tumblr</th>
32
- <td><?php $controls->text_url('theme_tumblr', 30); ?></td>
33
- </tr>
34
- <tr>
35
- <th>YouTube</th>
36
- <td><?php $controls->text_url('theme_youtube', 30); ?></td>
37
- </tr>
38
- <tr>
39
- <th>Soundcloud</th>
40
- <td><?php $controls->text_url('theme_soundcloud', 30); ?></td>
41
- </tr>
42
- <tr>
43
- <th>Instagram</th>
44
- <td><?php $controls->text_url('theme_instagram', 30); ?></td>
45
- </tr>
46
  </table>
1
+ <h3>Social icons</h3>
2
+ <table class="form-table">
3
+ <tr>
4
+ <th>Social block</th>
5
+ <td><?php $controls->checkbox('theme_social_disable'); ?> Disable</td>
6
+ </tr>
7
+ <tr>
8
+ <th>Facebook</th>
9
+ <td><?php $controls->text_url('theme_facebook', 30); ?></td>
10
+ </tr>
11
+ <tr>
12
+ <th>Twitter</th>
13
+ <td><?php $controls->text_url('theme_twitter', 30); ?></td>
14
+ </tr>
15
+ <tr>
16
+ <th>Pinterest</th>
17
+ <td><?php $controls->text_url('theme_pinterest', 30); ?></td>
18
+ </tr>
19
+ <tr>
20
+ <th>Google+</th>
21
+ <td><?php $controls->text_url('theme_googleplus', 30); ?></td>
22
+ </tr>
23
+ <tr>
24
+ <th>LinkedIn</th>
25
+ <td><?php $controls->text_url('theme_linkedin', 30); ?></td>
26
+ </tr>
27
+ <tr>
28
+ <th>Tumblr</th>
29
+ <td><?php $controls->text_url('theme_tumblr', 30); ?></td>
30
+ </tr>
31
+ <tr>
32
+ <th>YouTube</th>
33
+ <td><?php $controls->text_url('theme_youtube', 30); ?></td>
34
+ </tr>
35
+ <tr>
36
+ <th>Soundcloud</th>
37
+ <td><?php $controls->text_url('theme_soundcloud', 30); ?></td>
38
+ </tr>
 
 
 
 
 
 
 
39
  </table>
emails/themes/default/social.php CHANGED
@@ -1,63 +1,56 @@
1
- <!-- Social -->
2
- <?php
3
- if (!defined('ABSPATH')) exit;
4
-
5
- if (isset($theme_options['theme_social_disable'])) return;
6
- $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
7
- ?>
8
- <table cellpadding="5" align="center">
9
- <tr>
10
- <?php if (!empty($theme_options['theme_facebook'])) { ?>
11
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
12
- <a href="<?php echo esc_attr($theme_options['theme_facebook']) ?>"><img src="<?php echo $social_icon_url ?>/facebook.png"><br>Facebook</a>
13
- </td>
14
- <?php } ?>
15
-
16
- <?php if (!empty($theme_options['theme_twitter'])) { ?>
17
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
18
- <a href="<?php echo esc_attr($theme_options['theme_twitter']) ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"><br>Twitter</a>
19
- </td>
20
- <?php } ?>
21
-
22
- <?php if (!empty($theme_options['theme_googleplus'])) { ?>
23
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
24
- <a href="<?php echo esc_attr($theme_options['theme_googleplus']) ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"><br>Google+</a>
25
- </td>
26
- <?php } ?>
27
-
28
- <?php if (!empty($theme_options['theme_pinterest'])) { ?>
29
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
30
- <a href="<?php echo esc_attr($theme_options['theme_pinterest']) ?>"><img src="<?php echo $social_icon_url ?>/pinterest.png"><br>Pinterest</a>
31
- </td>
32
- <?php } ?>
33
-
34
- <?php if (!empty($theme_options['theme_linkedin'])) { ?>
35
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
36
- <a href="<?php echo esc_attr($theme_options['theme_linkedin']) ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"><br>LinkedIn</a>
37
- </td>
38
- <?php } ?>
39
-
40
- <?php if (!empty($theme_options['theme_tumblr'])) { ?>
41
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
42
- <a href="<?php echo esc_attr($theme_options['theme_tumblr']) ?>"><img src="<?php echo $social_icon_url ?>/tumblr.png"><br>Tumblr</a>
43
- </td>
44
- <?php } ?>
45
-
46
- <?php if (!empty($theme_options['theme_youtube'])) { ?>
47
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
48
- <a href="<?php echo esc_attr($theme_options['theme_youtube']) ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"><br>Youtube</a>
49
- </td>
50
- <?php } ?>
51
-
52
- <?php if (!empty($theme_options['theme_soundcloud'])) { ?>
53
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
54
- <a href="<?php echo esc_attr($theme_options['theme_soundcloud']) ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png"><br>SoundCloud</a>
55
- </td>
56
- <?php } ?>
57
- <?php if (!empty($theme_options['theme_instagram'])) { ?>
58
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
59
- <a href="<?php echo esc_attr($theme_options['theme_instagram']) ?>"><img src="<?php echo $social_icon_url ?>/instagram.png"><br>Instagram</a>
60
- </td>
61
- <?php } ?>
62
- </tr>
63
  </table>
1
+ <!-- Social -->
2
+ <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
+ ?>
6
+ <table cellpadding="5" align="center">
7
+ <tr>
8
+ <?php if (!empty($theme_options['theme_facebook'])) { ?>
9
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
10
+ <a href="<?php echo $theme_options['theme_facebook'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png"><br>Facebook</a>
11
+ </td>
12
+ <?php } ?>
13
+
14
+ <?php if (!empty($theme_options['theme_twitter'])) { ?>
15
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
16
+ <a href="<?php echo $theme_options['theme_twitter'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"><br>Twitter</a>
17
+ </td>
18
+ <?php } ?>
19
+
20
+ <?php if (!empty($theme_options['theme_googleplus'])) { ?>
21
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
22
+ <a href="<?php echo $theme_options['theme_googleplus'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"><br>Google+</a>
23
+ </td>
24
+ <?php } ?>
25
+
26
+ <?php if (!empty($theme_options['theme_pinterest'])) { ?>
27
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
28
+ <a href="<?php echo $theme_options['theme_pinterest'] ?>"><img src="<?php echo $social_icon_url ?>/pinterest.png"><br>Pinterest</a>
29
+ </td>
30
+ <?php } ?>
31
+
32
+ <?php if (!empty($theme_options['theme_linkedin'])) { ?>
33
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
34
+ <a href="<?php echo $theme_options['theme_linkedin'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"><br>LinkedIn</a>
35
+ </td>
36
+ <?php } ?>
37
+
38
+ <?php if (!empty($theme_options['theme_tumblr'])) { ?>
39
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
40
+ <a href="<?php echo $theme_options['theme_tumblr'] ?>"><img src="<?php echo $social_icon_url ?>/tumblr.png"><br>Tumblr</a>
41
+ </td>
42
+ <?php } ?>
43
+
44
+ <?php if (!empty($theme_options['theme_youtube'])) { ?>
45
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
46
+ <a href="<?php echo $theme_options['theme_youtube'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"><br>Youtube</a>
47
+ </td>
48
+ <?php } ?>
49
+
50
+ <?php if (!empty($theme_options['theme_soundcloud'])) { ?>
51
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
52
+ <a href="<?php echo $theme_options['theme_soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png"><br>SoundCloud</a>
53
+ </td>
54
+ <?php } ?>
55
+ </tr>
 
 
 
 
 
 
 
56
  </table>
emails/themes/default/social_main.php CHANGED
@@ -1,51 +1,44 @@
1
- <!-- Social -->
2
- <?php
3
- if (!defined('ABSPATH')) exit;
4
-
5
- if (isset($theme_options['theme_social_disable'])) return;
6
- $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
7
- ?>
8
- <table cellpadding="5" align="center">
9
- <tr>
10
- <?php if (!empty($theme_options['main_facebook_url'])) { ?>
11
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
12
- <a href="<?php echo esc_attr($theme_options['main_facebook_url']) ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
13
- </td>
14
- <?php } ?>
15
-
16
- <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
17
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
18
- <a href="<?php echo esc_attr($theme_options['main_googleplus_url']) ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
19
- </td>
20
- <?php } ?>
21
-
22
- <?php if (!empty($theme_options['main_twitter_url'])) { ?>
23
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
24
- <a href="<?php echo esc_attr($theme_options['main_twitter_url']) ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
25
- </td>
26
- <?php } ?>
27
-
28
- <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
29
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
30
- <a href="<?php echo esc_attr($theme_options['main_linkedin_url']) ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
31
- </td>
32
- <?php } ?>
33
-
34
- <?php if (!empty($theme_options['main_youtube_url'])) { ?>
35
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
36
- <a href="<?php echo esc_attr($theme_options['main_youtube_url']) ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
37
- </td>
38
- <?php } ?>
39
-
40
- <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
41
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
42
- <a href="<?php echo esc_attr($theme_options['main_vimeo_url']) ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
43
- </td>
44
- <?php } ?>
45
- <?php if (!empty($theme_options['main_instagram_url'])) { ?>
46
- <td style="text-align: center; vertical-align: top" align="center" valign="top">
47
- <a href="<?php echo esc_attr($theme_options['main_instagram_url']) ?>"><img src="<?php echo $social_icon_url ?>/instagram.png"></a>
48
- </td>
49
- <?php } ?>
50
- </tr>
51
  </table>
1
+ <!-- Social -->
2
+ <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
+ ?>
6
+ <table cellpadding="5" align="center">
7
+ <tr>
8
+ <?php if (!empty($theme_options['main_facebook_url'])) { ?>
9
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
10
+ <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
11
+ </td>
12
+ <?php } ?>
13
+
14
+ <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
15
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
16
+ <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
17
+ </td>
18
+ <?php } ?>
19
+
20
+ <?php if (!empty($theme_options['main_twitter_url'])) { ?>
21
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
22
+ <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
23
+ </td>
24
+ <?php } ?>
25
+
26
+ <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
27
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
28
+ <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
29
+ </td>
30
+ <?php } ?>
31
+
32
+ <?php if (!empty($theme_options['main_youtube_url'])) { ?>
33
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
34
+ <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
35
+ </td>
36
+ <?php } ?>
37
+
38
+ <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
39
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
40
+ <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
41
+ </td>
42
+ <?php } ?>
43
+ </tr>
 
 
 
 
 
 
 
44
  </table>
emails/themes/default/theme-options.php CHANGED
@@ -1,60 +1,78 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
-
6
- <table class="form-table">
7
- <tr><td colspan="2">General options for header, social links and footer sections could also be set in <a href="?page=newsletter_main_main">Blog Info panel</a>.</td></tr>
8
- <tr>
9
- <th>Base color</th>
10
- <td>
11
- <?php $controls->color('theme_color'); ?>
12
- <p class="description" style="display: inline">Hex values, e.g. #FF0000</p>
13
- </td>
14
- </tr>
15
- <tr>
16
- <th>Disable social links</th>
17
- <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
18
- </tr>
19
-
20
- </table>
21
-
22
- <h3>Posts</h3>
23
- <table class="form-table">
24
- <tr>
25
- <th>Posts</th>
26
- <td>
27
- <?php $controls->checkbox('theme_posts', 'Add latest posts'); ?>
28
- <br>
29
- <?php $controls->checkbox('theme_thumbnails', 'Add post thumbnails'); ?>
30
- <br>
31
- <?php $controls->checkbox('theme_excerpts', 'Add post excerpts'); ?>
32
- </td>
33
- </tr>
34
- <tr>
35
- <th>Categories</th>
36
- <td>
37
- <?php $controls->categories_group('theme_categories'); ?>
38
- </td>
39
- </tr>
40
- <tr>
41
- <th>Tags</th>
42
- <td>
43
- <?php $controls->text('theme_tags', 30); ?>
44
- <p class="description" style="display: inline"> comma separated</p>
45
- </td>
46
- </tr>
47
- <tr>
48
- <th>Max posts</th>
49
- <td>
50
- <?php $controls->text('theme_max_posts', 5); ?>
51
- </td>
52
- </tr>
53
- <tr>
54
- <th>Post types to include</th>
55
- <td>
56
- <?php $controls->post_types('theme_post_types'); ?>
57
- <div class="hints">Leave all unchecked for default behaviour.</div>
58
- </td>
59
- </tr>
60
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--<div id="tabs">
2
+ <ul>
3
+ <li><a href="#tab-general">General</a></li>
4
+ <li><a href="#tab-posts">Posts</a></li>
5
+ </ul>
6
+
7
+ <div id="tab-general">-->
8
+ <table class="form-table">
9
+ <tr><td colspan="2">General options for header, social links and footer sections could also be set in <a href="?page=newsletter_main_main">Blog Info panel</a>.</td></tr>
10
+ <tr>
11
+ <th>Base color</th>
12
+ <td>
13
+ <?php $controls->color('theme_color'); ?>
14
+ <p class="description" style="display: inline">Hex values, e.g. #FF0000</p>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <th>Disable social links</th>
19
+ <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
20
+ </tr>
21
+ <!-- <tr>
22
+ <th>Banner/Title</th>
23
+ <td>
24
+ <?php //$controls->wp_editor('theme_banner'); ?>
25
+ <div class="hints">
26
+ Create a content with an image (500 pixel wide) that will be your newsletter banner and that will replace the
27
+ title with your blog name.
28
+ </div>
29
+ <?php $controls->media('theme_header_logo', 'full'); ?>
30
+ <p class="description">
31
+ Click to change. This should be your logo in .png or .jpg format.
32
+ </p>
33
+ </td>
34
+ </tr>-->
35
+ </table>
36
+ <h3>Posts</h3>
37
+ <table class="form-table">
38
+ <tr>
39
+ <th>Posts</th>
40
+ <td>
41
+ <?php $controls->checkbox('theme_posts', 'Add latest posts'); ?>
42
+ <br>
43
+ <?php $controls->checkbox('theme_thumbnails', 'Add post thumbnails'); ?>
44
+ <br>
45
+ <?php $controls->checkbox('theme_excerpts', 'Add post excerpts'); ?>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <th>Categories</th>
50
+ <td>
51
+ <?php $controls->categories_group('theme_categories'); ?>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <th>Tags</th>
56
+ <td>
57
+ <?php $controls->text('theme_tags', 30); ?>
58
+ <p class="description" style="display: inline"> comma separated</p>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <th>Max posts</th>
63
+ <td>
64
+ <?php $controls->text('theme_max_posts', 5); ?>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <th>Post types to include</th>
69
+ <td>
70
+ <?php $controls->post_types('theme_post_types'); ?>
71
+ <div class="hints">Leave all unchecked for default behaviour.</div>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ <!--</div>-->
76
+ <!--<div id="tab-posts">-->
77
+ <!--</div>-->
78
+ <!--</div>-->
emails/themes/default/theme-text.php CHANGED
@@ -1,6 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>This email requires a modern e-mail reader but you can view the email online here:
4
 
5
  {email_url}.
6
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
 
 
2
 
3
  {email_url}.
4
 
emails/themes/default/theme.php CHANGED
@@ -12,8 +12,6 @@
12
 
13
  global $newsletter, $post;
14
 
15
- if (!defined('ABSPATH')) exit;
16
-
17
  $color = $theme_options['theme_color'];
18
  if (empty($color)) $color = '#000000';
19
 
@@ -49,20 +47,20 @@ if (isset($theme_options['theme_posts'])) {
49
  }
50
  </style>
51
  </head>
52
- <body style="background-color: #ECF2F6; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
53
  <br>
54
  <table align="center">
55
  <tr>
56
- <td valign="top" width="500" bgcolor="#ffffff" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
57
  <div style="text-align: left; background-color: #fff; max-width: 500px;">
58
  <div style="text-align: center">
59
  <?php //HEADER
60
  // if (!empty($theme_options['theme_banner'])) {
61
  // echo $theme_options['theme_banner'];
62
  if (!empty($theme_options['theme_header_logo']['url'])) { ?>
63
- <img style="max-width: 500px" alt="<?php echo esc_attr($theme_options['main_header_title']) ?>" src="<?php echo esc_attr($theme_options['theme_header_logo']['url']) ?>">
64
  <?php } elseif (!empty($theme_options['main_header_logo']['url'])) { ?>
65
- <img style="max-width: 500px" alt="<?php echo esc_attr($theme_options['main_header_title']) ?>" src="<?php echo esc_attr($theme_options['main_header_logo']['url']) ?>">
66
  <?php } elseif (!empty($theme_options['main_header_title'])) { ?>
67
  <div style="padding: 30px 0; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
68
  <?php echo $theme_options['main_header_title'] ?>
12
 
13
  global $newsletter, $post;
14
 
 
 
15
  $color = $theme_options['theme_color'];
16
  if (empty($color)) $color = '#000000';
17
 
47
  }
48
  </style>
49
  </head>
50
+ <body style="background-color: #ddd; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
51
  <br>
52
  <table align="center">
53
  <tr>
54
+ <td valign="top" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
55
  <div style="text-align: left; background-color: #fff; max-width: 500px;">
56
  <div style="text-align: center">
57
  <?php //HEADER
58
  // if (!empty($theme_options['theme_banner'])) {
59
  // echo $theme_options['theme_banner'];
60
  if (!empty($theme_options['theme_header_logo']['url'])) { ?>
61
+ <img style="max-width: 500px" alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['theme_header_logo']['url'] ?>" />
62
  <?php } elseif (!empty($theme_options['main_header_logo']['url'])) { ?>
63
+ <img style="max-width: 500px" alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['main_header_logo']['url'] ?>" />
64
  <?php } elseif (!empty($theme_options['main_header_title'])) { ?>
65
  <div style="padding: 30px 0; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
66
  <?php echo $theme_options['main_header_title'] ?>
emails/themes/linear/theme-options.php CHANGED
@@ -1,22 +1,18 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <table class="form-table">
6
- <tr>
7
- <th>Max posts</th>
8
- <td><?php $controls->text('theme_max_posts', 5); ?></td>
9
- </tr>
10
- <tr>
11
- <th>Categories</th>
12
- <td><?php $controls->categories_group('theme_categories'); ?></td>
13
- </tr>
14
- <tr>
15
- <th>Post types</th>
16
- <td>
17
- <?php $controls->post_types('theme_post_types'); ?>
18
- <p class="description">Leave all uncheck for a default behavior.</p>
19
- </td>
20
- </tr>
21
- </table>
22
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Max posts</th>
4
+ <td><?php $controls->text('theme_max_posts', 5); ?></td>
5
+ </tr>
6
+ <tr>
7
+ <th>Categories</th>
8
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
9
+ </tr>
10
+ <tr>
11
+ <th>Post types</th>
12
+ <td>
13
+ <?php $controls->post_types('theme_post_types'); ?>
14
+ <p class="description">Leave all uncheck for a default behavior.</p>
15
+ </td>
16
+ </tr>
17
+ </table>
 
 
 
 
18
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
emails/themes/linear/theme-text.php CHANGED
@@ -1,7 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>This email requires a modern e-mail reader but you can view the email online here:
5
 
6
  {email_url}.
7
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
 
 
 
2
 
3
  {email_url}.
4
 
emails/themes/linear/theme.php CHANGED
@@ -1,9 +1,6 @@
1
  <?php
2
  global $post;
3
 
4
- if (!defined('ABSPATH'))
5
- exit;
6
-
7
  $filters = array();
8
  if (!empty($theme_options['theme_categories'])) {
9
  $filters['category__in'] = $theme_options['theme_categories'];
@@ -76,7 +73,7 @@ $posts = get_posts($filters);
76
  <tr>
77
  <td valign="top" align="left">
78
  <?php
79
- foreach (array('facebook', 'twitter', 'youtube', 'linkedin', 'googleplus', 'pinterest', 'tumblr', 'instagram') as $social) {
80
  if (empty($theme_options["theme_$social"]))
81
  continue;
82
  ?>
1
  <?php
2
  global $post;
3
 
 
 
 
4
  $filters = array();
5
  if (!empty($theme_options['theme_categories'])) {
6
  $filters['category__in'] = $theme_options['theme_categories'];
73
  <tr>
74
  <td valign="top" align="left">
75
  <?php
76
+ foreach (array('facebook', 'twitter', 'youtube', 'linkedin', 'googleplus', 'pinterest', 'tumblr') as $social) {
77
  if (empty($theme_options["theme_$social"]))
78
  continue;
79
  ?>
emails/themes/pint/theme-options.php CHANGED
@@ -1,19 +1,15 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <p>
6
- This theme requires posts with at least one image and a number of posts like
7
- 3, 6, 9, ...
8
- </p>
9
- <table class="form-table">
10
- <tr>
11
- <th>Max posts</th>
12
- <td><?php $controls->text('theme_max_posts', 5); ?></td>
13
- </tr>
14
- <tr>
15
- <th>Categories</th>
16
- <td><?php $controls->categories_group('theme_categories'); ?></td>
17
- </tr>
18
- </table>
19
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
1
+ <p>
2
+ This theme requires posts with at least one image and a number of posts like
3
+ 3, 6, 9, ...
4
+ </p>
5
+ <table class="form-table">
6
+ <tr>
7
+ <th>Max posts</th>
8
+ <td><?php $controls->text('theme_max_posts', 5); ?></td>
9
+ </tr>
10
+ <tr>
11
+ <th>Categories</th>
12
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
13
+ </tr>
14
+ </table>
 
 
 
 
15
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
emails/themes/pint/theme-text.php CHANGED
@@ -1,7 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>This email requires a modern e-mail reader but you can view the email online here:
5
 
6
  {email_url}.
7
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
 
 
 
2
 
3
  {email_url}.
4
 
emails/themes/pint/theme.php CHANGED
@@ -10,8 +10,6 @@
10
 
11
  global $newsletter, $post;
12
 
13
- if (!defined('ABSPATH')) exit;
14
-
15
  $filters = array();
16
  if (!empty($theme_options['theme_categories'])) {
17
  $filters['category__in'] = $theme_options['theme_categories'];
10
 
11
  global $newsletter, $post;
12
 
 
 
13
  $filters = array();
14
  if (!empty($theme_options['theme_categories'])) {
15
  $filters['category__in'] = $theme_options['theme_categories'];
emails/themes/simple/theme-text.php CHANGED
@@ -1,7 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>This email requires a modern e-mail reader but you can view the email online here:
5
 
6
  {email_url}.
7
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
 
 
 
2
 
3
  {email_url}.
4
 
emails/themes/simple/theme.php CHANGED
@@ -10,9 +10,6 @@
10
 
11
  global $newsletter, $post;
12
 
13
- if (!defined('ABSPATH'))
14
- exit;
15
-
16
  $color = $theme_options['theme_color'];
17
  if (empty($color))
18
  $color = '#0088cc';
10
 
11
  global $newsletter, $post;
12
 
 
 
 
13
  $color = $theme_options['theme_color'];
14
  if (empty($color))
15
  $color = '#0088cc';
emails/themes/theme-1/theme-options.php CHANGED
@@ -1,46 +1,42 @@
1
- <?php
2
- /*
3
- * This is a pre packaged theme options page. Every option name
4
- * must start with "theme_" so Newsletter can distinguish them from other
5
- * options that are specific to the object using the theme.
6
- *
7
- * An array of theme default options should always be present and that default options
8
- * should be merged with the current complete set of options as shown below.
9
- *
10
- * Every theme can define its own set of options, the will be used in the theme.php
11
- * file while composing the email body. Newsletter knows nothing about theme options
12
- * (other than saving them) and does not use or relies on any of them.
13
- *
14
- * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
- * a decent system will be implemented.
16
- */
17
-
18
- if (!defined('ABSPATH'))
19
- exit;
20
-
21
- $theme_defaults = array(
22
- 'theme_max_posts'=>10,
23
- 'theme_categories'=>array()
24
- );
25
-
26
- // Mandatory!
27
- $controls->merge_defaults($theme_defaults);
28
- ?>
29
-
30
- <table class="form-table">
31
- <tr valign="top">
32
- <th>Max new posts to include</th>
33
- <td>
34
- <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
35
- </td>
36
- </tr>
37
- <tr valign="top">
38
- <th>Categories</th>
39
- <td>
40
- <?php $controls->categories_group('theme_categories'); ?>
41
- </td>
42
- </tr>
43
- </table>
44
-
45
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
46
-
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>10,
19
+ 'theme_categories'=>array()
20
+ );
21
+
22
+ // Mandatory!
23
+ $controls->merge_defaults($theme_defaults);
24
+ ?>
25
+
26
+ <table class="form-table">
27
+ <tr valign="top">
28
+ <th>Max new posts to include</th>
29
+ <td>
30
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
31
+ </td>
32
+ </tr>
33
+ <tr valign="top">
34
+ <th>Categories</th>
35
+ <td>
36
+ <?php $controls->categories_group('theme_categories'); ?>
37
+ </td>
38
+ </tr>
39
+ </table>
40
+
41
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
42
+
 
 
 
 
emails/themes/theme-1/theme-text.php CHANGED
@@ -2,9 +2,6 @@
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
  // This file is included inside a function so it inherit all the local variables.
9
 
10
  // Since a theme has it's own options, it must check if there is new content to send
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
 
 
 
5
  // This file is included inside a function so it inherit all the local variables.
6
 
7
  // Since a theme has it's own options, it must check if there is new content to send
emails/themes/theme-1/theme.php CHANGED
@@ -2,9 +2,6 @@
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
  /*
9
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
10
  * for example the theme options used to build the email body as configured by blog
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
 
 
 
5
  /*
6
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
  * for example the theme options used to build the email body as configured by blog
emails/themes/theme-3/theme-options.php CHANGED
@@ -1,47 +1,43 @@
1
- <?php
2
- /*
3
- * This is a pre packaged theme options page. Every option name
4
- * must start with "theme_" so Newsletter can distinguish them from other
5
- * options that are specific to the object using the theme.
6
- *
7
- * An array of theme default options should always be present and that default options
8
- * should be merged with the current complete set of options as shown below.
9
- *
10
- * Every theme can define its own set of options, the will be used in the theme.php
11
- * file while composing the email body. Newsletter knows nothing about theme options
12
- * (other than saving them) and does not use or relies on any of them.
13
- *
14
- * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
- * a decent system will be implemented.
16
- */
17
-
18
- if (!defined('ABSPATH'))
19
- exit;
20
-
21
- $theme_defaults = array(
22
- 'theme_max_posts'=>10,
23
-
24
- 'theme_categories'=>array()
25
- );
26
-
27
- // Mandatory!
28
- $controls->merge_defaults($theme_defaults);
29
- ?>
30
- <p>This theme build an email loading all new posts after the date of the last run.</p>
31
- <table class="form-table">
32
- <tr valign="top">
33
- <th>Max new posts to include</th>
34
- <td>
35
- <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
36
- </td>
37
- </tr>
38
- <tr valign="top">
39
- <th>Categories</th>
40
- <td>
41
- <?php $controls->categories_group('theme_categories'); ?>
42
- </td>
43
- </tr>
44
- </table>
45
-
46
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
47
-
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>10,
19
+
20
+ 'theme_categories'=>array()
21
+ );
22
+
23
+ // Mandatory!
24
+ $controls->merge_defaults($theme_defaults);
25
+ ?>
26
+ <p>This theme build an email loading all new posts after the date of the last run.</p>
27
+ <table class="form-table">
28
+ <tr valign="top">
29
+ <th>Max new posts to include</th>
30
+ <td>
31
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
32
+ </td>
33
+ </tr>
34
+ <tr valign="top">
35
+ <th>Categories</th>
36
+ <td>
37
+ <?php $controls->categories_group('theme_categories'); ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+
42
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
43
+
 
 
 
 
emails/themes/theme-3/theme-text.php CHANGED
@@ -2,9 +2,6 @@
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
  // This file is included inside a function so it inherit all the local variables.
9
 
10
  // Since a theme has it's own options, it must check if there is new content to send
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
 
 
 
5
  // This file is included inside a function so it inherit all the local variables.
6
 
7
  // Since a theme has it's own options, it must check if there is new content to send
emails/themes/theme-3/theme.php CHANGED
@@ -2,9 +2,6 @@
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
  /*
9
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
10
  * for example the theme options used to build the email body as configured by blog
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
 
 
 
5
  /*
6
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
  * for example the theme options used to build the email body as configured by blog
emails/themes/vimeo-like/theme-options.php CHANGED
@@ -1,64 +1,60 @@
1
- <?php
2
- /*
3
- * This is a pre packaged theme options page. Every option name
4
- * must start with "theme_" so Newsletter can distinguish them from other
5
- * options that are specific to the object using the theme.
6
- *
7
- * An array of theme default options should always be present and that default options
8
- * should be merged with the current complete set of options as shown below.
9
- *
10
- * Every theme can define its own set of options, the will be used in the theme.php
11
- * file while composing the email body. Newsletter knows nothing about theme options
12
- * (other than saving them) and does not use or relies on any of them.
13
- *
14
- * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
- * a decent system will be implemented.
16
- */
17
-
18
- if (!defined('ABSPATH'))
19
- exit;
20
-
21
- $theme_defaults = array(
22
- 'theme_max_posts'=>5,
23
- 'theme_read_more'=>'Read More',
24
- 'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
25
- 'theme_categories'=>array()
26
- );
27
-
28
- // Mandatory!
29
- $controls->merge_defaults($theme_defaults);
30
- ?>
31
-
32
- <table class="form-table">
33
- <tr valign="top">
34
- <th>Max new posts to include</th>
35
- <td>
36
- <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
37
- </td>
38
- </tr>
39
- <tr valign="top">
40
- <th>Categories to include</th>
41
- <td><?php $controls->categories_group('theme_categories'); ?></td>
42
- </tr>
43
- <tr>
44
- <th>Post types</th>
45
- <td>
46
- <?php $controls->post_types('theme_post_types'); ?>
47
- <p class="description">Leave all uncheck for a default behavior.</p>
48
- </td>
49
- </tr>
50
- <tr valign="top">
51
- <th>Pre message</th>
52
- <td>
53
- <?php $controls->text('theme_pre_message', 70); ?>
54
- </td>
55
- </tr>
56
- <tr valign="top">
57
- <th>Read more label</th>
58
- <td>
59
- <?php $controls->text('theme_read_more'); ?>
60
- </td>
61
- </tr>
62
- </table>
63
-
64
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>5,
19
+ 'theme_read_more'=>'Read More',
20
+ 'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
21
+ 'theme_categories'=>array()
22
+ );
23
+
24
+ // Mandatory!
25
+ $controls->merge_defaults($theme_defaults);
26
+ ?>
27
+
28
+ <table class="form-table">
29
+ <tr valign="top">
30
+ <th>Max new posts to include</th>
31
+ <td>
32
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
33
+ </td>
34
+ </tr>
35
+ <tr valign="top">
36
+ <th>Categories to include</th>
37
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
38
+ </tr>
39
+ <tr>
40
+ <th>Post types</th>
41
+ <td>
42
+ <?php $controls->post_types('theme_post_types'); ?>
43
+ <p class="description">Leave all uncheck for a default behavior.</p>
44
+ </td>
45
+ </tr>
46
+ <tr valign="top">
47
+ <th>Pre message</th>
48
+ <td>
49
+ <?php $controls->text('theme_pre_message', 70); ?>
50
+ </td>
51
+ </tr>
52
+ <tr valign="top">
53
+ <th>Read more label</th>
54
+ <td>
55
+ <?php $controls->text('theme_read_more'); ?>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+
60
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
 
 
 
 
emails/themes/vimeo-like/theme-text.php CHANGED
@@ -1,7 +1,4 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>This email requires a modern e-mail reader but you can view the email online here:
5
 
6
  {email_url}.
7
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
 
 
 
2
 
3
  {email_url}.
4
 
emails/themes/vimeo-like/theme.php CHANGED
@@ -2,9 +2,6 @@
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
  /*
9
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
10
  * for example the theme options used to build the email body as configured by blog
2
  global $newsletter; // Newsletter object
3
  global $post; // Current post managed by WordPress
4
 
 
 
 
5
  /*
6
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
  * for example the theme options used to build the email body as configured by blog
emails/themes/xmas-2014/theme.php CHANGED
@@ -1,125 +1,122 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
- <html xmlns="http://www.w3.org/1999/xhtml">
6
- <head>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <title></title>
9
-
10
- <style type="text/css">
11
- .ExternalClass {width:100%;}
12
-
13
- .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
14
- line-height: 100%;
15
- }
16
-
17
- body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;}
18
-
19
- body {margin:0; padding:0;}
20
-
21
- table td {border-collapse:collapse;}
22
-
23
- p {margin:0; padding:0; margin-bottom:1em;}
24
-
25
- h1, h2, h3, h4, h5, h6 {
26
- color: #666;
27
- line-height: 100%;
28
- }
29
-
30
- a, a:link {
31
- color:#2A5DB0;
32
- text-decoration: underline;
33
- }
34
-
35
- body, #body_style {
36
- background:#A52B00;
37
- min-height:1000px;
38
- xcolor:#000;
39
- font-family:Arial, Helvetica, sans-serif;
40
- font-size:14px;
41
- }
42
-
43
- span.yshortcuts { color:#000; background-color:none; border:none;}
44
- span.yshortcuts:hover,
45
- span.yshortcuts:active,
46
- span.yshortcuts:focus {color:#000; background-color:none; border:none;}
47
-
48
- a:visited { color: #3c96e2; text-decoration: none}
49
- a:focus { color: #3c96e2; text-decoration: underline}
50
- a:hover { color: #3c96e2; text-decoration: underline}
51
-
52
- @media only screen and (max-device-width: 480px) {
53
-
54
-
55
- body[yahoo] #container1 {display:block !important}
56
- body[yahoo] p {font-size: 10px}
57
-
58
- }
59
-
60
- @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
61
-
62
-
63
- body[yahoo] #container1 {display:block !important}
64
- body[yahoo] p {font-size: 14px}
65
-
66
- }
67
-
68
- </style>
69
-
70
-
71
- </head>
72
- <body style="margin-top: 0; background:#A52B00; min-height:1000px; color:#000;font-family:Arial, Helvetica, sans-serif; font-size:14px"
73
- alink="#FF0000" link="#FF0000" bgcolor="#A52B00" text="#000000" yahoo="fix">
74
-
75
- <div id="body_style" style="padding:0px">
76
-
77
- <table cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff" width="600" align="center">
78
- <tr>
79
- <td width="600" colspan="3"><img src="<?php echo $theme_url; ?>/images/header.png"></td>
80
- </tr>
81
- <tr>
82
- <td width="600" align="center" colspan="3">
83
- <h1><?php echo get_option('blogname'); ?></h1>
84
- </td>
85
- </tr>
86
- <tr>
87
- <td width="20">&nbsp;</td>
88
- <td width="560">
89
- <p>Hi {name},</p>
90
-
91
- <p>The Newsletter Team wishes you merry Christmas and happy New Year. This time of year is special for us and we would like
92
- to share this time with you, also.</p>
93
-
94
- <p>We'll take a rest for few days with our families but we have a <strong>big surprise</strong> for YOU that will
95
- be unvealed the first days of the New Year.</p>
96
-
97
- <p>Curious? You can <a href="<?php echo get_option('blogname'); ?>">discover a little more right now</a>.</p>
98
-
99
- <p>
100
- See you soon, TNT.<br>
101
- <a href="<?php echo get_option('blogname'); ?>">http://www.thenewsletterplugin.com</a>
102
- </p>
103
-
104
- </td>
105
- <td width="20">&nbsp;</td>
106
- </tr>
107
- <td width="600" colspan="3">
108
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
109
- </td>
110
- <tr>
111
- <td width="20">&nbsp;</td>
112
- <td width="560" style="color:#666">
113
- <p>To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
114
- </td>
115
- <td width="20">&nbsp;</td>
116
- </tr>
117
- <tr>
118
- <td width="600" colspan="3" bgcolor="#A52B00"><img src="<?php echo $theme_url; ?>/images/footer.png"></td>
119
- </tr>
120
- </table>
121
-
122
- </div>
123
-
124
- </body>
125
  </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title></title>
6
+
7
+ <style type="text/css">
8
+ .ExternalClass {width:100%;}
9
+
10
+ .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
11
+ line-height: 100%;
12
+ }
13
+
14
+ body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;}
15
+
16
+ body {margin:0; padding:0;}
17
+
18
+ table td {border-collapse:collapse;}
19
+
20
+ p {margin:0; padding:0; margin-bottom:1em;}
21
+
22
+ h1, h2, h3, h4, h5, h6 {
23
+ color: #666;
24
+ line-height: 100%;
25
+ }
26
+
27
+ a, a:link {
28
+ color:#2A5DB0;
29
+ text-decoration: underline;
30
+ }
31
+
32
+ body, #body_style {
33
+ background:#A52B00;
34
+ min-height:1000px;
35
+ xcolor:#000;
36
+ font-family:Arial, Helvetica, sans-serif;
37
+ font-size:14px;
38
+ }
39
+
40
+ span.yshortcuts { color:#000; background-color:none; border:none;}
41
+ span.yshortcuts:hover,
42
+ span.yshortcuts:active,
43
+ span.yshortcuts:focus {color:#000; background-color:none; border:none;}
44
+
45
+ a:visited { color: #3c96e2; text-decoration: none}
46
+ a:focus { color: #3c96e2; text-decoration: underline}
47
+ a:hover { color: #3c96e2; text-decoration: underline}
48
+
49
+ @media only screen and (max-device-width: 480px) {
50
+
51
+
52
+ body[yahoo] #container1 {display:block !important}
53
+ body[yahoo] p {font-size: 10px}
54
+
55
+ }
56
+
57
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
58
+
59
+
60
+ body[yahoo] #container1 {display:block !important}
61
+ body[yahoo] p {font-size: 14px}
62
+
63
+ }
64
+
65
+ </style>
66
+
67
+
68
+ </head>
69
+ <body style="margin-top: 0; background:#A52B00; min-height:1000px; color:#000;font-family:Arial, Helvetica, sans-serif; font-size:14px"
70
+ alink="#FF0000" link="#FF0000" bgcolor="#A52B00" text="#000000" yahoo="fix">
71
+
72
+ <div id="body_style" style="padding:0px">
73
+
74
+ <table cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff" width="600" align="center">
75
+ <tr>
76
+ <td width="600" colspan="3"><img src="<?php echo $theme_url; ?>/images/header.png"></td>
77
+ </tr>
78
+ <tr>
79
+ <td width="600" align="center" colspan="3">
80
+ <h1><?php echo get_option('blogname'); ?></h1>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td width="20">&nbsp;</td>
85
+ <td width="560">
86
+ <p>Hi {name},</p>
87
+
88
+ <p>The Newsletter Team wishes you merry Christmas and happy New Year. This time of year is special for us and we would like
89
+ to share this time with you, also.</p>
90
+
91
+ <p>We'll take a rest for few days with our families but we have a <strong>big surprise</strong> for YOU that will
92
+ be unvealed the first days of the New Year.</p>
93
+
94
+ <p>Curious? You can <a href="<?php echo get_option('blogname'); ?>">discover a little more right now</a>.</p>
95
+
96
+ <p>
97
+ See you soon, TNT.<br>
98
+ <a href="<?php echo get_option('blogname'); ?>">http://www.thenewsletterplugin.com</a>
99
+ </p>
100
+
101
+ </td>
102
+ <td width="20">&nbsp;</td>
103
+ </tr>
104
+ <td width="600" colspan="3">
105
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
106
+ </td>
107
+ <tr>
108
+ <td width="20">&nbsp;</td>
109
+ <td width="560" style="color:#666">
110
+ <p>To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
111
+ </td>
112
+ <td width="20">&nbsp;</td>
113
+ </tr>
114
+ <tr>
115
+ <td width="600" colspan="3" bgcolor="#A52B00"><img src="<?php echo $theme_url; ?>/images/footer.png"></td>
116
+ </tr>
117
+ </table>
118
+
119
+ </div>
120
+
121
+ </body>
 
 
 
122
  </html>
emails/tnp-composer/_css/newsletter-builder.css CHANGED
@@ -444,7 +444,6 @@
444
  .tnpc-subject input {
445
  padding: 12px 15px;
446
  margin-left: 20px;
447
- width: 70%;
448
  }
449
 
450
  .tnpc-subject a {
444
  .tnpc-subject input {
445
  padding: 12px 15px;
446
  margin-left: 20px;
 
447
  }
448
 
449
  .tnpc-subject a {
emails/tnp-composer/_scripts/newsletter-builder.js CHANGED
@@ -1,361 +1,354 @@
1
- jQuery.fn.hover_edit = function () {
2
-
3
- this.hover(
4
- function () {
5
- jQuery(this).append('<div class="tnpc-row-edit-hover"><i class="fa fa-pencil" style="line-height:30px;"></i></div>');
6
- jQuery(".tnpc-row-edit-hover").click(function (e) {
7
- e.preventDefault()
8
- });
9
- jQuery(".tnpc-row-edit-hover i").click(function (e) {
10
- e.preventDefault();
11
- $this = jQuery(this);
12
- target = $this.parent().parent();
13
- $this.parent().remove();
14
-
15
- //edit image
16
- if (target.attr("data-type") == 'image') {
17
- jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
18
- jQuery("#tnpc-edit-image .alt").val(target.find('img').attr("alt"));
19
- jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
20
- jQuery("#tnpc-edit-image").fadeIn(500);
21
- jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
22
- jQuery("#tnpc-edit-image .tnpc-edit-box-buttons-save").click(function () {
23
- jQuery(this).parent().parent().parent().fadeOut(500)
24
- jQuery(this).parent().parent().slideUp(500)
25
- target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
26
- target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
27
- target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
28
- });
29
- }
30
-
31
- //edit link
32
- if (target.attr("data-type") == 'link') {
33
- jQuery("#tnpc-edit-link .title").val(target.text());
34
- jQuery("#tnpc-edit-link .url").val(target.attr("href"));
35
- jQuery("#tnpc-edit-link").show();
36
- jQuery("#tnpc-edit-link .tnpc-edit-box").show();
37
- //jQuery("#tnpc-edit-link .tnpc-edit-box").slideDown(300);
38
- jQuery("#tnpc-edit-link .tnpc-edit-box-buttons-save").click(function () {
39
- jQuery(this).parent().parent().parent().fadeOut(500)
40
- jQuery(this).parent().parent().slideUp(500)
41
- target.text(jQuery("#tnpc-edit-link .title").val());
42
- target.attr("href", jQuery("#tnpc-edit-link .url").val());
43
- });
44
- }
45
-
46
- //edit button
47
- if (target.attr("data-type") == 'button') {
48
- jQuery("#tnpc-edit-button .title").val(target.text());
49
- jQuery("#tnpc-edit-button .url").val(target.attr("href"));
50
- jQuery('.bgcolor, .fgcolor').wpColorPicker({
51
- // change: function (event, ui) {
52
- // jQuery('.bgcolor').iris('hide');
53
- // },
54
- });
55
- jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
56
- jQuery('.fgcolor').wpColorPicker().iris('color', target.css("color"));
57
- jQuery("#tnpc-edit-button").fadeIn(500);
58
- jQuery("#tnpc-edit-button .tnpc-edit-box").slideDown(500);
59
- jQuery("#tnpc-edit-button .tnpc-edit-box-buttons-save").click(function () {
60
- jQuery(this).parent().parent().parent().fadeOut(500)
61
- jQuery(this).parent().parent().slideUp(500)
62
- target.text(jQuery("#tnpc-edit-button .title").val());
63
- target.attr("href", jQuery("#tnpc-edit-button .url").val());
64
- target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
65
- target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
66
- target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
67
- });
68
- }
69
-
70
- //edit title
71
- if (target.attr("data-type") == 'title') {
72
- jQuery("#tnpc-edit-title .title").val(target.text());
73
- jQuery("#tnpc-edit-title .color").val(target.css("color"));
74
- jQuery("#tnpc-edit-title .color").wpColorPicker({
75
- // change: function (event, ui) {
76
- // jQuery('.bgcolor').iris('hide');
77
- // },
78
- });
79
- jQuery("#tnpc-edit-title .color").wpColorPicker().iris('color', target.css("color"));
80
- jQuery("#tnpc-edit-title").fadeIn(500);
81
- jQuery("#tnpc-edit-title .tnpc-edit-box").slideDown(500);
82
- jQuery("#tnpc-edit-title .tnpc-edit-box-buttons-save").click(function () {
83
- jQuery(this).parent().parent().parent().fadeOut(500)
84
- jQuery(this).parent().parent().slideUp(500)
85
- target.text(jQuery("#tnpc-edit-title .title").val());
86
- target.css("color", jQuery("#tnpc-edit-title .color").val());
87
- });
88
- }
89
-
90
- //edit text
91
- if (target.attr("data-type") == 'text') {
92
- jQuery("#tnpc-edit-text .text").val(target.text());
93
- tinymce.init({
94
- selector: '#tnpc-edit-text .text',
95
- menubar: false,
96
- relative_urls: false,
97
- remove_script_host: false,
98
- toolbar: [
99
- 'fontselect fontsizeselect forecolor | bold italic underline | link | bullist numlist | emoticons | alignleft aligncenter alignright alignjustify tnp'
100
- ],
101
- plugins: "textcolor,link,emoticons",
102
- init_instance_callback: function (editor) {
103
- editor.setContent(target.html());
104
- },
105
- elementpath: false,
106
- statusbar: false,
107
- forced_root_block: false,
108
- font_formats: "Arial=arial,helvetica,sans-serif" +
109
- "Arial Black=arial black,avant garde;" +
110
- "Tahoma=tahoma,arial,helvetica,sans-serif;" +
111
- "Trebuchet MS=trebuchet ms,geneva;" +
112
- "Verdana=verdana,geneva;" +
113
- "Georgia=georgia,palatino;" +
114
- "Times=times,times new roman;" +
115
- "Times New Roman=times new roman,times;" +
116
- "Courier=courier,courier new;" +
117
- "Courier New=courier new,courier",
118
- setup: function (editor) {
119
- editor.addButton('tnp', {
120
- type: 'menubutton',
121
- image: tinymce.baseURL + '/skins/tnp.png',
122
- menu: [
123
- {text: '{blog_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_url}&nbsp;');}},
124
- {text: '{blog_title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_title}&nbsp;');}},
125
- {text: '{blog_description}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_description}&nbsp;');}},
126
- {text: '{date}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date}&nbsp;');}},
127
- {text: '{date_NNN}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date_NNN}&nbsp;');}},
128
- {text: '{email_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email_url}&nbsp;');}},
129
- {text: '{name}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{name}&nbsp;');}},
130
- {text: '{surname}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{surname}&nbsp;');}},
131
- {text: '{title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{title}&nbsp;');}},
132
- {text: '{email}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email}&nbsp;');}},
133
- {text: '{profile_N}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_N}&nbsp;');}},
134
- {text: '{ip}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{ip}&nbsp;');}},
135
- {text: '{subscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{subscription_confirm_url}&nbsp;');}},
136
- {text: '{unsubscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{unsubscription_confirm_url}&nbsp;');}},
137
- {text: '{profile_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_url}&nbsp;');}},
138
- ],
139
- });
140
- },
141
- });
142
- if (tinymce.activeEditor != null)
143
- tinymce.activeEditor.setContent(target.html());
144
- jQuery("#tnpc-edit-text").fadeIn(500);
145
- jQuery("#tnpc-edit-text .tnpc-edit-box").slideDown(500);
146
- jQuery("#tnpc-edit-text .tnpc-edit-box-buttons-save").click(function () {
147
- jQuery(this).parent().parent().parent().fadeOut(500)
148
- jQuery(this).parent().parent().slideUp(500)
149
- target.html(tinymce.activeEditor.getContent());
150
- });
151
- }
152
-
153
- //edit icon
154
- if (target.attr("data-type") == 'icon') {
155
- jQuery("#tnpc-edit-icon").fadeIn(500);
156
- jQuery("#tnpc-edit-icon .tnpc-edit-box").slideDown(500);
157
- jQuery("#tnpc-edit-icon i").click(function () {
158
- jQuery(this).parent().parent().parent().parent().fadeOut(500)
159
- jQuery(this).parent().parent().parent().slideUp(500)
160
- target.children('i').attr('class', jQuery(this).attr('class'));
161
- });
162
- }//
163
-
164
- });
165
- }, function () {
166
- jQuery(this).children(".tnpc-row-edit-hover").remove();
167
- }
168
- );
169
- }
170
-
171
- jQuery.fn.add_delete = function () {
172
- this.append('<div class="tnpc-row-delete"><i class="fa fa-times" ></i></div>');
173
- this.find('.tnpc-row-delete').perform_delete();
174
- }
175
-
176
- jQuery.fn.perform_delete = function () {
177
- this.click(function () {
178
- jQuery(this).parent().remove();
179
- });
180
- }
181
-
182
- jQuery.fn.add_block_edit = function () {
183
- this.append('<div class="tnpc-row-edit-block"><i class="fa fa-pencil" ></i></div>');
184
- this.find('.tnpc-row-edit-block i').perform_block_edit();
185
- }
186
-
187
- jQuery.fn.perform_block_edit = function () {
188
-
189
- jQuery(".tnpc-row-edit-block").click(function (e) {
190
- e.preventDefault()
191
- });
192
-
193
- this.click(function (e) {
194
-
195
- e.preventDefault();
196
-
197
- target = jQuery(this).parent().parent().find('.edit-block');
198
-
199
- jQuery("#tnpc-edit-block .bgcolor").val(target.css("background-color"));
200
- jQuery("#tnpc-edit-block .font").val(target.css("font-family"));
201
-
202
- jQuery('.bgcolor').wpColorPicker({
203
- // change: function (event, ui) {
204
- // jQuery('.bgcolor').iris('hide');
205
- // },
206
- });
207
- jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
208
-
209
- // posts block
210
- if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
211
-
212
- jQuery("#tnpc-edit-posts").fadeIn(500);
213
- jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
214
-
215
- } else {
216
-
217
- jQuery("#tnpc-edit-block").fadeIn(500);
218
- jQuery("#tnpc-edit-block .tnpc-edit-box").slideDown(500);
219
-
220
- }
221
-
222
- jQuery("#tnpc-edit-block .tnpc-edit-box-buttons-save").click(function () {
223
- jQuery(this).parent().parent().parent().fadeOut(500)
224
- jQuery(this).parent().parent().slideUp(500)
225
-
226
- target.css("background-color", jQuery("#tnpc-edit-block .bgcolor").val());
227
- target.css("font-family", jQuery("#tnpc-edit-block .font").val());
228
-
229
- });
230
-
231
- jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
232
-
233
- jQuery(this).parent().parent().parent().fadeOut(500)
234
- jQuery(this).parent().parent().slideUp(500)
235
- var categories = [];
236
- jQuery('#tnpc-edit-posts input[name="options[theme_categories][]"]:checked').each(function ()
237
- {
238
- categories.push(jQuery(this).val());
239
- });
240
- var data = {
241
- 'action': 'tnpc_render',
242
- 'b': target.parent().parent().parent().data('block') + ".block",
243
- 'num': jQuery("#tnpc-edit-posts .number").val(),
244
- 'tags': jQuery("#tnpc-edit-posts .tags").val(),
245
- 'categories': categories
246
- };
247
- jQuery.post(ajaxurl, data, function (response) {
248
- new_row = jQuery(response);
249
- target.parent().before(new_row).remove();
250
- new_row.add_delete();
251
- new_row.add_block_edit();
252
- new_row.find(".tnpc-row-edit").hover_edit();
253
- });
254
- });
255
-
256
- });
257
-
258
- }
259
-
260
- jQuery(function () {
261
-
262
- // collapse wp menu
263
- jQuery('body').addClass('folded');
264
-
265
- //Drag & Drop
266
- jQuery("#newsletter-builder-area-center-frame-content").sortable({
267
- revert: false,
268
- stop: function (event, ui) {
269
- if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
270
- loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
271
- ui.item.before(loading_row);
272
- ui.item.remove();
273
- var data = {
274
- 'action': 'tnpc_render',
275
- 'b': ui.item.data("file")
276
- };
277
- jQuery.post(ajaxurl, data, function (response) {
278
- new_row = jQuery(response);
279
- // ui.item.before(new_row);
280
- // ui.item.remove();
281
- loading_row.before(new_row);
282
- loading_row.remove();
283
- new_row.add_delete();
284
- new_row.add_block_edit();
285
- new_row.find(".tnpc-row-edit").hover_edit();
286
- });
287
- }
288
- }
289
- });
290
-
291
- jQuery(".tnpc-row").draggable({
292
- connectToSortable: "#newsletter-builder-area-center-frame-content",
293
- //helper: "clone",
294
- revert: false,
295
- handle: ".tnpc-row-move"
296
- });
297
-
298
- jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
299
- connectToSortable: "#newsletter-builder-area-center-frame-content",
300
- helper: "clone",
301
- revert: false,
302
- start: function () {
303
- if (jQuery('.tnpc-row').length)
304
- jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
305
- else
306
- jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
307
- },
308
- stop: function () {
309
- jQuery('.tnpc-drop-here').remove();
310
- }
311
- });
312
-
313
- //close edit
314
- jQuery(".tnpc-edit-box-buttons-cancel").click(function () {
315
- jQuery(this).parent().parent().parent().fadeOut(500)
316
- jQuery(this).parent().parent().slideUp(500)
317
- });
318
-
319
- // initialize controls
320
- jQuery(".tnpc-row").add_delete();
321
- jQuery(".tnpc-row").add_block_edit();
322
- jQuery(".tnpc-row-edit").hover_edit();
323
-
324
- });
325
-
326
- function create() {
327
-
328
- jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
329
-
330
- jQuery("#newsletter-preloaded-export .tnpc-row-delete").remove();
331
- jQuery("#newsletter-preloaded-export .tnpc-row-edit-block").remove();
332
- jQuery("#newsletter-preloaded-export .tnpc-row").removeClass("ui-draggable");
333
- // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeAttr("data-type");
334
- // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeClass("tnpc-row-edit");
335
- preload_export_html = jQuery("#newsletter-preloaded-export").html();
336
-
337
- if (preload_export_html.indexOf('<style type="text/css">') > -1) {
338
- export_content = preload_export_html;
339
- jQuery("#tnpc-edit-export .text").val(export_content);
340
- jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
341
- jQuery("#tnpc-form").submit();
342
- } else {
343
- jQuery.get(ajaxurl, {action: "tnpc_css"}, function (data) {
344
- // export_content = '<style>' + data + '</style><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css"><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><div id="tnpc-wrapper"><div id="tnpc-wrapper-newsletter">' + preload_export_html + '</div></div>';
345
- export_content = '<!DOCTYPE html><html><head><title>Newsletter</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge" />';
346
- export_content += '<style type="text/css">' + data + '</style>';
347
- export_content += '<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css">';
348
- export_content += '<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">';
349
- export_content += '</head><body style="margin: 0; padding: 0;">';
350
- export_content += preload_export_html;
351
- export_content += '</body></html>';
352
- jQuery("#tnpc-edit-export .text").val(export_content);
353
- jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
354
- jQuery("#tnpc-form").submit();
355
- });
356
- }
357
-
358
- jQuery("#newsletter-preloaded-export").html(' ');
359
-
360
- }
361
-
1
+ jQuery.fn.hover_edit = function () {
2
+
3
+ this.hover(
4
+ function () {
5
+ jQuery(this).append('<div class="tnpc-row-edit-hover"><i class="fa fa-pencil" style="line-height:30px;"></i></div>');
6
+ jQuery(".tnpc-row-edit-hover").click(function (e) {
7
+ e.preventDefault()
8
+ });
9
+ jQuery(".tnpc-row-edit-hover i").click(function (e) {
10
+ e.preventDefault();
11
+ target = jQuery(this).parent().parent();
12
+
13
+ //edit image
14
+ if (target.attr("data-type") == 'image') {
15
+ jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
16
+ jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
17
+ jQuery("#tnpc-edit-image").fadeIn(500);
18
+ jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
19
+ jQuery("#tnpc-edit-image .tnpc-edit-box-buttons-save").click(function () {
20
+ jQuery(this).parent().parent().parent().fadeOut(500)
21
+ jQuery(this).parent().parent().slideUp(500)
22
+ target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
23
+ target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
24
+ });
25
+ }
26
+
27
+ //edit link
28
+ if (target.attr("data-type") == 'link') {
29
+ jQuery("#tnpc-edit-link .title").val(target.text());
30
+ jQuery("#tnpc-edit-link .url").val(target.attr("href"));
31
+ jQuery("#tnpc-edit-link").fadeIn(500);
32
+ jQuery("#tnpc-edit-link .tnpc-edit-box").slideDown(500);
33
+ jQuery("#tnpc-edit-link .tnpc-edit-box-buttons-save").click(function () {
34
+ jQuery(this).parent().parent().parent().fadeOut(500)
35
+ jQuery(this).parent().parent().slideUp(500)
36
+ target.text(jQuery("#tnpc-edit-link .title").val());
37
+ target.attr("href", jQuery("#tnpc-edit-link .url").val());
38
+ });
39
+ }
40
+
41
+ //edit button
42
+ if (target.attr("data-type") == 'button') {
43
+ jQuery("#tnpc-edit-button .title").val(target.text());
44
+ jQuery("#tnpc-edit-button .url").val(target.attr("href"));
45
+ jQuery('.bgcolor, .fgcolor').wpColorPicker({
46
+ // change: function (event, ui) {
47
+ // jQuery('.bgcolor').iris('hide');
48
+ // },
49
+ });
50
+ jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
51
+ jQuery('.fgcolor').wpColorPicker().iris('color', target.css("color"));
52
+ jQuery("#tnpc-edit-button").fadeIn(500);
53
+ jQuery("#tnpc-edit-button .tnpc-edit-box").slideDown(500);
54
+ jQuery("#tnpc-edit-button .tnpc-edit-box-buttons-save").click(function () {
55
+ jQuery(this).parent().parent().parent().fadeOut(500)
56
+ jQuery(this).parent().parent().slideUp(500)
57
+ target.text(jQuery("#tnpc-edit-button .title").val());
58
+ target.attr("href", jQuery("#tnpc-edit-button .url").val());
59
+ target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
60
+ target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
61
+ target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
62
+ });
63
+ }
64
+
65
+ //edit title
66
+ if (target.attr("data-type") == 'title') {
67
+ jQuery("#tnpc-edit-title .title").val(target.text());
68
+ jQuery("#tnpc-edit-title .color").val(target.css("color"));
69
+ jQuery("#tnpc-edit-title .color").wpColorPicker({
70
+ // change: function (event, ui) {
71
+ // jQuery('.bgcolor').iris('hide');
72
+ // },
73
+ });
74
+ jQuery("#tnpc-edit-title .color").wpColorPicker().iris('color', target.css("color"));
75
+ jQuery("#tnpc-edit-title").fadeIn(500);
76
+ jQuery("#tnpc-edit-title .tnpc-edit-box").slideDown(500);
77
+ jQuery("#tnpc-edit-title .tnpc-edit-box-buttons-save").click(function () {
78
+ jQuery(this).parent().parent().parent().fadeOut(500)
79
+ jQuery(this).parent().parent().slideUp(500)
80
+ target.text(jQuery("#tnpc-edit-title .title").val());
81
+ target.css("color", jQuery("#tnpc-edit-title .color").val());
82
+ });
83
+ }
84
+
85
+ //edit text
86
+ if (target.attr("data-type") == 'text') {
87
+ jQuery("#tnpc-edit-text .text").val(target.text());
88
+ tinymce.init({
89
+ selector: '#tnpc-edit-text .text',
90
+ menubar: false,
91
+ toolbar: [
92
+ 'fontselect fontsizeselect forecolor | bold italic underline | link | bullist numlist | emoticons | alignleft aligncenter alignright alignjustify tnp'
93
+ ],
94
+ plugins: "textcolor,link,emoticons",
95
+ init_instance_callback: function (editor) {
96
+ editor.setContent(target.html());
97
+ },
98
+ elementpath: false,
99
+ statusbar: false,
100
+ forced_root_block: false,
101
+ font_formats: "Arial=arial,helvetica,sans-serif" +
102
+ "Arial Black=arial black,avant garde;" +
103
+ "Tahoma=tahoma,arial,helvetica,sans-serif;" +
104
+ "Trebuchet MS=trebuchet ms,geneva;" +
105
+ "Verdana=verdana,geneva;" +
106
+ "Georgia=georgia,palatino;" +
107
+ "Times=times,times new roman;" +
108
+ "Times New Roman=times new roman,times;" +
109
+ "Courier=courier,courier new;" +
110
+ "Courier New=courier new,courier",
111
+ setup: function (editor) {
112
+ editor.addButton('tnp', {
113
+ type: 'menubutton',
114
+ image: tinymce.baseURL + '/skins/tnp.png',
115
+ menu: [
116
+ {text: '{blog_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_url}&nbsp;');}},
117
+ {text: '{blog_title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_title}&nbsp;');}},
118
+ {text: '{blog_description}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_description}&nbsp;');}},
119
+ {text: '{date}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date}&nbsp;');}},
120
+ {text: '{date_NNN}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date_NNN}&nbsp;');}},
121
+ {text: '{email_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email_url}&nbsp;');}},
122
+ {text: '{name}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{name}&nbsp;');}},
123
+ {text: '{surname}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{surname}&nbsp;');}},
124
+ {text: '{title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{title}&nbsp;');}},
125
+ {text: '{email}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email}&nbsp;');}},
126
+ {text: '{profile_N}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_N}&nbsp;');}},
127
+ {text: '{ip}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{ip}&nbsp;');}},
128
+ {text: '{subscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{subscription_confirm_url}&nbsp;');}},
129
+ {text: '{unsubscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{unsubscription_confirm_url}&nbsp;');}},
130
+ {text: '{profile_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_url}&nbsp;');}},
131
+ ],
132
+ });
133
+ },
134
+ });
135
+ if (tinymce.activeEditor != null)
136
+ tinymce.activeEditor.setContent(target.html());
137
+ jQuery("#tnpc-edit-text").fadeIn(500);
138
+ jQuery("#tnpc-edit-text .tnpc-edit-box").slideDown(500);
139
+ jQuery("#tnpc-edit-text .tnpc-edit-box-buttons-save").click(function () {
140
+ jQuery(this).parent().parent().parent().fadeOut(500)
141
+ jQuery(this).parent().parent().slideUp(500)
142
+ target.html(tinymce.activeEditor.getContent());
143
+ });
144
+ }
145
+
146
+ //edit icon
147
+ if (target.attr("data-type") == 'icon') {
148
+ jQuery("#tnpc-edit-icon").fadeIn(500);
149
+ jQuery("#tnpc-edit-icon .tnpc-edit-box").slideDown(500);
150
+ jQuery("#tnpc-edit-icon i").click(function () {
151
+ jQuery(this).parent().parent().parent().parent().fadeOut(500)
152
+ jQuery(this).parent().parent().parent().slideUp(500)
153
+ target.children('i').attr('class', jQuery(this).attr('class'));
154
+ });
155
+ }//
156
+
157
+ });
158
+ }, function () {
159
+ jQuery(this).children(".tnpc-row-edit-hover").remove();
160
+ }
161
+ );
162
+ }
163
+
164
+ jQuery.fn.add_delete = function () {
165
+ this.append('<div class="tnpc-row-delete"><i class="fa fa-times" ></i></div>');
166
+ this.find('.tnpc-row-delete').perform_delete();
167
+ }
168
+
169
+ jQuery.fn.perform_delete = function () {
170
+ this.click(function () {
171
+ jQuery(this).parent().remove();
172
+ });
173
+ }
174
+
175
+ jQuery.fn.add_block_edit = function () {
176
+ this.append('<div class="tnpc-row-edit-block"><i class="fa fa-pencil" ></i></div>');
177
+ this.find('.tnpc-row-edit-block i').perform_block_edit();
178
+ }
179
+
180
+ jQuery.fn.perform_block_edit = function () {
181
+
182
+ jQuery(".tnpc-row-edit-block").click(function (e) {
183
+ e.preventDefault()
184
+ });
185
+
186
+ this.click(function (e) {
187
+
188
+ e.preventDefault();
189
+
190
+ target = jQuery(this).parent().parent().find('.edit-block');
191
+
192
+ jQuery("#tnpc-edit-block .bgcolor").val(target.css("background-color"));
193
+ jQuery("#tnpc-edit-block .font").val(target.css("font-family"));
194
+
195
+ jQuery('.bgcolor').wpColorPicker({
196
+ // change: function (event, ui) {
197
+ // jQuery('.bgcolor').iris('hide');
198
+ // },
199
+ });
200
+ jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
201
+
202
+ // posts block
203
+ if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
204
+
205
+ jQuery("#tnpc-edit-posts").fadeIn(500);
206
+ jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
207
+
208
+ } else {
209
+
210
+ jQuery("#tnpc-edit-block").fadeIn(500);
211
+ jQuery("#tnpc-edit-block .tnpc-edit-box").slideDown(500);
212
+
213
+ }
214
+
215
+ jQuery("#tnpc-edit-block .tnpc-edit-box-buttons-save").click(function () {
216
+ jQuery(this).parent().parent().parent().fadeOut(500)
217
+ jQuery(this).parent().parent().slideUp(500)
218
+
219
+ target.css("background-color", jQuery("#tnpc-edit-block .bgcolor").val());
220
+ target.css("font-family", jQuery("#tnpc-edit-block .font").val());
221
+
222
+ });
223
+
224
+ jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
225
+
226
+ jQuery(this).parent().parent().parent().fadeOut(500)
227
+ jQuery(this).parent().parent().slideUp(500)
228
+ var categories = [];
229
+ jQuery('#tnpc-edit-posts input[name="options[theme_categories][]"]:checked').each(function ()
230
+ {
231
+ categories.push(jQuery(this).val());
232
+ });
233
+ var data = {
234
+ 'action': 'tnpc_render',
235
+ 'b': target.parent().parent().parent().data('block'),
236
+ 'num': jQuery("#tnpc-edit-posts .number").val(),
237
+ 'tags': jQuery("#tnpc-edit-posts .tags").val(),
238
+ 'categories': categories
239
+ };
240
+ jQuery.post(ajaxurl, data, function (response) {
241
+ new_row = jQuery(response);
242
+ target.parent().before(new_row).remove();
243
+ new_row.add_delete();
244
+ new_row.add_block_edit();
245
+ new_row.find(".tnpc-row-edit").hover_edit();
246
+ });
247
+ });
248
+
249
+ });
250
+
251
+ }
252
+
253
+ jQuery(function () {
254
+
255
+ // collapse wp menu
256
+ jQuery('body').addClass('folded');
257
+
258
+ //Drag & Drop
259
+ jQuery("#newsletter-builder-area-center-frame-content").sortable({
260
+ revert: false,
261
+ stop: function (event, ui) {
262
+ if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
263
+ loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
264
+ ui.item.before(loading_row);
265
+ ui.item.remove();
266
+ var data = {
267
+ 'action': 'tnpc_render',
268
+ 'b': ui.item.data("file")
269
+ };
270
+ jQuery.post(ajaxurl, data, function (response) {
271
+ new_row = jQuery(response);
272
+ // ui.item.before(new_row);
273
+ // ui.item.remove();
274
+ loading_row.before(new_row);
275
+ loading_row.remove();
276
+ new_row.add_delete();
277
+ new_row.add_block_edit();
278
+ new_row.find(".tnpc-row-edit").hover_edit();
279
+ });
280
+ }
281
+ }
282
+ });
283
+
284
+ jQuery(".tnpc-row").draggable({
285
+ connectToSortable: "#newsletter-builder-area-center-frame-content",
286
+ //helper: "clone",
287
+ revert: false,
288
+ handle: ".tnpc-row-move"
289
+ });
290
+
291
+ jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
292
+ connectToSortable: "#newsletter-builder-area-center-frame-content",
293
+ helper: "clone",
294
+ revert: false,
295
+ start: function () {
296
+ if (jQuery('.tnpc-row').length)
297
+ jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
298
+ else
299
+ jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
300
+ },
301
+ stop: function () {
302
+ jQuery('.tnpc-drop-here').remove();
303
+ }
304
+ });
305
+
306
+ //close edit
307
+ jQuery(".tnpc-edit-box-buttons-cancel").click(function () {
308
+ jQuery(this).parent().parent().parent().fadeOut(500)
309
+ jQuery(this).parent().parent().slideUp(500)
310
+ });
311
+
312
+ // initialize controls
313
+ jQuery(".tnpc-row").add_delete();
314
+ jQuery(".tnpc-row").add_block_edit();
315
+ jQuery(".tnpc-row-edit").hover_edit();
316
+
317
+ });
318
+
319
+ function create() {
320
+
321
+ jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
322
+
323
+ jQuery("#newsletter-preloaded-export .tnpc-row-delete").remove();
324
+ jQuery("#newsletter-preloaded-export .tnpc-row-edit-block").remove();
325
+ jQuery("#newsletter-preloaded-export .tnpc-row").removeClass("ui-draggable");
326
+ // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeAttr("data-type");
327
+ // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeClass("tnpc-row-edit");
328
+ preload_export_html = jQuery("#newsletter-preloaded-export").html();
329
+
330
+ if (preload_export_html.indexOf('<style type="text/css">') > -1) {
331
+ export_content = preload_export_html;
332
+ jQuery("#tnpc-edit-export .text").val(export_content);
333
+ jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
334
+ jQuery("#tnpc-form").submit();
335
+ } else {
336
+ jQuery.get(ajaxurl, {action: "tnpc_css"}, function (data) {
337
+ // export_content = '<style>' + data + '</style><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css"><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><div id="tnpc-wrapper"><div id="tnpc-wrapper-newsletter">' + preload_export_html + '</div></div>';
338
+ export_content = '<!DOCTYPE html><html><head><title>Newsletter</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge" />';
339
+ export_content += '<style type="text/css">' + data + '</style>';
340
+ export_content += '<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css">';
341
+ export_content += '<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">';
342
+ export_content += '</head><body style="margin: 0; padding: 0;">';
343
+ export_content += preload_export_html;
344
+ export_content += '</body></html>';
345
+ jQuery("#tnpc-edit-export .text").val(export_content);
346
+ jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
347
+ jQuery("#tnpc-form").submit();
348
+ });
349
+ }
350
+
351
+ jQuery("#newsletter-preloaded-export").html(' ');
352
+
353
+ }
354
+
 
 
 
 
 
 
 
emails/tnp-composer/blocks/{content-01-hero.block.php → content-01-hero.block} RENAMED
@@ -10,7 +10,7 @@
10
  <tr>
11
  <td class="padding-copy tnpc-row-edit" data-type="image">
12
  <a href="#" target="_blank">
13
- <img src="https://unsplash.it/500/300?image=885" width="500" border="0" alt="Insert alt text here" style="max-width: 100%!important; width: 500px!important; height: auto!important; display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
14
  </a>
15
  </td>
16
  </tr>
10
  <tr>
11
  <td class="padding-copy tnpc-row-edit" data-type="image">
12
  <a href="#" target="_blank">
13
+ <img src="https://unsplash.it/500/300?image=885" width="500" height="400" border="0" alt="Insert alt text here" style="display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
14
  </a>
15
  </td>
16
  </tr>
emails/tnp-composer/blocks/{content-01-hero.block.png → content-01-hero.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-02-heading.block.php → content-02-heading.block} RENAMED
@@ -2,7 +2,7 @@
2
  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-02">
3
  <tr>
4
  <td bgcolor="#ffffff" align="center" style="padding: 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
- <table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table" style="max-width: 100%!important">
6
  <tr>
7
  <td align="center" style="font-size: 25px; color: #333333; padding-top: 30px;" class="padding-copy tnpc-row-edit" data-type="title">An Awesome Title</td>
8
  </tr>
2
  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-02">
3
  <tr>
4
  <td bgcolor="#ffffff" align="center" style="padding: 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
+ <table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
6
  <tr>
7
  <td align="center" style="font-size: 25px; color: #333333; padding-top: 30px;" class="padding-copy tnpc-row-edit" data-type="title">An Awesome Title</td>
8
  </tr>
emails/tnp-composer/blocks/{content-02-heading.block.png → content-02-heading.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-03-text.block.php → content-03-text.block} RENAMED
@@ -2,7 +2,7 @@
2
  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-03">
3
  <tr>
4
  <td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
- <table border="0" cellpadding="0" cellspacing="0" class="responsive-table" style="width: 100%!important">
6
  <tr>
7
  <td align="center" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
8
  </tr>
2
  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-03">
3
  <tr>
4
  <td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
+ <table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
6
  <tr>
7
  <td align="center" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
8
  </tr>
emails/tnp-composer/blocks/{content-03-text.block.png → content-03-text.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-04-cta.block.php → content-04-cta.block} RENAMED
File without changes
emails/tnp-composer/blocks/{content-04-cta.block.png → content-04-cta.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-05-image.block.php → content-05-image.block} RENAMED
@@ -4,7 +4,7 @@
4
  <td bgcolor="#ffffff" align="center" style="padding: 0; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
  <div class="tnpc-row-edit" data-type="image">
6
  <a href="#" target="_blank">
7
- <img src="https://unsplash.it/800/300?image=998" width="800" border="0" alt="Insert alt text here" style="max-width: 100%!important; width: 800px!important; height: auto!important;display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
8
  </a>
9
  </div>
10
  </td>
4
  <td bgcolor="#ffffff" align="center" style="padding: 0; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
  <div class="tnpc-row-edit" data-type="image">
6
  <a href="#" target="_blank">
7
+ <img src="https://unsplash.it/800/300?image=998" width="800" height="300" border="0" alt="Insert alt text here" style="display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
8
  </a>
9
  </div>
10
  </td>
emails/tnp-composer/blocks/{content-05-image.block.png → content-05-image.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-06-posts.block.php → content-06-posts.block} RENAMED
@@ -2,7 +2,7 @@
2
  include NEWSLETTER_INCLUDES_DIR . '/helper.php';
3
 
4
  $filters = array();
5
- $filters['showposts'] = isset($_POST['num']) ? intval($_POST['num']) : 3;
6
  if (!empty($_POST['categories'])) {
7
  $filters['category__in'] = $_POST['categories'];
8
  }
@@ -27,7 +27,7 @@ $posts = get_posts($filters);
27
  <tr>
28
  <td valign="top" style="padding: 40px 0 0 0;" class="mobile-hide tnpc-row-edit" data-type="image">
29
  <a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
30
- <img src="<?php echo tnp_post_thumbnail_src($post) ?>" width="105" height="105" border="0" style="display: block; font-family: Arial; color: #666666; font-size: 14px; width: 105px!important; height: 105px!important;">
31
  </a>
32
  </td>
33
  <td style="padding: 40px 0 0 0;" class="no-padding">
2
  include NEWSLETTER_INCLUDES_DIR . '/helper.php';
3
 
4
  $filters = array();
5
+ $filters['showposts'] = $_POST['num'] ? intval($_POST['num']) : 3;
6
  if (!empty($_POST['categories'])) {
7
  $filters['category__in'] = $_POST['categories'];
8
  }
27
  <tr>
28
  <td valign="top" style="padding: 40px 0 0 0;" class="mobile-hide tnpc-row-edit" data-type="image">
29
  <a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
30
+ <img src="<?php echo tnp_post_thumbnail_src($post) ?>" width="105" height="105" border="0" style="display: block; font-family: Arial; color: #666666; font-size: 14px; width: 105px; height: 105px;">
31
  </a>
32
  </td>
33
  <td style="padding: 40px 0 0 0;" class="no-padding">
emails/tnp-composer/blocks/{content-06-posts.block.png → content-06-posts.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-07-twocols.block.php → content-07-twocols.block} RENAMED
@@ -2,7 +2,7 @@
2
  include NEWSLETTER_INCLUDES_DIR . '/helper.php';
3
 
4
  $filters = array();
5
- $filters['showposts'] = isset($_POST['num']) ? intval($_POST['num']) : 3;
6
  if (!empty($_POST['categories'])) {
7
  $filters['category__in'] = $_POST['categories'];
8
  }
2
  include NEWSLETTER_INCLUDES_DIR . '/helper.php';
3
 
4
  $filters = array();
5
+ $filters['showposts'] = $_POST['num'] ? intval($_POST['num']) : 3;
6
  if (!empty($_POST['categories'])) {
7
  $filters['category__in'] = $_POST['categories'];
8
  }
emails/tnp-composer/blocks/{content-07-twocols.block.png → content-07-twocols.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-01-footer.block.php → footer-01-footer.block} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-01-footer.block.png → footer-01-footer.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-02-canspam.block.php → footer-02-canspam.block} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-02-canspam.block.png → footer-02-canspam.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-03-social.block.php → footer-03-social.block} RENAMED
@@ -47,11 +47,6 @@
47
  <a href="<?php echo $block_options['soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png" alt="SoundCloud"></a>
48
  </span>
49
  <?php } ?>
50
- <?php if (!empty($block_options['instagram_url'])) { $configured = true; ?>
51
- <span class="tnpc-row-edit" data-type="image">
52
- <a href="<?php echo $block_options['instagram'] ?>"><img src="<?php echo $social_icon_url ?>/instagram.png" alt="Instagram"></a>
53
- </span>
54
- <?php } ?>
55
  <?php if (!$configured) { ?>
56
  <p>Configure your social links in the <a href="?page=newsletter_main_info">Social configuration section</a>.<br/>
57
  Then remove and add again this block.</p>
47
  <a href="<?php echo $block_options['soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png" alt="SoundCloud"></a>
48
  </span>
49
  <?php } ?>
 
 
 
 
 
50
  <?php if (!$configured) { ?>
51
  <p>Configure your social links in the <a href="?page=newsletter_main_info">Social configuration section</a>.<br/>
52
  Then remove and add again this block.</p>
emails/tnp-composer/blocks/{footer-03-social.block.png → footer-03-social.png} RENAMED
File without changes
emails/tnp-composer/blocks/{header-01-header.block.php → header-01-header.block} RENAMED
File without changes
emails/tnp-composer/blocks/{header-01-header.block.png → header-01-header.png} RENAMED
File without changes
emails/tnp-composer/edit.php CHANGED
@@ -1,23 +1,18 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
  <div class="tnpc-edit" id="tnpc-edit-image">
5
  <div class="tnpc-edit-box">
6
- <div class="tnpc-edit-box-title"><?php _e("Edit Image", "newsletter") ?></div>
7
  <div class="tnpc-edit-box-content">
8
- <div class="tnpc-edit-box-content-text"><?php _e("SOURCE", "newsletter") ?> <span>(full image URL including http://)</span></div>
9
  <div class="tnpc-edit-box-content-field">
10
  <input type="text" class="tnpc-edit-box-content-field-input image"/>
11
  <input class="button select_image" value="Select or Upload Image" type="button">
12
  </div>
13
- <div class="tnpc-edit-box-content-text"><?php _e("ALT TEXT", "newsletter") ?><span>(optional but recommended)</span></div>
14
- <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input alt"/></div>
15
- <div class="tnpc-edit-box-content-text"><?php _e("LINK", "newsletter") ?> <span>(optional link address including http://)</span></div>
16
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
17
  </div>
18
  <div class="tnpc-edit-box-buttons">
19
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
20
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
21
  </div>
22
  </div>
23
  </div>
@@ -43,8 +38,6 @@ if (!defined('ABSPATH')) exit;
43
  // We set multiple to false so only get one image from the uploader
44
  attachment = file_frame.state().get('selection').first().toJSON();
45
  // Do something with attachment.id and/or attachment.url here
46
- // Patch for plugins which remove the protocol (not good for a newsletter...)
47
- if (attachment.url.indexOf("http") !== 0) attachment.url = "http:" + attachment.url;
48
  jQuery('#tnpc-edit-image .image').val(attachment.url);
49
  });
50
  // Finally, open the modal
@@ -54,55 +47,55 @@ if (!defined('ABSPATH')) exit;
54
 
55
  <div class="tnpc-edit" id="tnpc-edit-link">
56
  <div class="tnpc-edit-box">
57
- <div class="tnpc-edit-box-title"><?php _e("Edit Link", "newsletter") ?></div>
58
 
59
  <div class="tnpc-edit-box-content">
60
- <div class="tnpc-edit-box-content-text"><?php _e("TITLE", "newsletter") ?> </div>
61
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
62
- <div class="tnpc-edit-box-content-text"><?php _e("URL", "newsletter") ?> <span>(full address including http://)</span></div>
63
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
64
  </div>
65
  <div class="tnpc-edit-box-buttons">
66
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
67
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
68
  </div>
69
  </div>
70
  </div>
71
 
72
  <div class="tnpc-edit" id="tnpc-edit-button">
73
  <div class="tnpc-edit-box">
74
- <div class="tnpc-edit-box-title"><?php _e("Edit Button", "newsletter") ?></div>
75
 
76
  <div class="tnpc-edit-box-content">
77
- <div class="tnpc-edit-box-content-text"><?php _e("TITLE", "newsletter") ?> </div>
78
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
79
- <div class="tnpc-edit-box-content-text"><?php _e("URL", "newsletter") ?> <span>(full address including http://)</span></div>
80
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
81
- <div class="tnpc-edit-box-content-text"><?php _e("Text Color", "newsletter") ?></div>
82
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input fgcolor"/></div>
83
- <div class="tnpc-edit-box-content-text"><?php _e("Background Color", "newsletter") ?></div>
84
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
85
  </div>
86
  <div class="tnpc-edit-box-buttons">
87
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
88
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
89
  </div>
90
  </div>
91
  </div>
92
 
93
  <div class="tnpc-edit" id="tnpc-edit-title">
94
  <div class="tnpc-edit-box">
95
- <div class="tnpc-edit-box-title"><?php _e("Edit Title", "newsletter") ?></div>
96
 
97
  <div class="tnpc-edit-box-content">
98
- <div class="tnpc-edit-box-content-text"><?php _e("Title", "newsletter") ?></div>
99
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
100
- <div class="tnpc-edit-box-content-text"><?php _e("Text Color", "newsletter") ?></div>
101
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input color"/></div>
102
  </div>
103
  <div class="tnpc-edit-box-buttons">
104
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
105
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
106
  </div>
107
  </div>
108
  </div>
@@ -110,15 +103,15 @@ if (!defined('ABSPATH')) exit;
110
 
111
  <div class="tnpc-edit" id="tnpc-edit-text">
112
  <div class="tnpc-edit-box">
113
- <div class="tnpc-edit-box-title"><?php _e("Edit Text", "newsletter") ?></div>
114
 
115
  <div class="tnpc-edit-box-content">
116
- <div class="tnpc-edit-box-content-text"><?php _e("Text", "newsletter") ?></div>
117
  <div class="tnpc-edit-box-content-field"><textarea class="tnpc-edit-box-content-field-textarea text"></textarea></div>
118
  </div>
119
  <div class="tnpc-edit-box-buttons">
120
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
121
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
122
  </div>
123
  </div>
124
  </div>
@@ -126,10 +119,10 @@ if (!defined('ABSPATH')) exit;
126
 
127
  <div class="tnpc-edit" id="tnpc-edit-icon">
128
  <div class="tnpc-edit-box">
129
- <div class="tnpc-edit-box-title"><?php _e("Edit Icon", "newsletter") ?></div>
130
 
131
  <div class="tnpc-edit-box-content">
132
- <div class="tnpc-edit-box-content-text"><?php _e("Select Icon", "newsletter") ?></div>
133
  <div class="tnpc-edit-box-content-icons">
134
 
135
 
@@ -1384,19 +1377,19 @@ if (!defined('ABSPATH')) exit;
1384
  </div>
1385
  </div>
1386
  <div class="tnpc-edit-box-buttons">
1387
- <div class="tnpc-edit-box-buttons-cancel" style="margin-left:0px;"><?php _e("Cancel", "newsletter") ?></div>
1388
  </div>
1389
  </div>
1390
  </div>
1391
 
1392
  <div class="tnpc-edit" id="tnpc-edit-block">
1393
  <div class="tnpc-edit-box">
1394
- <div class="tnpc-edit-box-title"><?php _e("Edit Block", "newsletter") ?></div>
1395
 
1396
  <div class="tnpc-edit-box-content">
1397
- <div class="tnpc-edit-box-content-text"><?php _e("Background Color", "newsletter") ?></div>
1398
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1399
- <div class="tnpc-edit-box-content-text"><?php _e("Font Family", "newsletter") ?></div>
1400
  <div class="tnpc-edit-box-content-field">
1401
  <select class="tnpc-edit-box-content-field-input font">
1402
  <optgroup label="Sans Serif Web Safe Fonts">
@@ -1419,20 +1412,20 @@ if (!defined('ABSPATH')) exit;
1419
  </div>
1420
  </div>
1421
  <div class="tnpc-edit-box-buttons">
1422
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
1423
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
1424
  </div>
1425
  </div>
1426
  </div>
1427
 
1428
  <div class="tnpc-edit" id="tnpc-edit-posts">
1429
  <div class="tnpc-edit-box">
1430
- <div class="tnpc-edit-box-title"><?php _e("Edit Block", "newsletter") ?></div>
1431
 
1432
  <div class="tnpc-edit-box-content">
1433
- <div class="tnpc-edit-box-content-text"><?php _e("Background Color", "newsletter") ?></div>
1434
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1435
- <div class="tnpc-edit-box-content-text"><?php _e("Font Family", "newsletter") ?></div>
1436
  <div class="tnpc-edit-box-content-field">
1437
  <select class="tnpc-edit-box-content-field-input font">
1438
  <optgroup label="Sans Serif Web Safe Fonts">
@@ -1455,20 +1448,19 @@ if (!defined('ABSPATH')) exit;
1455
  </optgroup>
1456
  </select>
1457
  </div>
1458
- <div class="tnpc-edit-box-content-text"><?php _e("Number of posts", "newsletter") ?></div>
1459
  <div class="tnpc-edit-box-content-field"><input type="number" class="tnpc-edit-box-content-field-input number" value="3"/></div>
1460
- <div class="tnpc-edit-box-content-text"><?php _e("Categories", "newsletter") ?></div>
1461
  <div class="tnpc-edit-box-content-field">
1462
  <!-- <input type="text" class="tnpc-edit-box-content-field-input categories"/>-->
1463
  <?php $controls->categories_group('theme_categories'); ?>
1464
  </div>
1465
- <div class="tnpc-edit-box-content-text"><?php _e("Tags (comma separated)", "newsletter") ?></div>
1466
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input tags"/></div>
1467
  </div>
1468
  <div class="tnpc-edit-box-buttons">
1469
- <?php _e("Any prior changes to single posts will be lost when editing these settings.", "newsletter") ?>
1470
- <div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
1471
- <div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
1472
  </div>
1473
  </div>
1474
  </div>
 
 
 
1
  <div class="tnpc-edit" id="tnpc-edit-image">
2
  <div class="tnpc-edit-box">
3
+ <div class="tnpc-edit-box-title">Edit Image</div>
4
  <div class="tnpc-edit-box-content">
5
+ <div class="tnpc-edit-box-content-text">SOURCE <span>(full image URL including http://)</span></div>
6
  <div class="tnpc-edit-box-content-field">
7
  <input type="text" class="tnpc-edit-box-content-field-input image"/>
8
  <input class="button select_image" value="Select or Upload Image" type="button">
9
  </div>
10
+ <div class="tnpc-edit-box-content-text">LINK <span>(optional link address including http://)</span></div>
 
 
11
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
12
  </div>
13
  <div class="tnpc-edit-box-buttons">
14
+ <div class="tnpc-edit-box-buttons-save">Save</div>
15
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
16
  </div>
17
  </div>
18
  </div>
38
  // We set multiple to false so only get one image from the uploader
39
  attachment = file_frame.state().get('selection').first().toJSON();
40
  // Do something with attachment.id and/or attachment.url here
 
 
41
  jQuery('#tnpc-edit-image .image').val(attachment.url);
42
  });
43
  // Finally, open the modal
47
 
48
  <div class="tnpc-edit" id="tnpc-edit-link">
49
  <div class="tnpc-edit-box">
50
+ <div class="tnpc-edit-box-title">Edit Link</div>
51
 
52
  <div class="tnpc-edit-box-content">
53
+ <div class="tnpc-edit-box-content-text">TITLE </div>
54
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
55
+ <div class="tnpc-edit-box-content-text">URL <span>(full address including http://)</span></div>
56
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
57
  </div>
58
  <div class="tnpc-edit-box-buttons">
59
+ <div class="tnpc-edit-box-buttons-save">Save</div>
60
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
61
  </div>
62
  </div>
63
  </div>
64
 
65
  <div class="tnpc-edit" id="tnpc-edit-button">
66
  <div class="tnpc-edit-box">
67
+ <div class="tnpc-edit-box-title">Edit Button</div>
68
 
69
  <div class="tnpc-edit-box-content">
70
+ <div class="tnpc-edit-box-content-text">TITLE </div>
71
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
72
+ <div class="tnpc-edit-box-content-text">URL <span>(full address including http://)</span></div>
73
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
74
+ <div class="tnpc-edit-box-content-text">Text Color</div>
75
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input fgcolor"/></div>
76
+ <div class="tnpc-edit-box-content-text">Background Color</div>
77
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
78
  </div>
79
  <div class="tnpc-edit-box-buttons">
80
+ <div class="tnpc-edit-box-buttons-save">Save</div>
81
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
82
  </div>
83
  </div>
84
  </div>
85
 
86
  <div class="tnpc-edit" id="tnpc-edit-title">
87
  <div class="tnpc-edit-box">
88
+ <div class="tnpc-edit-box-title">Edit Title</div>
89
 
90
  <div class="tnpc-edit-box-content">
91
+ <div class="tnpc-edit-box-content-text">Title</div>
92
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
93
+ <div class="tnpc-edit-box-content-text">Text Color</div>
94
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input color"/></div>
95
  </div>
96
  <div class="tnpc-edit-box-buttons">
97
+ <div class="tnpc-edit-box-buttons-save">Save</div>
98
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
99
  </div>
100
  </div>
101
  </div>
103
 
104
  <div class="tnpc-edit" id="tnpc-edit-text">
105
  <div class="tnpc-edit-box">
106
+ <div class="tnpc-edit-box-title">Edit Text</div>
107
 
108
  <div class="tnpc-edit-box-content">
109
+ <div class="tnpc-edit-box-content-text">Text</div>
110
  <div class="tnpc-edit-box-content-field"><textarea class="tnpc-edit-box-content-field-textarea text"></textarea></div>
111
  </div>
112
  <div class="tnpc-edit-box-buttons">
113
+ <div class="tnpc-edit-box-buttons-save">Save</div>
114
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
115
  </div>
116
  </div>
117
  </div>
119
 
120
  <div class="tnpc-edit" id="tnpc-edit-icon">
121
  <div class="tnpc-edit-box">
122
+ <div class="tnpc-edit-box-title">Edit Icon</div>
123
 
124
  <div class="tnpc-edit-box-content">
125
+ <div class="tnpc-edit-box-content-text">Select Icon</div>
126
  <div class="tnpc-edit-box-content-icons">
127
 
128
 
1377
  </div>
1378
  </div>
1379
  <div class="tnpc-edit-box-buttons">
1380
+ <div class="tnpc-edit-box-buttons-cancel" style="margin-left:0px;">Cancel</div>
1381
  </div>
1382
  </div>
1383
  </div>
1384
 
1385
  <div class="tnpc-edit" id="tnpc-edit-block">
1386
  <div class="tnpc-edit-box">
1387
+ <div class="tnpc-edit-box-title">Edit Block</div>
1388
 
1389
  <div class="tnpc-edit-box-content">
1390
+ <div class="tnpc-edit-box-content-text">Background Color</div>
1391
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1392
+ <div class="tnpc-edit-box-content-text">Font Family</div>
1393
  <div class="tnpc-edit-box-content-field">
1394
  <select class="tnpc-edit-box-content-field-input font">
1395
  <optgroup label="Sans Serif Web Safe Fonts">
1412
  </div>
1413
  </div>
1414
  <div class="tnpc-edit-box-buttons">
1415
+ <div class="tnpc-edit-box-buttons-save">Save</div>
1416
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
1417
  </div>
1418
  </div>
1419
  </div>
1420
 
1421
  <div class="tnpc-edit" id="tnpc-edit-posts">
1422
  <div class="tnpc-edit-box">
1423
+ <div class="tnpc-edit-box-title">Edit Block</div>
1424
 
1425
  <div class="tnpc-edit-box-content">
1426
+ <div class="tnpc-edit-box-content-text">Background Color</div>
1427
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1428
+ <div class="tnpc-edit-box-content-text">Font Family</div>
1429
  <div class="tnpc-edit-box-content-field">
1430
  <select class="tnpc-edit-box-content-field-input font">
1431
  <optgroup label="Sans Serif Web Safe Fonts">
1448
  </optgroup>
1449
  </select>
1450
  </div>
1451
+ <div class="tnpc-edit-box-content-text">Number of Posts</div>
1452
  <div class="tnpc-edit-box-content-field"><input type="number" class="tnpc-edit-box-content-field-input number" value="3"/></div>
1453
+ <div class="tnpc-edit-box-content-text">Categories</div>
1454
  <div class="tnpc-edit-box-content-field">
1455
  <!-- <input type="text" class="tnpc-edit-box-content-field-input categories"/>-->
1456
  <?php $controls->categories_group('theme_categories'); ?>
1457
  </div>
1458
+ <div class="tnpc-edit-box-content-text">Tags (comma separated)</div>
1459
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input tags"/></div>
1460
  </div>
1461
  <div class="tnpc-edit-box-buttons">
1462
+ <div class="tnpc-edit-box-buttons-save">Save</div>
1463
+ <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
 
1464
  </div>
1465
  </div>
1466
  </div>
emails/tnp-composer/index.php CHANGED
@@ -1,88 +1,86 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- /* READ THE BLOCKS */
5
- $blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
6
- $files = glob($blocks_dir . '*.block.php', GLOB_BRACE);
7
- foreach ($files as $file) {
8
- $path_parts = pathinfo($file);
9
- $filename = $path_parts['filename'];
10
- $section = substr($filename, 0, strpos($filename, '-'));
11
- $index = substr($filename, strpos($filename, '-') + 1, 2);
12
- $blocks[$section][$index]['name'] = substr($filename, strrpos($filename, '-') + 1);
13
- $blocks[$section][$index]['filename'] = $filename;
14
- }
15
- // order the sections
16
- $blocks = array_merge(array_flip(array('header', 'content', 'footer')), $blocks);
17
-
18
- // prepare the options for the default blocks
19
- $block_options = get_option('newsletter_main');
20
- ?>
21
-
22
- <div id="newsletter-preloaded-export" style="display: none;"></div>
23
-
24
- <?php include NEWSLETTER_DIR . '/emails/tnp-composer/edit.php'; ?>
25
-
26
- <div id="newsletter-builder">
27
-
28
- <?php /* SIDEBAR */ ?>
29
- <div id="newsletter-builder-sidebar">
30
-
31
- <?php
32
- foreach ($blocks as $k => $section) {
33
- ?>
34
- <div class="newsletter-sidebar-add-buttons" id="sidebar-add-<?php echo $k ?>">
35
- <h4><span><?php echo ucfirst($k) ?></span></h4>
36
- <?php foreach ($section AS $key => $block) { ?>
37
- <div class="newsletter-sidebar-buttons-content-tab" data-id="<?php echo $k . '-' . $key ?>" data-file="<?php echo $block['filename'] ?>">
38
- <?php if (file_exists(NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . $block['filename'] . '.png')) { ?>
39
- <img src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/blocks/<?php echo $block['filename'] ?>.png" title="Drag&Drop" />
40
- <?php } else { ?>
41
- <img src="http://placehold.it/200x100?text=<?php echo $block['name'] ?>" title="Drag&Drop" />
42
- <?php } ?>
43
- </div>
44
- <?php } ?>
45
- </div>
46
- <?php } ?>
47
-
48
- </div>
49
-
50
- <div id="newsletter-builder-area">
51
-
52
- <div id="newsletter-builder-area-center">
53
-
54
- <div id="newsletter-builder-area-center-frame">
55
-
56
- <div id="newsletter-builder-area-center-frame-content">
57
-
58
- <?php
59
- if (isset($email)) {
60
- $x = strpos($body, '<body');
61
- if ($x !== false) {
62
- $x = strpos($body, '>', $x);
63
- $y = strpos($body, '</body>');
64
- echo substr($body, $x + 1, $y - $x - 1);
65
- } else {
66
- echo $body;
67
- }
68
- } else {
69
- include $blocks_dir . 'header-01-header.block.php';
70
- include $blocks_dir . 'content-01-hero.block.php';
71
- include $blocks_dir . 'footer-01-footer.block.php';
72
- include $blocks_dir . 'footer-02-canspam.block.php';
73
- }
74
- ?>
75
-
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- </div>
81
-
82
- <script type="text/javascript">
83
- TNP_PLUGIN_URL = "<?php echo NEWSLETTER_URL ?>";
84
- </script>
85
- <!--<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/jquery-2.2.3.min.js"></script>-->
86
- <!--<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/jquery-ui-1.10.4.min.js"></script>-->
87
- <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/newsletter-builder.js"></script>
88
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tinymce4/tinymce.min.js"></script>
1
+ <?php
2
+ /* READ THE BLOCKS */
3
+ $blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
4
+ $files = glob($blocks_dir . '*.block', GLOB_BRACE);
5
+ foreach ($files as $file) {
6
+ $path_parts = pathinfo($file);
7
+ $filename = $path_parts['filename'];
8
+ $section = substr($filename, 0, strpos($filename, '-'));
9
+ $index = substr($filename, strpos($filename, '-') + 1, 2);
10
+ $blocks[$section][$index]['name'] = substr($filename, strrpos($filename, '-') + 1);
11
+ $blocks[$section][$index]['filename'] = $filename;
12
+ }
13
+ // order the sections
14
+ $blocks = array_merge(array_flip(array('header', 'content', 'footer')), $blocks);
15
+
16
+ // prepare the options for the default blocks
17
+ $block_options = get_option('newsletter_main');
18
+ ?>
19
+
20
+ <div id="newsletter-preloaded-export" style="display: none;"></div>
21
+
22
+ <?php include NEWSLETTER_DIR . '/emails/tnp-composer/edit.php'; ?>
23
+
24
+ <div id="newsletter-builder">
25
+
26
+ <?php /* SIDEBAR */ ?>
27
+ <div id="newsletter-builder-sidebar">
28
+
29
+ <?php
30
+ foreach ($blocks as $k => $section) {
31
+ ?>
32
+ <div class="newsletter-sidebar-add-buttons" id="sidebar-add-<?php echo $k ?>">
33
+ <h4><span><?php echo ucfirst($k) ?></span></h4>
34
+ <?php foreach ($section AS $key => $block) { ?>
35
+ <div class="newsletter-sidebar-buttons-content-tab" data-id="<?php echo $k . '-' . $key ?>" data-file="<?php echo $block['filename'] ?>">
36
+ <?php if (file_exists(NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . $block['filename'] . '.png')) { ?>
37
+ <img src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/blocks/<?php echo $block['filename'] ?>.png" title="Drag&Drop" />
38
+ <?php } else { ?>
39
+ <img src="http://placehold.it/200x100?text=<?php echo $block['name'] ?>" title="Drag&Drop" />
40
+ <?php } ?>
41
+ </div>
42
+ <?php } ?>
43
+ </div>
44
+ <?php } ?>
45
+
46
+ </div>
47
+
48
+ <div id="newsletter-builder-area">
49
+
50
+ <div id="newsletter-builder-area-center">
51
+
52
+ <div id="newsletter-builder-area-center-frame">
53
+
54
+ <div id="newsletter-builder-area-center-frame-content">
55
+
56
+ <?php
57
+ if (isset($email)) {
58
+ $x = strpos($body, '<body');
59
+ if ($x !== false) {
60
+ $x = strpos($body, '>', $x);
61
+ $y = strpos($body, '</body>');
62
+ echo substr($body, $x + 1, $y - $x - 1);
63
+ } else {
64
+ echo $body;
65
+ }
66
+ } else {
67
+ include $blocks_dir . 'header-01-header.block';
68
+ include $blocks_dir . 'content-01-hero.block';
69
+ include $blocks_dir . 'footer-01-footer.block';
70
+ include $blocks_dir . 'footer-02-canspam.block';
71
+ }
72
+ ?>
73
+
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+
80
+ <script type="text/javascript">
81
+ TNP_PLUGIN_URL = "<?php echo NEWSLETTER_URL ?>";
82
+ </script>
83
+ <!--<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/jquery-2.2.3.min.js"></script>-->
84
+ <!--<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/jquery-ui-1.10.4.min.js"></script>-->
85
+ <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/newsletter-builder.js"></script>
 
 
86
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tinymce4/tinymce.min.js"></script>
feed/feed.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This is only demo code just to make the demo Feed by Mail panel work.
5
+ */
6
+ class NewsletterFeed extends NewsletterModule {
7
+
8
+ static $instance;
9
+
10
+ static function instance() {
11
+ if (self::$instance == null) {
12
+ self::$instance = new NewsletterFeed();
13
+ }
14
+ return self::$instance;
15
+ }
16
+
17
+ function __construct() {
18
+ parent::__construct('feed', '1.0.0');
19
+ }
20
+
21
+ function admin_menu() {
22
+ // $this->add_menu_page('index', 'Feed by Mail');
23
+ }
24
+ }
25
+
26
+ NewsletterFeed::instance();
feed/index.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wrap" id="tnp-wrap">
3
+
4
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
5
+
6
+ <div id="tnp-heading">
7
+
8
+ <h2>Feed by Mail</h2>
9
+
10
+ </div>
11
+
12
+ <div id="tnp-body">
13
+
14
+ <div class="updated">
15
+ <p>
16
+ The Feed by Mail demo has been removed to make the plugin <strong>faster</strong>. You can install the demo separately getting it
17
+ from <a href="http://www.thenewsletterplugin.com/downloads/demos" target="_blank">here</a> or directly the full version from
18
+ <a href="http://www.thenewsletterplugin.com/downloads" target="_blank">here</a>.
19
+ </p>
20
+ </div>
21
+
22
+ </div>
23
+
24
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
25
+
26
+ </div>
header-extension.php CHANGED
@@ -1,31 +1,28 @@
1
- <?php
2
- /*
3
- * Header file for the extensions administrative panels.
4
- *
5
- * - no top noticies
6
- * - no donation link
7
- */
8
-
9
- if (!defined('ABSPATH')) exit;
10
-
11
- ?>
12
- <?php if (NEWSLETTER_HEADER) { ?>
13
- <div id="newsletter-header-ext">
14
- <div style="text-align: center; margin-top: 5px;">
15
- <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/documentation.png"> Documentation</a>
16
- <a href="http://www.thenewsletterplugin.com/forums" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/forum.png"> Forum</a>
17
- <a href="https://www.facebook.com/thenewsletterplugin
18
- " target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/facebook.png"> Facebook</a>
19
-
20
- <!--<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
21
- </div>
22
-
23
- <div style="text-align: center; margin-top: 5px;">
24
- <form style="margin: 0;" action="http://www.thenewsletterplugin.com/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
25
- My Newsletter<!-- to thenewsletterplugin.com--> <input type="email" name="ne" required placeholder="Your email" style="padding: 2px">
26
- <input type="submit" value="Go" style="padding: 2px">
27
- </form>
28
- </div>
29
- </div>
30
- <?php } ?>
31
-
1
+ <?php
2
+ /*
3
+ * Header file for the extensions administrative panels.
4
+ *
5
+ * - no top noticies
6
+ * - no donation link
7
+ */
8
+ ?>
9
+ <?php if (NEWSLETTER_HEADER) { ?>
10
+ <div id="newsletter-header-ext">
11
+ <div style="text-align: center; margin-top: 5px;">
12
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/documentation.png"> Documentation</a>
13
+ <a href="http://www.thenewsletterplugin.com/forums" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/forum.png"> Forum</a>
14
+ <a href="https://www.facebook.com/thenewsletterplugin
15
+ " target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/facebook.png"> Facebook</a>
16
+
17
+ <!--<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
18
+ </div>
19
+
20
+ <div style="text-align: center; margin-top: 5px;">
21
+ <form style="margin: 0;" action="http://www.thenewsletterplugin.com/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
22
+ My Newsletter<!-- to thenewsletterplugin.com--> <input type="email" name="ne" required placeholder="Your email" style="padding: 2px">
23
+ <input type="submit" value="Go" style="padding: 2px">
24
+ </form>
25
+ </div>
26
+ </div>
27
+ <?php } ?>
28
+
 
 
 
includes/class-tgm-plugin-activation.php DELETED
@@ -1,3853 +0,0 @@
1
- <?php
2
- /**
3
- * Plugin installation and activation for WordPress themes.
4
- *
5
- * Please note that this is a drop-in library for a theme or plugin.
6
- * The authors of this library (Thomas, Gary and Juliette) are NOT responsible
7
- * for the support of your plugin or theme. Please contact the plugin
8
- * or theme author for support.
9
- *
10
- * @package TGM-Plugin-Activation
11
- * @version 2.6.1
12
- * @link http://tgmpluginactivation.com/
13
- * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
14
- * @copyright Copyright (c) 2011, Thomas Griffin
15
- * @license GPL-2.0+
16
- */
17
-
18
- /*
19
- Copyright 2011 Thomas Griffin (thomasgriffinmedia.com)
20
-
21
- This program is free software; you can redistribute it and/or modify
22
- it under the terms of the GNU General Public License, version 2, as
23
- published by the Free Software Foundation.
24
-
25
- This program is distributed in the hope that it will be useful,
26
- but WITHOUT ANY WARRANTY; without even the implied warranty of
27
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
- GNU General Public License for more details.
29
-
30
- You should have received a copy of the GNU General Public License
31
- along with this program; if not, write to the Free Software
32
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33
- */
34
-
35
- if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
36
-
37
- /**
38
- * Automatic plugin installation and activation library.
39
- *
40
- * Creates a way to automatically install and activate plugins from within themes.
41
- * The plugins can be either bundled, downloaded from the WordPress
42
- * Plugin Repository or downloaded from another external source.
43
- *
44
- * @since 1.0.0
45
- *
46
- * @package TGM-Plugin-Activation
47
- * @author Thomas Griffin
48
- * @author Gary Jones
49
- */
50
- class TGM_Plugin_Activation {
51
- /**
52
- * TGMPA version number.
53
- *
54
- * @since 2.5.0
55
- *
56
- * @const string Version number.
57
- */
58
- const TGMPA_VERSION = '2.6.1';
59
-
60
- /**
61
- * Regular expression to test if a URL is a WP plugin repo URL.
62
- *
63
- * @const string Regex.
64
- *
65
- * @since 2.5.0
66
- */
67
- const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|';
68
-
69
- /**
70
- * Arbitrary regular expression to test if a string starts with a URL.
71
- *
72
- * @const string Regex.
73
- *
74
- * @since 2.5.0
75
- */
76
- const IS_URL_REGEX = '|^http[s]?://|';
77
-
78
- /**
79
- * Holds a copy of itself, so it can be referenced by the class name.
80
- *
81
- * @since 1.0.0
82
- *
83
- * @var TGM_Plugin_Activation
84
- */
85
- public static $instance;
86
-
87
- /**
88
- * Holds arrays of plugin details.
89
- *
90
- * @since 1.0.0
91
- * @since 2.5.0 the array has the plugin slug as an associative key.
92
- *
93
- * @var array
94
- */
95
- public $plugins = array();
96
-
97
- /**
98
- * Holds arrays of plugin names to use to sort the plugins array.
99
- *
100
- * @since 2.5.0
101
- *
102
- * @var array
103
- */
104
- protected $sort_order = array();
105
-
106
- /**
107
- * Whether any plugins have the 'force_activation' setting set to true.
108
- *
109
- * @since 2.5.0
110
- *
111
- * @var bool
112
- */
113
- protected $has_forced_activation = false;
114
-
115
- /**
116
- * Whether any plugins have the 'force_deactivation' setting set to true.
117
- *
118
- * @since 2.5.0
119
- *
120
- * @var bool
121
- */
122
- protected $has_forced_deactivation = false;
123
-
124
- /**
125
- * Name of the unique ID to hash notices.
126
- *
127
- * @since 2.4.0
128
- *
129
- * @var string
130
- */
131
- public $id = 'tgmpa';
132
-
133
- /**
134
- * Name of the query-string argument for the admin page.
135
- *
136
- * @since 1.0.0
137
- *
138
- * @var string
139
- */
140
- protected $menu = 'tgmpa-install-plugins';
141
-
142
- /**
143
- * Parent menu file slug.
144
- *
145
- * @since 2.5.0
146
- *
147
- * @var string
148
- */
149
- public $parent_slug = 'themes.php';
150
-
151
- /**
152
- * Capability needed to view the plugin installation menu item.
153
- *
154
- * @since 2.5.0
155
- *
156
- * @var string
157
- */
158
- public $capability = 'edit_theme_options';
159
-
160
- /**
161
- * Default absolute path to folder containing bundled plugin zip files.
162
- *
163
- * @since 2.0.0
164
- *
165
- * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.
166
- */
167
- public $default_path = '';
168
-
169
- /**
170
- * Flag to show admin notices or not.
171
- *
172
- * @since 2.1.0
173
- *
174
- * @var boolean
175
- */
176
- public $has_notices = true;
177
-
178
- /**
179
- * Flag to determine if the user can dismiss the notice nag.
180
- *
181
- * @since 2.4.0
182
- *
183
- * @var boolean
184
- */
185
- public $dismissable = true;
186
-
187
- /**
188
- * Message to be output above nag notice if dismissable is false.
189
- *
190
- * @since 2.4.0
191
- *
192
- * @var string
193
- */
194
- public $dismiss_msg = '';
195
-
196
- /**
197
- * Flag to set automatic activation of plugins. Off by default.
198
- *
199
- * @since 2.2.0
200
- *
201
- * @var boolean
202
- */
203
- public $is_automatic = false;
204
-
205
- /**
206
- * Optional message to display before the plugins table.
207
- *
208
- * @since 2.2.0
209
- *
210
- * @var string Message filtered by wp_kses_post(). Default is empty string.
211
- */
212
- public $message = '';
213
-
214
- /**
215
- * Holds configurable array of strings.
216
- *
217
- * Default values are added in the constructor.
218
- *
219
- * @since 2.0.0
220
- *
221
- * @var array
222
- */
223
- public $strings = array();
224
-
225
- /**
226
- * Holds the version of WordPress.
227
- *
228
- * @since 2.4.0
229
- *
230
- * @var int
231
- */
232
- public $wp_version;
233
-
234
- /**
235
- * Holds the hook name for the admin page.
236
- *
237
- * @since 2.5.0
238
- *
239
- * @var string
240
- */
241
- public $page_hook;
242
-
243
- /**
244
- * Adds a reference of this object to $instance, populates default strings,
245
- * does the tgmpa_init action hook, and hooks in the interactions to init.
246
- *
247
- * {@internal This method should be `protected`, but as too many TGMPA implementations
248
- * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
249
- * Reverted back to public for the time being.}}
250
- *
251
- * @since 1.0.0
252
- *
253
- * @see TGM_Plugin_Activation::init()
254
- */
255
- public function __construct() {
256
- // Set the current WordPress version.
257
- $this->wp_version = $GLOBALS['wp_version'];
258
-
259
- // Announce that the class is ready, and pass the object (for advanced use).
260
- do_action_ref_array( 'tgmpa_init', array( $this ) );
261
-
262
- /*
263
- * Load our text domain and allow for overloading the fall-back file.
264
- *
265
- * {@internal IMPORTANT! If this code changes, review the regex in the custom TGMPA
266
- * generator on the website.}}
267
- */
268
- add_action( 'init', array( $this, 'load_textdomain' ), 5 );
269
- add_filter( 'load_textdomain_mofile', array( $this, 'overload_textdomain_mofile' ), 10, 2 );
270
-
271
- // When the rest of WP has loaded, kick-start the rest of the class.
272
- add_action( 'init', array( $this, 'init' ) );
273
- }
274
-
275
- /**
276
- * Magic method to (not) set protected properties from outside of this class.
277
- *
278
- * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property
279
- * is being assigned rather than tested in a conditional, effectively rendering it useless.
280
- * This 'hack' prevents this from happening.}}
281
- *
282
- * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593
283
- *
284
- * @since 2.5.2
285
- *
286
- * @param string $name Name of an inaccessible property.
287
- * @param mixed $value Value to assign to the property.
288
- * @return void Silently fail to set the property when this is tried from outside of this class context.
289
- * (Inside this class context, the __set() method if not used as there is direct access.)
290
- */
291
- public function __set( $name, $value ) {
292
- return;
293
- }
294
-
295
- /**
296
- * Magic method to get the value of a protected property outside of this class context.
297
- *
298
- * @since 2.5.2
299
- *
300
- * @param string $name Name of an inaccessible property.
301
- * @return mixed The property value.
302
- */
303
- public function __get( $name ) {
304
- return $this->{$name};
305
- }
306
-
307
- /**
308
- * Initialise the interactions between this class and WordPress.
309
- *
310
- * Hooks in three new methods for the class: admin_menu, notices and styles.
311
- *
312
- * @since 2.0.0
313
- *
314
- * @see TGM_Plugin_Activation::admin_menu()
315
- * @see TGM_Plugin_Activation::notices()
316
- * @see TGM_Plugin_Activation::styles()
317
- */
318
- public function init() {
319
- /**
320
- * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter
321
- * you can overrule that behaviour.
322
- *
323
- * @since 2.5.0
324
- *
325
- * @param bool $load Whether or not TGMPA should load.
326
- * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
327
- */
328
- if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
329
- return;
330
- }
331
-
332
- // Load class strings.
333
- $this->strings = array(
334
- 'page_title' => __( 'Install Required Plugins', 'tgmpa' ),
335
- 'menu_title' => __( 'Install Plugins', 'tgmpa' ),
336
- /* translators: %s: plugin name. */
337
- 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ),
338
- /* translators: %s: plugin name. */
339
- 'updating' => __( 'Updating Plugin: %s', 'tgmpa' ),
340
- 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ),
341
- 'notice_can_install_required' => _n_noop(
342
- /* translators: 1: plugin name(s). */
343
- 'This theme requires the following plugin: %1$s.',
344
- 'This theme requires the following plugins: %1$s.',
345
- 'tgmpa'
346
- ),
347
- 'notice_can_install_recommended' => _n_noop(
348
- /* translators: 1: plugin name(s). */
349
- 'This theme recommends the following plugin: %1$s.',
350
- 'This theme recommends the following plugins: %1$s.',
351
- 'tgmpa'
352
- ),
353
- 'notice_ask_to_update' => _n_noop(
354
- /* translators: 1: plugin name(s). */
355
- 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
356
- 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
357
- 'tgmpa'
358
- ),
359
- 'notice_ask_to_update_maybe' => _n_noop(
360
- /* translators: 1: plugin name(s). */
361
- 'There is an update available for: %1$s.',
362
- 'There are updates available for the following plugins: %1$s.',
363
- 'tgmpa'
364
- ),
365
- 'notice_can_activate_required' => _n_noop(
366
- /* translators: 1: plugin name(s). */
367
- 'The following required plugin is currently inactive: %1$s.',
368
- 'The following required plugins are currently inactive: %1$s.',
369
- 'tgmpa'
370
- ),
371
- 'notice_can_activate_recommended' => _n_noop(
372
- /* translators: 1: plugin name(s). */
373
- 'The following recommended plugin is currently inactive: %1$s.',
374
- 'The following recommended plugins are currently inactive: %1$s.',
375
- 'tgmpa'
376
- ),
377
- 'install_link' => _n_noop(
378
- 'Begin installing plugin',
379
- 'Begin installing plugins',
380
- 'tgmpa'
381
- ),
382
- 'update_link' => _n_noop(
383
- 'Begin updating plugin',
384
- 'Begin updating plugins',
385
- 'tgmpa'
386
- ),
387
- 'activate_link' => _n_noop(
388
- 'Begin activating plugin',
389
- 'Begin activating plugins',
390
- 'tgmpa'
391
- ),
392
- 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ),
393
- 'dashboard' => __( 'Return to the Dashboard', 'tgmpa' ),
394
- 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ),
395
- 'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ),
396
- /* translators: 1: plugin name. */
397
- 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),
398
- /* translators: 1: plugin name. */
399
- 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),
400
- /* translators: 1: dashboard link. */
401
- 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
402
- 'dismiss' => __( 'Dismiss this notice', 'tgmpa' ),
403
- 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'tgmpa' ),
404
- 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),
405
- );
406
-
407
- do_action( 'tgmpa_register' );
408
-
409
- /* After this point, the plugins should be registered and the configuration set. */
410
-
411
- // Proceed only if we have plugins to handle.
412
- if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
413
- return;
414
- }
415
-
416
- // Set up the menu and notices if we still have outstanding actions.
417
- if ( true !== $this->is_tgmpa_complete() ) {
418
- // Sort the plugins.
419
- array_multisort( $this->sort_order, SORT_ASC, $this->plugins );
420
-
421
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
422
- add_action( 'admin_head', array( $this, 'dismiss' ) );
423
-
424
- // Prevent the normal links from showing underneath a single install/update page.
425
- add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
426
- add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );
427
-
428
- if ( $this->has_notices ) {
429
- add_action( 'admin_notices', array( $this, 'notices' ) );
430
- add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
431
- add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
432
- }
433
- }
434
-
435
- // If needed, filter plugin action links.
436
- add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
437
-
438
- // Make sure things get reset on switch theme.
439
- add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );
440
-
441
- if ( $this->has_notices ) {
442
- add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
443
- }
444
-
445
- // Setup the force activation hook.
446
- if ( true === $this->has_forced_activation ) {
447
- add_action( 'admin_init', array( $this, 'force_activation' ) );
448
- }
449
-
450
- // Setup the force deactivation hook.
451
- if ( true === $this->has_forced_deactivation ) {
452
- add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
453
- }
454
- }
455
-
456
- /**
457
- * Load translations.
458
- *
459
- * @since 2.6.0
460
- *
461
- * (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to
462
- * get round the different ways of handling the path and deprecated notices being thrown
463
- * and such. For plugins, the actual file name will be corrected by a filter.}}
464
- *
465
- * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
466
- * generator on the website.}}
467
- */
468
- public function load_textdomain() {
469
- if ( is_textdomain_loaded( 'tgmpa' ) ) {
470
- return;
471
- }
472
-
473
- if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
474
- // Plugin, we'll need to adjust the file name.
475
- add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );
476
- load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
477
- remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );
478
- } else {
479
- load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
480
- }
481
- }
482
-
483
- /**
484
- * Correct the .mo file name for (must-use) plugins.
485
- *
486
- * Themese use `/path/{locale}.mo` while plugins use `/path/{text-domain}-{locale}.mo`.
487
- *
488
- * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
489
- * generator on the website.}}
490
- *
491
- * @since 2.6.0
492
- *
493
- * @param string $mofile Full path to the target mofile.
494
- * @param string $domain The domain for which a language file is being loaded.
495
- * @return string $mofile
496
- */
497
- public function correct_plugin_mofile( $mofile, $domain ) {
498
- // Exit early if not our domain (just in case).
499
- if ( 'tgmpa' !== $domain ) {
500
- return $mofile;
501
- }
502
- return preg_replace( '`/([a-z]{2}_[A-Z]{2}.mo)$`', '/tgmpa-$1', $mofile );
503
- }
504
-
505
- /**
506
- * Potentially overload the fall-back translation file for the current language.
507
- *
508
- * WP, by default since WP 3.7, will load a local translation first and if none
509
- * can be found, will try and find a translation in the /wp-content/languages/ directory.
510
- * As this library is theme/plugin agnostic, translation files for TGMPA can exist both
511
- * in the WP_LANG_DIR /plugins/ subdirectory as well as in the /themes/ subdirectory.
512
- *
513
- * This method makes sure both directories are checked.
514
- *
515
- * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
516
- * generator on the website.}}
517
- *
518
- * @since 2.6.0
519
- *
520
- * @param string $mofile Full path to the target mofile.
521
- * @param string $domain The domain for which a language file is being loaded.
522
- * @return string $mofile
523
- */
524
- public function overload_textdomain_mofile( $mofile, $domain ) {
525
- // Exit early if not our domain, not a WP_LANG_DIR load or if the file exists and is readable.
526
- if ( 'tgmpa' !== $domain || false === strpos( $mofile, WP_LANG_DIR ) || @is_readable( $mofile ) ) {
527
- return $mofile;
528
- }
529
-
530
- // Current fallback file is not valid, let's try the alternative option.
531
- if ( false !== strpos( $mofile, '/themes/' ) ) {
532
- return str_replace( '/themes/', '/plugins/', $mofile );
533
- } elseif ( false !== strpos( $mofile, '/plugins/' ) ) {
534
- return str_replace( '/plugins/', '/themes/', $mofile );
535
- } else {
536
- return $mofile;
537
- }
538
- }
539
-
540
- /**
541
- * Hook in plugin action link filters for the WP native plugins page.
542
- *
543
- * - Prevent activation of plugins which don't meet the minimum version requirements.
544
- * - Prevent deactivation of force-activated plugins.
545
- * - Add update notice if update available.
546
- *
547
- * @since 2.5.0
548
- */
549
- public function add_plugin_action_link_filters() {
550
- foreach ( $this->plugins as $slug => $plugin ) {
551
- if ( false === $this->can_plugin_activate( $slug ) ) {
552
- add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
553
- }
554
-
555
- if ( true === $plugin['force_activation'] ) {
556
- add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
557
- }
558
-
559
- if ( false !== $this->does_plugin_require_update( $slug ) ) {
560
- add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
561
- }
562
- }
563
- }
564
-
565
- /**
566
- * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the
567
- * minimum version requirements.
568
- *
569
- * @since 2.5.0
570
- *
571
- * @param array $actions Action links.
572
- * @return array
573
- */
574
- public function filter_plugin_action_links_activate( $actions ) {
575
- unset( $actions['activate'] );
576
-
577
- return $actions;
578
- }
579
-
580
- /**
581
- * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.
582
- *
583
- * @since 2.5.0
584
- *
585
- * @param array $actions Action links.
586
- * @return array
587
- */
588
- public function filter_plugin_action_links_deactivate( $actions ) {
589
- unset( $actions['deactivate'] );
590
-
591
- return $actions;
592
- }
593
-
594
- /**
595
- * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the
596
- * minimum version requirements.
597
- *
598
- * @since 2.5.0
599
- *
600
- * @param array $actions Action links.
601
- * @return array
602
- */
603
- public function filter_plugin_action_links_update( $actions ) {
604
- $actions['update'] = sprintf(
605
- '<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
606
- esc_url( $this->get_tgmpa_status_url( 'update' ) ),
607
- esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ),
608
- esc_html__( 'Update Required', 'tgmpa' )
609
- );
610
-
611
- return $actions;
612
- }
613
-
614
- /**
615
- * Handles calls to show plugin information via links in the notices.
616
- *
617
- * We get the links in the admin notices to point to the TGMPA page, rather
618
- * than the typical plugin-install.php file, so we can prepare everything
619
- * beforehand.
620
- *
621
- * WP does not make it easy to show the plugin information in the thickbox -
622
- * here we have to require a file that includes a function that does the
623
- * main work of displaying it, enqueue some styles, set up some globals and
624
- * finally call that function before exiting.
625
- *
626
- * Down right easy once you know how...
627
- *
628
- * Returns early if not the TGMPA page.
629
- *
630
- * @since 2.1.0
631
- *
632
- * @global string $tab Used as iframe div class names, helps with styling
633
- * @global string $body_id Used as the iframe body ID, helps with styling
634
- *
635
- * @return null Returns early if not the TGMPA page.
636
- */
637
- public function admin_init() {
638
- if ( ! $this->is_tgmpa_page() ) {
639
- return;
640
- }
641
-
642
- if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
643
- // Needed for install_plugin_information().
644
- require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
645
-
646
- wp_enqueue_style( 'plugin-install' );
647
-
648
- global $tab, $body_id;
649
- $body_id = 'plugin-information';
650
- // @codingStandardsIgnoreStart
651
- $tab = 'plugin-information';
652
- // @codingStandardsIgnoreEnd
653
-
654
- install_plugin_information();
655
-
656
- exit;
657
- }
658
- }
659
-
660
- /**
661
- * Enqueue thickbox scripts/styles for plugin info.
662
- *
663
- * Thickbox is not automatically included on all admin pages, so we must
664
- * manually enqueue it for those pages.
665
- *
666
- * Thickbox is only loaded if the user has not dismissed the admin
667
- * notice or if there are any plugins left to install and activate.
668
- *
669
- * @since 2.1.0
670
- */
671
- public function thickbox() {
672
- if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
673
- add_thickbox();
674
- }
675
- }
676
-
677
- /**
678
- * Adds submenu page if there are plugin actions to take.
679
- *
680
- * This method adds the submenu page letting users know that a required
681
- * plugin needs to be installed.
682
- *
683
- * This page disappears once the plugin has been installed and activated.
684
- *
685
- * @since 1.0.0
686
- *
687
- * @see TGM_Plugin_Activation::init()
688
- * @see TGM_Plugin_Activation::install_plugins_page()
689
- *
690
- * @return null Return early if user lacks capability to install a plugin.
691
- */
692
- public function admin_menu() {
693
- // Make sure privileges are correct to see the page.
694
- if ( ! current_user_can( 'install_plugins' ) ) {
695
- return;
696
- }
697
-
698
- $args = apply_filters(
699
- 'tgmpa_admin_menu_args',
700
- array(
701
- 'parent_slug' => $this->parent_slug, // Parent Menu slug.
702
- 'page_title' => $this->strings['page_title'], // Page title.
703
- 'menu_title' => $this->strings['menu_title'], // Menu title.
704
- 'capability' => $this->capability, // Capability.
705
- 'menu_slug' => $this->menu, // Menu slug.
706
- 'function' => array( $this, 'install_plugins_page' ), // Callback.
707
- )
708
- );
709
-
710
- $this->add_admin_menu( $args );
711
- }
712
-
713
- /**
714
- * Add the menu item.
715
- *
716
- * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
717
- * generator on the website.}}
718
- *
719
- * @since 2.5.0
720
- *
721
- * @param array $args Menu item configuration.
722
- */
723
- protected function add_admin_menu( array $args ) {
724
- if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
725
- _deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) );
726
- }
727
-
728
- if ( 'themes.php' === $this->parent_slug ) {
729
- $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
730
- } else {
731
- $this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
732
- }
733
- }
734
-
735
- /**
736
- * Echoes plugin installation form.
737
- *
738
- * This method is the callback for the admin_menu method function.
739
- * This displays the admin page and form area where the user can select to install and activate the plugin.
740
- * Aborts early if we're processing a plugin installation action.
741
- *
742
- * @since 1.0.0
743
- *
744
- * @return null Aborts early if we're processing a plugin installation action.
745
- */
746
- public function install_plugins_page() {
747
- // Store new instance of plugin table in object.
748
- $plugin_table = new TGMPA_List_Table;
749
-
750
- // Return early if processing a plugin installation action.
751
- if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
752
- return;
753
- }
754
-
755
- // Force refresh of available plugin information so we'll know about manual updates/deletes.
756
- wp_clean_plugins_cache( false );
757
-
758
- ?>
759
- <div class="tgmpa wrap">
760
- <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
761
- <?php $plugin_table->prepare_items(); ?>
762
-
763
- <?php
764
- if ( ! empty( $this->message ) && is_string( $this->message ) ) {
765
- echo wp_kses_post( $this->message );
766
- }
767
- ?>
768
- <?php $plugin_table->views(); ?>
769
-
770
- <form id="tgmpa-plugins" action="" method="post">
771
- <input type="hidden" name="tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>" />
772
- <input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
773
- <?php $plugin_table->display(); ?>
774
- </form>
775
- </div>
776
- <?php
777
- }
778
-
779
- /**
780
- * Installs, updates or activates a plugin depending on the action link clicked by the user.
781
- *
782
- * Checks the $_GET variable to see which actions have been
783
- * passed and responds with the appropriate method.
784
- *
785
- * Uses WP_Filesystem to process and handle the plugin installation
786
- * method.
787
- *
788
- * @since 1.0.0
789
- *
790
- * @uses WP_Filesystem
791
- * @uses WP_Error
792
- * @uses WP_Upgrader
793
- * @uses Plugin_Upgrader
794
- * @uses Plugin_Installer_Skin
795
- * @uses Plugin_Upgrader_Skin
796
- *
797
- * @return boolean True on success, false on failure.
798
- */
799
- protected function do_plugin_install() {
800
- if ( empty( $_GET['plugin'] ) ) {
801
- return false;
802
- }
803
-
804
- // All plugin information will be stored in an array for processing.
805
- $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
806
-
807
- if ( ! isset( $this->plugins[ $slug ] ) ) {
808
- return false;
809
- }
810
-
811
- // Was an install or upgrade action link clicked?
812
- if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
813
-
814
- $install_type = 'install';
815
- if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
816
- $install_type = 'update';
817
- }
818
-
819
- check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
820
-
821
- // Pass necessary information via URL if WP_Filesystem is needed.
822
- $url = wp_nonce_url(
823
- add_query_arg(
824
- array(
825
- 'plugin' => urlencode( $slug ),
826
- 'tgmpa-' . $install_type => $install_type . '-plugin',
827
- ),
828
- $this->get_tgmpa_url()
829
- ),
830
- 'tgmpa-' . $install_type,
831
- 'tgmpa-nonce'
832
- );
833
-
834
- $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
835
-
836
- if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {
837
- return true;
838
- }
839
-
840
- if ( ! WP_Filesystem( $creds ) ) {
841
- request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
842
- return true;
843
- }
844
-
845
- /* If we arrive here, we have the filesystem. */
846
-
847
- // Prep variables for Plugin_Installer_Skin class.
848
- $extra = array();
849
- $extra['slug'] = $slug; // Needed for potentially renaming of directory name.
850
- $source = $this->get_download_url( $slug );
851
- $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
852
- $api = ( false !== $api ) ? $api : null;
853
-
854
- $url = add_query_arg(
855
- array(
856
- 'action' => $install_type . '-plugin',
857
- 'plugin' => urlencode( $slug ),
858
- ),
859
- 'update.php'
860
- );
861
-
862
- if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
863
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
864
- }
865
-
866
- $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
867
- $skin_args = array(
868
- 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
869
- 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ),
870
- 'url' => esc_url_raw( $url ),
871
- 'nonce' => $install_type . '-plugin_' . $slug,
872
- 'plugin' => '',
873
- 'api' => $api,
874
- 'extra' => $extra,
875
- );
876
- unset( $title );
877
-
878
- if ( 'update' === $install_type ) {
879
- $skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
880
- $skin = new Plugin_Upgrader_Skin( $skin_args );
881
- } else {
882
- $skin = new Plugin_Installer_Skin( $skin_args );
883
- }
884
-
885
- // Create a new instance of Plugin_Upgrader.
886
- $upgrader = new Plugin_Upgrader( $skin );
887
-
888
- // Perform the action and install the plugin from the $source urldecode().
889
- add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
890
-
891
- if ( 'update' === $install_type ) {
892
- // Inject our info into the update transient.
893
- $to_inject = array( $slug => $this->plugins[ $slug ] );
894
- $to_inject[ $slug ]['source'] = $source;
895
- $this->inject_update_info( $to_inject );
896
-
897
- $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
898
- } else {
899
- $upgrader->install( $source );
900
- }
901
-
902
- remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 );
903
-
904
- // Make sure we have the correct file path now the plugin is installed/updated.
905
- $this->populate_file_path( $slug );
906
-
907
- // Only activate plugins if the config option is set to true and the plugin isn't
908
- // already active (upgrade).
909
- if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
910
- $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
911
- if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
912
- return true; // Finish execution of the function early as we encountered an error.
913
- }
914
- }
915
-
916
- $this->show_tgmpa_version();
917
-
918
- // Display message based on if all plugins are now active or not.
919
- if ( $this->is_tgmpa_complete() ) {
920
- echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';
921
- echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
922
- } else {
923
- echo '<p><a href="admin.php?page=newsletter_main_extensions" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
924
- }
925
-
926
- return true;
927
- } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
928
- // Activate action link was clicked.
929
- check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
930
-
931
- if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
932
- return true; // Finish execution of the function early as we encountered an error.
933
- }
934
- }
935
-
936
- return false;
937
- }
938
-
939
- /**
940
- * Inject information into the 'update_plugins' site transient as WP checks that before running an update.
941
- *
942
- * @since 2.5.0
943
- *
944
- * @param array $plugins The plugin information for the plugins which are to be updated.
945
- */
946
- public function inject_update_info( $plugins ) {
947
- $repo_updates = get_site_transient( 'update_plugins' );
948
-
949
- if ( ! is_object( $repo_updates ) ) {
950
- $repo_updates = new stdClass;
951
- }
952
-
953
- foreach ( $plugins as $slug => $plugin ) {
954
- $file_path = $plugin['file_path'];
955
-
956
- if ( empty( $repo_updates->response[ $file_path ] ) ) {
957
- $repo_updates->response[ $file_path ] = new stdClass;
958
- }
959
-
960
- // We only really need to set package, but let's do all we can in case WP changes something.
961
- $repo_updates->response[ $file_path ]->slug = $slug;
962
- $repo_updates->response[ $file_path ]->plugin = $file_path;
963
- $repo_updates->response[ $file_path ]->new_version = $plugin['version'];
964
- $repo_updates->response[ $file_path ]->package = $plugin['source'];
965
- if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
966
- $repo_updates->response[ $file_path ]->url = $plugin['external_url'];
967
- }
968
- }
969
-
970
- set_site_transient( 'update_plugins', $repo_updates );
971
- }
972
-
973
- /**
974
- * Adjust the plugin directory name if necessary.
975
- *
976
- * The final destination directory of a plugin is based on the subdirectory name found in the
977
- * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this
978
- * subdirectory name is not the same as the expected slug and the plugin will not be recognized
979
- * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to
980
- * the expected plugin slug.
981
- *
982
- * @since 2.5.0
983
- *
984
- * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
985
- * @param string $remote_source Path to upgrade/zip-file-name.tmp.
986
- * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
987
- * @return string $source
988
- */
989
- public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
990
- if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
991
- return $source;
992
- }
993
-
994
- // Check for single file plugins.
995
- $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
996
- if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
997
- return $source;
998
- }
999
-
1000
- // Multi-file plugin, let's see if the directory is correctly named.
1001
- $desired_slug = '';
1002
-
1003
- // Figure out what the slug is supposed to be.
1004
- if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
1005
- $desired_slug = $upgrader->skin->options['extra']['slug'];
1006
- } else {
1007
- // Bulk installer contains less info, so fall back on the info registered here.
1008
- foreach ( $this->plugins as $slug => $plugin ) {
1009
- if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
1010
- $desired_slug = $slug;
1011
- break;
1012
- }
1013
- }
1014
- unset( $slug, $plugin );
1015
- }
1016
-
1017
- if ( ! empty( $desired_slug ) ) {
1018
- $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
1019
-
1020
- if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1021
- $from_path = untrailingslashit( $source );
1022
- $to_path = trailingslashit( $remote_source ) . $desired_slug;
1023
-
1024
- if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
1025
- return trailingslashit( $to_path );
1026
- } else {
1027
- return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
1028
- }
1029
- } elseif ( empty( $subdir_name ) ) {
1030
- return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
1031
- }
1032
- }
1033
-
1034
- return $source;
1035
- }
1036
-
1037
- /**
1038
- * Activate a single plugin and send feedback about the result to the screen.
1039
- *
1040
- * @since 2.5.0
1041
- *
1042
- * @param string $file_path Path within wp-plugins/ to main plugin file.
1043
- * @param string $slug Plugin slug.
1044
- * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false.
1045
- * This determines the styling of the output messages.
1046
- * @return bool False if an error was encountered, true otherwise.
1047
- */
1048
- protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
1049
- if ( $this->can_plugin_activate( $slug ) ) {
1050
- $activate = activate_plugin( $file_path );
1051
-
1052
- if ( is_wp_error( $activate ) ) {
1053
- echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
1054
- '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
1055
-
1056
- return false; // End it here if there is an error with activation.
1057
- } else {
1058
- if ( ! $automatic ) {
1059
- // Make sure message doesn't display again if bulk activation is performed
1060
- // immediately after a single activation.
1061
- if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1062
- echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
1063
- }
1064
- } else {
1065
- // Simpler message layout for use on the plugin install page.
1066
- echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
1067
- }
1068
- }
1069
- } elseif ( $this->is_plugin_active( $slug ) ) {
1070
- // No simpler message format provided as this message should never be encountered
1071
- // on the plugin install page.
1072
- echo '<div id="message" class="error"><p>',
1073
- sprintf(
1074
- esc_html( $this->strings['plugin_already_active'] ),
1075
- '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1076
- ),
1077
- '</p></div>';
1078
- } elseif ( $this->does_plugin_require_update( $slug ) ) {
1079
- if ( ! $automatic ) {
1080
- // Make sure message doesn't display again if bulk activation is performed
1081
- // immediately after a single activation.
1082
- if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1083
- echo '<div id="message" class="error"><p>',
1084
- sprintf(
1085
- esc_html( $this->strings['plugin_needs_higher_version'] ),
1086
- '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1087
- ),
1088
- '</p></div>';
1089
- }
1090
- } else {
1091
- // Simpler message layout for use on the plugin install page.
1092
- echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
1093
- }
1094
- }
1095
-
1096
- return true;
1097
- }
1098
-
1099
- /**
1100
- * Echoes required plugin notice.
1101
- *
1102
- * Outputs a message telling users that a specific plugin is required for
1103
- * their theme. If appropriate, it includes a link to the form page where
1104
- * users can install and activate the plugin.
1105
- *
1106
- * Returns early if we're on the Install page.
1107
- *
1108
- * @since 1.0.0
1109
- *
1110
- * @global object $current_screen
1111
- *
1112
- * @return null Returns early if we're on the Install page.
1113
- */
1114
- public function notices() {
1115
- // Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
1116
- if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) {
1117
- return;
1118
- }
1119
-
1120
- // Store for the plugin slugs by message type.
1121
- $message = array();
1122
-
1123
- // Initialize counters used to determine plurality of action link texts.
1124
- $install_link_count = 0;
1125
- $update_link_count = 0;
1126
- $activate_link_count = 0;
1127
- $total_required_action_count = 0;
1128
-
1129
- foreach ( $this->plugins as $slug => $plugin ) {
1130
- if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
1131
- continue;
1132
- }
1133
-
1134
- if ( ! $this->is_plugin_installed( $slug ) ) {
1135
- if ( current_user_can( 'install_plugins' ) ) {
1136
- $install_link_count++;
1137
-
1138
- if ( true === $plugin['required'] ) {
1139
- $message['notice_can_install_required'][] = $slug;
1140
- } else {
1141
- $message['notice_can_install_recommended'][] = $slug;
1142
- }
1143
- }
1144
- if ( true === $plugin['required'] ) {
1145
- $total_required_action_count++;
1146
- }
1147
- } else {
1148
- if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
1149
- if ( current_user_can( 'activate_plugins' ) ) {
1150
- $activate_link_count++;
1151
-
1152
- if ( true === $plugin['required'] ) {
1153
- $message['notice_can_activate_required'][] = $slug;
1154
- } else {
1155
- $message['notice_can_activate_recommended'][] = $slug;
1156
- }
1157
- }
1158
- if ( true === $plugin['required'] ) {
1159
- $total_required_action_count++;
1160
- }
1161
- }
1162
-
1163
- if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1164
-
1165
- if ( current_user_can( 'update_plugins' ) ) {
1166
- $update_link_count++;
1167
-
1168
- if ( $this->does_plugin_require_update( $slug ) ) {
1169
- $message['notice_ask_to_update'][] = $slug;
1170
- } elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
1171
- $message['notice_ask_to_update_maybe'][] = $slug;
1172
- }
1173
- }
1174
- if ( true === $plugin['required'] ) {
1175
- $total_required_action_count++;
1176
- }
1177
- }
1178
- }
1179
- }
1180
- unset( $slug, $plugin );
1181
-
1182
- // If we have notices to display, we move forward.
1183
- if ( ! empty( $message ) || $total_required_action_count > 0 ) {
1184
- krsort( $message ); // Sort messages.
1185
- $rendered = '';
1186
-
1187
- // As add_settings_error() wraps the final message in a <p> and as the final message can't be
1188
- // filtered, using <p>'s in our html would render invalid html output.
1189
- $line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
1190
-
1191
- if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
1192
- $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] );
1193
- $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
1194
- } else {
1195
-
1196
- // If dismissable is false and a message is set, output it now.
1197
- if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
1198
- $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
1199
- }
1200
-
1201
- // Render the individual message lines for the notice.
1202
- foreach ( $message as $type => $plugin_group ) {
1203
- $linked_plugins = array();
1204
-
1205
- // Get the external info link for a plugin if one is available.
1206
- foreach ( $plugin_group as $plugin_slug ) {
1207
- $linked_plugins[] = $this->get_info_link( $plugin_slug );
1208
- }
1209
- unset( $plugin_slug );
1210
-
1211
- $count = count( $plugin_group );
1212
- $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
1213
- $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
1214
- $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
1215
-
1216
- $rendered .= sprintf(
1217
- $line_template,
1218
- sprintf(
1219
- translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ),
1220
- $imploded,
1221
- $count
1222
- )
1223
- );
1224
-
1225
- }
1226
- unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );
1227
-
1228
- $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template );
1229
- }
1230
-
1231
- // Register the nag messages and prepare them to be processed.
1232
- add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() );
1233
- }
1234
-
1235
- // Admin options pages already output settings_errors, so this is to avoid duplication.
1236
- if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
1237
- $this->display_settings_errors();
1238
- }
1239
- }
1240
-
1241
- /**
1242
- * Generate the user action links for the admin notice.
1243
- *
1244
- * @since 2.6.0
1245
- *
1246
- * @param int $install_count Number of plugins to install.
1247
- * @param int $update_count Number of plugins to update.
1248
- * @param int $activate_count Number of plugins to activate.
1249
- * @param int $line_template Template for the HTML tag to output a line.
1250
- * @return string Action links.
1251
- */
1252
- protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) {
1253
- // Setup action links.
1254
- $action_links = array(
1255
- 'install' => '',
1256
- 'update' => '',
1257
- 'activate' => '',
1258
- 'dismiss' => $this->dismissable ? '<a href="' . esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ), 'tgmpa-dismiss-' . get_current_user_id() ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
1259
- );
1260
-
1261
- $link_template = '<a href="%2$s">%1$s</a>';
1262
-
1263
- if ( current_user_can( 'install_plugins' ) ) {
1264
- if ( $install_count > 0 ) {
1265
- $action_links['install'] = sprintf(
1266
- $link_template,
1267
- translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ),
1268
- esc_url( $this->get_tgmpa_status_url( 'install' ) )
1269
- );
1270
- }
1271
- if ( $update_count > 0 ) {
1272
- $action_links['update'] = sprintf(
1273
- $link_template,
1274
- translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ),
1275
- esc_url( $this->get_tgmpa_status_url( 'update' ) )
1276
- );
1277
- }
1278
- }
1279
-
1280
- if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
1281
- $action_links['activate'] = sprintf(
1282
- $link_template,
1283
- translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ),
1284
- esc_url( $this->get_tgmpa_status_url( 'activate' ) )
1285
- );
1286
- }
1287
-
1288
- $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );
1289
-
1290
- $action_links = array_filter( (array) $action_links ); // Remove any empty array items.
1291
-
1292
- if ( ! empty( $action_links ) ) {
1293
- $action_links = sprintf( $line_template, implode( ' | ', $action_links ) );
1294
- return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );
1295
- } else {
1296
- return '';
1297
- }
1298
- }
1299
-
1300
- /**
1301
- * Get admin notice class.
1302
- *
1303
- * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7
1304
- * (lowest supported version by TGMPA).
1305
- *
1306
- * @since 2.6.0
1307
- *
1308
- * @return string
1309
- */
1310
- protected function get_admin_notice_class() {
1311
- if ( ! empty( $this->strings['nag_type'] ) ) {
1312
- return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
1313
- } else {
1314
- if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
1315
- return 'notice-warning';
1316
- } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) {
1317
- return 'notice';
1318
- } else {
1319
- return 'updated';
1320
- }
1321
- }
1322
- }
1323
-
1324
- /**
1325
- * Display settings errors and remove those which have been displayed to avoid duplicate messages showing
1326
- *
1327
- * @since 2.5.0
1328
- */
1329
- protected function display_settings_errors() {
1330
- global $wp_settings_errors;
1331
-
1332
- settings_errors( 'tgmpa' );
1333
-
1334
- foreach ( (array) $wp_settings_errors as $key => $details ) {
1335
- if ( 'tgmpa' === $details['setting'] ) {
1336
- unset( $wp_settings_errors[ $key ] );
1337
- break;
1338
- }
1339
- }
1340
- }
1341
-
1342
- /**
1343
- * Register dismissal of admin notices.
1344
- *
1345
- * Acts on the dismiss link in the admin nag messages.
1346
- * If clicked, the admin notice disappears and will no longer be visible to this user.
1347
- *
1348
- * @since 2.1.0
1349
- */
1350
- public function dismiss() {
1351
- if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) {
1352
- update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
1353
- }
1354
- }
1355
-
1356
- /**
1357
- * Add individual plugin to our collection of plugins.
1358
- *
1359
- * If the required keys are not set or the plugin has already
1360
- * been registered, the plugin is not added.
1361
- *
1362
- * @since 2.0.0
1363
- *
1364
- * @param array|null $plugin Array of plugin arguments or null if invalid argument.
1365
- * @return null Return early if incorrect argument.
1366
- */
1367
- public function register( $plugin ) {
1368
- if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
1369
- return;
1370
- }
1371
-
1372
- if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
1373
- return;
1374
- }
1375
-
1376
- $defaults = array(
1377
- 'name' => '', // String
1378
- 'slug' => '', // String
1379
- 'source' => 'repo', // String
1380
- 'required' => false, // Boolean
1381
- 'version' => '', // String
1382
- 'force_activation' => false, // Boolean
1383
- 'force_deactivation' => false, // Boolean
1384
- 'external_url' => '', // String
1385
- 'is_callable' => '', // String|Array.
1386
- );
1387
-
1388
- // Prepare the received data.
1389
- $plugin = wp_parse_args( $plugin, $defaults );
1390
-
1391
- // Standardize the received slug.
1392
- $plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
1393
-
1394
- // Forgive users for using string versions of booleans or floats for version number.
1395
- $plugin['version'] = (string) $plugin['version'];
1396
- $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
1397
- $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] );
1398
- $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
1399
- $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
1400
-
1401
- // Enrich the received data.
1402
- $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
1403
- $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
1404
-
1405
- // Set the class properties.
1406
- $this->plugins[ $plugin['slug'] ] = $plugin;
1407
- $this->sort_order[ $plugin['slug'] ] = $plugin['name'];
1408
-
1409
- // Should we add the force activation hook ?
1410
- if ( true === $plugin['force_activation'] ) {
1411
- $this->has_forced_activation = true;
1412
- }
1413
-
1414
- // Should we add the force deactivation hook ?
1415
- if ( true === $plugin['force_deactivation'] ) {
1416
- $this->has_forced_deactivation = true;
1417
- }
1418
- }
1419
-
1420
- /**
1421
- * Determine what type of source the plugin comes from.
1422
- *
1423
- * @since 2.5.0
1424
- *
1425
- * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path
1426
- * (= bundled) or an external URL.
1427
- * @return string 'repo', 'external', or 'bundled'
1428
- */
1429
- protected function get_plugin_source_type( $source ) {
1430
- if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
1431
- return 'repo';
1432
- } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
1433
- return 'external';
1434
- } else {
1435
- return 'bundled';
1436
- }
1437
- }
1438
-
1439
- /**
1440
- * Sanitizes a string key.
1441
- *
1442
- * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*
1443
- * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase
1444
- * characters in the plugin directory path/slug. Silly them.
1445
- *
1446
- * @see https://developer.wordpress.org/reference/hooks/sanitize_key/
1447
- *
1448
- * @since 2.5.0
1449
- *
1450
- * @param string $key String key.
1451
- * @return string Sanitized key
1452
- */
1453
- public function sanitize_key( $key ) {
1454
- $raw_key = $key;
1455
- $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
1456
-
1457
- /**
1458
- * Filter a sanitized key string.
1459
- *
1460
- * @since 2.5.0
1461
- *
1462
- * @param string $key Sanitized key.
1463
- * @param string $raw_key The key prior to sanitization.
1464
- */
1465
- return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
1466
- }
1467
-
1468
- /**
1469
- * Amend default configuration settings.
1470
- *
1471
- * @since 2.0.0
1472
- *
1473
- * @param array $config Array of config options to pass as class properties.
1474
- */
1475
- public function config( $config ) {
1476
- $keys = array(
1477
- 'id',
1478
- 'default_path',
1479
- 'has_notices',
1480
- 'dismissable',
1481
- 'dismiss_msg',
1482
- 'menu',
1483
- 'parent_slug',
1484
- 'capability',
1485
- 'is_automatic',
1486
- 'message',
1487
- 'strings',
1488
- );
1489
-
1490
- foreach ( $keys as $key ) {
1491
- if ( isset( $config[ $key ] ) ) {
1492
- if ( is_array( $config[ $key ] ) ) {
1493
- $this->$key = array_merge( $this->$key, $config[ $key ] );
1494
- } else {
1495
- $this->$key = $config[ $key ];
1496
- }
1497
- }
1498
- }
1499
- }
1500
-
1501
- /**
1502
- * Amend action link after plugin installation.
1503
- *
1504
- * @since 2.0.0
1505
- *
1506
- * @param array $install_actions Existing array of actions.
1507
- * @return false|array Amended array of actions.
1508
- */
1509
- public function actions( $install_actions ) {
1510
- // Remove action links on the TGMPA install page.
1511
- if ( $this->is_tgmpa_page() ) {
1512
- return false;
1513
- }
1514
-
1515
- return $install_actions;
1516
- }
1517
-
1518
- /**
1519
- * Flushes the plugins cache on theme switch to prevent stale entries
1520
- * from remaining in the plugin table.
1521
- *
1522
- * @since 2.4.0
1523
- *
1524
- * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
1525
- * Parameter added in v2.5.0.
1526
- */
1527
- public function flush_plugins_cache( $clear_update_cache = true ) {
1528
- wp_clean_plugins_cache( $clear_update_cache );
1529
- }
1530
-
1531
- /**
1532
- * Set file_path key for each installed plugin.
1533
- *
1534
- * @since 2.1.0
1535
- *
1536
- * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
1537
- * Parameter added in v2.5.0.
1538
- */
1539
- public function populate_file_path( $plugin_slug = '' ) {
1540
- if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
1541
- $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1542
- } else {
1543
- // Add file_path key for all plugins.
1544
- foreach ( $this->plugins as $slug => $values ) {
1545
- $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
1546
- }
1547
- }
1548
- }
1549
-
1550
- /**
1551
- * Helper function to extract the file path of the plugin file from the
1552
- * plugin slug, if the plugin is installed.
1553
- *
1554
- * @since 2.0.0
1555
- *
1556
- * @param string $slug Plugin slug (typically folder name) as provided by the developer.
1557
- * @return string Either file path for plugin if installed, or just the plugin slug.
1558
- */
1559
- protected function _get_plugin_basename_from_slug( $slug ) {
1560
- $keys = array_keys( $this->get_plugins() );
1561
-
1562
- foreach ( $keys as $key ) {
1563
- if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1564
- return $key;
1565
- }
1566
- }
1567
-
1568
- return $slug;
1569
- }
1570
-
1571
- /**
1572
- * Retrieve plugin data, given the plugin name.
1573
- *
1574
- * Loops through the registered plugins looking for $name. If it finds it,
1575
- * it returns the $data from that plugin. Otherwise, returns false.
1576
- *
1577
- * @since 2.1.0
1578
- *
1579
- * @param string $name Name of the plugin, as it was registered.
1580
- * @param string $data Optional. Array key of plugin data to return. Default is slug.
1581
- * @return string|boolean Plugin slug if found, false otherwise.
1582
- */
1583
- public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
1584
- foreach ( $this->plugins as $values ) {
1585
- if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
1586
- return $values[ $data ];
1587
- }
1588
- }
1589
-
1590
- return false;
1591
- }
1592
-
1593
- /**
1594
- * Retrieve the download URL for a package.
1595
- *
1596
- * @since 2.5.0
1597
- *
1598
- * @param string $slug Plugin slug.
1599
- * @return string Plugin download URL or path to local file or empty string if undetermined.
1600
- */
1601
- public function get_download_url( $slug ) {
1602
- $dl_source = '';
1603
-
1604
- switch ( $this->plugins[ $slug ]['source_type'] ) {
1605
- case 'repo':
1606
- return $this->get_wp_repo_download_url( $slug );
1607
- case 'external':
1608
- return $this->plugins[ $slug ]['source'];
1609
- case 'bundled':
1610
- return $this->default_path . $this->plugins[ $slug ]['source'];
1611
- }
1612
-
1613
- return $dl_source; // Should never happen.
1614
- }
1615
-
1616
- /**
1617
- * Retrieve the download URL for a WP repo package.
1618
- *
1619
- * @since 2.5.0
1620
- *
1621
- * @param string $slug Plugin slug.
1622
- * @return string Plugin download URL.
1623
- */
1624
- protected function get_wp_repo_download_url( $slug ) {
1625
- $source = '';
1626
- $api = $this->get_plugins_api( $slug );
1627
-
1628
- if ( false !== $api && isset( $api->download_link ) ) {
1629
- $source = $api->download_link;
1630
- }
1631
-
1632
- return $source;
1633
- }
1634
-
1635
- /**
1636
- * Try to grab information from WordPress API.
1637
- *
1638
- * @since 2.5.0
1639
- *
1640
- * @param string $slug Plugin slug.
1641
- * @return object Plugins_api response object on success, WP_Error on failure.
1642
- */
1643
- protected function get_plugins_api( $slug ) {
1644
- static $api = array(); // Cache received responses.
1645
-
1646
- if ( ! isset( $api[ $slug ] ) ) {
1647
- if ( ! function_exists( 'plugins_api' ) ) {
1648
- require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
1649
- }
1650
-
1651
- $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
1652
-
1653
- $api[ $slug ] = false;
1654
-
1655
- if ( is_wp_error( $response ) ) {
1656
- wp_die( esc_html( $this->strings['oops'] ) );
1657
- } else {
1658
- $api[ $slug ] = $response;
1659
- }
1660
- }
1661
-
1662
- return $api[ $slug ];
1663
- }
1664
-
1665
- /**
1666
- * Retrieve a link to a plugin information page.
1667
- *
1668
- * @since 2.5.0
1669
- *
1670
- * @param string $slug Plugin slug.
1671
- * @return string Fully formed html link to a plugin information page if available
1672
- * or the plugin name if not.
1673
- */
1674
- public function get_info_link( $slug ) {
1675
- if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
1676
- $link = sprintf(
1677
- '<a href="%1$s" target="_blank">%2$s</a>',
1678
- esc_url( $this->plugins[ $slug ]['external_url'] ),
1679
- esc_html( $this->plugins[ $slug ]['name'] )
1680
- );
1681
- } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
1682
- $url = add_query_arg(
1683
- array(
1684
- 'tab' => 'plugin-information',
1685
- 'plugin' => urlencode( $slug ),
1686
- 'TB_iframe' => 'true',
1687
- 'width' => '640',
1688
- 'height' => '500',
1689
- ),
1690
- self_admin_url( 'plugin-install.php' )
1691
- );
1692
-
1693
- $link = sprintf(
1694
- '<a href="%1$s" class="thickbox">%2$s</a>',
1695
- esc_url( $url ),
1696
- esc_html( $this->plugins[ $slug ]['name'] )
1697
- );
1698
- } else {
1699
- $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
1700
- }
1701
-
1702
- return $link;
1703
- }
1704
-
1705
- /**
1706
- * Determine if we're on the TGMPA Install page.
1707
- *
1708
- * @since 2.1.0
1709
- *
1710
- * @return boolean True when on the TGMPA page, false otherwise.
1711
- */
1712
- protected function is_tgmpa_page() {
1713
- return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
1714
- }
1715
-
1716
- /**
1717
- * Determine if we're on a WP Core installation/upgrade page.
1718
- *
1719
- * @since 2.6.0
1720
- *
1721
- * @return boolean True when on a WP Core installation/upgrade page, false otherwise.
1722
- */
1723
- protected function is_core_update_page() {
1724
- // Current screen is not always available, most notably on the customizer screen.
1725
- if ( ! function_exists( 'get_current_screen' ) ) {
1726
- return false;
1727
- }
1728
-
1729
- $screen = get_current_screen();
1730
-
1731
- if ( 'update-core' === $screen->base ) {
1732
- // Core update screen.
1733
- return true;
1734
- } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1735
- // Plugins bulk update screen.
1736
- return true;
1737
- } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1738
- // Individual updates (ajax call).
1739
- return true;
1740
- }
1741
-
1742
- return false;
1743
- }
1744
-
1745
- /**
1746
- * Retrieve the URL to the TGMPA Install page.
1747
- *
1748
- * I.e. depending on the config settings passed something along the lines of:
1749
- * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins
1750
- *
1751
- * @since 2.5.0
1752
- *
1753
- * @return string Properly encoded URL (not escaped).
1754
- */
1755
- public function get_tgmpa_url() {
1756
- static $url;
1757
-
1758
- if ( ! isset( $url ) ) {
1759
- $parent = $this->parent_slug;
1760
- if ( false === strpos( $parent, '.php' ) ) {
1761
- $parent = 'admin.php';
1762
- }
1763
- $url = add_query_arg(
1764
- array(
1765
- 'page' => urlencode( $this->menu ),
1766
- ),
1767
- self_admin_url( $parent )
1768
- );
1769
- }
1770
-
1771
- return $url;
1772
- }
1773
-
1774
- /**
1775
- * Retrieve the URL to the TGMPA Install page for a specific plugin status (view).
1776
- *
1777
- * I.e. depending on the config settings passed something along the lines of:
1778
- * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install
1779
- *
1780
- * @since 2.5.0
1781
- *
1782
- * @param string $status Plugin status - either 'install', 'update' or 'activate'.
1783
- * @return string Properly encoded URL (not escaped).
1784
- */
1785
- public function get_tgmpa_status_url( $status ) {
1786
- return add_query_arg(
1787
- array(
1788
- 'plugin_status' => urlencode( $status ),
1789
- ),
1790
- $this->get_tgmpa_url()
1791
- );
1792
- }
1793
-
1794
- /**
1795
- * Determine whether there are open actions for plugins registered with TGMPA.
1796
- *
1797
- * @since 2.5.0
1798
- *
1799
- * @return bool True if complete, i.e. no outstanding actions. False otherwise.
1800
- */
1801
- public function is_tgmpa_complete() {
1802
- $complete = true;
1803
- foreach ( $this->plugins as $slug => $plugin ) {
1804
- if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1805
- $complete = false;
1806
- break;
1807
- }
1808
- }
1809
-
1810
- return $complete;
1811
- }
1812
-
1813
- /**
1814
- * Check if a plugin is installed. Does not take must-use plugins into account.
1815
- *
1816
- * @since 2.5.0
1817
- *
1818
- * @param string $slug Plugin slug.
1819
- * @return bool True if installed, false otherwise.
1820
- */
1821
- public function is_plugin_installed( $slug ) {
1822
- $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1823
-
1824
- return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
1825
- }
1826
-
1827
- /**
1828
- * Check if a plugin is active.
1829
- *
1830
- * @since 2.5.0
1831
- *
1832
- * @param string $slug Plugin slug.
1833
- * @return bool True if active, false otherwise.
1834
- */
1835
- public function is_plugin_active( $slug ) {
1836
- return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
1837
- }
1838
-
1839
- /**
1840
- * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required
1841
- * available, check whether the current install meets them.
1842
- *
1843
- * @since 2.5.0
1844
- *
1845
- * @param string $slug Plugin slug.
1846
- * @return bool True if OK to update, false otherwise.
1847
- */
1848
- public function can_plugin_update( $slug ) {
1849
- // We currently can't get reliable info on non-WP-repo plugins - issue #380.
1850
- if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1851
- return true;
1852
- }
1853
-
1854
- $api = $this->get_plugins_api( $slug );
1855
-
1856
- if ( false !== $api && isset( $api->requires ) ) {
1857
- return version_compare( $this->wp_version, $api->requires, '>=' );
1858
- }
1859
-
1860
- // No usable info received from the plugins API, presume we can update.
1861
- return true;
1862
- }
1863
-
1864
- /**
1865
- * Check to see if the plugin is 'updatetable', i.e. installed, with an update available
1866
- * and no WP version requirements blocking it.
1867
- *
1868
- * @since 2.6.0
1869
- *
1870
- * @param string $slug Plugin slug.
1871
- * @return bool True if OK to proceed with update, false otherwise.
1872
- */
1873
- public function is_plugin_updatetable( $slug ) {
1874
- if ( ! $this->is_plugin_installed( $slug ) ) {
1875
- return false;
1876
- } else {
1877
- return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) );
1878
- }
1879
- }
1880
-
1881
- /**
1882
- * Check if a plugin can be activated, i.e. is not currently active and meets the minimum
1883
- * plugin version requirements set in TGMPA (if any).
1884
- *
1885
- * @since 2.5.0
1886
- *
1887
- * @param string $slug Plugin slug.
1888
- * @return bool True if OK to activate, false otherwise.
1889
- */
1890
- public function can_plugin_activate( $slug ) {
1891
- return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
1892
- }
1893
-
1894
- /**
1895
- * Retrieve the version number of an installed plugin.
1896
- *
1897
- * @since 2.5.0
1898
- *
1899
- * @param string $slug Plugin slug.
1900
- * @return string Version number as string or an empty string if the plugin is not installed
1901
- * or version unknown (plugins which don't comply with the plugin header standard).
1902
- */
1903
- public function get_installed_version( $slug ) {
1904
- $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1905
-
1906
- if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
1907
- return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
1908
- }
1909
-
1910
- return '';
1911
- }
1912
-
1913
- /**
1914
- * Check whether a plugin complies with the minimum version requirements.
1915
- *
1916
- * @since 2.5.0
1917
- *
1918
- * @param string $slug Plugin slug.
1919
- * @return bool True when a plugin needs to be updated, otherwise false.
1920
- */
1921
- public function does_plugin_require_update( $slug ) {
1922
- $installed_version = $this->get_installed_version( $slug );
1923
- $minimum_version = $this->plugins[ $slug ]['version'];
1924
-
1925
- return version_compare( $minimum_version, $installed_version, '>' );
1926
- }
1927
-
1928
- /**
1929
- * Check whether there is an update available for a plugin.
1930
- *
1931
- * @since 2.5.0
1932
- *
1933
- * @param string $slug Plugin slug.
1934
- * @return false|string Version number string of the available update or false if no update available.
1935
- */
1936
- public function does_plugin_have_update( $slug ) {
1937
- // Presume bundled and external plugins will point to a package which meets the minimum required version.
1938
- if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1939
- if ( $this->does_plugin_require_update( $slug ) ) {
1940
- return $this->plugins[ $slug ]['version'];
1941
- }
1942
-
1943
- return false;
1944
- }
1945
-
1946
- $repo_updates = get_site_transient( 'update_plugins' );
1947
-
1948
- if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
1949
- return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
1950
- }
1951
-
1952
- return false;
1953
- }
1954
-
1955
- /**
1956
- * Retrieve potential upgrade notice for a plugin.
1957
- *
1958
- * @since 2.5.0
1959
- *
1960
- * @param string $slug Plugin slug.
1961
- * @return string The upgrade notice or an empty string if no message was available or provided.
1962
- */
1963
- public function get_upgrade_notice( $slug ) {
1964
- // We currently can't get reliable info on non-WP-repo plugins - issue #380.
1965
- if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1966
- return '';
1967
- }
1968
-
1969
- $repo_updates = get_site_transient( 'update_plugins' );
1970
-
1971
- if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
1972
- return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
1973
- }
1974
-
1975
- return '';
1976
- }
1977
-
1978
- /**
1979
- * Wrapper around the core WP get_plugins function, making sure it's actually available.
1980
- *
1981
- * @since 2.5.0
1982
- *
1983
- * @param string $plugin_folder Optional. Relative path to single plugin folder.
1984
- * @return array Array of installed plugins with plugin information.
1985
- */
1986
- public function get_plugins( $plugin_folder = '' ) {
1987
- if ( ! function_exists( 'get_plugins' ) ) {
1988
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
1989
- }
1990
-
1991
- return get_plugins( $plugin_folder );
1992
- }
1993
-
1994
- /**
1995
- * Delete dismissable nag option when theme is switched.
1996
- *
1997
- * This ensures that the user(s) is/are again reminded via nag of required
1998
- * and/or recommended plugins if they re-activate the theme.
1999
- *
2000
- * @since 2.1.1
2001
- */
2002
- public function update_dismiss() {
2003
- delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );
2004
- }
2005
-
2006
- /**
2007
- * Forces plugin activation if the parameter 'force_activation' is
2008
- * set to true.
2009
- *
2010
- * This allows theme authors to specify certain plugins that must be
2011
- * active at all times while using the current theme.
2012
- *
2013
- * Please take special care when using this parameter as it has the
2014
- * potential to be harmful if not used correctly. Setting this parameter
2015
- * to true will not allow the specified plugin to be deactivated unless
2016
- * the user switches themes.
2017
- *
2018
- * @since 2.2.0
2019
- */
2020
- public function force_activation() {
2021
- foreach ( $this->plugins as $slug => $plugin ) {
2022
- if ( true === $plugin['force_activation'] ) {
2023
- if ( ! $this->is_plugin_installed( $slug ) ) {
2024
- // Oops, plugin isn't there so iterate to next condition.
2025
- continue;
2026
- } elseif ( $this->can_plugin_activate( $slug ) ) {
2027
- // There we go, activate the plugin.
2028
- activate_plugin( $plugin['file_path'] );
2029
- }
2030
- }
2031
- }
2032
- }
2033
-
2034
- /**
2035
- * Forces plugin deactivation if the parameter 'force_deactivation'
2036
- * is set to true and adds the plugin to the 'recently active' plugins list.
2037
- *
2038
- * This allows theme authors to specify certain plugins that must be
2039
- * deactivated upon switching from the current theme to another.
2040
- *
2041
- * Please take special care when using this parameter as it has the
2042
- * potential to be harmful if not used correctly.
2043
- *
2044
- * @since 2.2.0
2045
- */
2046
- public function force_deactivation() {
2047
- $deactivated = array();
2048
-
2049
- foreach ( $this->plugins as $slug => $plugin ) {
2050
- /*
2051
- * Only proceed forward if the parameter is set to true and plugin is active
2052
- * as a 'normal' (not must-use) plugin.
2053
- */
2054
- if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) {
2055
- deactivate_plugins( $plugin['file_path'] );
2056
- $deactivated[ $plugin['file_path'] ] = time();
2057
- }
2058
- }
2059
-
2060
- if ( ! empty( $deactivated ) ) {
2061
- update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
2062
- }
2063
- }
2064
-
2065
- /**
2066
- * Echo the current TGMPA version number to the page.
2067
- *
2068
- * @since 2.5.0
2069
- */
2070
- public function show_tgmpa_version() {
2071
- echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
2072
- esc_html(
2073
- sprintf(
2074
- /* translators: %s: version number */
2075
- __( 'TGMPA v%s', 'tgmpa' ),
2076
- self::TGMPA_VERSION
2077
- )
2078
- ),
2079
- '</small></strong></p>';
2080
- }
2081
-
2082
- /**
2083
- * Returns the singleton instance of the class.
2084
- *
2085
- * @since 2.4.0
2086
- *
2087
- * @return \TGM_Plugin_Activation The TGM_Plugin_Activation object.
2088
- */
2089
- public static function get_instance() {
2090
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
2091
- self::$instance = new self();
2092
- }
2093
-
2094
- return self::$instance;
2095
- }
2096
- }
2097
-
2098
- if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {
2099
- /**
2100
- * Ensure only one instance of the class is ever invoked.
2101
- *
2102
- * @since 2.5.0
2103
- */
2104
- function load_tgm_plugin_activation() {
2105
- $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();
2106
- }
2107
- }
2108
-
2109
- if ( did_action( 'plugins_loaded' ) ) {
2110
- load_tgm_plugin_activation();
2111
- } else {
2112
- add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
2113
- }
2114
- }
2115
-
2116
- if ( ! function_exists( 'tgmpa' ) ) {
2117
- /**
2118
- * Helper function to register a collection of required plugins.
2119
- *
2120
- * @since 2.0.0
2121
- * @api
2122
- *
2123
- * @param array $plugins An array of plugin arrays.
2124
- * @param array $config Optional. An array of configuration values.
2125
- */
2126
- function tgmpa( $plugins, $config = array() ) {
2127
- $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
2128
-
2129
- foreach ( $plugins as $plugin ) {
2130
- call_user_func( array( $instance, 'register' ), $plugin );
2131
- }
2132
-
2133
- if ( ! empty( $config ) && is_array( $config ) ) {
2134
- // Send out notices for deprecated arguments passed.
2135
- if ( isset( $config['notices'] ) ) {
2136
- _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );
2137
- if ( ! isset( $config['has_notices'] ) ) {
2138
- $config['has_notices'] = $config['notices'];
2139
- }
2140
- }
2141
-
2142
- if ( isset( $config['parent_menu_slug'] ) ) {
2143
- _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
2144
- }
2145
- if ( isset( $config['parent_url_slug'] ) ) {
2146
- _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
2147
- }
2148
-
2149
- call_user_func( array( $instance, 'config' ), $config );
2150
- }
2151
- }
2152
- }
2153
-
2154
- /**
2155
- * WP_List_Table isn't always available. If it isn't available,
2156
- * we load it here.
2157
- *
2158
- * @since 2.2.0
2159
- */
2160
- if ( ! class_exists( 'WP_List_Table' ) ) {
2161
- require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
2162
- }
2163
-
2164
- if ( ! class_exists( 'TGMPA_List_Table' ) ) {
2165
-
2166
- /**
2167
- * List table class for handling plugins.
2168
- *
2169
- * Extends the WP_List_Table class to provide a future-compatible
2170
- * way of listing out all required/recommended plugins.
2171
- *
2172
- * Gives users an interface similar to the Plugin Administration
2173
- * area with similar (albeit stripped down) capabilities.
2174
- *
2175
- * This class also allows for the bulk install of plugins.
2176
- *
2177
- * @since 2.2.0
2178
- *
2179
- * @package TGM-Plugin-Activation
2180
- * @author Thomas Griffin
2181
- * @author Gary Jones
2182
- */
2183
- class TGMPA_List_Table extends WP_List_Table {
2184
- /**
2185
- * TGMPA instance.
2186
- *
2187
- * @since 2.5.0
2188
- *
2189
- * @var object
2190
- */
2191
- protected $tgmpa;
2192
-
2193
- /**
2194
- * The currently chosen view.
2195
- *
2196
- * @since 2.5.0
2197
- *
2198
- * @var string One of: 'all', 'install', 'update', 'activate'
2199
- */
2200
- public $view_context = 'all';
2201
-
2202
- /**
2203
- * The plugin counts for the various views.
2204
- *
2205
- * @since 2.5.0
2206
- *
2207
- * @var array
2208
- */
2209
- protected $view_totals = array(
2210
- 'all' => 0,
2211
- 'install' => 0,
2212
- 'update' => 0,
2213
- 'activate' => 0,
2214
- );
2215
-
2216
- /**
2217
- * References parent constructor and sets defaults for class.
2218
- *
2219
- * @since 2.2.0
2220
- */
2221
- public function __construct() {
2222
- $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
2223
-
2224
- parent::__construct(
2225
- array(
2226
- 'singular' => 'plugin',
2227
- 'plural' => 'plugins',
2228
- 'ajax' => false,
2229
- )
2230
- );
2231
-
2232
- if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {
2233
- $this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
2234
- }
2235
-
2236
- add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
2237
- }
2238
-
2239
- /**
2240
- * Get a list of CSS classes for the <table> tag.
2241
- *
2242
- * Overruled to prevent the 'plural' argument from being added.
2243
- *
2244
- * @since 2.5.0
2245
- *
2246
- * @return array CSS classnames.
2247
- */
2248
- public function get_table_classes() {
2249
- return array( 'widefat', 'fixed' );
2250
- }
2251
-
2252
- /**
2253
- * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
2254
- *
2255
- * @since 2.2.0
2256
- *
2257
- * @return array $table_data Information for use in table.
2258
- */
2259
- protected function _gather_plugin_data() {
2260
- // Load thickbox for plugin links.
2261
- $this->tgmpa->admin_init();
2262
- $this->tgmpa->thickbox();
2263
-
2264
- // Categorize the plugins which have open actions.
2265
- $plugins = $this->categorize_plugins_to_views();
2266
-
2267
- // Set the counts for the view links.
2268
- $this->set_view_totals( $plugins );
2269
-
2270
- // Prep variables for use and grab list of all installed plugins.
2271
- $table_data = array();
2272
- $i = 0;
2273
-
2274
- // Redirect to the 'all' view if no plugins were found for the selected view context.
2275
- if ( empty( $plugins[ $this->view_context ] ) ) {
2276
- $this->view_context = 'all';
2277
- }
2278
-
2279
- foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
2280
- $table_data[ $i ]['sanitized_plugin'] = $plugin['name'];
2281
- $table_data[ $i ]['slug'] = $slug;
2282
- $table_data[ $i ]['plugin'] = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';
2283
- $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] );
2284
- $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] );
2285
- $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug );
2286
- $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );
2287
- $table_data[ $i ]['minimum_version'] = $plugin['version'];
2288
- $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );
2289
-
2290
- // Prep the upgrade notice info.
2291
- $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );
2292
- if ( ! empty( $upgrade_notice ) ) {
2293
- $table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
2294
-
2295
- add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 );
2296
- }
2297
-
2298
- $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );
2299
-
2300
- $i++;
2301
- }
2302
-
2303
- return $table_data;
2304
- }
2305
-
2306
- /**
2307
- * Categorize the plugins which have open actions into views for the TGMPA page.
2308
- *
2309
- * @since 2.5.0
2310
- */
2311
- protected function categorize_plugins_to_views() {
2312
- $plugins = array(
2313
- 'all' => array(), // Meaning: all plugins which still have open actions.
2314
- 'install' => array(),
2315
- 'update' => array(),
2316
- 'activate' => array(),
2317
- );
2318
-
2319
- foreach ( $this->tgmpa->plugins as $slug => $plugin ) {
2320
- if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
2321
- // No need to display plugins if they are installed, up-to-date and active.
2322
- continue;
2323
- } else {
2324
- $plugins['all'][ $slug ] = $plugin;
2325
-
2326
- if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
2327
- $plugins['install'][ $slug ] = $plugin;
2328
- } else {
2329
- if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
2330
- $plugins['update'][ $slug ] = $plugin;
2331
- }
2332
-
2333
- if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
2334
- $plugins['activate'][ $slug ] = $plugin;
2335
- }
2336
- }
2337
- }
2338
- }
2339
-
2340
- return $plugins;
2341
- }
2342
-
2343
- /**
2344
- * Set the counts for the view links.
2345
- *
2346
- * @since 2.5.0
2347
- *
2348
- * @param array $plugins Plugins order by view.
2349
- */
2350
- protected function set_view_totals( $plugins ) {
2351
- foreach ( $plugins as $type => $list ) {
2352
- $this->view_totals[ $type ] = count( $list );
2353
- }
2354
- }
2355
-
2356
- /**
2357
- * Get the plugin required/recommended text string.
2358
- *
2359
- * @since 2.5.0
2360
- *
2361
- * @param string $required Plugin required setting.
2362
- * @return string
2363
- */
2364
- protected function get_plugin_advise_type_text( $required ) {
2365
- if ( true === $required ) {
2366
- return __( 'Required', 'tgmpa' );
2367
- }
2368
-
2369
- return __( 'Recommended', 'tgmpa' );
2370
- }
2371
-
2372
- /**
2373
- * Get the plugin source type text string.
2374
- *
2375
- * @since 2.5.0
2376
- *
2377
- * @param string $type Plugin type.
2378
- * @return string
2379
- */
2380
- protected function get_plugin_source_type_text( $type ) {
2381
- $string = '';
2382
-
2383
- switch ( $type ) {
2384
- case 'repo':
2385
- $string = __( 'WordPress Repository', 'tgmpa' );
2386
- break;
2387
- case 'external':
2388
- $string = __( 'External Source', 'tgmpa' );
2389
- break;
2390
- case 'bundled':
2391
- $string = __( 'Pre-Packaged', 'tgmpa' );
2392
- break;
2393
- }
2394
-
2395
- return $string;
2396
- }
2397
-
2398
- /**
2399
- * Determine the plugin status message.
2400
- *
2401
- * @since 2.5.0
2402
- *
2403
- * @param string $slug Plugin slug.
2404
- * @return string
2405
- */
2406
- protected function get_plugin_status_text( $slug ) {
2407
- if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
2408
- return __( 'Not Installed', 'tgmpa' );
2409
- }
2410
-
2411
- if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
2412
- $install_status = __( 'Installed But Not Activated', 'tgmpa' );
2413
- } else {
2414
- $install_status = __( 'Active', 'tgmpa' );
2415
- }
2416
-
2417
- $update_status = '';
2418
-
2419
- if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
2420
- $update_status = __( 'Required Update not Available', 'tgmpa' );
2421
-
2422
- } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
2423
- $update_status = __( 'Requires Update', 'tgmpa' );
2424
-
2425
- } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
2426
- $update_status = __( 'Update recommended', 'tgmpa' );
2427
- }
2428
-
2429
- if ( '' === $update_status ) {
2430
- return $install_status;
2431
- }
2432
-
2433
- return sprintf(
2434
- /* translators: 1: install status, 2: update status */
2435
- _x( '%1$s, %2$s', 'Install/Update Status', 'tgmpa' ),
2436
- $install_status,
2437
- $update_status
2438
- );
2439
- }
2440
-
2441
- /**
2442
- * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.
2443
- *
2444
- * @since 2.5.0
2445
- *
2446
- * @param array $items Prepared table items.
2447
- * @return array Sorted table items.
2448
- */
2449
- public function sort_table_items( $items ) {
2450
- $type = array();
2451
- $name = array();
2452
-
2453
- foreach ( $items as $i => $plugin ) {
2454
- $type[ $i ] = $plugin['type']; // Required / recommended.
2455
- $name[ $i ] = $plugin['sanitized_plugin'];
2456
- }
2457
-
2458
- array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );
2459
-
2460
- return $items;
2461
- }
2462
-
2463
- /**
2464
- * Get an associative array ( id => link ) of the views available on this table.
2465
- *
2466
- * @since 2.5.0
2467
- *
2468
- * @return array
2469
- */
2470
- public function get_views() {
2471
- $status_links = array();
2472
-
2473
- foreach ( $this->view_totals as $type => $count ) {
2474
- if ( $count < 1 ) {
2475
- continue;
2476
- }
2477
-
2478
- switch ( $type ) {
2479
- case 'all':
2480
- /* translators: 1: number of plugins. */
2481
- $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'tgmpa' );
2482
- break;
2483
- case 'install':
2484
- /* translators: 1: number of plugins. */
2485
- $text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'tgmpa' );
2486
- break;
2487
- case 'update':
2488
- /* translators: 1: number of plugins. */
2489
- $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'tgmpa' );
2490
- break;
2491
- case 'activate':
2492
- /* translators: 1: number of plugins. */
2493
- $text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'tgmpa' );
2494
- break;
2495
- default:
2496
- $text = '';
2497
- break;
2498
- }
2499
-
2500
- if ( ! empty( $text ) ) {
2501
-
2502
- $status_links[ $type ] = sprintf(
2503
- '<a href="%s"%s>%s</a>',
2504
- esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),
2505
- ( $type === $this->view_context ) ? ' class="current"' : '',
2506
- sprintf( $text, number_format_i18n( $count ) )
2507
- );
2508
- }
2509
- }
2510
-
2511
- return $status_links;
2512
- }
2513
-
2514
- /**
2515
- * Create default columns to display important plugin information
2516
- * like type, action and status.
2517
- *
2518
- * @since 2.2.0
2519
- *
2520
- * @param array $item Array of item data.
2521
- * @param string $column_name The name of the column.
2522
- * @return string
2523
- */
2524
- public function column_default( $item, $column_name ) {
2525
- return $item[ $column_name ];
2526
- }
2527
-
2528
- /**
2529
- * Required for bulk installing.
2530
- *
2531
- * Adds a checkbox for each plugin.
2532
- *
2533
- * @since 2.2.0
2534
- *
2535
- * @param array $item Array of item data.
2536
- * @return string The input checkbox with all necessary info.
2537
- */
2538
- public function column_cb( $item ) {
2539
- return sprintf(
2540
- '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
2541
- esc_attr( $this->_args['singular'] ),
2542
- esc_attr( $item['slug'] ),
2543
- esc_attr( $item['sanitized_plugin'] )
2544
- );
2545
- }
2546
-
2547
- /**
2548
- * Create default title column along with the action links.
2549
- *
2550
- * @since 2.2.0
2551
- *
2552
- * @param array $item Array of item data.
2553
- * @return string The plugin name and action links.
2554
- */
2555
- public function column_plugin( $item ) {
2556
- return sprintf(
2557
- '%1$s %2$s',
2558
- $item['plugin'],
2559
- $this->row_actions( $this->get_row_actions( $item ), true )
2560
- );
2561
- }
2562
-
2563
- /**
2564
- * Create version information column.
2565
- *
2566
- * @since 2.5.0
2567
- *
2568
- * @param array $item Array of item data.
2569
- * @return string HTML-formatted version information.
2570
- */
2571
- public function column_version( $item ) {
2572
- $output = array();
2573
-
2574
- if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
2575
- $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'tgmpa' );
2576
-
2577
- $color = '';
2578
- if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
2579
- $color = ' color: #ff0000; font-weight: bold;';
2580
- }
2581
-
2582
- $output[] = sprintf(
2583
- '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'tgmpa' ) . '</p>',
2584
- $color,
2585
- $installed
2586
- );
2587
- }
2588
-
2589
- if ( ! empty( $item['minimum_version'] ) ) {
2590
- $output[] = sprintf(
2591
- '<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'tgmpa' ) . '</p>',
2592
- $item['minimum_version']
2593
- );
2594
- }
2595
-
2596
- if ( ! empty( $item['available_version'] ) ) {
2597
- $color = '';
2598
- if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {
2599
- $color = ' color: #71C671; font-weight: bold;';
2600
- }
2601
-
2602
- $output[] = sprintf(
2603
- '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'tgmpa' ) . '</p>',
2604
- $color,
2605
- $item['available_version']
2606
- );
2607
- }
2608
-
2609
- if ( empty( $output ) ) {
2610
- return '&nbsp;'; // Let's not break the table layout.
2611
- } else {
2612
- return implode( "\n", $output );
2613
- }
2614
- }
2615
-
2616
- /**
2617
- * Sets default message within the plugins table if no plugins
2618
- * are left for interaction.
2619
- *
2620
- * Hides the menu item to prevent the user from clicking and
2621
- * getting a permissions error.
2622
- *
2623
- * @since 2.2.0
2624
- */
2625
- public function no_items() {
2626
- echo esc_html__( 'No plugins to install, update or activate.', 'tgmpa' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>';
2627
- echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
2628
- }
2629
-
2630
- /**
2631
- * Output all the column information within the table.
2632
- *
2633
- * @since 2.2.0
2634
- *
2635
- * @return array $columns The column names.
2636
- */
2637
- public function get_columns() {
2638
- $columns = array(
2639
- 'cb' => '<input type="checkbox" />',
2640
- 'plugin' => __( 'Plugin', 'tgmpa' ),
2641
- 'source' => __( 'Source', 'tgmpa' ),
2642
- 'type' => __( 'Type', 'tgmpa' ),
2643
- );
2644
-
2645
- if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
2646
- $columns['version'] = __( 'Version', 'tgmpa' );
2647
- $columns['status'] = __( 'Status', 'tgmpa' );
2648
- }
2649
-
2650
- return apply_filters( 'tgmpa_table_columns', $columns );
2651
- }
2652
-
2653
- /**
2654
- * Get name of default primary column
2655
- *
2656
- * @since 2.5.0 / WP 4.3+ compatibility
2657
- * @access protected
2658
- *
2659
- * @return string
2660
- */
2661
- protected function get_default_primary_column_name() {
2662
- return 'plugin';
2663
- }
2664
-
2665
- /**
2666
- * Get the name of the primary column.
2667
- *
2668
- * @since 2.5.0 / WP 4.3+ compatibility
2669
- * @access protected
2670
- *
2671
- * @return string The name of the primary column.
2672
- */
2673
- protected function get_primary_column_name() {
2674
- if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
2675
- return parent::get_primary_column_name();
2676
- } else {
2677
- return $this->get_default_primary_column_name();
2678
- }
2679
- }
2680
-
2681
- /**
2682
- * Get the actions which are relevant for a specific plugin row.
2683
- *
2684
- * @since 2.5.0
2685
- *
2686
- * @param array $item Array of item data.
2687
- * @return array Array with relevant action links.
2688
- */
2689
- protected function get_row_actions( $item ) {
2690
- $actions = array();
2691
- $action_links = array();
2692
-
2693
- // Display the 'Install' action link if the plugin is not yet available.
2694
- if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
2695
- /* translators: %2$s: plugin name in screen reader markup */
2696
- $actions['install'] = __( 'Install %2$s', 'tgmpa' );
2697
- } else {
2698
- // Display the 'Update' action link if an update is available and WP complies with plugin minimum.
2699
- if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
2700
- /* translators: %2$s: plugin name in screen reader markup */
2701
- $actions['update'] = __( 'Update %2$s', 'tgmpa' );
2702
- }
2703
-
2704
- // Display the 'Activate' action link, but only if the plugin meets the minimum version.
2705
- if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
2706
- /* translators: %2$s: plugin name in screen reader markup */
2707
- $actions['activate'] = __( 'Activate %2$s', 'tgmpa' );
2708
- }
2709
- }
2710
-
2711
- // Create the actual links.
2712
- foreach ( $actions as $action => $text ) {
2713
- $nonce_url = wp_nonce_url(
2714
- add_query_arg(
2715
- array(
2716
- 'plugin' => urlencode( $item['slug'] ),
2717
- 'tgmpa-' . $action => $action . '-plugin',
2718
- ),
2719
- $this->tgmpa->get_tgmpa_url()
2720
- ),
2721
- 'tgmpa-' . $action,
2722
- 'tgmpa-nonce'
2723
- );
2724
-
2725
- $action_links[ $action ] = sprintf(
2726
- '<a href="%1$s">' . esc_html( $text ) . '</a>', // $text contains the second placeholder.
2727
- esc_url( $nonce_url ),
2728
- '<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
2729
- );
2730
- }
2731
-
2732
- $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';
2733
- return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context );
2734
- }
2735
-
2736
- /**
2737
- * Generates content for a single row of the table.
2738
- *
2739
- * @since 2.5.0
2740
- *
2741
- * @param object $item The current item.
2742
- */
2743
- public function single_row( $item ) {
2744
- parent::single_row( $item );
2745
-
2746
- /**
2747
- * Fires after each specific row in the TGMPA Plugins list table.
2748
- *
2749
- * The dynamic portion of the hook name, `$item['slug']`, refers to the slug
2750
- * for the plugin.
2751
- *
2752
- * @since 2.5.0
2753
- */
2754
- do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
2755
- }
2756
-
2757
- /**
2758
- * Show the upgrade notice below a plugin row if there is one.
2759
- *
2760
- * @since 2.5.0
2761
- *
2762
- * @see /wp-admin/includes/update.php
2763
- *
2764
- * @param string $slug Plugin slug.
2765
- * @param array $item The information available in this table row.
2766
- * @return null Return early if upgrade notice is empty.
2767
- */
2768
- public function wp_plugin_update_row( $slug, $item ) {
2769
- if ( empty( $item['upgrade_notice'] ) ) {
2770
- return;
2771
- }
2772
-
2773
- echo '
2774
- <tr class="plugin-update-tr">
2775
- <td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
2776
- <div class="update-message">',
2777
- esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ),
2778
- ' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
2779
- </div>
2780
- </td>
2781
- </tr>';
2782
- }
2783
-
2784
- /**
2785
- * Extra controls to be displayed between bulk actions and pagination.
2786
- *
2787
- * @since 2.5.0
2788
- *
2789
- * @param string $which 'top' or 'bottom' table navigation.
2790
- */
2791
- public function extra_tablenav( $which ) {
2792
- if ( 'bottom' === $which ) {
2793
- $this->tgmpa->show_tgmpa_version();
2794
- }
2795
- }
2796
-
2797
- /**
2798
- * Defines the bulk actions for handling registered plugins.
2799
- *
2800
- * @since 2.2.0
2801
- *
2802
- * @return array $actions The bulk actions for the plugin install table.
2803
- */
2804
- public function get_bulk_actions() {
2805
-
2806
- $actions = array();
2807
-
2808
- if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
2809
- if ( current_user_can( 'install_plugins' ) ) {
2810
- $actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' );
2811
- }
2812
- }
2813
-
2814
- if ( 'install' !== $this->view_context ) {
2815
- if ( current_user_can( 'update_plugins' ) ) {
2816
- $actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' );
2817
- }
2818
- if ( current_user_can( 'activate_plugins' ) ) {
2819
- $actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' );
2820
- }
2821
- }
2822
-
2823
- return $actions;
2824
- }
2825
-
2826
- /**
2827
- * Processes bulk installation and activation actions.
2828
- *
2829
- * The bulk installation process looks for the $_POST information and passes that
2830
- * through if a user has to use WP_Filesystem to enter their credentials.
2831
- *
2832
- * @since 2.2.0
2833
- */
2834
- public function process_bulk_actions() {
2835
- // Bulk installation process.
2836
- if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {
2837
-
2838
- check_admin_referer( 'bulk-' . $this->_args['plural'] );
2839
-
2840
- $install_type = 'install';
2841
- if ( 'tgmpa-bulk-update' === $this->current_action() ) {
2842
- $install_type = 'update';
2843
- }
2844
-
2845
- $plugins_to_install = array();
2846
-
2847
- // Did user actually select any plugins to install/update ?
2848
- if ( empty( $_POST['plugin'] ) ) {
2849
- if ( 'install' === $install_type ) {
2850
- $message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );
2851
- } else {
2852
- $message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );
2853
- }
2854
-
2855
- echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2856
-
2857
- return false;
2858
- }
2859
-
2860
- if ( is_array( $_POST['plugin'] ) ) {
2861
- $plugins_to_install = (array) $_POST['plugin'];
2862
- } elseif ( is_string( $_POST['plugin'] ) ) {
2863
- // Received via Filesystem page - un-flatten array (WP bug #19643).
2864
- $plugins_to_install = explode( ',', $_POST['plugin'] );
2865
- }
2866
-
2867
- // Sanitize the received input.
2868
- $plugins_to_install = array_map( 'urldecode', $plugins_to_install );
2869
- $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );
2870
-
2871
- // Validate the received input.
2872
- foreach ( $plugins_to_install as $key => $slug ) {
2873
- // Check if the plugin was registered with TGMPA and remove if not.
2874
- if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {
2875
- unset( $plugins_to_install[ $key ] );
2876
- continue;
2877
- }
2878
-
2879
- // For install: make sure this is a plugin we *can* install and not one already installed.
2880
- if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) {
2881
- unset( $plugins_to_install[ $key ] );
2882
- }
2883
-
2884
- // For updates: make sure this is a plugin we *can* update (update available and WP version ok).
2885
- if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) {
2886
- unset( $plugins_to_install[ $key ] );
2887
- }
2888
- }
2889
-
2890
- // No need to proceed further if we have no plugins to handle.
2891
- if ( empty( $plugins_to_install ) ) {
2892
- if ( 'install' === $install_type ) {
2893
- $message = __( 'No plugins are available to be installed at this time.', 'tgmpa' );
2894
- } else {
2895
- $message = __( 'No plugins are available to be updated at this time.', 'tgmpa' );
2896
- }
2897
-
2898
- echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2899
-
2900
- return false;
2901
- }
2902
-
2903
- // Pass all necessary information if WP_Filesystem is needed.
2904
- $url = wp_nonce_url(
2905
- $this->tgmpa->get_tgmpa_url(),
2906
- 'bulk-' . $this->_args['plural']
2907
- );
2908
-
2909
- // Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
2910
- $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.
2911
-
2912
- $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2913
- $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2914
-
2915
- if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2916
- return true; // Stop the normal page form from displaying, credential request form will be shown.
2917
- }
2918
-
2919
- // Now we have some credentials, setup WP_Filesystem.
2920
- if ( ! WP_Filesystem( $creds ) ) {
2921
- // Our credentials were no good, ask the user for them again.
2922
- request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2923
-
2924
- return true;
2925
- }
2926
-
2927
- /* If we arrive here, we have the filesystem */
2928
-
2929
- // Store all information in arrays since we are processing a bulk installation.
2930
- $names = array();
2931
- $sources = array(); // Needed for installs.
2932
- $file_paths = array(); // Needed for upgrades.
2933
- $to_inject = array(); // Information to inject into the update_plugins transient.
2934
-
2935
- // Prepare the data for validated plugins for the install/upgrade.
2936
- foreach ( $plugins_to_install as $slug ) {
2937
- $name = $this->tgmpa->plugins[ $slug ]['name'];
2938
- $source = $this->tgmpa->get_download_url( $slug );
2939
-
2940
- if ( ! empty( $name ) && ! empty( $source ) ) {
2941
- $names[] = $name;
2942
-
2943
- switch ( $install_type ) {
2944
-
2945
- case 'install':
2946
- $sources[] = $source;
2947
- break;
2948
-
2949
- case 'update':
2950
- $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path'];
2951
- $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ];
2952
- $to_inject[ $slug ]['source'] = $source;
2953
- break;
2954
- }
2955
- }
2956
- }
2957
- unset( $slug, $name, $source );
2958
-
2959
- // Create a new instance of TGMPA_Bulk_Installer.
2960
- $installer = new TGMPA_Bulk_Installer(
2961
- new TGMPA_Bulk_Installer_Skin(
2962
- array(
2963
- 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),
2964
- 'nonce' => 'bulk-' . $this->_args['plural'],
2965
- 'names' => $names,
2966
- 'install_type' => $install_type,
2967
- )
2968
- )
2969
- );
2970
-
2971
- // Wrap the install process with the appropriate HTML.
2972
- echo '<div class="tgmpa">',
2973
- '<h2 style="font-size: 23px; font-weight: 400; line-height: 29px; margin: 0; padding: 9px 15px 4px 0;">', esc_html( get_admin_page_title() ), '</h2>
2974
- <div class="update-php" style="width: 100%; height: 98%; min-height: 850px; padding-top: 1px;">';
2975
-
2976
- // Process the bulk installation submissions.
2977
- add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
2978
-
2979
- if ( 'tgmpa-bulk-update' === $this->current_action() ) {
2980
- // Inject our info into the update transient.
2981
- $this->tgmpa->inject_update_info( $to_inject );
2982
-
2983
- $installer->bulk_upgrade( $file_paths );
2984
- } else {
2985
- $installer->bulk_install( $sources );
2986
- }
2987
-
2988
- remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 );
2989
-
2990
- echo '</div></div>';
2991
-
2992
- return true;
2993
- }
2994
-
2995
- // Bulk activation process.
2996
- if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
2997
- check_admin_referer( 'bulk-' . $this->_args['plural'] );
2998
-
2999
- // Did user actually select any plugins to activate ?
3000
- if ( empty( $_POST['plugin'] ) ) {
3001
- echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '</p></div>';
3002
-
3003
- return false;
3004
- }
3005
-
3006
- // Grab plugin data from $_POST.
3007
- $plugins = array();
3008
- if ( isset( $_POST['plugin'] ) ) {
3009
- $plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
3010
- $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );
3011
- }
3012
-
3013
- $plugins_to_activate = array();
3014
- $plugin_names = array();
3015
-
3016
- // Grab the file paths for the selected & inactive plugins from the registration array.
3017
- foreach ( $plugins as $slug ) {
3018
- if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
3019
- $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];
3020
- $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name'];
3021
- }
3022
- }
3023
- unset( $slug );
3024
-
3025
- // Return early if there are no plugins to activate.
3026
- if ( empty( $plugins_to_activate ) ) {
3027
- echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'tgmpa' ), '</p></div>';
3028
-
3029
- return false;
3030
- }
3031
-
3032
- // Now we are good to go - let's start activating plugins.
3033
- $activate = activate_plugins( $plugins_to_activate );
3034
-
3035
- if ( is_wp_error( $activate ) ) {
3036
- echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
3037
- } else {
3038
- $count = count( $plugin_names ); // Count so we can use _n function.
3039
- $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
3040
- $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
3041
- $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
3042
-
3043
- printf( // WPCS: xss ok.
3044
- '<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
3045
- esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa' ) ),
3046
- $imploded
3047
- );
3048
-
3049
- // Update recently activated plugins option.
3050
- $recent = (array) get_option( 'recently_activated' );
3051
- foreach ( $plugins_to_activate as $plugin => $time ) {
3052
- if ( isset( $recent[ $plugin ] ) ) {
3053
- unset( $recent[ $plugin ] );
3054
- }
3055
- }
3056
- update_option( 'recently_activated', $recent );
3057
- }
3058
-
3059
- unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.
3060
-
3061
- return true;
3062
- }
3063
-
3064
- return false;
3065
- }
3066
-
3067
- /**
3068
- * Prepares all of our information to be outputted into a usable table.
3069
- *
3070
- * @since 2.2.0
3071
- */
3072
- public function prepare_items() {
3073
- $columns = $this->get_columns(); // Get all necessary column information.
3074
- $hidden = array(); // No columns to hide, but we must set as an array.
3075
- $sortable = array(); // No reason to make sortable columns.
3076
- $primary = $this->get_primary_column_name(); // Column which has the row actions.
3077
- $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.
3078
-
3079
- // Process our bulk activations here.
3080
- if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
3081
- $this->process_bulk_actions();
3082
- }
3083
-
3084
- // Store all of our plugin data into $items array so WP_List_Table can use it.
3085
- $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );
3086
- }
3087
-
3088
- /* *********** DEPRECATED METHODS *********** */
3089
-
3090
- /**
3091
- * Retrieve plugin data, given the plugin name.
3092
- *
3093
- * @since 2.2.0
3094
- * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.
3095
- * @see TGM_Plugin_Activation::_get_plugin_data_from_name()
3096
- *
3097
- * @param string $name Name of the plugin, as it was registered.
3098
- * @param string $data Optional. Array key of plugin data to return. Default is slug.
3099
- * @return string|boolean Plugin slug if found, false otherwise.
3100
- */
3101
- protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
3102
- _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );
3103
-
3104
- return $this->tgmpa->_get_plugin_data_from_name( $name, $data );
3105
- }
3106
- }
3107
- }
3108
-
3109
-
3110
- if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {
3111
-
3112
- /**
3113
- * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
3114
- *
3115
- * @since 2.5.2
3116
- *
3117
- * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer.
3118
- * For more information, see that class.}}
3119
- */
3120
- class TGM_Bulk_Installer {
3121
- }
3122
- }
3123
- if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {
3124
-
3125
- /**
3126
- * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
3127
- *
3128
- * @since 2.5.2
3129
- *
3130
- * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin.
3131
- * For more information, see that class.}}
3132
- */
3133
- class TGM_Bulk_Installer_Skin {
3134
- }
3135
- }
3136
-
3137
- /**
3138
- * The WP_Upgrader file isn't always available. If it isn't available,
3139
- * we load it here.
3140
- *
3141
- * We check to make sure no action or activation keys are set so that WordPress
3142
- * does not try to re-include the class when processing upgrades or installs outside
3143
- * of the class.
3144
- *
3145
- * @since 2.2.0
3146
- */
3147
- add_action( 'admin_init', 'tgmpa_tnp_load_bulk_installer' );
3148
- if ( ! function_exists( 'tgmpa_tnp_load_bulk_installer' ) ) {
3149
- /**
3150
- * Load bulk installer
3151
- */
3152
- function tgmpa_tnp_load_bulk_installer() {
3153
- // Silently fail if 2.5+ is loaded *after* an older version.
3154
- if ( ! isset( $GLOBALS['tgmpa'] ) ) {
3155
- return;
3156
- }
3157
-
3158
- // Get TGMPA class instance.
3159
- $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
3160
-
3161
- if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {
3162
- if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
3163
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
3164
- }
3165
-
3166
- if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {
3167
-
3168
- /**
3169
- * Installer class to handle bulk plugin installations.
3170
- *
3171
- * Extends WP_Upgrader and customizes to suit the installation of multiple
3172
- * plugins.
3173
- *
3174
- * @since 2.2.0
3175
- *
3176
- * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}}
3177
- * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer.
3178
- * This was done to prevent backward compatibility issues with v2.3.6.}}
3179
- *
3180
- * @package TGM-Plugin-Activation
3181
- * @author Thomas Griffin
3182
- * @author Gary Jones
3183
- */
3184
- class TGMPA_Bulk_Installer extends Plugin_Upgrader {
3185
- /**
3186
- * Holds result of bulk plugin installation.
3187
- *
3188
- * @since 2.2.0
3189
- *
3190
- * @var string
3191
- */
3192
- public $result;
3193
-
3194
- /**
3195
- * Flag to check if bulk installation is occurring or not.
3196
- *
3197
- * @since 2.2.0
3198
- *
3199
- * @var boolean
3200
- */
3201
- public $bulk = false;
3202
-
3203
- /**
3204
- * TGMPA instance
3205
- *
3206
- * @since 2.5.0
3207
- *
3208
- * @var object
3209
- */
3210
- protected $tgmpa;
3211
-
3212
- /**
3213
- * Whether or not the destination directory needs to be cleared ( = on update).
3214
- *
3215
- * @since 2.5.0
3216
- *
3217
- * @var bool
3218
- */
3219
- protected $clear_destination = false;
3220
-
3221
- /**
3222
- * References parent constructor and sets defaults for class.
3223
- *
3224
- * @since 2.2.0
3225
- *
3226
- * @param \Bulk_Upgrader_Skin|null $skin Installer skin.
3227
- */
3228
- public function __construct( $skin = null ) {
3229
- // Get TGMPA class instance.
3230
- $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
3231
-
3232
- parent::__construct( $skin );
3233
-
3234
- if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
3235
- $this->clear_destination = true;
3236
- }
3237
-
3238
- if ( $this->tgmpa->is_automatic ) {
3239
- $this->activate_strings();
3240
- }
3241
-
3242
- add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );
3243
- }
3244
-
3245
- /**
3246
- * Sets the correct activation strings for the installer skin to use.
3247
- *
3248
- * @since 2.2.0
3249
- */
3250
- public function activate_strings() {
3251
- $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' );
3252
- $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' );
3253
- }
3254
-
3255
- /**
3256
- * Performs the actual installation of each plugin.
3257
- *
3258
- * @since 2.2.0
3259
- *
3260
- * @see WP_Upgrader::run()
3261
- *
3262
- * @param array $options The installation config options.
3263
- * @return null|array Return early if error, array of installation data on success.
3264
- */
3265
- public function run( $options ) {
3266
- $result = parent::run( $options );
3267
-
3268
- // Reset the strings in case we changed one during automatic activation.
3269
- if ( $this->tgmpa->is_automatic ) {
3270
- if ( 'update' === $this->skin->options['install_type'] ) {
3271
- $this->upgrade_strings();
3272
- } else {
3273
- $this->install_strings();
3274
- }
3275
- }
3276
-
3277
- return $result;
3278
- }
3279
-
3280
- /**
3281
- * Processes the bulk installation of plugins.
3282
- *
3283
- * @since 2.2.0
3284
- *
3285
- * {@internal This is basically a near identical copy of the WP Core
3286
- * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with
3287
- * new installs instead of upgrades.
3288
- * For ease of future synchronizations, the adjustments are clearly commented, but no other
3289
- * comments are added. Code style has been made to comply.}}
3290
- *
3291
- * @see Plugin_Upgrader::bulk_upgrade()
3292
- * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838
3293
- * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}}
3294
- *
3295
- * @param array $plugins The plugin sources needed for installation.
3296
- * @param array $args Arbitrary passed extra arguments.
3297
- * @return array|false Install confirmation messages on success, false on failure.
3298
- */
3299
- public function bulk_install( $plugins, $args = array() ) {
3300
- // [TGMPA + ] Hook auto-activation in.
3301
- add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3302
-
3303
- $defaults = array(
3304
- 'clear_update_cache' => true,
3305
- );
3306
- $parsed_args = wp_parse_args( $args, $defaults );
3307
-
3308
- $this->init();
3309
- $this->bulk = true;
3310
-
3311
- $this->install_strings(); // [TGMPA + ] adjusted.
3312
-
3313
- /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */
3314
-
3315
- /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */
3316
-
3317
- $this->skin->header();
3318
-
3319
- // Connect to the Filesystem first.
3320
- $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
3321
- if ( ! $res ) {
3322
- $this->skin->footer();
3323
- return false;
3324
- }
3325
-
3326
- $this->skin->bulk_header();
3327
-
3328
- /*
3329
- * Only start maintenance mode if:
3330
- * - running Multisite and there are one or more plugins specified, OR
3331
- * - a plugin with an update available is currently active.
3332
- * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
3333
- */
3334
- $maintenance = ( is_multisite() && ! empty( $plugins ) );
3335
-
3336
- /*
3337
- [TGMPA - ]
3338
- foreach ( $plugins as $plugin )
3339
- $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
3340
- */
3341
- if ( $maintenance ) {
3342
- $this->maintenance_mode( true );
3343
- }
3344
-
3345
- $results = array();
3346
-
3347
- $this->update_count = count( $plugins );
3348
- $this->update_current = 0;
3349
- foreach ( $plugins as $plugin ) {
3350
- $this->update_current++;
3351
-
3352
- /*
3353
- [TGMPA - ]
3354
- $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
3355
-
3356
- if ( !isset( $current->response[ $plugin ] ) ) {
3357
- $this->skin->set_result('up_to_date');
3358
- $this->skin->before();
3359
- $this->skin->feedback('up_to_date');
3360
- $this->skin->after();
3361
- $results[$plugin] = true;
3362
- continue;
3363
- }
3364
-
3365
- // Get the URL to the zip file.
3366
- $r = $current->response[ $plugin ];
3367
-
3368
- $this->skin->plugin_active = is_plugin_active($plugin);
3369
- */
3370
-
3371
- $result = $this->run(
3372
- array(
3373
- 'package' => $plugin, // [TGMPA + ] adjusted.
3374
- 'destination' => WP_PLUGIN_DIR,
3375
- 'clear_destination' => false, // [TGMPA + ] adjusted.
3376
- 'clear_working' => true,
3377
- 'is_multi' => true,
3378
- 'hook_extra' => array(
3379
- 'plugin' => $plugin,
3380
- ),
3381
- )
3382
- );
3383
-
3384
- $results[ $plugin ] = $this->result;
3385
-
3386
- // Prevent credentials auth screen from displaying multiple times.
3387
- if ( false === $result ) {
3388
- break;
3389
- }
3390
- } //end foreach $plugins
3391
-
3392
- $this->maintenance_mode( false );
3393
-
3394
- /**
3395
- * Fires when the bulk upgrader process is complete.
3396
- *
3397
- * @since WP 3.6.0 / TGMPA 2.5.0
3398
- *
3399
- * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
3400
- * be a Theme_Upgrader or Core_Upgrade instance.
3401
- * @param array $data {
3402
- * Array of bulk item update data.
3403
- *
3404
- * @type string $action Type of action. Default 'update'.
3405
- * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
3406
- * @type bool $bulk Whether the update process is a bulk update. Default true.
3407
- * @type array $packages Array of plugin, theme, or core packages to update.
3408
- * }
3409
- */
3410
- do_action( 'upgrader_process_complete', $this, array(
3411
- 'action' => 'install', // [TGMPA + ] adjusted.
3412
- 'type' => 'plugin',
3413
- 'bulk' => true,
3414
- 'plugins' => $plugins,
3415
- ) );
3416
-
3417
- $this->skin->bulk_footer();
3418
-
3419
- $this->skin->footer();
3420
-
3421
- // Cleanup our hooks, in case something else does a upgrade on this connection.
3422
- /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */
3423
-
3424
- // [TGMPA + ] Remove our auto-activation hook.
3425
- remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3426
-
3427
- // Force refresh of plugin update information.
3428
- wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
3429
-
3430
- return $results;
3431
- }
3432
-
3433
- /**
3434
- * Handle a bulk upgrade request.
3435
- *
3436
- * @since 2.5.0
3437
- *
3438
- * @see Plugin_Upgrader::bulk_upgrade()
3439
- *
3440
- * @param array $plugins The local WP file_path's of the plugins which should be upgraded.
3441
- * @param array $args Arbitrary passed extra arguments.
3442
- * @return string|bool Install confirmation messages on success, false on failure.
3443
- */
3444
- public function bulk_upgrade( $plugins, $args = array() ) {
3445
-
3446
- add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3447
-
3448
- $result = parent::bulk_upgrade( $plugins, $args );
3449
-
3450
- remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3451
-
3452
- return $result;
3453
- }
3454
-
3455
- /**
3456
- * Abuse a filter to auto-activate plugins after installation.
3457
- *
3458
- * Hooked into the 'upgrader_post_install' filter hook.
3459
- *
3460
- * @since 2.5.0
3461
- *
3462
- * @param bool $bool The value we need to give back (true).
3463
- * @return bool
3464
- */
3465
- public function auto_activate( $bool ) {
3466
- // Only process the activation of installed plugins if the automatic flag is set to true.
3467
- if ( $this->tgmpa->is_automatic ) {
3468
- // Flush plugins cache so the headers of the newly installed plugins will be read correctly.
3469
- wp_clean_plugins_cache();
3470
-
3471
- // Get the installed plugin file.
3472
- $plugin_info = $this->plugin_info();
3473
-
3474
- // Don't try to activate on upgrade of active plugin as WP will do this already.
3475
- if ( ! is_plugin_active( $plugin_info ) ) {
3476
- $activate = activate_plugin( $plugin_info );
3477
-
3478
- // Adjust the success string based on the activation result.
3479
- $this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";
3480
-
3481
- if ( is_wp_error( $activate ) ) {
3482
- $this->skin->error( $activate );
3483
- $this->strings['process_success'] .= $this->strings['activation_failed'];
3484
- } else {
3485
- $this->strings['process_success'] .= $this->strings['activation_success'];
3486
- }
3487
- }
3488
- }
3489
-
3490
- return $bool;
3491
- }
3492
- }
3493
- }
3494
-
3495
- if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {
3496
-
3497
- /**
3498
- * Installer skin to set strings for the bulk plugin installations..
3499
- *
3500
- * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple
3501
- * plugins.
3502
- *
3503
- * @since 2.2.0
3504
- *
3505
- * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to
3506
- * TGMPA_Bulk_Installer_Skin.
3507
- * This was done to prevent backward compatibility issues with v2.3.6.}}
3508
- *
3509
- * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
3510
- *
3511
- * @package TGM-Plugin-Activation
3512
- * @author Thomas Griffin
3513
- * @author Gary Jones
3514
- */
3515
- class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {
3516
- /**
3517
- * Holds plugin info for each individual plugin installation.
3518
- *
3519
- * @since 2.2.0
3520
- *
3521
- * @var array
3522
- */
3523
- public $plugin_info = array();
3524
-
3525
- /**
3526
- * Holds names of plugins that are undergoing bulk installations.
3527
- *
3528
- * @since 2.2.0
3529
- *
3530
- * @var array
3531
- */
3532
- public $plugin_names = array();
3533
-
3534
- /**
3535
- * Integer to use for iteration through each plugin installation.
3536
- *
3537
- * @since 2.2.0
3538
- *
3539
- * @var integer
3540
- */
3541
- public $i = 0;
3542
-
3543
- /**
3544
- * TGMPA instance
3545
- *
3546
- * @since 2.5.0
3547
- *
3548
- * @var object
3549
- */
3550
- protected $tgmpa;
3551
-
3552
- /**
3553
- * Constructor. Parses default args with new ones and extracts them for use.
3554
- *
3555
- * @since 2.2.0
3556
- *
3557
- * @param array $args Arguments to pass for use within the class.
3558
- */
3559
- public function __construct( $args = array() ) {
3560
- // Get TGMPA class instance.
3561
- $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
3562
-
3563
- // Parse default and new args.
3564
- $defaults = array(
3565
- 'url' => '',
3566
- 'nonce' => '',
3567
- 'names' => array(),
3568
- 'install_type' => 'install',
3569
- );
3570
- $args = wp_parse_args( $args, $defaults );
3571
-
3572
- // Set plugin names to $this->plugin_names property.
3573
- $this->plugin_names = $args['names'];
3574
-
3575
- // Extract the new args.
3576
- parent::__construct( $args );
3577
- }
3578
-
3579
- /**
3580
- * Sets install skin strings for each individual plugin.
3581
- *
3582
- * Checks to see if the automatic activation flag is set and uses the
3583
- * the proper strings accordingly.
3584
- *
3585
- * @since 2.2.0
3586
- */
3587
- public function add_strings() {
3588
- if ( 'update' === $this->options['install_type'] ) {
3589
- parent::add_strings();
3590
- /* translators: 1: plugin name, 2: action number 3: total number of actions. */
3591
- $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3592
- } else {
3593
- /* translators: 1: plugin name, 2: error message. */
3594
- $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );
3595
- /* translators: 1: plugin name. */
3596
- $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' );
3597
-
3598
- if ( $this->tgmpa->is_automatic ) {
3599
- // Automatic activation strings.
3600
- $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
3601
- /* translators: 1: plugin name. */
3602
- $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
3603
- $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' );
3604
- /* translators: 1: plugin name, 2: action number 3: total number of actions. */
3605
- $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3606
- } else {
3607
- // Default installation strings.
3608
- $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
3609
- /* translators: 1: plugin name. */
3610
- $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
3611
- $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' );
3612
- /* translators: 1: plugin name, 2: action number 3: total number of actions. */
3613
- $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3614
- }
3615
- }
3616
- }
3617
-
3618
- /**
3619
- * Outputs the header strings and necessary JS before each plugin installation.
3620
- *
3621
- * @since 2.2.0
3622
- *
3623
- * @param string $title Unused in this implementation.
3624
- */
3625
- public function before( $title = '' ) {
3626
- if ( empty( $title ) ) {
3627
- $title = esc_html( $this->plugin_names[ $this->i ] );
3628
- }
3629
- parent::before( $title );
3630
- }
3631
-
3632
- /**
3633
- * Outputs the footer strings and necessary JS after each plugin installation.
3634
- *
3635
- * Checks for any errors and outputs them if they exist, else output
3636
- * success strings.
3637
- *
3638
- * @since 2.2.0
3639
- *
3640
- * @param string $title Unused in this implementation.
3641
- */
3642
- public function after( $title = '' ) {
3643
- if ( empty( $title ) ) {
3644
- $title = esc_html( $this->plugin_names[ $this->i ] );
3645
- }
3646
- parent::after( $title );
3647
-
3648
- $this->i++;
3649
- }
3650
-
3651
- /**
3652
- * Outputs links after bulk plugin installation is complete.
3653
- *
3654
- * @since 2.2.0
3655
- */
3656
- public function bulk_footer() {
3657
- // Serve up the string to say installations (and possibly activations) are complete.
3658
- parent::bulk_footer();
3659
-
3660
- // Flush plugins cache so we can make sure that the installed plugins list is always up to date.
3661
- wp_clean_plugins_cache();
3662
-
3663
- $this->tgmpa->show_tgmpa_version();
3664
-
3665
- // Display message based on if all plugins are now active or not.
3666
- $update_actions = array();
3667
-
3668
- if ( $this->tgmpa->is_tgmpa_complete() ) {
3669
- // All plugins are active, so we display the complete string and hide the menu to protect users.
3670
- echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
3671
- $update_actions['dashboard'] = sprintf(
3672
- esc_html( $this->tgmpa->strings['complete'] ),
3673
- '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>'
3674
- );
3675
- } else {
3676
- $update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';
3677
- }
3678
-
3679
- /**
3680
- * Filter the list of action links available following bulk plugin installs/updates.
3681
- *
3682
- * @since 2.5.0
3683
- *
3684
- * @param array $update_actions Array of plugin action links.
3685
- * @param array $plugin_info Array of information for the last-handled plugin.
3686
- */
3687
- $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
3688
-
3689
- if ( ! empty( $update_actions ) ) {
3690
- $this->feedback( implode( ' | ', (array) $update_actions ) );
3691
- }
3692
- }
3693
-
3694
- /* *********** DEPRECATED METHODS *********** */
3695
-
3696
- /**
3697
- * Flush header output buffer.
3698
- *
3699
- * @since 2.2.0
3700
- * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
3701
- * @see Bulk_Upgrader_Skin::flush_output()
3702
- */
3703
- public function before_flush_output() {
3704
- _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3705
- $this->flush_output();
3706
- }
3707
-
3708
- /**
3709
- * Flush footer output buffer and iterate $this->i to make sure the
3710
- * installation strings reference the correct plugin.
3711
- *
3712
- * @since 2.2.0
3713
- * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
3714
- * @see Bulk_Upgrader_Skin::flush_output()
3715
- */
3716
- public function after_flush_output() {
3717
- _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3718
- $this->flush_output();
3719
- $this->i++;
3720
- }
3721
- }
3722
- }
3723
- }
3724
- }
3725
- }
3726
-
3727
- if ( ! class_exists( 'TGMPA_Utils' ) ) {
3728
-
3729
- /**
3730
- * Generic utilities for TGMPA.
3731
- *
3732
- * All methods are static, poor-dev name-spacing class wrapper.
3733
- *
3734
- * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
3735
- *
3736
- * @since 2.5.0
3737
- *
3738
- * @package TGM-Plugin-Activation
3739
- * @author Juliette Reinders Folmer
3740
- */
3741
- class TGMPA_Utils {
3742
- /**
3743
- * Whether the PHP filter extension is enabled.
3744
- *
3745
- * @see http://php.net/book.filter
3746
- *
3747
- * @since 2.5.0
3748
- *
3749
- * @static
3750
- *
3751
- * @var bool $has_filters True is the extension is enabled.
3752
- */
3753
- public static $has_filters;
3754
-
3755
- /**
3756
- * Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().
3757
- *
3758
- * @since 2.5.0
3759
- *
3760
- * @static
3761
- *
3762
- * @param string $string Text to be wrapped.
3763
- * @return string
3764
- */
3765
- public static function wrap_in_em( $string ) {
3766
- return '<em>' . wp_kses_post( $string ) . '</em>';
3767
- }
3768
-
3769
- /**
3770
- * Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().
3771
- *
3772
- * @since 2.5.0
3773
- *
3774
- * @static
3775
- *
3776
- * @param string $string Text to be wrapped.
3777
- * @return string
3778
- */
3779
- public static function wrap_in_strong( $string ) {
3780
- return '<strong>' . wp_kses_post( $string ) . '</strong>';
3781
- }
3782
-
3783
- /**
3784
- * Helper function: Validate a value as boolean
3785
- *
3786
- * @since 2.5.0
3787
- *
3788
- * @static
3789
- *
3790
- * @param mixed $value Arbitrary value.
3791
- * @return bool
3792
- */
3793
- public static function validate_bool( $value ) {
3794
- if ( ! isset( self::$has_filters ) ) {
3795
- self::$has_filters = extension_loaded( 'filter' );
3796
- }
3797
-
3798
- if ( self::$has_filters ) {
3799
- return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
3800
- } else {
3801
- return self::emulate_filter_bool( $value );
3802
- }
3803
- }
3804
-
3805
- /**
3806
- * Helper function: Cast a value to bool
3807
- *
3808
- * @since 2.5.0
3809
- *
3810
- * @static
3811
- *
3812
- * @param mixed $value Value to cast.
3813
- * @return bool
3814
- */
3815
- protected static function emulate_filter_bool( $value ) {
3816
- // @codingStandardsIgnoreStart
3817
- static $true = array(
3818
- '1',
3819
- 'true', 'True', 'TRUE',
3820
- 'y', 'Y',
3821
- 'yes', 'Yes', 'YES',
3822
- 'on', 'On', 'ON',
3823
- );
3824
- static $false = array(
3825
- '0',
3826
- 'false', 'False', 'FALSE',
3827
- 'n', 'N',
3828
- 'no', 'No', 'NO',
3829
- 'off', 'Off', 'OFF',
3830
- );
3831
- // @codingStandardsIgnoreEnd
3832
-
3833
- if ( is_bool( $value ) ) {
3834
- return $value;
3835
- } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
3836
- return (bool) $value;
3837
- } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
3838
- return (bool) $value;
3839
- } elseif ( is_string( $value ) ) {
3840
- $value = trim( $value );
3841
- if ( in_array( $value, $true, true ) ) {
3842
- return true;
3843
- } elseif ( in_array( $value, $false, true ) ) {
3844
- return false;
3845
- } else {
3846
- return false;
3847
- }
3848
- }
3849
-
3850
- return false;
3851
- }
3852
- } // End of class TGMPA_Utils
3853
- } // End of class_exists wrapper
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/controls.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  class NewsletterControls {
5
 
@@ -113,25 +112,16 @@ class NewsletterControls {
113
  }
114
 
115
  function add_message_saved() {
116
- if (!empty($this->messages)) {
117
  $this->messages .= '<br><br>';
118
- }
119
  $this->messages .= __('Saved.', 'newsletter');
120
  }
121
-
122
- function add_message_done() {
123
- if (!empty($this->messages)) {
124
- $this->messages .= '<br><br>';
125
- }
126
- $this->messages .= __('Done.', 'newsletter');
127
- }
128
 
129
  function hint($text, $url = '') {
130
  echo '<div class="hints">';
131
- // Do not escape that, it can be formatted
132
  echo $text;
133
  if (!empty($url)) {
134
- echo ' <a href="' . esc_attr($url) . '" target="_blank">Read more</a>.';
135
  }
136
  echo '</div>';
137
  }
@@ -139,16 +129,14 @@ class NewsletterControls {
139
  function yesno($name) {
140
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
141
 
142
- echo '<select style="width: 60px" name="options[' . esc_attr($name) . ']">';
143
  echo '<option value="0"';
144
- if ($value == 0) {
145
  echo ' selected';
146
- }
147
  echo '>No</option>';
148
  echo '<option value="1"';
149
- if ($value == 1) {
150
  echo ' selected';
151
- }
152
  echo '>Yes</option>';
153
  echo '</select>&nbsp;&nbsp;&nbsp;';
154
  }
@@ -156,7 +144,7 @@ class NewsletterControls {
156
  function enabled($name) {
157
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
158
 
159
- echo '<select style="width: 100px" name="options[' . esc_attr($name) . ']">';
160
  echo '<option value="0"';
161
  if ($value == 0) {
162
  echo ' selected';
@@ -173,16 +161,14 @@ class NewsletterControls {
173
  function disabled($name) {
174
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
175
 
176
- echo '<select style="width: 100px" name="options[' . esc_attr($name) . ']">';
177
  echo '<option value="0"';
178
- if ($value == 0) {
179
  echo ' selected';
180
- }
181
  echo '>Enabled</option>';
182
  echo '<option value="1"';
183
- if ($value == 1) {
184
  echo ' selected';
185
- }
186
  echo '>Disabled</option>';
187
  echo '</select>';
188
  }
@@ -205,14 +191,12 @@ class NewsletterControls {
205
  echo "<div class='newsletter-checkboxes-group'>";
206
  foreach ($values_labels as $value => $label) {
207
  echo "<div class='newsletter-checkboxes-item'>";
208
- echo '<label><input type="checkbox" id="' . esc_attr($name) . '" name="options[' . esc_attr($name) . '][]" value="' . esc_attr($value) . '"';
209
- if (array_search($value, $value_array) !== false) {
210
- echo ' checked';
211
- }
212
- echo '>';
213
- if ($label != '') {
214
- echo esc_html($label);
215
- }
216
  echo "</label></div>";
217
  }
218
  echo "</div><div style='clear: both'></div>";
@@ -223,21 +207,12 @@ class NewsletterControls {
223
  function post_types($name = 'post_types') {
224
  $list = array();
225
  $post_types = get_post_types(array('public' => true), 'objects', 'and');
226
- foreach ($post_types as $post_type) {
227
  $list[$post_type->name] = $post_type->labels->name;
228
  }
229
 
230
  $this->checkboxes_group($name, $list);
231
  }
232
-
233
- function page($name='page', $first = null) {
234
- $pages = get_pages();
235
- $options = array();
236
- foreach ($pages as $page) {
237
- $options[$page->ID] = $page->post_title;
238
- }
239
- $this->select($name, $options, $first);
240
- }
241
 
242
  /** Used to create a select which is part of a group of controls identified by $name that will
243
  * produce an array of values as $_REQUEST['name'].
@@ -247,14 +222,14 @@ class NewsletterControls {
247
  function select_group($name, $options) {
248
  $value_array = $this->get_value_array($name);
249
 
250
- echo '<select name="options[' . esc_attr($name) . '][]">';
251
 
252
  foreach ($options as $key => $label) {
253
- echo '<option value="' . esc_attr($key) . '"';
254
  if (array_search($key, $value_array) !== false) {
255
  echo ' selected';
256
  }
257
- echo '>' . esc_html($label) . '</option>';
258
  }
259
 
260
  echo '</select>';
@@ -263,15 +238,15 @@ class NewsletterControls {
263
  function select($name, $options, $first = null) {
264
  $value = $this->get_value($name);
265
 
266
- echo '<select id="options-' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']">';
267
  if (!empty($first)) {
268
- echo '<option value="">' . esc_html($first) . '</option>';
269
  }
270
  foreach ($options as $key => $label) {
271
- echo '<option value="' . esc_attr($key) . '"';
272
  if ($value == $key)
273
  echo ' selected';
274
- echo '>' . esc_html($label) . '</option>';
275
  }
276
  echo '</select>';
277
  }
@@ -282,17 +257,15 @@ class NewsletterControls {
282
  echo '<select name="options[' . $name . ']">';
283
 
284
  foreach ($groups as $group) {
285
- echo '<optgroup label="' . esc_attr($group['']) . '">';
286
  if (!empty($group)) {
287
  foreach ($group as $key => $label) {
288
- if ($key == '') {
289
  continue;
290
- }
291
- echo '<option value="' . esc_attr($key) . '"';
292
- if ($value == $key) {
293
  echo ' selected';
294
- }
295
- echo '>' . esc_html($label) . '</option>';
296
  }
297
  }
298
  echo '</optgroup>';
@@ -307,9 +280,9 @@ class NewsletterControls {
307
  function themes($name, $themes, $submit_on_click = true) {
308
  foreach ($themes as $key => $data) {
309
  echo '<label style="display: block; float: left; text-align: center; margin-right: 10px;">';
310
- echo esc_html($key) . '<br>';
311
- echo '<img src="' . esc_attr($data['screenshot']) . '" width="100" height="100" style="border: 1px solid #666; padding: 5px"><br>';
312
- echo '<input style="position: relative; top: -40px" type="radio" onchange="this.form.act.value=\'theme\';this.form.submit()" name="options[' . esc_attr($name) . ']" value="' . esc_attr($key) . '"';
313
  if ($this->data[$name] == $key) {
314
  echo ' checked';
315
  }
@@ -353,32 +326,32 @@ class NewsletterControls {
353
 
354
  function text_email($name, $size = 40) {
355
  $value = $this->get_value($name);
356
- echo '<input name="options[' . esc_attr($name) . ']" type="email" placeholder="';
357
  echo esc_attr(__('Valid email address', 'newsletter'));
358
- echo '" size="' . esc_attr($size) . '" value="';
359
  echo esc_attr($value);
360
  echo '">';
361
  }
362
 
363
  function text_url($name, $size = 40) {
364
  $value = $this->get_value($name);
365
- echo '<input name="options[' . esc_attr($name) . ']" type="url" placeholder="http://..." size="' . esc_attr($size) . '" value="';
366
- echo esc_attr($value);
367
  echo '"/>';
368
  }
369
 
370
  function hidden($name) {
371
  $value = $this->get_value($name);
372
  echo '<input name="options[' . $name . ']" type="hidden" value="';
373
- echo esc_attr($value);
374
  echo '"/>';
375
  }
376
 
377
  function button($action, $label, $function = null) {
378
  if ($function != null) {
379
- echo '<input class="button-secondary" type="button" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';' . esc_html($function) . '"/>';
380
  } else {
381
- echo '<input class="button-secondary" type="submit" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';return true;"/>';
382
  }
383
  }
384
 
@@ -400,7 +373,7 @@ class NewsletterControls {
400
 
401
  function button_back($url) {
402
  echo '<a href="';
403
- echo esc_attr($url);
404
  echo '" class="button"><i class="fa fa-chevron-left"></i>&nbsp;';
405
  _e('Back', 'newsletter');
406
  echo '</a>';
@@ -434,30 +407,30 @@ class NewsletterControls {
434
 
435
  function button_primary($action, $label, $function = null) {
436
  if ($function != null) {
437
- echo '<input class="button-primary" type="button" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';' . esc_attr($function) . '"/>';
438
  } else {
439
- echo '<input class="button-primary" type="button" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';this.form.submit()"/>';
440
  }
441
  }
442
 
443
  function button_confirm($action, $label, $message = '', $data = '') {
444
  if (empty($message)) {
445
- echo '<input class="button-secondary" type="button" value="' . esc_attr($label) . '" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'' . esc_attr($action) . '\';this.form.submit()"/>';
446
  } else {
447
- echo '<input class="button-secondary" type="button" value="' . esc_attr($label) . '" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'' . esc_attr($action) . '\';if (confirm(\'' .
448
  esc_attr(esc_js($message)) . '\')) this.form.submit()"/>';
449
  }
450
  }
451
 
452
  function editor($name, $rows = 5, $cols = 75) {
453
- echo '<textarea class="visual" name="options[' . esc_attr($name) . ']" style="width: 100%" wrap="off" rows="' . esc_attr($rows) . '">';
454
  echo esc_html($this->get_value($name));
455
  echo '</textarea>';
456
  }
457
 
458
  function wp_editor($name, $settings = array()) {
459
  $value = $this->get_value($name);
460
- wp_editor($value, $name, array_merge(array('textarea_name' => 'options[' . esc_attr($name) . ']', 'wpautop' => false), $settings));
461
  if (!is_plugin_active('mce_table_buttons/mce_table_buttons.php')) {
462
  echo '<p class="description">You can install <a href="https://wordpress.org/plugins/mce-table-buttons/" target="_blank">MCE Table Button</a> for a table management toolbar add on.</p>';
463
  }
@@ -465,14 +438,14 @@ class NewsletterControls {
465
 
466
  function textarea($name, $width = '100%', $height = '50') {
467
  $value = $this->get_value($name);
468
- echo '<textarea id="options-' . esc_attr($name) . '" class="dynamic" name="options[' . esc_attr($name) . ']" wrap="off" style="width:' . esc_attr($width) . ';height:' . esc_attr($height) . '">';
469
  echo esc_html($value);
470
  echo '</textarea>';
471
  }
472
 
473
  function textarea_fixed($name, $width = '100%', $height = '200') {
474
  $value = $this->get_value($name);
475
- echo '<textarea id="options-' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']" wrap="off" style="width:' . esc_attr($width) . ';height:' . esc_attr($height) . 'px">';
476
  echo esc_html($value);
477
  echo '</textarea>';
478
  }
@@ -480,13 +453,13 @@ class NewsletterControls {
480
  function textarea_preview($name, $width = '100%', $height = '200', $header = '', $footer = '') {
481
  $value = $this->get_value($name);
482
  //do_action('newsletter_controls_textarea_preview', $name);
483
- echo '<input class="button" type="button" onclick="newsletter_textarea_preview(\'options-' . esc_attr($name) . '\', \'\', \'\')" value="Switch editor/preview">';
484
  echo '<br><br>';
485
  echo '<div style="position: relative">';
486
- echo '<textarea id="options-' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']" wrap="off" style="width:' . esc_attr($width) . ';height:' . esc_attr($height) . 'px">';
487
  echo esc_html($value);
488
  echo '</textarea>';
489
- echo '<iframe id="options-' . esc_attr($name) . '-iframe" class="newsletter-textarea-preview" style="background-color: #fff; width: ' . esc_attr($width) . '; height: ' . esc_attr($height) . 'px; position: absolute; top: 0; left: 0; z-index: 10000; display: none"></iframe>';
490
  echo '</div>';
491
  }
492
 
@@ -511,13 +484,13 @@ class NewsletterControls {
511
  if ($label != '') {
512
  echo '<label>';
513
  }
514
- echo '<input type="checkbox" id="' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']" value="1"';
515
  if (!empty($this->data[$name])) {
516
  echo ' checked="checked"';
517
  }
518
  echo '>';
519
  if ($label != '') {
520
- echo '&nbsp;' . esc_html($label) . '</label>';
521
  }
522
  }
523
 
@@ -525,15 +498,15 @@ class NewsletterControls {
525
  if ($label != '') {
526
  echo '<label>';
527
  }
528
- echo '<input type="checkbox" id="' . esc_attr($name) . '" onchange="document.getElementById(\'' . esc_attr($name) . '_hidden\').value=this.checked?\'1\':\'0\'"';
529
  if (!empty($this->data[$name])) {
530
  echo ' checked="checked"';
531
  }
532
  echo '>';
533
  if ($label != '') {
534
- echo '&nbsp;' . esc_html($label) . '</label>';
535
  }
536
- echo '<input type="hidden" id="' . esc_attr($name) . '_hidden" name="options[' . esc_attr($name) . ']" value="';
537
 
538
  echo empty($this->data[$name]) ? '0' : '1';
539
  echo '">';
@@ -543,14 +516,14 @@ class NewsletterControls {
543
  if ($label != '') {
544
  echo '<label>';
545
  }
546
- echo '<input type="radio" id="' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']" value="' . esc_attr($value) . '"';
547
  $v = $this->get_value($name);
548
  if ($v == $value) {
549
  echo ' checked="checked"';
550
  }
551
  echo '>';
552
  if ($label != '') {
553
- echo '&nbsp;' . esc_html($label) . '</label>';
554
  }
555
  }
556
 
@@ -559,13 +532,13 @@ class NewsletterControls {
559
  * the key $name an array containig the passed value.
560
  */
561
  function checkbox_group($name, $value, $label = '') {
562
- echo '<label><input type="checkbox" id="' . esc_attr($name) . '" name="options[' . esc_attr($name) . '][]" value="' . esc_attr($value) . '"';
563
  if (isset($this->data[$name]) && is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false) {
564
  echo ' checked';
565
  }
566
- echo '>';
567
  if ($label != '') {
568
- echo esc_html($label);
569
  }
570
  echo '</label>';
571
  }
@@ -579,7 +552,7 @@ class NewsletterControls {
579
  function categories($name = 'category') {
580
  $categories = get_categories();
581
  echo '<div class="newsletter-checkboxes-group">';
582
- foreach ($categories as $c) {
583
  echo '<div class="newsletter-checkboxes-item">';
584
  $this->checkbox($name . '_' . $c->cat_ID, esc_html($c->cat_name));
585
  echo '</div>';
@@ -698,8 +671,8 @@ class NewsletterControls {
698
  $year = date('Y', $this->data[$name]);
699
  $day = date('j', $this->data[$name]);
700
  $month = date('m', $this->data[$name]);
701
- $onchange = "this.form.elements['options[" . esc_attr($name) . "]'].value = new Date(document.getElementById('" . esc_attr($name) . "_year').value, document.getElementById('" . esc_attr($name) . "_month').value, document.getElementById('" . esc_attr($name) . "_day').value, 12, 0, 0).getTime()/1000";
702
- echo '<select id="' . $name . '_month" onchange="' . esc_attr($onchange) . '">';
703
  for ($i = 0; $i < 12; $i++) {
704
  echo '<option value="' . $i . '"';
705
  if ($month - 1 == $i) {
@@ -709,7 +682,7 @@ class NewsletterControls {
709
  }
710
  echo '</select>';
711
 
712
- echo '<select id="' . esc_attr($name) . '_day" onchange="' . esc_attr($onchange) . '">';
713
  for ($i = 1; $i <= 31; $i++) {
714
  echo '<option value="' . $i . '"';
715
  if ($day == $i) {
@@ -719,7 +692,7 @@ class NewsletterControls {
719
  }
720
  echo '</select>';
721
 
722
- echo '<select id="' . esc_attr($name) . '_year" onchange="' . esc_attr($onchange) . '">';
723
  for ($i = 2011; $i <= 2021; $i++) {
724
  echo '<option value="' . $i . '"';
725
  if ($year == $i) {
@@ -734,14 +707,14 @@ class NewsletterControls {
734
  * Date and time (hour) selector. Timestamp stored.
735
  */
736
  function datetime($name) {
737
- echo '<input type="hidden" name="fields[' . esc_attr($name) . ']" value="datetime">';
738
  $time = $this->data[$name] + get_option('gmt_offset') * 3600;
739
  $year = gmdate('Y', $time);
740
  $day = gmdate('j', $time);
741
  $month = gmdate('m', $time);
742
  $hour = gmdate('H', $time);
743
 
744
- echo '<select name="' . esc_attr($name) . '_month">';
745
  for ($i = 1; $i <= 12; $i++) {
746
  echo '<option value="' . $i . '"';
747
  if ($month == $i) {
@@ -751,7 +724,7 @@ class NewsletterControls {
751
  }
752
  echo '</select>';
753
 
754
- echo '<select name="' . esc_attr($name) . '_day">';
755
  for ($i = 1; $i <= 31; $i++) {
756
  echo '<option value="' . $i . '"';
757
  if ($day == $i) {
@@ -761,7 +734,7 @@ class NewsletterControls {
761
  }
762
  echo '</select>';
763
 
764
- echo '<select name="' . esc_attr($name) . '_year">';
765
  for ($i = 2011; $i <= 2021; $i++) {
766
  echo '<option value="' . $i . '"';
767
  if ($year == $i) {
@@ -771,7 +744,7 @@ class NewsletterControls {
771
  }
772
  echo '</select>';
773
 
774
- echo '<select name="' . esc_attr($name) . '_hour">';
775
  for ($i = 0; $i <= 23; $i++) {
776
  echo '<option value="' . $i . '"';
777
  if ($hour == $i) {
@@ -865,7 +838,7 @@ class NewsletterControls {
865
 
866
  function js_redirect($url) {
867
  echo '<script>';
868
- echo 'location.href="' . esc_js($url) . '"';
869
  echo '</script>';
870
  }
871
 
@@ -886,7 +859,7 @@ class NewsletterControls {
886
  function css_font_size($name) {
887
  $value = $this->get_value($name);
888
 
889
- echo '<select id="options-' . esc_attr($name) . '" name="options[' . esc_attr($name) . ']">';
890
  for ($i = 8; $i < 50; $i++) {
891
  echo '<option value="' . $i . '"';
892
  if ($value == $i) {
@@ -900,7 +873,7 @@ class NewsletterControls {
900
  function css_border($name) {
901
  $value = $this->get_value($name . '_width');
902
 
903
- echo 'width&nbsp;<select id="options-' . esc_attr($name) . '-width" name="options[' . esc_attr($name) . '_width]">';
904
  for ($i = 0; $i < 10; $i++) {
905
  echo '<option value="' . $i . '"';
906
  if ($value == $i) {
@@ -916,7 +889,7 @@ class NewsletterControls {
916
 
917
  $value = $this->get_value($name . '_radius');
918
 
919
- echo '&nbsp;&nbsp;radius&nbsp;<select id="options-' . esc_attr($name) . '-radius" name="options[' . esc_attr($name) . '_radius]">';
920
  for ($i = 0; $i < 10; $i++) {
921
  echo '<option value="' . $i . '"';
922
  if ($value == $i) {
@@ -934,24 +907,24 @@ class NewsletterControls {
934
 
935
  if ($media === false) {
936
  $media = array('', '', '');
937
- echo '<img style="width: 200px" id="' . esc_attr($name) . '_img" src="' . plugins_url('newsletter') . '/images/nomedia.png" onclick="newsletter_media(\'' . esc_attr($name) . '\')">';
938
  } else {
939
- echo '<img style="width: 200px" id="' . esc_attr($name) . '_img" src="' . $media[0] . '" onclick="newsletter_media(\'' . esc_attr($name) . '\')">';
940
  echo '<br>';
941
- echo '<a href="#" onclick="newsletter_media_remove(\'' . esc_attr($name) . '\'); return false">Remove</a>';
942
  }
943
 
944
- echo '<input type="hidden" id="' . esc_attr($name) . '_id" name="options[' . esc_attr($name) . '][id]" value="' . esc_attr($media_id) . '" size="5">';
945
- echo '<input type="hidden" id="' . esc_attr($name) . '_url" name="options[' . esc_attr($name) . '][url]" value="' . esc_attr($media_full[0]) . '" size="50">';
946
  }
947
 
948
  function media_input($option, $name, $label) {
949
 
950
  if (!empty($label)) {
951
- $output = '<label class="select" for="tnp_' . esc_attr($name) . '">' . esc_html($label) . ':</label>';
952
  }
953
- $output .= '<input id="tnp_' . esc_attr($name) . '" type="text" size="36" name="' . esc_attr($option) . '[' . esc_attr($name) . ']" value="' . esc_attr($val) . '" />';
954
- $output .= '<input id="tnp_' . esc_attr($name) . '_button" class="button" type="button" value="Select Image" />';
955
  $output .= '<br class="clear"/>';
956
 
957
  echo $output;
1
  <?php
 
2
 
3
  class NewsletterControls {
4
 
112
  }
113
 
114
  function add_message_saved() {
115
+ if (!empty($this->messages))
116
  $this->messages .= '<br><br>';
 
117
  $this->messages .= __('Saved.', 'newsletter');
118
  }
 
 
 
 
 
 
 
119
 
120
  function hint($text, $url = '') {
121
  echo '<div class="hints">';
 
122
  echo $text;
123
  if (!empty($url)) {
124
+ echo " <a href='$url' target='_blank'>Read more</a>.";
125
  }
126
  echo '</div>';
127
  }
129
  function yesno($name) {
130
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
131
 
132
+ echo '<select style="width: 60px" name="options[' . $name . ']">';
133
  echo '<option value="0"';
134
+ if ($value == 0)
135
  echo ' selected';
 
136
  echo '>No</option>';
137
  echo '<option value="1"';
138
+ if ($value == 1)
139
  echo ' selected';
 
140
  echo '>Yes</option>';
141
  echo '</select>&nbsp;&nbsp;&nbsp;';
142
  }
144
  function enabled($name) {
145
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
146
 
147
+ echo '<select style="width: 100px" name="options[' . $name . ']">';
148
  echo '<option value="0"';
149
  if ($value == 0) {
150
  echo ' selected';
161
  function disabled($name) {
162
  $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
163
 
164
+ echo '<select style="width: 100px" name="options[' . $name . ']">';
165
  echo '<option value="0"';
166
+ if ($value == 0)
167
  echo ' selected';
 
168
  echo '>Enabled</option>';
169
  echo '<option value="1"';
170
+ if ($value == 1)
171
  echo ' selected';
 
172
  echo '>Disabled</option>';
173
  echo '</select>';
174
  }
191
  echo "<div class='newsletter-checkboxes-group'>";
192
  foreach ($values_labels as $value => $label) {
193
  echo "<div class='newsletter-checkboxes-item'>";
194
+ echo "<label><input type='checkbox' id='$name' name='options[$name][]' value='$value'";
195
+ if (array_search($value, $value_array) !== false)
196
+ echo " checked";
197
+ echo '/>';
198
+ if ($label != '')
199
+ echo $label;
 
 
200
  echo "</label></div>";
201
  }
202
  echo "</div><div style='clear: both'></div>";
207
  function post_types($name = 'post_types') {
208
  $list = array();
209
  $post_types = get_post_types(array('public' => true), 'objects', 'and');
210
+ foreach ($post_types as &$post_type) {
211
  $list[$post_type->name] = $post_type->labels->name;
212
  }
213
 
214
  $this->checkboxes_group($name, $list);
215
  }
 
 
 
 
 
 
 
 
 
216
 
217
  /** Used to create a select which is part of a group of controls identified by $name that will
218
  * produce an array of values as $_REQUEST['name'].
222
  function select_group($name, $options) {
223
  $value_array = $this->get_value_array($name);
224
 
225
+ echo '<select name="options[' . $name . '][]">';
226
 
227
  foreach ($options as $key => $label) {
228
+ echo '<option value="' . $key . '"';
229
  if (array_search($key, $value_array) !== false) {
230
  echo ' selected';
231
  }
232
+ echo '>' . htmlspecialchars($label) . '</option>';
233
  }
234
 
235
  echo '</select>';
238
  function select($name, $options, $first = null) {
239
  $value = $this->get_value($name);
240
 
241
+ echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
242
  if (!empty($first)) {
243
+ echo '<option value="">' . htmlspecialchars($first) . '</option>';
244
  }
245
  foreach ($options as $key => $label) {
246
+ echo '<option value="' . $key . '"';
247
  if ($value == $key)
248
  echo ' selected';
249
+ echo '>' . htmlspecialchars($label) . '</option>';
250
  }
251
  echo '</select>';
252
  }
257
  echo '<select name="options[' . $name . ']">';
258
 
259
  foreach ($groups as $group) {
260
+ echo '<optgroup label="' . htmlspecialchars($group['']) . '">';
261
  if (!empty($group)) {
262
  foreach ($group as $key => $label) {
263
+ if ($key == '')
264
  continue;
265
+ echo '<option value="' . $key . '"';
266
+ if ($value == $key)
 
267
  echo ' selected';
268
+ echo '>' . htmlspecialchars($label) . '</option>';
 
269
  }
270
  }
271
  echo '</optgroup>';
280
  function themes($name, $themes, $submit_on_click = true) {
281
  foreach ($themes as $key => $data) {
282
  echo '<label style="display: block; float: left; text-align: center; margin-right: 10px;">';
283
+ echo $key . '<br>';
284
+ echo '<img src="' . $data['screenshot'] . '" width="100" height="100" style="border: 1px solid #666; padding: 5px"><br>';
285
+ echo '<input style="position: relative; top: -40px" type="radio" onchange="this.form.act.value=\'theme\';this.form.submit()" name="options[' . $name . ']" value="' . $key . '"';
286
  if ($this->data[$name] == $key) {
287
  echo ' checked';
288
  }
326
 
327
  function text_email($name, $size = 40) {
328
  $value = $this->get_value($name);
329
+ echo '<input name="options[' . $name . ']" type="email" placeholder="';
330
  echo esc_attr(__('Valid email address', 'newsletter'));
331
+ echo '" size="' . $size . '" value="';
332
  echo esc_attr($value);
333
  echo '">';
334
  }
335
 
336
  function text_url($name, $size = 40) {
337
  $value = $this->get_value($name);
338
+ echo '<input name="options[' . $name . ']" type="url" placeholder="http://..." size="' . $size . '" value="';
339
+ echo htmlspecialchars($value);
340
  echo '"/>';
341
  }
342
 
343
  function hidden($name) {
344
  $value = $this->get_value($name);
345
  echo '<input name="options[' . $name . ']" type="hidden" value="';
346
+ echo htmlspecialchars($value);
347
  echo '"/>';
348
  }
349
 
350
  function button($action, $label, $function = null) {
351
  if ($function != null) {
352
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';' . htmlspecialchars($function) . '"/>';
353
  } else {
354
+ echo '<input class="button-secondary" type="submit" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';return true;"/>';
355
  }
356
  }
357
 
373
 
374
  function button_back($url) {
375
  echo '<a href="';
376
+ echo $url;
377
  echo '" class="button"><i class="fa fa-chevron-left"></i>&nbsp;';
378
  _e('Back', 'newsletter');
379
  echo '</a>';
407
 
408
  function button_primary($action, $label, $function = null) {
409
  if ($function != null) {
410
+ echo '<input class="button-primary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';' . htmlspecialchars($function) . '"/>';
411
  } else {
412
+ echo '<input class="button-primary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
413
  }
414
  }
415
 
416
  function button_confirm($action, $label, $message = '', $data = '') {
417
  if (empty($message)) {
418
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
419
  } else {
420
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';if (confirm(\'' .
421
  esc_attr(esc_js($message)) . '\')) this.form.submit()"/>';
422
  }
423
  }
424
 
425
  function editor($name, $rows = 5, $cols = 75) {
426
+ echo '<textarea class="visual" name="options[' . $name . ']" style="width: 100%" wrap="off" rows="' . $rows . '">';
427
  echo esc_html($this->get_value($name));
428
  echo '</textarea>';
429
  }
430
 
431
  function wp_editor($name, $settings = array()) {
432
  $value = $this->get_value($name);
433
+ wp_editor($value, $name, array_merge(array('textarea_name' => 'options[' . $name . ']', 'wpautop' => false), $settings));
434
  if (!is_plugin_active('mce_table_buttons/mce_table_buttons.php')) {
435
  echo '<p class="description">You can install <a href="https://wordpress.org/plugins/mce-table-buttons/" target="_blank">MCE Table Button</a> for a table management toolbar add on.</p>';
436
  }
438
 
439
  function textarea($name, $width = '100%', $height = '50') {
440
  $value = $this->get_value($name);
441
+ echo '<textarea class="dynamic" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . '">';
442
  echo esc_html($value);
443
  echo '</textarea>';
444
  }
445
 
446
  function textarea_fixed($name, $width = '100%', $height = '200') {
447
  $value = $this->get_value($name);
448
+ echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
449
  echo esc_html($value);
450
  echo '</textarea>';
451
  }
453
  function textarea_preview($name, $width = '100%', $height = '200', $header = '', $footer = '') {
454
  $value = $this->get_value($name);
455
  //do_action('newsletter_controls_textarea_preview', $name);
456
+ echo '<input class="button" type="button" onclick="newsletter_textarea_preview(\'options-' . $name . '\', \'\', \'\')" value="Switch editor/preview">';
457
  echo '<br><br>';
458
  echo '<div style="position: relative">';
459
+ echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
460
  echo esc_html($value);
461
  echo '</textarea>';
462
+ echo '<iframe id="options-' . $name . '-iframe" class="newsletter-textarea-preview" style="background-color: #fff; width: ' . $width . '; height: ' . $height . 'px; position: absolute; top: 0; left: 0; z-index: 10000; display: none"></iframe>';
463
  echo '</div>';
464
  }
465
 
484
  if ($label != '') {
485
  echo '<label>';
486
  }
487
+ echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . ']" value="1"';
488
  if (!empty($this->data[$name])) {
489
  echo ' checked="checked"';
490
  }
491
  echo '>';
492
  if ($label != '') {
493
+ echo '&nbsp;' . $label . '</label>';
494
  }
495
  }
496
 
498
  if ($label != '') {
499
  echo '<label>';
500
  }
501
+ echo '<input type="checkbox" id="' . $name . '" onchange="document.getElementById(\'' . $name . '_hidden\').value=this.checked?\'1\':\'0\'"';
502
  if (!empty($this->data[$name])) {
503
  echo ' checked="checked"';
504
  }
505
  echo '>';
506
  if ($label != '') {
507
+ echo '&nbsp;' . $label . '</label>';
508
  }
509
+ echo '<input type="hidden" id="' . $name . '_hidden" name="options[' . $name . ']" value="';
510
 
511
  echo empty($this->data[$name]) ? '0' : '1';
512
  echo '">';
516
  if ($label != '') {
517
  echo '<label>';
518
  }
519
+ echo '<input type="radio" id="' . $name . '" name="options[' . $name . ']" value="' . esc_attr($value) . '"';
520
  $v = $this->get_value($name);
521
  if ($v == $value) {
522
  echo ' checked="checked"';
523
  }
524
  echo '>';
525
  if ($label != '') {
526
+ echo '&nbsp;' . $label . '</label>';
527
  }
528
  }
529
 
532
  * the key $name an array containig the passed value.
533
  */
534
  function checkbox_group($name, $value, $label = '') {
535
+ echo '<label><input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . esc_attr($value) . '"';
536
  if (isset($this->data[$name]) && is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false) {
537
  echo ' checked';
538
  }
539
+ echo '/>';
540
  if ($label != '') {
541
+ echo $label;
542
  }
543
  echo '</label>';
544
  }
552
  function categories($name = 'category') {
553
  $categories = get_categories();
554
  echo '<div class="newsletter-checkboxes-group">';
555
+ foreach ($categories as &$c) {
556
  echo '<div class="newsletter-checkboxes-item">';
557
  $this->checkbox($name . '_' . $c->cat_ID, esc_html($c->cat_name));
558
  echo '</div>';
671
  $year = date('Y', $this->data[$name]);
672
  $day = date('j', $this->data[$name]);
673
  $month = date('m', $this->data[$name]);
674
+ $onchange = "this.form.elements['options[" . $name . "]'].value = new Date(document.getElementById('" . $name . "_year').value, document.getElementById('" . $name . "_month').value, document.getElementById('" . $name . "_day').value, 12, 0, 0).getTime()/1000";
675
+ echo '<select id="' . $name . '_month" onchange="' . $onchange . '">';
676
  for ($i = 0; $i < 12; $i++) {
677
  echo '<option value="' . $i . '"';
678
  if ($month - 1 == $i) {
682
  }
683
  echo '</select>';
684
 
685
+ echo '<select id="' . $name . '_day" onchange="' . $onchange . '">';
686
  for ($i = 1; $i <= 31; $i++) {
687
  echo '<option value="' . $i . '"';
688
  if ($day == $i) {
692
  }
693
  echo '</select>';
694
 
695
+ echo '<select id="' . $name . '_year" onchange="' . $onchange . '">';
696
  for ($i = 2011; $i <= 2021; $i++) {
697
  echo '<option value="' . $i . '"';
698
  if ($year == $i) {
707
  * Date and time (hour) selector. Timestamp stored.
708
  */
709
  function datetime($name) {
710
+ echo '<input type="hidden" name="fields[' . $name . ']" value="datetime">';
711
  $time = $this->data[$name] + get_option('gmt_offset') * 3600;
712
  $year = gmdate('Y', $time);
713
  $day = gmdate('j', $time);
714
  $month = gmdate('m', $time);
715
  $hour = gmdate('H', $time);
716
 
717
+ echo '<select name="' . $name . '_month">';
718
  for ($i = 1; $i <= 12; $i++) {
719
  echo '<option value="' . $i . '"';
720
  if ($month == $i) {
724
  }
725
  echo '</select>';
726
 
727
+ echo '<select name="' . $name . '_day">';
728
  for ($i = 1; $i <= 31; $i++) {
729
  echo '<option value="' . $i . '"';
730
  if ($day == $i) {
734
  }
735
  echo '</select>';
736
 
737
+ echo '<select name="' . $name . '_year">';
738
  for ($i = 2011; $i <= 2021; $i++) {
739
  echo '<option value="' . $i . '"';
740
  if ($year == $i) {
744
  }
745
  echo '</select>';
746
 
747
+ echo '<select name="' . $name . '_hour">';
748
  for ($i = 0; $i <= 23; $i++) {
749
  echo '<option value="' . $i . '"';
750
  if ($hour == $i) {
838
 
839
  function js_redirect($url) {
840
  echo '<script>';
841
+ echo 'location.href="' . $url . '"';
842
  echo '</script>';
843
  }
844
 
859
  function css_font_size($name) {
860
  $value = $this->get_value($name);
861
 
862
+ echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
863
  for ($i = 8; $i < 50; $i++) {
864
  echo '<option value="' . $i . '"';
865
  if ($value == $i) {
873
  function css_border($name) {
874
  $value = $this->get_value($name . '_width');
875
 
876
+ echo 'width&nbsp;<select id="options-' . $name . '-width" name="options[' . $name . '_width]">';
877
  for ($i = 0; $i < 10; $i++) {
878
  echo '<option value="' . $i . '"';
879
  if ($value == $i) {
889
 
890
  $value = $this->get_value($name . '_radius');
891
 
892
+ echo '&nbsp;&nbsp;radius&nbsp;<select id="options-' . $name . '-radius" name="options[' . $name . '_radius]">';
893
  for ($i = 0; $i < 10; $i++) {
894
  echo '<option value="' . $i . '"';
895
  if ($value == $i) {
907
 
908
  if ($media === false) {
909
  $media = array('', '', '');
910
+ echo '<img style="width: 200px" id="' . $name . '_img" src="' . plugins_url('newsletter') . '/images/nomedia.png" onclick="newsletter_media(\'' . $name . '\')">';
911
  } else {
912
+ echo '<img style="width: 200px" id="' . $name . '_img" src="' . $media[0] . '" onclick="newsletter_media(\'' . $name . '\')">';
913
  echo '<br>';
914
+ echo '<a href="#" onclick="newsletter_media_remove(\'' . $name . '\'); return false">Remove</a>';
915
  }
916
 
917
+ echo '<input type="hidden" id="' . $name . '_id" name="options[' . $name . '][id]" value="' . $media_id . '" size="5">';
918
+ echo '<input type="hidden" id="' . $name . '_url" name="options[' . $name . '][url]" value="' . esc_attr($media_full[0]) . '" size="50">';
919
  }
920
 
921
  function media_input($option, $name, $label) {
922
 
923
  if (!empty($label)) {
924
+ $output = '<label class="select" for="tnp_' . $name . '">' . $label . ':</label>';
925
  }
926
+ $output .= '<input id="tnp_' . $name . '" type="text" size="36" name="' . $option . '[' . $name . ']" value="' . esc_attr($val) . '" />';
927
+ $output .= '<input id="tnp_' . $name . '_button" class="button" type="button" value="Select Image" />';
928
  $output .= '<br class="clear"/>';
929
 
930
  echo $output;
includes/helper.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
5
  $media = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size);
6
- if (strpos($media[0], 'http') !== 0) $media[0] = 'http:' . $media[0];
7
  return $media[0];
8
  }
9
 
1
  <?php
 
2
 
3
  function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
4
  $media = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size);
 
5
  return $media[0];
6
  }
7
 
includes/logger.php CHANGED
@@ -1,84 +1,77 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- if (!defined('NEWSLETTER_LOG_DIR')) {
5
- define('NEWSLETTER_LOG_DIR', WP_CONTENT_DIR . '/logs/newsletter/');
6
- }
7
-
8
- class NewsletterLogger {
9
-
10
- const NONE = 0;
11
- const FATAL = 1;
12
- const ERROR = 2;
13
- const INFO = 3;
14
- const DEBUG = 4;
15
-
16
- var $level;
17
- var $module;
18
- var $file;
19
-
20
- function __construct($module) {
21
- $this->module = $module;
22
- if (defined('NEWSLETTER_LOG_LEVEL')) $this->level = NEWSLETTER_LOG_LEVEL;
23
- else $this->level = get_option('newsletter_log_level', self::ERROR);
24
-
25
- $secret = get_option('newsletter_logger_secret');
26
- if (strlen($secret) < 8) {
27
- $secret = NewsletterModule::get_token(8);
28
- update_option('newsletter_logger_secret', $secret);
29
- }
30
-
31
- if (!wp_mkdir_p(NEWSLETTER_LOG_DIR)) {
32
- $this->level = self::NONE;
33
- }
34
-
35
- $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . date('Y-m') . '-' . $secret . '.txt';
36
- }
37
-
38
- function log($text, $level = self::ERROR) {
39
-
40
- if ($this->level < $level) return;
41
-
42
- $time = date('d-m-Y H:i:s ');
43
- switch ($level) {
44
- case self::FATAL: $time .= '- FATAL';
45
- break;
46
- case self::ERROR: $time .= '- ERROR';
47
- break;
48
- case self::INFO: $time .= '- INFO ';
49
- break;
50
- case self::DEBUG: $time .= '- DEBUG';
51
- break;
52
- }
53
- if (is_wp_error($text)) {
54
- /* @var $text WP_Error */
55
- $text = $text->get_error_message() . ' (' . $text->get_error_code() . ')';
56
- } else {
57
- if (is_array($text) || is_object($text)) $text = print_r($text, true);
58
- }
59
- // The "logs" dir is created on Newsletter constructor.
60
- $current_user_id = 0;
61
- if (function_exists('get_current_user_id')) $current_user_id = get_current_user_id();
62
- $res = @file_put_contents($this->file, $time . ' - m: ' . size_format(memory_get_usage(), 1) . ', u: ' . $current_user_id . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
63
- if ($res === false) {
64
- $this->level = self::NONE;
65
- }
66
- }
67
-
68
- function error($text) {
69
- self::log($text, self::ERROR);
70
- }
71
-
72
- function info($text) {
73
- $this->log($text, self::INFO);
74
- }
75
-
76
- function fatal($text) {
77
- $this->log($text, self::FATAL);
78
- }
79
-
80
- function debug($text) {
81
- $this->log($text, self::DEBUG);
82
- }
83
-
84
- }
1
+ <?php
2
+
3
+ if (!defined('NEWSLETTER_LOG_DIR')) {
4
+ define('NEWSLETTER_LOG_DIR', WP_CONTENT_DIR . '/logs/newsletter/');
5
+ }
6
+
7
+ class NewsletterLogger {
8
+
9
+ const NONE = 0;
10
+ const FATAL = 1;
11
+ const ERROR = 2;
12
+ const INFO = 3;
13
+ const DEBUG = 4;
14
+
15
+ var $level;
16
+ var $module;
17
+ var $file;
18
+
19
+ function __construct($module) {
20
+ $this->module = $module;
21
+ if (defined('NEWSLETTER_LOG_LEVEL')) $this->level = NEWSLETTER_LOG_LEVEL;
22
+ else $this->level = get_option('newsletter_log_level', self::ERROR);
23
+
24
+ $secret = get_option('newsletter_logger_secret');
25
+ if (strlen($secret) < 8) {
26
+ $secret = NewsletterModule::get_token(8);
27
+ update_option('newsletter_logger_secret', $secret);
28
+ }
29
+
30
+ if (!wp_mkdir_p(NEWSLETTER_LOG_DIR)) {
31
+ $this->level = self::NONE;
32
+ }
33
+
34
+ $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . $secret . '.txt';
35
+ }
36
+
37
+ function log($text, $level = self::ERROR) {
38
+
39
+ if ($this->level < $level) return;
40
+
41
+ $time = date('d-m-Y H:i:s ');
42
+ switch ($level) {
43
+ case self::FATAL: $time .= '- FATAL';
44
+ break;
45
+ case self::ERROR: $time .= '- ERROR';
46
+ break;
47
+ case self::INFO: $time .= '- INFO ';
48
+ break;
49
+ case self::DEBUG: $time .= '- DEBUG';
50
+ break;
51
+ }
52
+ if (is_array($text) || is_object($text)) $text = print_r($text, true);
53
+
54
+ // The "logs" dir is created on Newsletter constructor.
55
+ $res = @file_put_contents($this->file, $time . ' - ' . size_format(memory_get_usage(), 1) . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
56
+ if ($res === false) {
57
+ $this->level = self::NONE;
58
+ }
59
+ }
60
+
61
+ function error($text) {
62
+ self::log($text, self::ERROR);
63
+ }
64
+
65
+ function info($text) {
66
+ $this->log($text, self::INFO);
67
+ }
68
+
69
+ function fatal($text) {
70
+ $this->log($text, self::FATAL);
71
+ }
72
+
73
+ function debug($text) {
74
+ $this->log($text, self::DEBUG);
75
+ }
76
+
77
+ }
 
 
 
 
 
 
 
includes/module.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  class NewsletterModule {
5
 
@@ -62,7 +61,6 @@ class NewsletterModule {
62
 
63
  if ($this->old_version == '0.0.0') {
64
  $this->first_install();
65
- update_option($this->prefix."_first_install_time", time(), FALSE);
66
  }
67
 
68
  if (strcmp($this->old_version, $this->version) != 0) {
@@ -102,9 +100,9 @@ class NewsletterModule {
102
  $options = array_merge($default_options, $options);
103
  $this->save_options($options, $sub);
104
  if ($autoload) {
105
- $this->upgrade_query('update ' . $wpdb->options . " set autoload='yes' where option_name='" . esc_sql($this->get_prefix($sub)) . "' limit 1");
106
  } else {
107
- $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . esc_sql($this->get_prefix($sub)) . "' limit 1");
108
  }
109
  }
110
 
@@ -377,7 +375,7 @@ class NewsletterModule {
377
  static function format_scheduler_time($name) {
378
  $time = wp_next_scheduled($name);
379
  if ($time === false) {
380
- return 'No next run scheduled';
381
  }
382
  $delta = $time - time();
383
  // If less 10 minutes late it can be a cron problem but now it is working
@@ -498,21 +496,19 @@ class NewsletterModule {
498
  }
499
 
500
  $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/styles';
501
- if (is_dir($dir)) {
502
- $handle = @opendir($dir);
503
-
504
- if ($handle !== false) {
505
- while ($file = readdir($handle)) {
506
- if ($file == '.' || $file == '..')
507
- continue;
508
- if (isset($list[$file]))
509
- continue;
510
- if (substr($file, -4) != '.css')
511
- continue;
512
- $list[$file] = substr($file, 0, strlen($file) - 4);
513
- }
514
- closedir($handle);
515
  }
 
516
  }
517
  return $list;
518
  }
@@ -530,6 +526,16 @@ class NewsletterModule {
530
 
531
  function add_menu_page($page, $title) {
532
  global $newsletter;
 
 
 
 
 
 
 
 
 
 
533
  $name = 'newsletter_' . $this->module . '_' . $page;
534
  add_submenu_page('newsletter_main_index', $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
535
  }
@@ -540,7 +546,7 @@ class NewsletterModule {
540
  $name = apply_filters('newsletter_admin_page', $name);
541
  add_submenu_page(null, $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
542
  }
543
-
544
  function sanitize_file_name($name) {
545
  return preg_replace('/[^a-z_\\-]/i', '', $name);
546
  }
@@ -751,7 +757,6 @@ class NewsletterModule {
751
  echo '<html><head></head><body>';
752
  echo '<form method="post" action="' . home_url('/') . '" id="form">';
753
  foreach ($_REQUEST as $name => $value) {
754
- if ($name == 'submit') continue;
755
  if (is_array($value)) {
756
  foreach ($value as $element) {
757
  echo '<input type="hidden" name="';
1
  <?php
 
2
 
3
  class NewsletterModule {
4
 
61
 
62
  if ($this->old_version == '0.0.0') {
63
  $this->first_install();
 
64
  }
65
 
66
  if (strcmp($this->old_version, $this->version) != 0) {
100
  $options = array_merge($default_options, $options);
101
  $this->save_options($options, $sub);
102
  if ($autoload) {
103
+ $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . $this->get_prefix($sub) . "' limit 1");
104
  } else {
105
+ $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . $this->get_prefix($sub) . "' limit 1");
106
  }
107
  }
108
 
375
  static function format_scheduler_time($name) {
376
  $time = wp_next_scheduled($name);
377
  if ($time === false) {
378
+ return 'Not active';
379
  }
380
  $delta = $time - time();
381
  // If less 10 minutes late it can be a cron problem but now it is working
496
  }
497
 
498
  $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/styles';
499
+ $handle = @opendir($dir);
500
+
501
+ if ($handle !== false) {
502
+ while ($file = readdir($handle)) {
503
+ if ($file == '.' || $file == '..')
504
+ continue;
505
+ if (isset($list[$file]))
506
+ continue;
507
+ if (substr($file, -4) != '.css')
508
+ continue;
509
+ $list[$file] = substr($file, 0, strlen($file) - 4);
 
 
 
510
  }
511
+ closedir($handle);
512
  }
513
  return $list;
514
  }
526
 
527
  function add_menu_page($page, $title) {
528
  global $newsletter;
529
+
530
+ // Why check the plugin dir? I don't remember!
531
+ // $file = WP_PLUGIN_DIR . '/newsletter-' . $this->module . '/' . $page . '.php';
532
+ // if (!is_file($file)) {
533
+ // $file = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/' . $page . '.php';
534
+ // }
535
+ // if (!is_file($file)) {
536
+ // $file = NEWSLETTER_DIR . '/' . $this->module . '/' . $page . '.php';
537
+ // }
538
+
539
  $name = 'newsletter_' . $this->module . '_' . $page;
540
  add_submenu_page('newsletter_main_index', $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
541
  }
546
  $name = apply_filters('newsletter_admin_page', $name);
547
  add_submenu_page(null, $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
548
  }
549
+
550
  function sanitize_file_name($name) {
551
  return preg_replace('/[^a-z_\\-]/i', '', $name);
552
  }
757
  echo '<html><head></head><body>';
758
  echo '<form method="post" action="' . home_url('/') . '" id="form">';
759
  foreach ($_REQUEST as $name => $value) {
 
760
  if (is_array($value)) {
761
  foreach ($value as $element) {
762
  echo '<input type="hidden" name="';
includes/store.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  @require_once NEWSLETTER_INCLUDES_DIR . '/logger.php';
5
 
@@ -116,7 +115,7 @@ class NewsletterStore {
116
  if ($r === false) {
117
  $this->logger->fatal($wpdb->last_error);
118
  $this->logger->fatal($wpdb->last_query);
119
- die('Database error see the log files (log files path can be found on Newsletter diagnostic panel)');
120
  }
121
  }
122
  //$this->logger->debug('save: ' . $wpdb->last_query);
@@ -125,7 +124,7 @@ class NewsletterStore {
125
  if ($r === false) {
126
  $this->logger->fatal($wpdb->last_error);
127
  $this->logger->fatal($wpdb->last_query);
128
- die('Database error see the log files (log files path can be found on Newsletter diagnostic panel)');
129
  }
130
  $id = $wpdb->insert_id;
131
  }
1
  <?php
 
2
 
3
  @require_once NEWSLETTER_INCLUDES_DIR . '/logger.php';
4
 
115
  if ($r === false) {
116
  $this->logger->fatal($wpdb->last_error);
117
  $this->logger->fatal($wpdb->last_query);
118
+ die('Database error.');
119
  }
120
  }
121
  //$this->logger->debug('save: ' . $wpdb->last_query);
124
  if ($r === false) {
125
  $this->logger->fatal($wpdb->last_error);
126
  $this->logger->fatal($wpdb->last_query);
127
+ die('Database error.');
128
  }
129
  $id = $wpdb->insert_id;
130
  }
includes/themes.php CHANGED
@@ -1,218 +1,217 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- class NewsletterThemes {
5
-
6
- var $module;
7
- var $is_extension = false;
8
-
9
- function __construct($module, $is_extension = false) {
10
- $this->module = $module;
11
- $this->is_extension = $is_extension;
12
- }
13
-
14
- /** Loads all themes of a module (actually only "emails" module makes sense). Themes are located inside the subfolder
15
- * named as the module on plugin folder and on a subfolder named as the module on wp-content/newsletter folder (which
16
- * must be manually created).
17
- *
18
- * @param type $module
19
- * @return type
20
- */
21
- function get_all() {
22
- $list = array();
23
-
24
- $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes';
25
- $handle = @opendir($dir);
26
-
27
- if ($handle !== false) {
28
- while ($file = readdir($handle)) {
29
- if ($file == '.' || $file == '..')
30
- continue;
31
- if (!is_file($dir . '/' . $file . '/theme.php'))
32
- continue;
33
- $list[$file] = $file;
34
- }
35
- closedir($handle);
36
- }
37
-
38
- if (!$this->is_extension) {
39
- $dir = NEWSLETTER_DIR . '/' . $this->module . '/themes';
40
- $handle = @opendir($dir);
41
-
42
- if ($handle !== false) {
43
- while ($file = readdir($handle)) {
44
- if ($file == '.' || $file == '..')
45
- continue;
46
- if (isset($list[$file]))
47
- continue;
48
- if (!is_file($dir . '/' . $file . '/theme.php'))
49
- continue;
50
-
51
- $list[$file] = $file;
52
- }
53
- closedir($handle);
54
- }
55
- }
56
-
57
- return $list;
58
- }
59
-
60
- function themescmp($a, $b) {
61
- $al = strtolower($a['name']);
62
- $bl = strtolower($b['name']);
63
- if ($al == 'default') {
64
- return -1;
65
- }
66
- return (strcmp($al, $bl));
67
- }
68
-
69
- function get_all_with_data() {
70
- $list = array();
71
-
72
- $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes';
73
- $handle = @opendir($dir);
74
-
75
- if ($handle !== false) {
76
- while ($file = readdir($handle)) {
77
- if ($file == '.' || $file == '..') {
78
- continue;
79
- }
80
- if (isset($list[$file])) {
81
- continue;
82
- }
83
- if (!is_file($dir . '/' . $file . '/theme.php')) {
84
- continue;
85
- }
86
- $data = get_file_data($dir . '/' . $file . '/theme.php', array('name' => 'Name', 'type' => 'Type', 'description'=>'Description'));
87
- $data['id'] = $file;
88
- if (empty($data['name'])) {
89
- $data['name'] = $file;
90
- }
91
- if (empty($data['type'])) {
92
- $data['type'] = 'standard';
93
- }
94
- $screenshot = $dir . '/' . $file . '/screenshot.png';
95
- if (is_file($screenshot)) {
96
- $data['screenshot'] = $this->get_theme_url($file) . '/screenshot.png';
97
- } else {
98
- $data['screenshot'] = plugins_url('newsletter') . '/images/theme-screenshot.png';
99
- }
100
- $list[$file] = $data;
101
- }
102
- closedir($handle);
103
- }
104
-
105
- if (!$this->is_extension) {
106
- $dir = NEWSLETTER_DIR . '/' . $this->module . '/themes';
107
- $handle = @opendir($dir);
108
-
109
- if ($handle !== false) {
110
- while ($file = readdir($handle)) {
111
- if ($file == '.' || $file == '..') {
112
- continue;
113
- }
114
- if (!is_file($dir . '/' . $file . '/theme.php')) {
115
- continue;
116
- }
117
- $data = get_file_data($dir . '/' . $file . '/theme.php', array('name' => 'Name', 'type' => 'Type', 'description'=>'Description'));
118
- $data['id'] = $file;
119
- if (empty($data['name'])) {
120
- $data['name'] = $file;
121
- }
122
- if (empty($data['type'])) {
123
- $data['type'] = 'standard';
124
- }
125
- $screenshot = $dir . '/' . $file . '/screenshot.png';
126
- if (is_file($screenshot)) {
127
- $data['screenshot'] = $this->get_theme_url($file) . '/screenshot.png';
128
- } else {
129
- $data['screenshot'] = plugins_url('newsletter') . '/images/theme-screenshot.png';
130
- }
131
- $list[$file] = $data;
132
- }
133
- closedir($handle);
134
- }
135
- }
136
-
137
- usort($list, array($this, "themescmp"));
138
-
139
- return $list;
140
- }
141
-
142
- /**
143
- *
144
- * @param type $theme
145
- * @param type $options
146
- * @param type $module
147
- */
148
- function save_options($theme, &$options) {
149
- add_option('newsletter_' . $this->module . '_theme_' . $theme, array(), null, 'no');
150
- $theme_options = array();
151
- foreach ($options as $key => &$value) {
152
- if (substr($key, 0, 6) != 'theme_')
153
- continue;
154
- $theme_options[$key] = $value;
155
- }
156
- update_option('newsletter_' . $this->module . '_theme_' . $theme, $theme_options);
157
- }
158
-
159
- function get_options($theme) {
160
- $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
161
- // To avoid merge problems.
162
- if (!is_array($options)) {
163
- return array();
164
- }
165
- return $options;
166
- }
167
-
168
- function get_file_path($theme, $file) {
169
- $path = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/' . $file;
170
- if (is_file($path)) {
171
- return $path;
172
- } else {
173
- return NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/' . $file;
174
- }
175
- }
176
-
177
- function get_theme_url($theme) {
178
- if ($this->is_extension) {
179
- return WP_CONTENT_URL . '/extensions/newsletter/' . $this->module . '/themes/' . $theme;
180
- }
181
-
182
- $path = NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme;
183
- if (is_dir($path)) {
184
- return plugins_url('newsletter') . '/' . $this->module . '/themes/' . $theme;
185
- } else {
186
- return WP_CONTENT_URL . '/extensions/newsletter/' . $this->module . '/themes/' . $theme;
187
- }
188
- }
189
-
190
- function get_default_options() {
191
- if ($this->is_extension) {
192
- $path2 = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/languages';
193
- @include $path2 . '/en_US.php';
194
- @include $path2 . '/' . WPLANG . '.php';
195
- } else {
196
- $path1 = NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/languages';
197
- $path2 = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/languages';
198
- @include $path1 . '/en_US.php';
199
- @include $path2 . '/en_US.php';
200
- @include $path1 . '/' . WPLANG . '.php';
201
- @include $path2 . '/' . WPLANG . '.php';
202
- }
203
-
204
- if (!is_array($options))
205
- return array();
206
- return $options;
207
- }
208
-
209
- }
210
-
211
- function nt_option($name, $def = null) {
212
- $options = get_option('newsletter_email');
213
- $option = $options['theme_' . $name];
214
- if (!isset($option))
215
- return $def;
216
- else
217
- return $option;
218
- }
1
+ <?php
2
+
3
+ class NewsletterThemes {
4
+
5
+ var $module;
6
+ var $is_extension = false;
7
+
8
+ function __construct($module, $is_extension = false) {
9
+ $this->module = $module;
10
+ $this->is_extension = $is_extension;
11
+ }
12
+
13
+ /** Loads all themes of a module (actually only "emails" module makes sense). Themes are located inside the subfolder
14
+ * named as the module on plugin folder and on a subfolder named as the module on wp-content/newsletter folder (which
15
+ * must be manually created).
16
+ *
17
+ * @param type $module
18
+ * @return type
19
+ */
20
+ function get_all() {
21
+ $list = array();
22
+
23
+ $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes';
24
+ $handle = @opendir($dir);
25
+
26
+ if ($handle !== false) {
27
+ while ($file = readdir($handle)) {
28
+ if ($file == '.' || $file == '..')
29
+ continue;
30
+ if (!is_file($dir . '/' . $file . '/theme.php'))
31
+ continue;
32
+ $list[$file] = $file;
33
+ }
34
+ closedir($handle);
35
+ }
36
+
37
+ if (!$this->is_extension) {
38
+ $dir = NEWSLETTER_DIR . '/' . $this->module . '/themes';
39
+ $handle = @opendir($dir);
40
+
41
+ if ($handle !== false) {
42
+ while ($file = readdir($handle)) {
43
+ if ($file == '.' || $file == '..')
44
+ continue;
45
+ if (isset($list[$file]))
46
+ continue;
47
+ if (!is_file($dir . '/' . $file . '/theme.php'))
48
+ continue;
49
+
50
+ $list[$file] = $file;
51
+ }
52
+ closedir($handle);
53
+ }
54
+ }
55
+
56
+ return $list;
57
+ }
58
+
59
+ function themescmp($a, $b) {
60
+ $al = strtolower($a['name']);
61
+ $bl = strtolower($b['name']);
62
+ if ($al == 'default') {
63
+ return -1;
64
+ }
65
+ return (strcmp($al, $bl));
66
+ }
67
+
68
+ function get_all_with_data() {
69
+ $list = array();
70
+
71
+ $dir = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes';
72
+ $handle = @opendir($dir);
73
+
74
+ if ($handle !== false) {
75
+ while ($file = readdir($handle)) {
76
+ if ($file == '.' || $file == '..') {
77
+ continue;
78
+ }
79
+ if (isset($list[$file])) {
80
+ continue;
81
+ }
82
+ if (!is_file($dir . '/' . $file . '/theme.php')) {
83
+ continue;
84
+ }
85
+ $data = get_file_data($dir . '/' . $file . '/theme.php', array('name' => 'Name', 'type' => 'Type', 'description'=>'Description'));
86
+ $data['id'] = $file;
87
+ if (empty($data['name'])) {
88
+ $data['name'] = $file;
89
+ }
90
+ if (empty($data['type'])) {
91
+ $data['type'] = 'standard';
92
+ }
93
+ $screenshot = $dir . '/' . $file . '/screenshot.png';
94
+ if (is_file($screenshot)) {
95
+ $data['screenshot'] = $this->get_theme_url($file) . '/screenshot.png';
96
+ } else {
97
+ $data['screenshot'] = plugins_url('newsletter') . '/images/theme-screenshot.png';
98
+ }
99
+ $list[$file] = $data;
100
+ }
101
+ closedir($handle);
102
+ }
103
+
104
+ if (!$this->is_extension) {
105
+ $dir = NEWSLETTER_DIR . '/' . $this->module . '/themes';
106
+ $handle = @opendir($dir);
107
+
108
+ if ($handle !== false) {
109
+ while ($file = readdir($handle)) {
110
+ if ($file == '.' || $file == '..') {
111
+ continue;
112
+ }
113
+ if (!is_file($dir . '/' . $file . '/theme.php')) {
114
+ continue;
115
+ }
116
+ $data = get_file_data($dir . '/' . $file . '/theme.php', array('name' => 'Name', 'type' => 'Type', 'description'=>'Description'));
117
+ $data['id'] = $file;
118
+ if (empty($data['name'])) {
119
+ $data['name'] = $file;
120
+ }
121
+ if (empty($data['type'])) {
122
+ $data['type'] = 'standard';
123
+ }
124
+ $screenshot = $dir . '/' . $file . '/screenshot.png';
125
+ if (is_file($screenshot)) {
126
+ $data['screenshot'] = $this->get_theme_url($file) . '/screenshot.png';
127
+ } else {
128
+ $data['screenshot'] = plugins_url('newsletter') . '/images/theme-screenshot.png';
129
+ }
130
+ $list[$file] = $data;
131
+ }
132
+ closedir($handle);
133
+ }
134
+ }
135
+
136
+ usort($list, array($this, "themescmp"));
137
+
138
+ return $list;
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @param type $theme
144
+ * @param type $options
145
+ * @param type $module
146
+ */
147
+ function save_options($theme, &$options) {
148
+ add_option('newsletter_' . $this->module . '_theme_' . $theme, array(), null, 'no');
149
+ $theme_options = array();
150
+ foreach ($options as $key => &$value) {
151
+ if (substr($key, 0, 6) != 'theme_')
152
+ continue;
153
+ $theme_options[$key] = $value;
154
+ }
155
+ update_option('newsletter_' . $this->module . '_theme_' . $theme, $theme_options);
156
+ }
157
+
158
+ function get_options($theme) {
159
+ $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
160
+ // To avoid merge problems.
161
+ if (!is_array($options)) {
162
+ return array();
163
+ }
164
+ return $options;
165
+ }
166
+
167
+ function get_file_path($theme, $file) {
168
+ $path = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/' . $file;
169
+ if (is_file($path)) {
170
+ return $path;
171
+ } else {
172
+ return NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/' . $file;
173
+ }
174
+ }
175
+
176
+ function get_theme_url($theme) {
177
+ if ($this->is_extension) {
178
+ return WP_CONTENT_URL . '/extensions/newsletter/' . $this->module . '/themes/' . $theme;
179
+ }
180
+
181
+ $path = NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme;
182
+ if (is_dir($path)) {
183
+ return plugins_url('newsletter') . '/' . $this->module . '/themes/' . $theme;
184
+ } else {
185
+ return WP_CONTENT_URL . '/extensions/newsletter/' . $this->module . '/themes/' . $theme;
186
+ }
187
+ }
188
+
189
+ function get_default_options() {
190
+ if ($this->is_extension) {
191
+ $path2 = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/languages';
192
+ @include $path2 . '/en_US.php';
193
+ @include $path2 . '/' . WPLANG . '.php';
194
+ } else {
195
+ $path1 = NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/languages';
196
+ $path2 = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/languages';
197
+ @include $path1 . '/en_US.php';
198
+ @include $path2 . '/en_US.php';
199
+ @include $path1 . '/' . WPLANG . '.php';
200
+ @include $path2 . '/' . WPLANG . '.php';
201
+ }
202
+
203
+ if (!is_array($options))
204
+ return array();
205
+ return $options;
206
+ }
207
+
208
+ }
209
+
210
+ function nt_option($name, $def = null) {
211
+ $options = get_option('newsletter_email');
212
+ $option = $options['theme_' . $name];
213
+ if (!isset($option))
214
+ return $def;
215
+ else
216
+ return $option;
217
+ }
 
lock/index.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterLock::instance();
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterLock::instance();
lock/lock.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
5
 
1
  <?php
 
2
 
3
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
4
 
main/diagnostic.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
-
5
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $module = Newsletter::instance();
7
  $controls = new NewsletterControls();
@@ -42,11 +39,6 @@ if ($controls->is_action('engine_on')) {
42
  $controls->messages = 'Delivery engine reactivated.';
43
  }
44
 
45
- if ($controls->is_action('reset_stats')) {
46
- update_option('newsletter_diagnostic_cron_calls', array(), false);
47
- $controls->messages = 'Scheduler statistics reset.';
48
- }
49
-
50
  if ($controls->is_action('upgrade')) {
51
  // TODO: Compact them in a call to Newsletter which should be able to manage the installed modules
52
  Newsletter::instance()->upgrade();
@@ -173,34 +165,7 @@ if (count($calls) > 1) {
173
  $max = $diff;
174
  }
175
  }
176
- $mean = $mean / (count($calls) - 1);
177
- }
178
-
179
- // Send calls stats
180
- $send_calls = get_option('newsletter_diagnostic_send_calls', array());
181
- if (count($send_calls)) {
182
- $send_max = 0;
183
- $send_min = PHP_INT_MAX;
184
- $send_total_time = 0;
185
- $send_total_emails = 0;
186
- $send_completed = 0;
187
- for ($i = 0; $i < count($send_calls); $i++) {
188
- if (empty($send_calls[$i][2])) continue;
189
-
190
- $delta = $send_calls[$i][1] - $send_calls[$i][0];
191
- $send_total_time += $delta;
192
- $send_total_emails += $send_calls[$i][2];
193
- $send_mean = $delta / $send_calls[$i][2];
194
- if ($send_min > $send_mean) {
195
- $send_min = $send_mean;
196
- }
197
- if ($send_max < $send_mean) {
198
- $send_max = $send_mean;
199
- }
200
- if (isset($send_calls[$i][3]))
201
- $send_completed++;
202
- }
203
- $send_mean = $send_total_time / $send_total_emails;
204
  }
205
  ?>
206
 
@@ -229,10 +194,14 @@ if (count($send_calls)) {
229
  <div id="tabs">
230
 
231
  <ul>
232
- <li><a href="#tabs-tests"><?php _e('Tests', 'newsletter') ?></a></li>
233
- <li><a href="#tabs-2"><?php _e('Scheduler', 'newsletter') ?></a></li>
234
- <li><a href="#tabs-logging"><?php _e('Logging', 'newsletter') ?></a></li>
235
- <li><a href="#tabs-upgrade"><?php _e('Maintenance', 'newsletter') ?></a></li>
 
 
 
 
236
  </ul>
237
 
238
  <!-- TESTS -->
@@ -265,7 +234,13 @@ if (count($send_calls)) {
265
  <code>wp-content/logs/newsletter</code>.
266
  </p>
267
 
268
- <table class="form-table">
 
 
 
 
 
 
269
 
270
  <tbody>
271
  <tr>
@@ -281,8 +256,6 @@ if (count($send_calls)) {
281
  Log folder
282
  </td>
283
  <td>
284
- <code><?php echo NEWSLETTER_LOG_DIR ?></code>
285
- <br>
286
  <?php
287
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
288
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
@@ -292,8 +265,6 @@ if (count($send_calls)) {
292
  ?>
293
  </td>
294
  </tr>
295
-
296
-
297
  </tbody>
298
  </table>
299
 
@@ -302,9 +273,36 @@ if (count($send_calls)) {
302
 
303
  <!-- SEMAPHORES -->
304
  <div id="tabs-2">
 
 
 
 
 
 
 
 
305
 
306
- <h3>Scheduler</h3>
307
- <table class="widefat" style="width: auto; margin: 0">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  <thead>
309
  <tr>
310
  <th>Function</th>
@@ -313,61 +311,254 @@ if (count($send_calls)) {
313
  </thead>
314
 
315
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
316
 
 
 
 
 
 
 
 
 
 
 
 
317
 
 
 
 
 
 
318
 
 
 
 
 
 
 
 
319
 
320
-
321
  <tr>
322
- <td>Sending statistics</td>
323
  <td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
- <?php if (!$send_calls) { ?>
326
- <em>Still not enough data.</em>
327
- <?php } else { ?>
328
- Average time to send an email: <?php echo sprintf("%.2f", $send_mean) ?> seconds<br>
329
- Max mean time measured: <?php echo $send_max ?> seconds<br>
330
- Min mean time measured: <?php echo $send_min ?> seconds<br>
331
- Total emails: <?php echo $send_total_emails ?><br>
332
- Batches prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
333
- Collected batch samples: <?php echo count($send_calls); ?><br>
334
- <?php } ?>
335
  </td>
336
  </tr>
337
-
338
 
339
  </tbody>
340
  </table>
 
341
 
342
- <h3>Semaphores</h3>
343
- <table class="widefat" style="width: auto; margin: 0">
 
 
344
  <thead>
345
  <tr>
346
- <th>Name</th>
347
- <th>Active since</th>
348
  </tr>
349
  </thead>
350
-
351
  <tbody>
352
  <tr>
 
353
  <td>
354
- Newsletter delivery
355
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  <td>
357
  <?php
358
- $value = get_transient('newsletter_main_engine');
359
- if ($value)
360
- echo (time() - $value) . ' seconds';
361
- else
362
  echo 'Not set';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  ?>
364
- <?php $controls->button('delete_transient', 'Delete', null, 'newsletter_main_engine'); ?>
365
  </td>
366
  </tr>
367
  </tbody>
368
  </table>
369
-
370
- </div>
 
371
  <div id="tabs-upgrade">
372
  <p>
373
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
@@ -397,10 +588,21 @@ if (count($send_calls)) {
397
  </p>
398
  </div>
399
 
 
 
 
 
 
 
 
 
 
 
 
400
  </form>
401
 
402
  </div>
403
 
404
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
405
 
406
- </div>
1
  <?php
 
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $module = Newsletter::instance();
4
  $controls = new NewsletterControls();
39
  $controls->messages = 'Delivery engine reactivated.';
40
  }
41
 
 
 
 
 
 
42
  if ($controls->is_action('upgrade')) {
43
  // TODO: Compact them in a call to Newsletter which should be able to manage the installed modules
44
  Newsletter::instance()->upgrade();
165
  $max = $diff;
166
  }
167
  }
168
+ $mean = $mean / count($calls) - 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
170
  ?>
171
 
194
  <div id="tabs">
195
 
196
  <ul>
197
+ <li><a href="#tabs-tests">Tests</a></li>
198
+ <li><a href="#tabs-logging">Logging</a></li>
199
+ <li><a href="#tabs-2">Semaphores and Crons</a></li>
200
+ <li><a href="#tabs-4">System</a></li>
201
+ <li><a href="#tabs-upgrade">Maintenance</a></li>
202
+ <?php if (isset($_GET['debug'])) { ?>
203
+ <li><a href="#tabs-debug">Debug Data</a></li>
204
+ <?php } ?>
205
  </ul>
206
 
207
  <!-- TESTS -->
234
  <code>wp-content/logs/newsletter</code>.
235
  </p>
236
 
237
+ <table class="widefat">
238
+ <thead>
239
+ <tr>
240
+ <th>Name</th>
241
+ <th>Active since</th>
242
+ </tr>
243
+ </thead>
244
 
245
  <tbody>
246
  <tr>
256
  Log folder
257
  </td>
258
  <td>
 
 
259
  <?php
260
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
261
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
265
  ?>
266
  </td>
267
  </tr>
 
 
268
  </tbody>
269
  </table>
270
 
273
 
274
  <!-- SEMAPHORES -->
275
  <div id="tabs-2">
276
+ <h4>Semaphores</h4>
277
+ <table class="widefat">
278
+ <thead>
279
+ <tr>
280
+ <th>Name</th>
281
+ <th>Active since</th>
282
+ </tr>
283
+ </thead>
284
 
285
+ <tbody>
286
+ <tr>
287
+ <td>
288
+ Newsletter delivery
289
+ </td>
290
+ <td>
291
+ <?php
292
+ $value = get_transient('newsletter_main_engine');
293
+ if ($value)
294
+ echo (time() - $value) . ' seconds';
295
+ else
296
+ echo 'Not set';
297
+ ?>
298
+ <?php $controls->button('delete_transient', 'Delete', null, 'newsletter_main_engine'); ?>
299
+ </td>
300
+ </tr>
301
+ </tbody>
302
+ </table>
303
+
304
+ <h4>Crons</h4>
305
+ <table class="widefat">
306
  <thead>
307
  <tr>
308
  <th>Function</th>
311
  </thead>
312
 
313
  <tbody>
314
+ <tr>
315
+ <td>
316
+ WordPress Cron System
317
+ </td>
318
+ <td>
319
+ <?php
320
+ if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON)
321
+ echo 'DISABLED. (can be a problem, see the <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_tab">delivery engine documentation</a>)';
322
+ else
323
+ echo "ENABLED. (it's ok)";
324
+ ?>
325
+ </td>
326
+ </tr>
327
 
328
+ <tr>
329
+ <td>
330
+ WordPress schedules
331
+ </td>
332
+ <td>
333
+ <?php
334
+ $schedules = wp_get_schedules();
335
+ if (empty($schedules)) {
336
+ echo 'Really bad, no schedules found, missing even the WordPress default schedules!';
337
+ } else {
338
+ $found = false;
339
 
340
+ foreach ($schedules as $key => &$data) {
341
+ if ($key == 'newsletter')
342
+ $found = true;
343
+ echo $key . ' - ' . $data['interval'] . ' s<br>';
344
+ }
345
 
346
+ if (!$found) {
347
+ echo 'The "newsletter" schedule was not found, email delivery won\'t work.';
348
+ }
349
+ }
350
+ ?>
351
+ </td>
352
+ </tr>
353
 
 
354
  <tr>
 
355
  <td>
356
+ Delivery Engine
357
+ </td>
358
+ <td>
359
+ <?php echo NewsletterModule::format_scheduler_time('newsletter'); ?>
360
+ <?php $controls->button('trigger', 'Trigger now'); ?>
361
+ <p class="description">
362
+ If inactive or always in "running now" status your blog has a problem: <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">read more here</a>.
363
+ </p>
364
+ </td>
365
+ </tr>
366
+ <tr>
367
+ <td>Collected samples</td>
368
+ <td>
369
+ <?php echo count($calls); ?>
370
+ <p class="description">Samples are collected in a maximum number of <?php echo Newsletter::MAX_CRON_SAMPLES; ?></p>
371
+ </td>
372
+ </tr>
373
+ <tr>
374
+ <td>Scheduler execution interval mean</td>
375
+ <td>
376
+ <?php
377
+ if (count($calls) > 10) {
378
+ echo (int) $mean . ' seconds';
379
+ if ($mean < NEWSLETTER_CRON_INTERVAL * 1.2) {
380
+ echo ' (<span style="color: green; font-weight: bold">OK</span>)';
381
+ } else {
382
+ echo ' (<span style="color: red; font-weight: bold">KO</span>)';
383
+ }
384
+ } else {
385
+ echo 'Still not enough data. It requires few hours to collect a relevant data set.';
386
+ }
387
+ ?>
388
+
389
+ <p class="description">
390
+ Should be less than <?php echo NEWSLETTER_CRON_INTERVAL; ?> seconds.
391
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Read more</a>.
392
+ </p>
393
 
 
 
 
 
 
 
 
 
 
 
394
  </td>
395
  </tr>
 
396
 
397
  </tbody>
398
  </table>
399
+ </div>
400
 
401
+ <!-- SYSTEM -->
402
+ <div id="tabs-4">
403
+
404
+ <table class="widefat">
405
  <thead>
406
  <tr>
407
+ <th>Parameter</th>
408
+ <th>Value</th>
409
  </tr>
410
  </thead>
 
411
  <tbody>
412
  <tr>
413
+ <td>PHP Version</td>
414
  <td>
415
+ <?php echo phpversion(); ?>
416
  </td>
417
+ </tr>
418
+ <tr>
419
+ <td>Database Wait Timeout</td>
420
+ <td>
421
+ <?php $wait_timeout = $wpdb->get_var("select @@wait_timeout"); ?>
422
+ <?php echo $wait_timeout; ?> (seconds)
423
+ </td>
424
+ </tr>
425
+ <tr>
426
+ <td>PHP Execution Time</td>
427
+ <td>
428
+ <?php echo ini_get('max_execution_time'); ?> (seconds)
429
+ </td>
430
+ </tr>
431
+ <tr>
432
+ <td>NEWSLETTER_MAX_EXECUTION_TIME</td>
433
  <td>
434
  <?php
435
+ if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
436
+ echo NEWSLETTER_MAX_EXECUTION_TIME . ' (seconds)';
437
+ } else {
 
438
  echo 'Not set';
439
+ }
440
+ ?>
441
+ </td>
442
+ </tr>
443
+ <tr>
444
+ <td>NEWSLETTER_CRON_INTERVAL</td>
445
+ <td>
446
+ <?php echo NEWSLETTER_CRON_INTERVAL . ' (seconds)'; ?>
447
+ </td>
448
+ </tr>
449
+ <tr>
450
+ <td>PHP Memory Limit</td>
451
+ <td>
452
+ <?php echo @ini_get('memory_limit'); ?>
453
+ </td>
454
+ </tr>
455
+ <tr>
456
+ <td>WordPress plugin url</td>
457
+ <td>
458
+ <?php echo WP_PLUGIN_URL; ?>
459
+ <br>
460
+ Filters:
461
+
462
+ <?php
463
+ $filters = $wp_filter['plugins_url'];
464
+ if (!is_array($filters))
465
+ echo 'no filters attached to "plugin_urls"';
466
+ else {
467
+ echo '<ul>';
468
+ foreach ($filters as &$filter) {
469
+ foreach ($filter as &$entry) {
470
+ echo '<li>';
471
+ if (is_array($entry['function']))
472
+ echo get_class($entry['function'][0]) . '->' . $entry['function'][1];
473
+ else
474
+ echo $entry['function'];
475
+ echo '</li>';
476
+ }
477
+ }
478
+ echo '</ul>';
479
+ }
480
+ ?>
481
+ <p class="description">
482
+ This value should contains the full URL to your plugin folder. If there are filters
483
+ attached, the value can be different from the original generated by WordPress and sometime worng.
484
+ </p>
485
+ </td>
486
+ </tr>
487
+ <tr>
488
+ <td>Blog Charset</td>
489
+ <td>
490
+ <?php echo get_option('blog_charset'); ?>
491
+ </td>
492
+ </tr>
493
+ <tr>
494
+ <td>WordPress Memory limit</td>
495
+ <td>
496
+ <?php echo WP_MEMORY_LIMIT; ?>
497
+ </td>
498
+ </tr>
499
+ <tr>
500
+ <td>WP_DEBUG</td>
501
+ <td>
502
+ <?php echo WP_DEBUG ? 'true' : 'false'; ?>
503
+ </td>
504
+ </tr>
505
+ <tr>
506
+ <td>Absolute path</td>
507
+ <td>
508
+ <?php echo ABSPATH; ?>
509
+ </td>
510
+ </tr>
511
+ <tr>
512
+ <td>Tables Prefix</td>
513
+ <td>
514
+ <?php echo $wpdb->prefix; ?>
515
+ </td>
516
+ </tr>
517
+ <tr>
518
+ <td>Database Charset and Collate</td>
519
+ <td>
520
+ <?php echo DB_CHARSET; ?> <?php echo DB_COLLATE; ?>
521
+ </td>
522
+ </tr>
523
+ <tr>
524
+ <td>Action file accessibility (obsolete)</td>
525
+ <td>
526
+ <?php
527
+ $res = wp_remote_get(plugins_url('newsletter') . '/do/subscribe.php?test=1');
528
+ if (is_wp_error($res)) {
529
+ echo 'It seems the Newsletter action files are not reachable. See the note and the file permission check below.';
530
+ } else {
531
+ echo 'OK';
532
+ }
533
+ ?>
534
+ <p class="description">
535
+ If this internal test fails, subscription, confirmation and so on could fail. Try to open
536
+ <a href="<?php echo plugins_url('newsletter') . '/do/subscribe.php?test=1' ?>" target="_blank">this link</a>: if
537
+ it reports "ok", consider this test as passed.
538
+ </p>
539
+ </td>
540
+ </tr>
541
+ <tr>
542
+ <td>File permissions (obsolete)</td>
543
+ <td>
544
+ <?php
545
+ $index_owner = fileowner(ABSPATH . '/index.php');
546
+ $index_permissions = fileperms(ABSPATH . '/index.php');
547
+ $subscribe_permissions = fileperms(NEWSLETTER_DIR . '/do/subscribe.php');
548
+ $subscribe_owner = fileowner(NEWSLETTER_DIR . '/do/subscribe.php');
549
+ if ($index_permissions != $subscribe_permissions || $index_owner != $subscribe_owner) {
550
+ echo 'Plugin file permissions or owner differ from blog index.php permissions, that may compromise the subscription process';
551
+ } else {
552
+ echo 'OK';
553
+ }
554
  ?>
 
555
  </td>
556
  </tr>
557
  </tbody>
558
  </table>
559
+
560
+ </div>
561
+
562
  <div id="tabs-upgrade">
563
  <p>
564
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
588
  </p>
589
  </div>
590
 
591
+ <?php if (isset($_GET['debug'])) { ?>
592
+ <div id="tabs-debug">
593
+ <h3>Extension versions data</h3>
594
+ <pre style="font-size: 11px"><?php echo esc_html(print_r(get_option('newsletter_extension_versions'), true)); ?></pre>
595
+
596
+ <h3>Update plugins data</h3>
597
+ <pre style="font-size: 11px"><?php echo esc_html(print_r(get_site_transient('update_plugins'), true)); ?></pre>
598
+ </div>
599
+ <?php } ?>
600
+ </div>
601
+
602
  </form>
603
 
604
  </div>
605
 
606
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
607
 
608
+ </div>
main/extensions.php CHANGED
@@ -2,116 +2,36 @@
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = Newsletter::instance();
5
- $extensions = $module->getTnpExtensions();
6
 
7
  if (!$controls->is_action()) {
8
  $controls->data = get_option('newsletter_main');
 
 
 
 
9
  }
10
  ?>
11
 
 
12
  <div class="wrap" id="tnp-wrap">
13
 
14
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
15
 
16
  <div id="tnp-heading">
17
 
18
- <h2><?php _e('Extensions', 'newsletter') ?></h2>
19
 
20
  </div>
21
 
22
  <div id="tnp-body">
23
 
24
- <?php if (is_array($extensions)) { ?>
25
-
26
- <?php foreach ($extensions AS $e) { ?>
27
-
28
- <!--PREMIUM EXTENSIONS-->
29
- <?php if ($e->type == "premium") { ?>
30
- <div class="tnp-extension-premium-box <?php echo $e->slug ?>">
31
- <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
32
- <h3><?php echo $e->title ?></h3>
33
- <p><?php echo $e->description ?></p>
34
- <div class="tnp-extension-premium-action">
35
- <?php if (is_plugin_active($e->wp_slug)) { ?>
36
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
37
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
38
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-activate=activate-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-activate') ?>" class="tnp-extension-activate">
39
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
40
- </a>
41
- <?php } elseif ($e->downloadable) { ?>
42
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-install=install-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-install') ?>" class="tnp-extension-install">
43
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
44
- </a>
45
- <?php } else { ?>
46
- <a href="http://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-buy" target="_blank">
47
- <i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy Now
48
- </a>
49
- <?php } ?>
50
- </div>
51
- </div>
52
- <?php } ?>
53
-
54
- <!--FREE EXTENSIONS-->
55
- <?php if ($e->type == "free") { ?>
56
- <div class="tnp-extension-free-box <?php echo $e->slug ?>">
57
- <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
58
- <h3><?php echo $e->title ?></h3>
59
- <p><?php echo $e->description ?></p>
60
- <div class="tnp-extension-free-action">
61
- <?php if (is_plugin_active($e->wp_slug)) { ?>
62
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
63
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
64
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-activate=activate-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-activate') ?>" class="tnp-extension-activate">
65
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
66
- </a>
67
- <?php } elseif ($e->downloadable) { ?>
68
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-install=install-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-install') ?>" class="tnp-extension-install">
69
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
70
- </a>
71
- <?php } else { ?>
72
- <a href="http://www.thenewsletterplugin.com/account?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-free" target="_blank">
73
- <i class="fa fa-gift" aria-hidden="true"></i> Free Download
74
- </a>
75
- <?php } ?>
76
- </div>
77
- </div>
78
- <?php } ?>
79
-
80
- <!--INTEGRATIONS-->
81
- <?php if ($e->type == "integration") { ?>
82
- <div class="tnp-integration-box <?php echo $e->slug ?>">
83
- <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
84
- <h3><?php echo $e->title ?></h3>
85
- <p><?php echo $e->description ?></p>
86
- <div class="tnp-integration-action">
87
- <?php if (is_plugin_active($e->wp_slug)) { ?>
88
- <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
89
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
90
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-activate=activate-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-activate') ?>" class="tnp-extension-activate">
91
- <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
92
- </a>
93
- <?php } elseif ($e->downloadable) { ?>
94
- <a href="<?php echo admin_url('plugins.php') ?>?page=tgmpa-install-plugins&plugin=<?php echo $e->slug ?>&tgmpa-install=install-plugin&tgmpa-nonce=<?php echo wp_create_nonce('tgmpa-install') ?>" class="tnp-extension-install">
95
- <i class="fa fa-download" aria-hidden="true"></i> Install Now
96
- </a>
97
- <?php } else { ?>
98
- <a href="http://www.thenewsletterplugin.com/premium?utm_source=plugin&utm_medium=link&utm_campaign=extpanel" class="tnp-extension-buy" target="_blank">
99
- <i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy Now
100
- </a>
101
- <?php } ?>
102
- </div>
103
- </div>
104
- <?php } ?>
105
-
106
- <?php } ?>
107
-
108
- <?php } else { ?>
109
-
110
- <p style="color: white;">No extensions available.</p>
111
-
112
- <?php } ?>
113
-
114
- <p class="clear"></p>
115
 
116
  </div>
117
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = Newsletter::instance();
 
5
 
6
  if (!$controls->is_action()) {
7
  $controls->data = get_option('newsletter_main');
8
+ } else {
9
+ if ($controls->is_action('remove')) {
10
+
11
+ }
12
  }
13
  ?>
14
 
15
+
16
  <div class="wrap" id="tnp-wrap">
17
 
18
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
19
 
20
  <div id="tnp-heading">
21
 
22
+ <h2><?php _e('General Settings', 'newsletter') ?></h2>
23
 
24
  </div>
25
 
26
  <div id="tnp-body">
27
 
28
+ <form method="post" action="">
29
+ <?php $controls->init(); ?>
30
+
31
+
32
+
33
+
34
+ </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  </div>
37
 
main/index.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
 
6
  $controls = new NewsletterControls();
@@ -351,7 +349,7 @@ $labels = array_reverse($labels);
351
  ?></td>
352
  <td style="white-space:nowrap">
353
  <a class="button" title="<?php _e('Edit', 'newsletter') ?>" href="<?php echo $users_module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>"><i class="fa fa-pencil"></i></a>
354
- <a title="<?php _e('Profile', 'newsletter') ?>" href="<?php echo home_url('/') ?>?na=p&nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><i class="fa fa-user"></i></a>
355
  </td>
356
  </tr>
357
  <?php } ?>
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
 
4
  $controls = new NewsletterControls();
349
  ?></td>
350
  <td style="white-space:nowrap">
351
  <a class="button" title="<?php _e('Edit', 'newsletter') ?>" href="<?php echo $users_module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>"><i class="fa fa-pencil"></i></a>
352
+ <a title="<?php _e('Profile', 'newsletter') ?>" href="<?php echo plugins_url('newsletter/do/profile.php'); ?>?nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><i class="fa fa-user"></i></a>
353
  </td>
354
  </tr>
355
  <?php } ?>
main/info.php CHANGED
@@ -1,202 +1,191 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
- $module = Newsletter::instance();
6
- $controls = new NewsletterControls();
7
-
8
- if (!$controls->is_action()) {
9
- $controls->data = get_option('newsletter_main');
10
- } else {
11
-
12
- if ($controls->is_action('save')) {
13
- $module->merge_options($controls->data);
14
- $controls->messages .= 'Saved.';
15
- }
16
- }
17
- ?>
18
-
19
- <div class="wrap" id="tnp-wrap">
20
-
21
- <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
22
-
23
- <div id="tnp-heading">
24
-
25
- <h2><?php _e('Company Info', 'newsletter') ?></h2>
26
- <p>
27
- These informations are used by Newsletter themes to automatically generate some sections of regular newsletters,
28
- <a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">
29
- auto messages
30
- </a> and
31
- <a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-followup" target="_blank">
32
- follow-up mails
33
- </a>.
34
- Themes may not use all these fields and/or have specific alternate configurations. All fields are <strong>optional</strong>.
35
- </p>
36
-
37
- </div>
38
- <div id="tnp-body">
39
-
40
- <form method="post" action="">
41
- <?php $controls->init(); ?>
42
-
43
- <div id="tabs">
44
-
45
- <ul>
46
- <li><a href="#tabs-general"><?php _e('General', 'newsletter') ?></a></li>
47
- <li><a href="#tabs-social"><?php _e('Social', 'newsletter') ?></a></li>
48
- </ul>
49
-
50
- <div id="tabs-general">
51
- <h3>Header Settings</h3>
52
-
53
- <table class="form-table">
54
- <tr valign="top">
55
- <th>
56
- Logo
57
- <div class="tnp-tip">
58
- <span class="tip-button">Tip</span>
59
- <span class="tip-content">
60
- Keep the file lightweight and ideally smaller than 500px in width and 200px in height.
61
- Remember that .png images provide best performances with text and shapes logos.
62
- </span>
63
- </div>
64
- </th>
65
- <td>
66
- <?php $controls->media('header_logo', 'medium'); ?>
67
- <p class="description">
68
- Click to change. This should be your logo in .png or .jpg format.
69
- </p>
70
- </td>
71
- </tr>
72
- <tr>
73
- <th>Title</th>
74
- <td>
75
- <?php $controls->text('header_title', 40); ?>
76
- <p class="description">Appears only when no logo has been uploaded or when it's blocked by email clients.</p>
77
- </td>
78
- </tr>
79
- <tr>
80
- <th>Subtitle</th>
81
- <td>
82
- <?php $controls->text('header_sub', 40); ?>
83
- <p class="description">Appears only if present.</p>
84
- </td>
85
- </tr>
86
- </table>
87
-
88
- <h3>Footer Settings</h3>
89
-
90
- <table class="form-table">
91
- <tr valign="top">
92
- <th>Blog or company name</th>
93
- <td>
94
- <?php $controls->text('footer_title', 40); ?>
95
- <p class="description">
96
- User or corporation name to be displayed on the newsletter footer.
97
- </p>
98
- </td>
99
- </tr>
100
- <tr valign="top">
101
- <th>Address</th>
102
- <td>
103
- <?php $controls->text('footer_contact', 40); ?>
104
- <p class="description">
105
- Your real address, if available. The CAN-SPAM Act requires it.
106
- </p>
107
- </td>
108
- </tr>
109
- <tr>
110
- <th>Copyright, privacy or legal text</th>
111
- <td>
112
- <?php $controls->text('footer_legal', 40); ?>
113
- <p class="description">
114
- Any copyright, privacy or legal text you want on the newsletter footer.
115
- </p>
116
- </td>
117
- </tr>
118
- </table>
119
- </div>
120
- <div id="tabs-social">
121
- <h3>Social Settings</h3>
122
-
123
- <p>Social icons will be added automatically to your newsletter only for set URLs.</p>
124
-
125
- <table class="form-table">
126
- <tr valign="top">
127
- <th>Facebook</th>
128
- <td>
129
- <?php $controls->text('facebook_url', 40); ?>
130
- <p class="description">
131
- Your Facebook url (e.g. https://www.facebook.com/thenewsletterplugin)
132
- </p>
133
- </td>
134
- </tr>
135
- <tr valign="top">
136
- <th>Google+</th>
137
- <td>
138
- <?php $controls->text('googleplus_url', 40); ?>
139
- <p class="description">
140
- Your Google+ url (e.g. https://plus.google.com/...)
141
- </p>
142
- </td>
143
- </tr>
144
- <tr valign="top">
145
- <th>Twitter</th>
146
- <td>
147
- <?php $controls->text('twitter_url', 40); ?>
148
- <p class="description">
149
- Your Twitter url (e.g. https://twitter.com/...)
150
- </p>
151
- </td>
152
- </tr>
153
- <tr valign="top">
154
- <th>Linkedin</th>
155
- <td>
156
- <?php $controls->text('linkedin_url', 40); ?>
157
- <p class="description">
158
- Your Linkedin url (e.g. https://www.linkedin.com/in/...)
159
- </p>
160
- </td>
161
- </tr>
162
- <tr valign="top">
163
- <th>YouTube</th>
164
- <td>
165
- <?php $controls->text('youtube_url', 40); ?>
166
- <p class="description">
167
- Your YouTube url (e.g. https://www.youtube.com/channel/...)
168
- </p>
169
- </td>
170
- </tr>
171
- <tr valign="top">
172
- <th>Vimeo</th>
173
- <td>
174
- <?php $controls->text('vimeo_url', 40); ?>
175
- <p class="description">
176
- Your Vimeo url (e.g. http://vimeo.com/...)
177
- </p>
178
- </td>
179
- </tr>
180
- <tr valign="top">
181
- <th>Instagram</th>
182
- <td>
183
- <?php $controls->text('instagram_url', 40); ?>
184
- <p class="description">
185
- Your Vimeo url (e.g. http://instagram.com/...)
186
- </p>
187
- </td>
188
- </tr>
189
- </table>
190
- </div>
191
- </div>
192
-
193
- <p>
194
- <?php $controls->button('save', 'Save'); ?>
195
- </p>
196
-
197
- </form>
198
- </div>
199
-
200
- <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
201
-
202
- </div>
1
+ <?php
2
+ @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $module = Newsletter::instance();
4
+ $controls = new NewsletterControls();
5
+
6
+ if (!$controls->is_action()) {
7
+ $controls->data = get_option('newsletter_main');
8
+ } else {
9
+
10
+ if ($controls->is_action('save')) {
11
+ $module->merge_options($controls->data);
12
+ $controls->messages .= 'Saved.';
13
+ }
14
+ }
15
+ ?>
16
+
17
+ <div class="wrap" id="tnp-wrap">
18
+
19
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
20
+
21
+ <div id="tnp-heading">
22
+
23
+ <h2><?php _e('Company Info', 'newsletter') ?></h2>
24
+ <p>
25
+ These informations are used by Newsletter themes to automatically generate some sections of regular newsletters,
26
+ <a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">
27
+ auto messages
28
+ </a> and
29
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-followup" target="_blank">
30
+ follow-up mails
31
+ </a>.
32
+ Themes may not use all these fields and/or have specific alternate configurations. All fields are <strong>optional</strong>.
33
+ </p>
34
+
35
+ </div>
36
+ <div id="tnp-body">
37
+
38
+ <form method="post" action="">
39
+ <?php $controls->init(); ?>
40
+
41
+ <div id="tabs">
42
+
43
+ <ul>
44
+ <li><a href="#tabs-general"><?php _e('General', 'newsletter') ?></a></li>
45
+ <li><a href="#tabs-social"><?php _e('Social', 'newsletter') ?></a></li>
46
+ </ul>
47
+
48
+ <div id="tabs-general">
49
+ <h3>Header Settings</h3>
50
+
51
+ <table class="form-table">
52
+ <tr valign="top">
53
+ <th>
54
+ Logo
55
+ <div class="tnp-tip">
56
+ <span class="tip-button">Tip</span>
57
+ <span class="tip-content">
58
+ Keep the file lightweight and ideally smaller than 500px in width and 200px in height.
59
+ Remember that .png images provide best performances with text and shapes logos.
60
+ </span>
61
+ </div>
62
+ </th>
63
+ <td>
64
+ <?php $controls->media('header_logo', 'medium'); ?>
65
+ <p class="description">
66
+ Click to change. This should be your logo in .png or .jpg format.
67
+ </p>
68
+ </td>
69
+ </tr>
70
+ <tr>
71
+ <th>Title</th>
72
+ <td>
73
+ <?php $controls->text('header_title', 40); ?>
74
+ <p class="description">Appears only when no logo has been uploaded or when it's blocked by email clients.</p>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <th>Subtitle</th>
79
+ <td>
80
+ <?php $controls->text('header_sub', 40); ?>
81
+ <p class="description">Appears only if present.</p>
82
+ </td>
83
+ </tr>
84
+ </table>
85
+
86
+ <h3>Footer Settings</h3>
87
+
88
+ <table class="form-table">
89
+ <tr valign="top">
90
+ <th>Blog or company name</th>
91
+ <td>
92
+ <?php $controls->text('footer_title', 40); ?>
93
+ <p class="description">
94
+ User or corporation name to be displayed on the newsletter footer.
95
+ </p>
96
+ </td>
97
+ </tr>
98
+ <tr valign="top">
99
+ <th>Address</th>
100
+ <td>
101
+ <?php $controls->text('footer_contact', 40); ?>
102
+ <p class="description">
103
+ Your real address, if available. The CAN-SPAM Act requires it.
104
+ </p>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <th>Copyright, privacy or legal text</th>
109
+ <td>
110
+ <?php $controls->text('footer_legal', 40); ?>
111
+ <p class="description">
112
+ Any copyright, privacy or legal text you want on the newsletter footer.
113
+ </p>
114
+ </td>
115
+ </tr>
116
+ </table>
117
+ </div>
118
+ <div id="tabs-social">
119
+ <h3>Social Settings</h3>
120
+
121
+ <p>Social icons will be added automatically to your newsletter only for set URLs.</p>
122
+
123
+ <table class="form-table">
124
+ <tr valign="top">
125
+ <th>Facebook</th>
126
+ <td>
127
+ <?php $controls->text('facebook_url', 40); ?>
128
+ <p class="description">
129
+ Your Facebook url (e.g. https://www.facebook.com/thenewsletterplugin)
130
+ </p>
131
+ </td>
132
+ </tr>
133
+ <tr valign="top">
134
+ <th>Google+</th>
135
+ <td>
136
+ <?php $controls->text('googleplus_url', 40); ?>
137
+ <p class="description">
138
+ Your Google+ url (e.g. https://plus.google.com/...)
139
+ </p>
140
+ </td>
141
+ </tr>
142
+ <tr valign="top">
143
+ <th>Twitter</th>
144
+ <td>
145
+ <?php $controls->text('twitter_url', 40); ?>
146
+ <p class="description">
147
+ Your Twitter url (e.g. https://twitter.com/...)
148
+ </p>
149
+ </td>
150
+ </tr>
151
+ <tr valign="top">
152
+ <th>Linkedin</th>
153
+ <td>
154
+ <?php $controls->text('linkedin_url', 40); ?>
155
+ <p class="description">
156
+ Your Linkedin url (e.g. https://www.linkedin.com/in/...)
157
+ </p>
158
+ </td>
159
+ </tr>
160
+ <tr valign="top">
161
+ <th>YouTube</th>
162
+ <td>
163
+ <?php $controls->text('youtube_url', 40); ?>
164
+ <p class="description">
165
+ Your YouTube url (e.g. https://www.youtube.com/channel/...)
166
+ </p>
167
+ </td>
168
+ </tr>
169
+ <tr valign="top">
170
+ <th>Vimeo</th>
171
+ <td>
172
+ <?php $controls->text('vimeo_url', 40); ?>
173
+ <p class="description">
174
+ Your Vimeo url (e.g. http://vimeo.com/...)
175
+ </p>
176
+ </td>
177
+ </tr>
178
+ </table>
179
+ </div>
180
+ </div>
181
+
182
+ <p>
183
+ <?php $controls->button('save', 'Save'); ?>
184
+ </p>
185
+
186
+ </form>
187
+ </div>
188
+
189
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
190
+
191
+ </div>
 
 
 
 
 
 
 
 
 
 
 
main/main.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
-
5
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $controls = new NewsletterControls();
7
  $module = Newsletter::instance();
@@ -48,18 +45,11 @@ if (!$controls->is_action()) {
48
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
49
  $controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
50
  }
51
-
52
- $controls->data['contract_key'] = trim($controls->data['contract_key']);
53
-
54
  if (empty($controls->errors)) {
55
  $module->merge_options($controls->data);
56
  $controls->messages .= __('Saved.', 'newsletter');
57
  }
58
-
59
- update_option('newsletter_log_level', $controls->data['log_level']);
60
-
61
  $module->hook_newsletter_extension_versions(true);
62
- delete_transient("tnp_extensions_json");
63
  }
64
  }
65
 
@@ -67,35 +57,21 @@ if (!empty($controls->data['contract_key'])) {
67
  $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key']);
68
  if (is_wp_error($response)) {
69
  /* @var $response WP_Error */
70
- $controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
71
  $controls->errors .= $response->get_error_code() . ' - ' . $response->get_error_message();
72
  $controls->data['licence_expires'] = "";
73
  } else if ($response['response']['code'] != 200) {
74
- $controls->errors .= 'The license seems expired or not valid, please check your <a href="http://www.thenewsletterplugin.com/account">license code and status</a>, thank you.';
75
  $controls->data['licence_expires'] = "";
76
  } elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
77
  $controls->data['licence_expires'] = $expires->expire;
78
- $controls->messages = 'Your license is valid and expires on ' . date('Y-m-d', $expires->expire);
79
  } else {
80
- $controls->errors = 'Unable to detect the license expiration. Debug data to report to the support: <code>' . wp_remote_retrieve_body($response) . '</code>';
81
  $controls->data['licence_expires'] = "";
82
  }
83
  $module->merge_options($controls->data);
84
  }
85
 
86
-
87
- $return_path = $module->options['return_path'];
88
- if (!empty($return_path)) {
89
- list($return_path_local, $return_path_domain) = explode('@', $return_path);
90
-
91
- $sender = $module->options['sender_email'];
92
- list($sender_local, $sender_domain) = explode('@', $sender);
93
-
94
-
95
- if ($sender_domain != $return_path_domain) {
96
- $controls->messages .= '<br><br>Your Return Path domain is different from your Sender domain. Providers may require them to be identical';
97
- }
98
- }
99
  ?>
100
 
101
  <div class="wrap" id="tnp-wrap">
@@ -244,25 +220,6 @@ if (!empty($return_path)) {
244
  </td>
245
  </tr>
246
 
247
- <tr>
248
- <td>
249
- Log level
250
- </td>
251
- <td>
252
- <?php $controls->log_level('log_level'); ?>
253
- </td>
254
- </tr>
255
-
256
- <tr valign="top">
257
- <th>Debug mode</th>
258
- <td>
259
- <?php $controls->yesno('debug', 40); ?>
260
- <p class="description">
261
- In debug mode Newsletter intercepts PHP errors. To be used only by the support team.
262
- </p>
263
- </td>
264
- </tr>
265
-
266
  <tr valign="top">
267
  <th>API key</th>
268
  <td>
@@ -279,7 +236,9 @@ if (!empty($return_path)) {
279
  <td>
280
  <?php $controls->textarea('css'); ?>
281
  <p class="description">
282
- This option is obsolete and will be removed, use the custom style field in the subscription configuration panel.
 
 
283
  </p>
284
  </td>
285
  </tr>
@@ -317,6 +276,14 @@ if (!empty($return_path)) {
317
  </p>
318
  </td>
319
  </tr>
 
 
 
 
 
 
 
 
320
  </table>
321
 
322
  </div>
1
  <?php
 
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = Newsletter::instance();
45
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
46
  $controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
47
  }
 
 
 
48
  if (empty($controls->errors)) {
49
  $module->merge_options($controls->data);
50
  $controls->messages .= __('Saved.', 'newsletter');
51
  }
 
 
 
52
  $module->hook_newsletter_extension_versions(true);
 
53
  }
54
  }
55
 
57
  $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key']);
58
  if (is_wp_error($response)) {
59
  /* @var $response WP_Error */
60
+ $controls->errors .= 'It seems that your blog cannot contact the license validator.<br>';
61
  $controls->errors .= $response->get_error_code() . ' - ' . $response->get_error_message();
62
  $controls->data['licence_expires'] = "";
63
  } else if ($response['response']['code'] != 200) {
64
+ $controls->errors .= 'The license seems expired or not valid, please check your account on www.thenewsletterplugin.com';
65
  $controls->data['licence_expires'] = "";
66
  } elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
67
  $controls->data['licence_expires'] = $expires->expire;
 
68
  } else {
 
69
  $controls->data['licence_expires'] = "";
70
  }
71
  $module->merge_options($controls->data);
72
  }
73
 
74
+ //echo $module->get_extension_version(64);
 
 
 
 
 
 
 
 
 
 
 
 
75
  ?>
76
 
77
  <div class="wrap" id="tnp-wrap">
220
  </td>
221
  </tr>
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  <tr valign="top">
224
  <th>API key</th>
225
  <td>
236
  <td>
237
  <?php $controls->textarea('css'); ?>
238
  <p class="description">
239
+ Add here your own css to style the forms. The whole form is enclosed in a div with class
240
+ "newsletter" and it's made with a table (guys, I know about your table less design
241
+ mission, don't blame me too much!)
242
  </p>
243
  </td>
244
  </tr>
276
  </p>
277
  </td>
278
  </tr>
279
+ <!--
280
+ <tr valign="top">
281
+ <th>Totally remove this plugin</th>
282
+ <td>
283
+ <?php $controls->button_confirm('remove', 'Totally remove this plugin', 'Really sure to totally remove this plugin. All data will be lost!'); ?>
284
+ </td>
285
+ </tr>
286
+ -->
287
  </table>
288
 
289
  </div>
main/smtp.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $module = Newsletter::instance();
6
  $controls = new NewsletterControls();
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $module = Newsletter::instance();
4
  $controls = new NewsletterControls();
main/startup.php CHANGED
@@ -1,163 +1,161 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
-
6
- $controls = new NewsletterControls();
7
-
8
- if ($controls->is_action('feed_enable')) {
9
- delete_option('newsletter_feed_demo_disable');
10
- $controls->messages = 'Feed by Mail demo panels enabled. On next page reload it will show up.';
11
- }
12
-
13
- if ($controls->is_action('feed_disable')) {
14
- update_option('newsletter_feed_demo_disable', 1);
15
- $controls->messages = 'Feed by Mail demo panel disabled. On next page reload it will disappear.';
16
- }
17
- ?>
18
-
19
- <div class="wrap" id="tnp-wrap">
20
-
21
- <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter'; ?>
22
- <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
23
-
24
- <div id="tnp-heading">
25
-
26
- <h2><?php _e('Quick Startup', 'newsletter') ?></h2>
27
- <p>
28
- With my horrible English, everything can be found starting from <a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Newsletter Official page</a>
29
- and every configuration panel has some included documentation just to avoid the most common mistakes.
30
- </p>
31
-
32
- </div>
33
-
34
- <div id="tnp-body" class="tnp-body-lite">
35
-
36
- <?php $controls->show(); ?>
37
- <form method="post" action="">
38
- <?php $controls->init(); ?>
39
-
40
- <h3>Few minutes to get the most out of Newsletter</h3>
41
-
42
- <ol>
43
- <li>
44
- <em>It (should) work!</em> Newsletter <strong>works out of the box</strong>, you should only
45
- <a href="widgets.php"><strong>add the Newsletter Widget</strong></a> to the sidebar and subscriptions will start to get in.
46
- </li>
47
-
48
- <li>
49
- <em>Subscription page.</em> If you feel more confortable with a <strong>subscription page</strong>, let Newsletter create one for you: on
50
- the <a href="admin.php?page=newsletter_subscription_options">subscription configuration panel</a>. You can keep both the
51
- widget and the page, of course.
52
- </li>
53
-
54
- <li>
55
- <em>Translations.</em> The <strong>administrative panels</strong> are only in (my bad) English but any other public
56
- message and label and button can be translated on <a href="admin.php?page=newsletter_subscription_options">subscription configuration panel</a>:
57
- please <strong>explore it</strong>.
58
- </li>
59
-
60
- <li>
61
- <em>More about subscription.</em> The subscription and unsubscription processes to a mailing
62
- list <strong>must be clear</strong> to the blog owner. <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">You can find more on thenewsletterplugin.com</a>.
63
- </li>
64
- </ol>
65
-
66
- <h3>Something is not working (it could happen)</h3>
67
-
68
- <ol>
69
- <li>
70
- <em>No emails are sent.</em> This is mostly a problem of your provider. <strong>Make a test</strong> using the instructions you find on
71
- the diagnostic panel.
72
- </li>
73
- <li>
74
- <em>I get a 500/fatal error during subscription.</em> This is mostly a problem of file permissions. On the diagnostic
75
- panel there is a check and on
76
- <a target="_blank" href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#errors">thenewsletterplugin.com there are some solutions</a>.
77
- </li>
78
- </ol>
79
-
80
- <h3>I want to create and send a newsletter</h3>
81
-
82
- <ol>
83
- <li>
84
- <em>I want to create a newsletter.</em> Use the <a href="admin.php?page=newsletter_emails_index">newsletters panel</a>
85
- <strong>choose a theme</strong>, preview, twick it if needed and create your message.
86
- </li>
87
- <li>
88
- <em>I want to test my newsletter.</em> Save the newsletter and move to the
89
- <a href="admin.php?page=newsletter_users_index">subscribers panel</a>.
90
- Create some subscribers manually using your own email addresses and mark them as test subscribers. They will be
91
- used for newsletter tests.
92
- </li>
93
- <li>
94
- <em>I want to send my newsletter.</em> Simple, press the send button. The email is created and put on
95
- <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine queue</a>.
96
- On newsletter list, it will be shown as "sending".
97
- </li>
98
- <li>
99
- <em>The newsletter is going out too slowly.</em> The <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine</a> sends
100
- emails as quickly as configured, see the <a href="admin.php?page=newsletter_main_main">main
101
- configuration panel</a>. Look at your provider documentation as well, since it surely has a hourly limit.
102
- </li>
103
- </ol>
104
-
105
- <h3>Extensions</h3>
106
- <p>
107
- Newsletter plugin can be extended with advanced features installing one or more of the
108
- available Professional Extensions you can find on <a href="http://www.thenewsletterplugin.com/downloads" target="_blank">www.thenewsletterplugin.com/downloads</a>.
109
- </p>
110
- <p>
111
- Newsletter Extensions are regular plugins (from version 2.x) and can be managed from the plugin panel of your
112
- once installed for the first time.
113
- </p>
114
-
115
- <h3>Support</h3>
116
- <p>
117
- There are few options to find or ask for support:
118
- </p>
119
- <ul>
120
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">The official Newsletter page</a> contains information and links to documentation and FAQ</li>
121
- <li><a href="http://www.thenewsletterplugin.com/forums/forum/newsletter-plugin" target="_blank">The official Newsletter forum</a> where to find solutions or create new requests</li>
122
- <li><a href="http://www.thenewsletterplugin.com/tag/newsletter" target="_blank">Newsletter articles and comments</a> are a source of solutions</li>
123
- <li>Only for <a href="http://www.thenewsletterplugin.com/membership" target="_blank">members</a> the <a href="http://www.thenewsletterplugin.com/support-form" target="_blank">support page</a>
124
- <li>Write directly to us at info@thenewsletterplugin.com</li>
125
- </ul>
126
-
127
- <h3>Documentation</h3>
128
- <p>
129
- Below are the pages on www.thenewsletterplugin.com which document Newsletter. Since the site evolves, more pages can be available and
130
- the full list is always up-to-date on main Newsletter page.
131
- </p>
132
-
133
- <ul>
134
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Official Newsletter page</a></li>
135
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration" target="_blank">Main configuration</a></li>
136
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-diagnostic" target="_blank">Diagnostic</a></li>
137
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq" target="_blank">FAQ</a></li>
138
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Delivery Engine</a></li>
139
-
140
-
141
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">Subscription Module</a></li>
142
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms" target="_blank">Subscription Forms</a></li>
143
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Subscriber's preferences</a></li>
144
-
145
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module" target="_blank">Newsletters Module</a></li>
146
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Themes</a></li>
147
-
148
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module" target="_blank">Subscribers Module</a></li>
149
- <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module" target="_blank">Statistics Module</a></li>
150
-
151
- <li><a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">Feed by Mail Module</a></li>
152
- <!--<li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module" target="_blank">Follow Up Module</a></li>
153
- -->
154
- </ul>
155
-
156
-
157
- </form>
158
-
159
- </div>
160
-
161
- <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
162
-
163
- </div>
1
+ x<?php
2
+ @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+
4
+ $controls = new NewsletterControls();
5
+
6
+ if ($controls->is_action('feed_enable')) {
7
+ delete_option('newsletter_feed_demo_disable');
8
+ $controls->messages = 'Feed by Mail demo panels enabled. On next page reload it will show up.';
9
+ }
10
+
11
+ if ($controls->is_action('feed_disable')) {
12
+ update_option('newsletter_feed_demo_disable', 1);
13
+ $controls->messages = 'Feed by Mail demo panel disabled. On next page reload it will disappear.';
14
+ }
15
+ ?>
16
+
17
+ <div class="wrap" id="tnp-wrap">
18
+
19
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter'; ?>
20
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
21
+
22
+ <div id="tnp-heading">
23
+
24
+ <h2><?php _e('Quick Startup', 'newsletter') ?></h2>
25
+ <p>
26
+ With my horrible English, everything can be found starting from <a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Newsletter Official page</a>
27
+ and every configuration panel has some included documentation just to avoid the most common mistakes.
28
+ </p>
29
+
30
+ </div>
31
+
32
+ <div id="tnp-body" class="tnp-body-lite">
33
+
34
+ <?php $controls->show(); ?>
35
+ <form method="post" action="">
36
+ <?php $controls->init(); ?>
37
+
38
+ <h3>Few minutes to get the most out of Newsletter</h3>
39
+
40
+ <ol>
41
+ <li>
42
+ <em>It (should) work!</em> Newsletter <strong>works out of the box</strong>, you should only
43
+ <a href="widgets.php"><strong>add the Newsletter Widget</strong></a> to the sidebar and subscriptions will start to get in.
44
+ </li>
45
+
46
+ <li>
47
+ <em>Subscription page.</em> If you feel more confortable with a <strong>subscription page</strong>, let Newsletter create one for you: on
48
+ the <a href="admin.php?page=newsletter_subscription_options">subscription configuration panel</a>. You can keep both the
49
+ widget and the page, of course.
50
+ </li>
51
+
52
+ <li>
53
+ <em>Translations.</em> The <strong>administrative panels</strong> are only in (my bad) English but any other public
54
+ message and label and button can be translated on <a href="admin.php?page=newsletter_subscription_options">subscription configuration panel</a>:
55
+ please <strong>explore it</strong>.
56
+ </li>
57
+
58
+ <li>
59
+ <em>More about subscription.</em> The subscription and unsubscription processes to a mailing
60
+ list <strong>must be clear</strong> to the blog owner. <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">You can find more on thenewsletterplugin.com</a>.
61
+ </li>
62
+ </ol>
63
+
64
+ <h3>Something is not working (it could happen)</h3>
65
+
66
+ <ol>
67
+ <li>
68
+ <em>No emails are sent.</em> This is mostly a problem of your provider. <strong>Make a test</strong> using the instructions you find on
69
+ the diagnostic panel.
70
+ </li>
71
+ <li>
72
+ <em>I get a 500/fatal error during subscription.</em> This is mostly a problem of file permissions. On the diagnostic
73
+ panel there is a check and on
74
+ <a target="_blank" href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#errors">thenewsletterplugin.com there are some solutions</a>.
75
+ </li>
76
+ </ol>
77
+
78
+ <h3>I want to create and send a newsletter</h3>
79
+
80
+ <ol>
81
+ <li>
82
+ <em>I want to create a newsletter.</em> Use the <a href="admin.php?page=newsletter_emails_index">newsletters panel</a>
83
+ <strong>choose a theme</strong>, preview, twick it if needed and create your message.
84
+ </li>
85
+ <li>
86
+ <em>I want to test my newsletter.</em> Save the newsletter and move to the
87
+ <a href="admin.php?page=newsletter_users_index">subscribers panel</a>.
88
+ Create some subscribers manually using your own email addresses and mark them as test subscribers. They will be
89
+ used for newsletter tests.
90
+ </li>
91
+ <li>
92
+ <em>I want to send my newsletter.</em> Simple, press the send button. The email is created and put on
93
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine queue</a>.
94
+ On newsletter list, it will be shown as "sending".
95
+ </li>
96
+ <li>
97
+ <em>The newsletter is going out too slowly.</em> The <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine</a> sends
98
+ emails as quickly as configured, see the <a href="admin.php?page=newsletter_main_main">main
99
+ configuration panel</a>. Look at your provider documentation as well, since it surely has a hourly limit.
100
+ </li>
101
+ </ol>
102
+
103
+ <h3>Extensions</h3>
104
+ <p>
105
+ Newsletter plugin can be extended with advanced features installing one or more of the
106
+ available Professional Extensions you can find on <a href="http://www.thenewsletterplugin.com/downloads" target="_blank">www.thenewsletterplugin.com/downloads</a>.
107
+ </p>
108
+ <p>
109
+ Newsletter Extensions are regular plugins (from version 2.x) and can be managed from the plugin panel of your
110
+ once installed for the first time.
111
+ </p>
112
+
113
+ <h3>Support</h3>
114
+ <p>
115
+ There are few options to find or ask for support:
116
+ </p>
117
+ <ul>
118
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">The official Newsletter page</a> contains information and links to documentation and FAQ</li>
119
+ <li><a href="http://www.thenewsletterplugin.com/forums/forum/newsletter-plugin" target="_blank">The official Newsletter forum</a> where to find solutions or create new requests</li>
120
+ <li><a href="http://www.thenewsletterplugin.com/tag/newsletter" target="_blank">Newsletter articles and comments</a> are a source of solutions</li>
121
+ <li>Only for <a href="http://www.thenewsletterplugin.com/membership" target="_blank">members</a> the <a href="http://www.thenewsletterplugin.com/support-form" target="_blank">support page</a>
122
+ <li>Write directly to us at info@thenewsletterplugin.com</li>
123
+ </ul>
124
+
125
+ <h3>Documentation</h3>
126
+ <p>
127
+ Below are the pages on www.thenewsletterplugin.com which document Newsletter. Since the site evolves, more pages can be available and
128
+ the full list is always up-to-date on main Newsletter page.
129
+ </p>
130
+
131
+ <ul>
132
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Official Newsletter page</a></li>
133
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration" target="_blank">Main configuration</a></li>
134
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-diagnostic" target="_blank">Diagnostic</a></li>
135
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq" target="_blank">FAQ</a></li>
136
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Delivery Engine</a></li>
137
+
138
+
139
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">Subscription Module</a></li>
140
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms" target="_blank">Subscription Forms</a></li>
141
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Subscriber's preferences</a></li>
142
+
143
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module" target="_blank">Newsletters Module</a></li>
144
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Themes</a></li>
145
+
146
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module" target="_blank">Subscribers Module</a></li>
147
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module" target="_blank">Statistics Module</a></li>
148
+
149
+ <li><a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">Feed by Mail Module</a></li>
150
+ <!--<li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module" target="_blank">Follow Up Module</a></li>
151
+ -->
152
+ </ul>
153
+
154
+
155
+ </form>
156
+
157
+ </div>
158
+
159
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
160
+
161
+ </div>
 
 
main/status.php DELETED
@@ -1,892 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
-
5
- @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
- $module = Newsletter::instance();
7
- $controls = new NewsletterControls();
8
- /* @var $wpdb wpdb */
9
-
10
-
11
- $wp_cron_calls = get_option('newsletter_diagnostic_cron_calls', array());
12
- if (count($wp_cron_calls) > 20) {
13
- $total = 0;
14
- $wp_cron_calls_max = 0;
15
- $wp_cron_calls_min = 0;
16
- for ($i = 1; $i < count($wp_cron_calls); $i++) {
17
- $diff = $wp_cron_calls[$i] - $wp_cron_calls[$i - 1];
18
- $total += $diff;
19
- if ($wp_cron_calls_min == 0 || $wp_cron_calls_min > $diff) {
20
- $wp_cron_calls_min = $diff;
21
- }
22
- if ($wp_cron_calls_max < $diff) {
23
- $wp_cron_calls_max = $diff;
24
- }
25
- }
26
- $wp_cron_calls_avg = (int) ($total / (count($wp_cron_calls) - 1));
27
- }
28
-
29
- if ($controls->is_action('delete_logs')) {
30
- $files = glob(WP_CONTENT_DIR . '/logs/newsletter/*.txt');
31
- foreach ($files as $file) {
32
- if (is_file($file))
33
- unlink($file);
34
- }
35
- $secret = NewsletterModule::get_token(8);
36
- update_option('newsletter_logger_secret', $secret);
37
- $controls->messages = 'Logs deleted';
38
- }
39
-
40
- if ($controls->is_action('test')) {
41
-
42
- if (!NewsletterModule::is_email($controls->data['test_email'])) {
43
- $controls->errors = 'The test email address is not set or is not correct.';
44
- }
45
-
46
- if (empty($controls->errors)) {
47
-
48
- $options = $controls->data;
49
-
50
- if ($controls->data['test_email'] == $module->options['sender_email']) {
51
- $controls->messages .= '<strong>Warning:</strong> you are using as test email the same address configured as sender in main configuration. Test can fail because of that.<br>';
52
- }
53
-
54
- // Newsletter mail
55
- $text = array();
56
- $text['html'] = '<p>This is an <b>HTML</b> test email sent using the sender data set on Newsletter main setting. <a href="http://www.thenewsletterplugin.com">This is a link to an external site</a>.</p>';
57
- $text['text'] = 'This is a textual test email part sent using the sender data set on Newsletter main setting.';
58
- $r = $module->mail($controls->data['test_email'], 'Newsletter test email at ' . date(DATE_ISO8601), $text);
59
-
60
- $controls->messages .= 'Email sent with Newsletter';
61
- if ($module->mail_method) {
62
- $controls->messages .= ' (with a mail delivery extension)';
63
- } else {
64
- $smtp_options = $module->get_smtp_options();
65
-
66
- if (!empty($smtp_options['enabled'])) {
67
- $controls->messages .= ' (with an SMTP)';
68
- }
69
- }
70
- $controls->messages .= ': ';
71
-
72
- if ($r) {
73
- $options['mail'] = 1;
74
- $controls->messages .= '<strong>SUCCESS</strong><br>';
75
- } else {
76
- $options['mail'] = 0;
77
- $options['mail_error'] = $module->mail_last_error;
78
-
79
- $controls->messages .= '<strong>FAILED</strong> (' . $module->mail_last_error . ')<br>';
80
-
81
- if ($module->mail_method) {
82
- $controls->messages .= '- You are using a mail delivery extension. Check and test its configuration.<br>';
83
- } else {
84
- $smtp_options = $module->get_smtp_options();
85
- if (!empty($smtp_options['enabled'])) {
86
- $controls->messages .= '- You are using an SMTP (' . $smtp_options['host'] . '). Check its configuration on main configuration or on SMTP Newsletter extensions if used.<br>';
87
- }
88
- }
89
-
90
- if (!empty($module->options['return_path'])) {
91
- $controls->messages .= '- Try to remove the return path on main settings.<br>';
92
- }
93
-
94
- $parts = explode('@', $module->options['sender_email']);
95
- $sitename = strtolower($_SERVER['SERVER_NAME']);
96
- if (substr($sitename, 0, 4) == 'www.') {
97
- $sitename = substr($sitename, 4);
98
- }
99
- if (strtolower($sitename) != strtolower($parts[1])) {
100
- $controls->messages .= '- Try to set on main setting a sender address with the same domain of your blog: ' . $sitename . ' (you are using ' . $module->options['sender_email'] . ')<br>';
101
- }
102
- }
103
- $module->save_options($options, 'status');
104
- }
105
- }
106
-
107
- $options = $module->get_options('status');
108
- ?>
109
-
110
- <div class="wrap tnp-main-status" id="tnp-wrap">
111
-
112
- <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
113
-
114
- <div id="tnp-heading">
115
-
116
- <h2><?php _e('System Status', 'newsletter') ?></h2>
117
-
118
- </div>
119
-
120
- <div id="tnp-body">
121
-
122
- <form method="post" action="">
123
- <?php $controls->init(); ?>
124
-
125
- <h3>General checks</h3>
126
- <table class="widefat" id="tnp-status-table">
127
-
128
- <thead>
129
- <tr>
130
- <th>Parameter</th>
131
- <th><?php _e('Status', 'newsletter') ?></th>
132
- <th>Action</th>
133
- </tr>
134
- </thead>
135
-
136
- <tbody>
137
-
138
- <tr>
139
- <td>Mailing</td>
140
- <td>
141
- <?php if (empty($options['mail'])) { ?>
142
- <span class="tnp-ko">KO</span>
143
- <?php } else { ?>
144
- <span class="tnp-ok">OK</span>
145
- <?php } ?>
146
-
147
- </td>
148
- <td>
149
- <?php if (empty($options['mail'])) { ?>
150
- <?php if (empty($options['mail_error'])) { ?>
151
- A test has never run.
152
- <?php } else { ?>
153
- Last test failed with error "<?php echo esc_html($options['mail_error']) ?>".
154
- <?php } ?>
155
- <?php } else { ?>
156
- Last test was successful. If you dind't receive the test email:
157
- <ol>
158
- <li>If you set the Newsletter SMTP, do a test from that panel</li>
159
- <li>If you're using a integration extension do a test from its configuration panel</li>
160
- <li>If previous points do not apply to you, ask for support to your provider reporting the emails from your blog are not delivered</li>
161
- </ol>
162
- <?php } ?>
163
- <br>
164
- Email: <?php $controls->text_email('test_email') ?> <?php $controls->button('test', __('Send a test message')) ?>
165
- </td>
166
-
167
- </tr>
168
-
169
- <?php
170
- $return_path = $module->options['return_path'];
171
- if (!empty($return_path)) {
172
- list($return_path_local, $return_path_domain) = explode('@', $return_path);
173
- }
174
- $sender = $module->options['sender_email'];
175
- if (!empty($sender)) {
176
- list($sender_local, $sender_domain) = explode('@', $sender);
177
- }
178
- ?>
179
- <tr>
180
- <td>Return path</td>
181
- <td>
182
- <?php if (empty($return_path)) { ?>
183
- <span class="tnp-ok">OK</span>
184
- <?php } else { ?>
185
- <?php if ($sender_domain != $return_path_domain) { ?>
186
- <span class="tnp-maybe">MAYBE</span>
187
- <?php } else { ?>
188
- <span class="tnp-ok">OK</span>
189
- <?php } ?>
190
- <?php } ?>
191
-
192
- </td>
193
- <td>
194
- <?php if (!empty($return_path)) { ?>
195
- Some providers require the return path domain <code><?php echo esc_html($return_path_domain) ?></code> to be identical
196
- to the sender domain <code><?php echo esc_html($sender_domain) ?></code>. See the main settings.
197
- <?php } else { ?>
198
- <?php } ?>
199
- </td>
200
-
201
- </tr>
202
-
203
- <tr>
204
- <td>Blog Charset</td>
205
- <td>
206
- <?php if (get_option('blog_charset') == 'UTF-8') { ?>
207
- <span class="tnp-ok">OK</span>
208
- <?php } else { ?>
209
- <span class="tnp-ko">KO</span>
210
- <?php } ?>
211
- </td>
212
- <td>
213
- Charset: <?php echo esc_html(get_option('blog_charset')) ?>
214
- <br>
215
-
216
- <?php if (get_option('blog_charset') == 'UTF-8') { ?>
217
-
218
- <?php } else { ?>
219
- Your blog charset is <?php echo esc_html(get_option('blog_charset')) ?> but it is recommended to use
220
- the <code>UTF-8</code> charset but the <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion</a>
221
- could be tricky. If you're not experiencing problem, leave things as is.
222
- <?php } ?>
223
- </td>
224
- </tr>
225
-
226
- <tr>
227
- <td>PHP version</td>
228
- <td>
229
- <?php if (version_compare(phpversion(), '5.3', '<')) { ?>
230
- <span class="tnp-ko">KO</span>
231
- <?php } else { ?>
232
- <span class="tnp-ok">OK</span>
233
- <?php } ?>
234
-
235
- </td>
236
- <td>
237
- Your PHP version is <?php echo phpversion() ?><br>
238
- <?php if (version_compare(phpversion(), '5.3', '<')) { ?>
239
- Newsletter plugin works correctly with PHP version 5.3 or greater. Ask your provider to upgrade your PHP. Your version is
240
- unsupported even by the PHP community.
241
- <?php } ?>
242
- </td>
243
-
244
- </tr>
245
-
246
- <?php
247
- $value = (int) ini_get('max_execution_time');
248
- if ($value != 0 && $value < NEWSLETTER_CRON_INTERVAL) {
249
- $res = set_time_limit(NEWSLETTER_CRON_INTERVAL * 1.2);
250
- }
251
- ?>
252
-
253
- <tr>
254
- <td>PHP execution time limit</td>
255
- <td>
256
- <?php if ($res) { ?>
257
- <span class="tnp-ok">OK</span>
258
- <?php } else { ?>
259
- <span class="tnp-ko">KO</span>
260
- <?php } ?>
261
-
262
- </td>
263
- <td>
264
- <?php if (!$res) { ?>
265
- Your PHP execution time limit is <?php echo $value ?> seconds and cannot be changed or
266
- is too lower to grant the maximum delivery rate of Newsletter.
267
- <?php } else { ?>
268
- Your PHP execution time limit is <?php echo $value ?> seconds and can be eventually changed by Newsletter<br>
269
- <?php } ?>
270
-
271
- </td>
272
-
273
- </tr>
274
-
275
- <tr>
276
- <td>Database Charset</td>
277
- <td>
278
- <?php if (DB_CHARSET != 'utf8' && DB_CHARSET != 'utf8mb4') { ?>
279
- <span class="tnp-ko">KO</span>
280
- <?php } else { ?>
281
- <span class="tnp-ok">OK</span>
282
- <?php } ?>
283
-
284
- </td>
285
- <td>
286
- Charset: <?php echo DB_CHARSET; ?>
287
- <br>
288
- <?php if (DB_CHARSET != 'utf8' && DB_CHARSET != 'utf8mb4') { ?>
289
- The recommended charset for your database is <code>utf8</code> or <code>utf8mb4</code>
290
- but the <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion</a>
291
- could be tricky. If you're not experiencing problem, leave things as is.
292
- <?php } else { ?>
293
-
294
- <?php } ?>
295
- </td>
296
- </tr>
297
-
298
-
299
- <?php $wait_timeout = $wpdb->get_var("select @@wait_timeout"); ?>
300
- <tr>
301
- <td>Database wait timeout</td>
302
- <td>
303
- <?php if ($wait_timeout < 300) { ?>
304
- <span class="tnp-ko">KO</span>
305
- <?php } else { ?>
306
- <span class="tnp-ok">OK</span>
307
- <?php } ?>
308
-
309
- </td>
310
- <td>
311
- Your database wait timeout is <?php echo $wait_timeout; ?> seconds<br>
312
- <?php if ($wait_timeout < 300) { ?>
313
- That value is low and could produce database connection errors while sending emails. Ask the provider to raise it
314
- at least to 300 seconds.
315
- <?php } ?>
316
- </td>
317
- </tr>
318
-
319
- <?php
320
- $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
321
- $res = $wpdb->query("create table if not exists {$wpdb->prefix}newsletter_test (id int(20))");
322
- ?>
323
- <tr>
324
- <td>Database table creation</td>
325
- <td>
326
- <?php if ($res === false) { ?>
327
- <span class="tnp-ko">KO</span>
328
- <?php } else { ?>
329
- <span class="tnp-ok">OK</span>
330
- <?php } ?>
331
- </td>
332
- <td>
333
- <?php if ($res === false) { ?>
334
- Check the privileges of the user you use to connect to the database, it seems it cannot create tables.<br>
335
- (<?php echo esc_html($wpdb->last_error) ?>)
336
- <?php } else { ?>
337
- <?php } ?>
338
- </td>
339
- </tr>
340
-
341
- <?php
342
- $res = $wpdb->query("alter table {$wpdb->prefix}newsletter_test add column id1 int(20)");
343
- ?>
344
- <tr>
345
- <td>Database table change</td>
346
- <td>
347
- <?php if ($res === false) { ?>
348
- <span class="tnp-ko">KO</span>
349
- <?php } else { ?>
350
- <span class="tnp-ok">OK</span>
351
- <?php } ?>
352
- </td>
353
- <td>
354
- <?php if ($res === false) { ?>
355
- Check the privileges of the user you use to connect to the database, it seems it cannot change the tables. It's require to update the
356
- plugin.<br>
357
- (<?php echo esc_html($wpdb->last_error) ?>)
358
- <?php } else { ?>
359
- <?php } ?>
360
- </td>
361
- </tr>
362
-
363
- <?php
364
- // Clean up
365
- $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
366
- ?>
367
-
368
- <?php
369
- set_transient('newsletter_transient_test', 1, 300);
370
- delete_transient('newsletter_transient_test');
371
- $res = get_transient('newsletter_transient_test');
372
- ?>
373
- <tr>
374
- <td>WordPress transients</td>
375
- <td>
376
- <?php if ($res !== false) { ?>
377
- <span class="tnp-ko">KO</span>
378
- <?php } else { ?>
379
- <span class="tnp-ok">OK</span>
380
- <?php } ?>
381
- </td>
382
- <td>
383
- <?php if ($res !== false) { ?>
384
- Transients cannot be delete. This can block the delivery engine. Usually it is due to a not well coded plugin installed.
385
- <?php } else { ?>
386
- <?php } ?>
387
- </td>
388
- </tr>
389
-
390
- <?php
391
- $time = wp_next_scheduled('newsletter');
392
- $res = true;
393
- if ($time === false) {
394
- $res = false;
395
- }
396
- $delta = $time - time();
397
- if ($delta <= -600) {
398
- $res = false;
399
- }
400
- ?>
401
- <tr>
402
- <td>Newsletter schedule timing</td>
403
- <td>
404
- <?php if ($res === false) { ?>
405
- <span class="tnp-ko">KO</span>
406
- <?php } else { ?>
407
- <span class="tnp-ok">OK</span>
408
- <?php } ?>
409
- </td>
410
- <td>
411
- <?php if ($res === false) { ?>
412
- No next execution is planned.
413
- <?php } else { ?>
414
- Next execution is planned in <?php echo $delta ?> seconds (negative values are ok).
415
- <?php } ?>
416
- </td>
417
- </tr>
418
-
419
- <?php
420
- $schedules = wp_get_schedules();
421
- $res = false;
422
- if (!empty($schedules)) {
423
- foreach ($schedules as $key => $data) {
424
- if ($key == 'newsletter') {
425
- $res = true;
426
- break;
427
- }
428
- }
429
- }
430
- ?>
431
-
432
- <tr>
433
- <td>
434
- Newsletter schedule
435
- </td>
436
- <td>
437
- <?php if ($res === false) { ?>
438
- <span class="tnp-ko">KO</span>
439
- <?php } else { ?>
440
- <span class="tnp-ok">OK</span>
441
- <?php } ?>
442
- </td>
443
- <td>
444
- <?php if ($res === false) { ?>
445
- The Newsletter schedule is not present probably another plugin is interfering with the starndard WordPress schuling system.<br>
446
- <?php } else { ?>
447
- <?php } ?>
448
-
449
- WordPress registsred schedules:<br>
450
- <?php
451
- if (!empty($schedules)) {
452
- foreach ($schedules as $key => $data) {
453
- echo esc_html($key . ' - ' . $data['interval']) . ' seconds<br>';
454
- }
455
- }
456
- ?>
457
- </td>
458
- </tr>
459
-
460
- <tr>
461
- <td>
462
- WordPress scheduler auto trigger
463
- </td>
464
- <td>
465
- <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) { ?>
466
- <span class="tnp-maybe">MAYBE</span>
467
- <?php } else { ?>
468
- <span class="tnp-ok">OK</span>
469
- <?php } ?>
470
- </td>
471
- <td>
472
- <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) { ?>
473
- The constant DISABLE_WP_CRON is set to true (probably in wp-config.php). That disables the scheduler auto triggering and it's
474
- good ONLY if you setup an external trigger.
475
- <?php } else { ?>
476
-
477
- <?php } ?>
478
- </td>
479
- </tr>
480
-
481
- <?php
482
- $res = true;
483
- $response = wp_remote_post(home_url('/') . '?na=test');
484
- if (is_wp_error($response)) {
485
- $res = false;
486
- $message = $reponse->get_error_message();
487
- } else {
488
- if (wp_remote_retrieve_response_code($response) != 200) {
489
- $res = false;
490
- $message = wp_remote_retrieve_response_message($response);
491
- }
492
- }
493
- ?>
494
- <tr>
495
- <td>
496
- Action call
497
- </td>
498
- <td>
499
- <?php if (!$res) { ?>
500
- <span class="tnp-ko">KO</span>
501
- <?php } else { ?>
502
- <span class="tnp-ok">OK</span>
503
- <?php } ?>
504
- </td>
505
- <td>
506
- <?php if (!$res) { ?>
507
- The blog is not responding to Newsletter URLs: ask the provider or your IT consultant to check this problem. Report the URL and error blow<br>
508
- Error: <?php echo esc_html($message) ?><br>
509
- <?php } else { ?>
510
-
511
- <?php } ?>
512
- Url: <?php echo esc_html(home_url('/') . '?na=test') ?><br>
513
- </td>
514
- </tr>
515
-
516
- <?php
517
- $res = true;
518
- $response = wp_remote_get(site_url('/wp-cron.php') . '?' . time());
519
- if (is_wp_error($response)) {
520
- $res = false;
521
- $message = $reponse->get_error_message();
522
- } else {
523
- if (wp_remote_retrieve_response_code($response) != 200) {
524
- $res = false;
525
- $message = wp_remote_retrieve_response_message($response);
526
- }
527
- }
528
- ?>
529
- <tr>
530
- <td>
531
- WordPress scheduler auto trigger call
532
- </td>
533
- <td>
534
- <?php if (!$res) { ?>
535
- <span class="tnp-ko">KO</span>
536
- <?php } else { ?>
537
- <span class="tnp-ok">OK</span>
538
- <?php } ?>
539
- </td>
540
- <td>
541
- <?php if (!$res) { ?>
542
- The blog cannot autotrigger the internal scheduler, if an external trigger is used this could not be a real problem.<br>
543
- Error: <?php echo esc_html($message) ?><br>
544
- <?php } else { ?>
545
-
546
- <?php } ?>
547
- Url: <?php echo esc_html(site_url('/wp-cron.php')) ?><br>
548
- </td>
549
- </tr>
550
-
551
- <?php
552
- $res = true;
553
- $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/versions/all.txt');
554
- if (is_wp_error($response)) {
555
- $res = false;
556
- $message = $reponse->get_error_message();
557
- } else {
558
- if (wp_remote_retrieve_response_code($response) != 200) {
559
- $res = false;
560
- $message = wp_remote_retrieve_response_message($response);
561
- }
562
- }
563
- ?>
564
- <tr>
565
- <td>
566
- Extension version check
567
- </td>
568
- <td>
569
- <?php if (!$res) { ?>
570
- <span class="tnp-ko">KO</span>
571
- <?php } else { ?>
572
- <span class="tnp-ok">OK</span>
573
- <?php } ?>
574
- </td>
575
- <td>
576
- <?php if (!$res) { ?>
577
- The blog cannot contact www.thenewsletterplugin.com to check the license or the extension versions.<br>
578
- Error: <?php echo esc_html($message) ?><br>
579
- <?php } else { ?>
580
-
581
- <?php } ?>
582
- </td>
583
- </tr>
584
-
585
- <tr>
586
- <td>
587
- WordPress debug mode
588
- </td>
589
- <td>
590
- <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
591
- <span class="tnp-maybe">MAYBE</span>
592
- <?php } else { ?>
593
- <span class="tnp-ok">OK</span>
594
- <?php } ?>
595
- </td>
596
- <td>
597
- <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
598
- WordPress is in debug mode it is not recommended on a production system. See the constant WP_DEBUG insde the wp-config.php.
599
- <?php } else { ?>
600
-
601
- <?php } ?>
602
- </td>
603
- </tr>
604
-
605
-
606
-
607
- <?php
608
- $memory = intval(WP_MEMORY_LIMIT);
609
- if (false !== strpos(WP_MEMORY_LIMIT, 'G'))
610
- $memory *= 1024;
611
- ?>
612
- <tr>
613
- <td>
614
- PHP memory limit
615
- </td>
616
- <td>
617
- <?php if ($memory < 64) { ?>
618
- <span class="tnp-ko">KO</span>
619
- <?php } else if ($memory < 128) { ?>
620
- <span class="tnp-maybe">MAYBE</span>
621
- <?php } else { ?>
622
- <span class="tnp-ok">OK</span>
623
- <?php } ?>
624
- </td>
625
- <td>
626
- Your memory limit is set to <?php echo $memory ?> megabyte<br>
627
- <?php if ($memory < 64) { ?>
628
- This value is too low you should increase it adding <code>define('WP_MEMORY_LIMIT', '64M');</code> to your wp-config.php.
629
- <?php } else if ($memory < 128) { ?>
630
- The value should be fine, it depends on how many plugin you're running and how many resource are required by your theme.
631
- Blank pages are usually syntoms of low memory. Eventually increase it adding <code>define('WP_MEMORY_LIMIT', '128M');</code>
632
- to your wp-config.php.
633
- <?php } else { ?>
634
-
635
- <?php } ?>
636
-
637
- </td>
638
- </tr>
639
-
640
- <?php
641
- $ip = gethostbyname($_SERVER['HTTP_HOST']);
642
- $name = gethostbyaddr($ip);
643
- $res = true;
644
- if (strpos($name, '.secureserver.net') !== false) {
645
- //$smtp = get_option('newsletter_main_smtp');
646
- //if (!empty($smtp['enabled']))
647
- $res = false;
648
- $message = 'If you\'re hosted with GoDaddy, be sure to set their SMTP (relay-hosting.secureserver.net, without username and password) to send emails
649
- on Newsletter SMTP panel.
650
- Remember they limits you to 250 emails per day. Open them a ticket for more details.';
651
- }
652
- if (strpos($name, '.aruba.it') !== false) {
653
- $res = false;
654
- $message = 'If you\'re hosted with Aruba consider to use an external SMTP (Sendgrid, Mailjet, Mailgun, Amazon SES, Elasticemail, Sparkpost, ...)
655
- since their mail service is not good. If you have your personal email with them, you can try to use the SMTP of your
656
- pesonal account. Ask the support for the SMTP parameters and configure them on Newsletter SMTP panel.';
657
- }
658
- ?>
659
- <tr>
660
- <td>Your Server</td>
661
- <td>
662
- <?php if ($res === false) { ?>
663
- <span class="tnp-maybe">MAYBE</span>
664
- <?php } else { ?>
665
- <span class="tnp-ok">OK</span>
666
- <?php } ?>
667
-
668
-
669
- </td>
670
- <td>
671
- <?php if ($res === false) { ?>
672
- <?php echo $message ?>
673
- <?php } else { ?>
674
-
675
- <?php } ?>
676
- IP: <?php echo $ip ?><br>
677
- Name: <?php echo $name ?><br>
678
- </td>
679
- </tr>
680
-
681
- <?php
682
- wp_mkdir_p(NEWSLETTER_LOG_DIR);
683
- $res = is_dir(NEWSLETTER_LOG_DIR);
684
- if ($res) {
685
- file_put_contents(NEWSLETTER_LOG_DIR . '/test.txt', "");
686
- $res = is_file(NEWSLETTER_LOG_DIR . '/test.txt');
687
- if ($res) {
688
- @unlink(NEWSLETTER_LOG_DIR . '/test.txt');
689
- }
690
- }
691
- ?>
692
- <tr>
693
- <td>
694
- Log folder
695
- </td>
696
- <td>
697
- <?php if (!$res) { ?>
698
- <span class="tnp-ko">KO</span>
699
- <?php } else { ?>
700
- <span class="tnp-ok">OK</span>
701
- <?php } ?>
702
- </td>
703
- <td>
704
- The log folder is <?php echo esc_html(NEWSLETTER_LOG_DIR) ?><br>
705
- <?php if (!$res) { ?>
706
- Cannot create the folder or it is not writable.
707
- <?php } else { ?>
708
-
709
- <?php } ?>
710
- </td>
711
- </tr>
712
- </tbody>
713
- </table>
714
-
715
- <h3>General parameters</h3>
716
- <table class="widefat" id="tnp-parameters-table">
717
- <thead>
718
- <tr>
719
- <th>Parameter</th>
720
- <th>Value</th>
721
- </tr>
722
- </thead>
723
- <tbody>
724
-
725
- <tr>
726
- <td>Newsletter version</td>
727
- <td>
728
- <?php echo NEWSLETTER_VERSION ?>
729
- </td>
730
- </tr>
731
-
732
- <tr>
733
- <td>NEWSLETTER_MAX_EXECUTION_TIME</td>
734
- <td>
735
- <?php
736
- if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
737
- echo NEWSLETTER_MAX_EXECUTION_TIME . ' (seconds)';
738
- } else {
739
- echo 'Not set';
740
- }
741
- ?>
742
- </td>
743
- </tr>
744
- <tr>
745
- <td>NEWSLETTER_CRON_INTERVAL</td>
746
- <td>
747
- <?php echo NEWSLETTER_CRON_INTERVAL . ' (seconds)'; ?>
748
- </td>
749
- </tr>
750
-
751
- <?php /*
752
- <tr>
753
- <td>WordPress plugin url</td>
754
- <td>
755
- <?php echo WP_PLUGIN_URL; ?>
756
- <br>
757
- Filters:
758
-
759
- <?php
760
- if (isset($wp_filter))
761
- $filters = $wp_filter['plugins_url'];
762
- if (!isset($filters) || !is_array($filters))
763
- echo 'no filters attached to "plugin_urls"';
764
- else {
765
- echo '<ul>';
766
- foreach ($filters as &$filter) {
767
- foreach ($filter as &$entry) {
768
- echo '<li>';
769
- if (is_array($entry['function']))
770
- echo esc_html(get_class($entry['function'][0]) . '->' . $entry['function'][1]);
771
- else
772
- echo esc_html($entry['function']);
773
- echo '</li>';
774
- }
775
- }
776
- echo '</ul>';
777
- }
778
- ?>
779
- <p class="description">
780
- This value should contains the full URL to your plugin folder. If there are filters
781
- attached, the value can be different from the original generated by WordPress and sometime worng.
782
- </p>
783
- </td>
784
- </tr>
785
- */ ?>
786
-
787
- <tr>
788
- <td>Absolute path</td>
789
- <td>
790
- <?php echo esc_html(ABSPATH); ?>
791
- </td>
792
- </tr>
793
- <tr>
794
- <td>Tables Prefix</td>
795
- <td>
796
- <?php echo $wpdb->prefix; ?>
797
- </td>
798
- </tr>
799
- </tbody>
800
- </table>
801
-
802
- <h3>Log files</h3>
803
-
804
- <ul class="tnp-log-files">
805
- <?php
806
- $files = glob(WP_CONTENT_DIR . '/logs/newsletter/*.txt'); // get all file names
807
- foreach ($files as $file) { // iterate files
808
- echo '<li><a href="' . WP_CONTENT_URL . '/logs/newsletter/' . basename($file) . '" target="_blank">' . basename($file) . '</a>';
809
- echo ' <span class="tnp-log-size">(' . size_format(filesize($file)) . ')</span>';
810
- echo '</li>';
811
- }
812
- ?>
813
- </ul>
814
-
815
- <?php $controls->button('delete_logs', 'Delete all'); ?>
816
-
817
-
818
- <?php if (isset($_GET['debug'])) { ?>
819
-
820
-
821
- <h3>Database Tables</h3>
822
- <h4><?php echo $wpdb->prefix ?>newsletter</h4>
823
- <?php
824
- $rs = $wpdb->get_results("describe {$wpdb->prefix}newsletter");
825
- ?>
826
- <table class="tnp-db-table">
827
- <thead>
828
- <tr>
829
- <th>Field</th>
830
- <th>Type</th>
831
- <th>Null</th>
832
- <th>Key</th>
833
- <th>Default</th>
834
- <th>Extra</th>
835
- </tr>
836
- </thead>
837
- <tbody>
838
- <?php foreach ($rs as $r) { ?>
839
- <tr>
840
- <td><?php echo esc_html($r->Field) ?></td>
841
- <td><?php echo esc_html($r->Type) ?></td>
842
- <td><?php echo esc_html($r->Null) ?></td>
843
- <td><?php echo esc_html($r->Key) ?></td>
844
- <td><?php echo esc_html($r->Default) ?></td>
845
- <td><?php echo esc_html($r->Extra) ?></td>
846
- </tr>
847
- <?php } ?>
848
- </tbody>
849
- </table>
850
-
851
- <h4><?php echo $wpdb->prefix ?>newsletter_emails</h4>
852
- <?php
853
- $rs = $wpdb->get_results("describe {$wpdb->prefix}newsletter_emails");
854
- ?>
855
- <table class="tnp-db-table">
856
- <thead>
857
- <tr>
858
- <th>Field</th>
859
- <th>Type</th>
860
- <th>Null</th>
861
- <th>Key</th>
862
- <th>Default</th>
863
- <th>Extra</th>
864
- </tr>
865
- </thead>
866
- <tbody>
867
- <?php foreach ($rs as $r) { ?>
868
- <tr>
869
- <td><?php echo esc_html($r->Field) ?></td>
870
- <td><?php echo esc_html($r->Type) ?></td>
871
- <td><?php echo esc_html($r->Null) ?></td>
872
- <td><?php echo esc_html($r->Key) ?></td>
873
- <td><?php echo esc_html($r->Default) ?></td>
874
- <td><?php echo esc_html($r->Extra) ?></td>
875
- </tr>
876
- <?php } ?>
877
- </tbody>
878
- </table>
879
-
880
-
881
- <h3>Extensions</h3>
882
- <pre style="font-size: 11px; font-family: monospace; background-color: #efefef; color: #444"><?php echo esc_html(print_r(get_option('newsletter_extension_versions'), true)); ?></pre>
883
-
884
- <h3>Update plugins data</h3>
885
- <pre style="font-size: 11px; font-family: monospace; background-color: #efefef; color: #444"><?php echo esc_html(print_r(get_site_transient('update_plugins'), true)); ?></pre>
886
-
887
- <?php } ?>
888
- </div>
889
-
890
- <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
891
-
892
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin.php CHANGED
@@ -4,17 +4,17 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.7.8
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
11
  Text Domain: newsletter
12
 
13
- Copyright 2009-2017 The Newsletter Team (email: info@thenewsletterplugin.com, web: http://www.thenewsletterplugin.com)
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '4.7.8');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -106,7 +106,7 @@ class Newsletter extends NewsletterModule {
106
  var $action = '';
107
  static $instance;
108
 
109
- const MAX_CRON_SAMPLES = 100;
110
 
111
  /**
112
  * @return Newsletter
@@ -127,11 +127,6 @@ class Newsletter extends NewsletterModule {
127
  $this->action = $_POST['na'];
128
  }
129
 
130
- if (!empty($this->action)) {
131
- // For old versions of wp super cache
132
- $_GET['preview'] = 'true';
133
- }
134
-
135
  $this->time_start = time();
136
 
137
  // Here because the upgrade is called by the parent constructor and uses the scheduler
@@ -155,29 +150,14 @@ class Newsletter extends NewsletterModule {
155
 
156
  if (defined('DOING_CRON') && DOING_CRON) {
157
  $calls = get_option('newsletter_diagnostic_cron_calls', array());
 
 
 
158
  $calls[] = time();
159
  if (count($calls) > self::MAX_CRON_SAMPLES) {
160
  array_shift($calls);
161
  }
162
- update_option('newsletter_diagnostic_cron_calls', $calls, false);
163
-
164
- if (count($calls) > 50) {
165
- $mean = 0;
166
- $max = 0;
167
- $min = 0;
168
- for ($i = 1; $i < count($calls); $i++) {
169
- $diff = $calls[$i] - $calls[$i - 1];
170
- $mean += $diff;
171
- if ($min == 0 || $min > $diff) {
172
- $min = $diff;
173
- }
174
- if ($max < $diff) {
175
- $max = $diff;
176
- }
177
- }
178
- $mean = $mean / count($calls) - 1;
179
- update_option('newsletter_diagnostic_cron_data', array('mean' => $mean, 'max' => $max, 'min' => $min), false);
180
- }
181
  return;
182
  }
183
 
@@ -205,8 +185,6 @@ class Newsletter extends NewsletterModule {
205
  add_action('wp_ajax_tnpc_render', 'tnpc_render_callback');
206
  add_action('wp_ajax_tnpc_preview', 'tnpc_preview_callback');
207
  add_action('wp_ajax_tnpc_css', 'tnpc_css_callback');
208
-
209
- add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
210
  }
211
  }
212
 
@@ -370,18 +348,12 @@ class Newsletter extends NewsletterModule {
370
 
371
  $this->add_menu_page('index', 'Dashboard');
372
  $this->add_menu_page('main', 'Settings and More');
373
-
374
  $this->add_admin_page('smtp', 'SMTP');
375
- $this->add_admin_page('status', 'Status');
376
  $this->add_admin_page('info', 'Company info');
377
  $this->add_admin_page('diagnostic', 'Diagnostic');
378
  $this->add_admin_page('startup', 'Quick Startup');
379
  }
380
 
381
- function add_extensions_menu() {
382
- $this->add_menu_page('extensions', '<span style="color:#27AE60; font-weight: bold;">Extensions</span>');
383
- }
384
-
385
  /**
386
  * Returns a set of warnings about this installtion the suser should be aware of. Return an empty string
387
  * if there are no warnings.
@@ -393,11 +365,6 @@ class Newsletter extends NewsletterModule {
393
  $warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
394
  } else if (time() - $x > 900) {
395
  $warnings .= 'The cron system seems not running correctly. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
396
- } else {
397
- $cron_data = get_option('newsletter_diagnostic_cron_data');
398
- if ($cron_data && $cron_data['mean'] > 400) {
399
- $warnings .= 'The WordPress internal schedule is not triggered enough often. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
400
- }
401
  }
402
 
403
  if (!empty($warnings)) {
@@ -410,17 +377,12 @@ class Newsletter extends NewsletterModule {
410
  function hook_init() {
411
  global $cache_stop, $hyper_cache_stop, $wpdb;
412
 
413
- if (isset($this->options['debug']) && $this->options['debug'] == 1) {
414
- ini_set('log_errors', 1);
415
- ini_set('error_log', WP_CONTENT_DIR . '/logs/newsletter/php-' . date('Y-m') . '-' . get_option('newsletter_logger_secret') . '.txt');
416
- }
417
-
418
  if (is_admin()) {
419
  if ($this->is_admin_page()) {
420
  wp_enqueue_script('jquery-ui-tabs');
421
- //wp_enqueue_script('media-upload');
422
- //wp_enqueue_script('thickbox');
423
- //wp_enqueue_style('thickbox');
424
  wp_enqueue_media();
425
 
426
  $dismissed = get_option('newsletter_dismissed', array());
@@ -456,11 +418,6 @@ class Newsletter extends NewsletterModule {
456
  $this->message = $options_followup['unsubscribed_text'];
457
  return;
458
  }
459
-
460
- if ($action == 'test') {
461
- echo 'ok';
462
- die();
463
- }
464
  }
465
 
466
  function is_admin_page() {
@@ -488,10 +445,19 @@ class Newsletter extends NewsletterModule {
488
  echo $this->options['css'];
489
  echo "</style>";
490
  }
 
 
 
 
 
 
 
 
 
491
  }
492
 
493
- function relink($text, $email_id, $user_id, $email_token = '') {
494
- return NewsletterStatistics::instance()->relink($text, $email_id, $user_id, $email_token);
495
  }
496
 
497
  /**
@@ -503,18 +469,16 @@ class Newsletter extends NewsletterModule {
503
  $this->logger->debug('hook_newsletter> Start');
504
 
505
  // Do not accept job activation before at least 4 minutes are elapsed from the last run.
506
- if (!$this->check_transient('engine', NEWSLETTER_CRON_INTERVAL)) {
507
  return;
508
- }
509
 
510
  // Retrieve all email in "sending" status
511
  $emails = $wpdb->get_results("select * from " . NEWSLETTER_EMAILS_TABLE . " where status='sending' and send_on<" . time() . " order by id asc");
512
  $this->logger->debug('hook_newsletter> Emails found in sending status: ' . count($emails));
513
- foreach ($emails as $email) {
514
  $this->logger->debug('hook_newsletter> Sending email ' . $email->id);
515
- if (!$this->send($email)) {
516
  break;
517
- }
518
  }
519
  // Remove the semaphore so the delivery engine can be activated again
520
  $this->delete_transient('engine');
@@ -523,7 +487,7 @@ class Newsletter extends NewsletterModule {
523
  }
524
 
525
  /**
526
- * Sends an email to targeted users or to given users. If a list of users is given (usually a list of test users)
527
  * the query inside the email to retrieve users is not used.
528
  *
529
  * @global wpdb $wpdb
@@ -535,11 +499,10 @@ class Newsletter extends NewsletterModule {
535
  function send($email, $users = null) {
536
  global $wpdb;
537
 
538
- if (is_array($email)) {
539
  $email = (object) $email;
540
- }
541
 
542
- // This stops the update of last_id and sent fields since it's not a scheduled delivery but a test or something else (like an autoresponder)
543
  $test = $users != null;
544
 
545
  if ($users == null) {
@@ -562,17 +525,11 @@ class Newsletter extends NewsletterModule {
562
  }
563
  }
564
 
565
- $start_time = microtime(true);
566
- $count = 0;
567
- $result = true;
568
-
569
- foreach ($users as $user) {
570
 
571
  // Before try to send, check the limits.
572
- if (!$test && $this->limits_exceeded()) {
573
- $result = false;
574
- break;
575
- }
576
 
577
  $headers = array('List-Unsubscribe' => '<' . home_url('/') . '?na=u&nk=' . $user->id . '-' . $user->token . '>');
578
  $headers['Precedence'] = 'bulk';
@@ -588,7 +545,7 @@ class Newsletter extends NewsletterModule {
588
 
589
 
590
  if ($email->track == 1) {
591
- $m = $this->relink($m, $email->id, $user->id, $email->token);
592
  }
593
 
594
  $s = $this->replace($email->subject, $user);
@@ -612,20 +569,9 @@ class Newsletter extends NewsletterModule {
612
  $wpdb->query($wpdb->prepare("insert into " . $wpdb->prefix . 'newsletter_sent (user_id, email_id, time, status, error) values (%d, %d, %d, %d, %s) on duplicate key update time=%d, status=%d, error=%s', $user->id, $email->id, time(), $status, $this->mail_last_error, time(), $status, $this->mail_last_error));
613
 
614
  $this->email_limit--;
615
- $count++;
616
  }
617
- $end_time = microtime(true);
618
-
619
- if ($count > 0) {
620
- $send_calls = get_option('newsletter_diagnostic_send_calls', array());
621
- $send_calls[] = array($start_time, $end_time, $count, $result);
622
-
623
- if (count($send_calls) > self::MAX_CRON_SAMPLES)
624
- array_shift($send_calls);
625
 
626
- update_option('newsletter_diagnostic_send_calls', $send_calls, false);
627
- }
628
- return $result;
629
  }
630
 
631
  /**
@@ -662,8 +608,6 @@ class Newsletter extends NewsletterModule {
662
  @set_time_limit((int) $this->options['php_time_limit']);
663
  } else if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
664
  @set_time_limit(NEWSLETTER_MAX_EXECUTION_TIME);
665
- } else {
666
- @set_time_limit(NEWSLETTER_CRON_INTERVAL);
667
  }
668
 
669
  $max_time = (int) (@ini_get('max_execution_time') * 0.95);
@@ -719,10 +663,10 @@ class Newsletter extends NewsletterModule {
719
 
720
  function mail($to, $subject, $message, $headers = null) {
721
  $this->mail_last_error = '';
722
- //$this->logger->debug('mail> To: ' . $to);
723
- //$this->logger->debug('mail> Subject: ' . $subject);
724
  if (empty($subject)) {
725
- $this->logger->error('mail> Subject empty, skipped');
726
  return true;
727
  }
728
 
@@ -746,7 +690,7 @@ class Newsletter extends NewsletterModule {
746
  }
747
 
748
  if ($this->mail_method != null) {
749
- //$this->logger->debug('mail> alternative mail method found');
750
  return call_user_func($this->mail_method, $to, $subject, $message, $headers);
751
  }
752
 
@@ -851,6 +795,13 @@ class Newsletter extends NewsletterModule {
851
  require_once ABSPATH . WPINC . '/class-smtp.php';
852
 
853
  $smtp_options = $this->get_smtp_options();
 
 
 
 
 
 
 
854
 
855
 
856
  if ($smtp_options['enabled'] == 1) {
@@ -979,6 +930,43 @@ class Newsletter extends NewsletterModule {
979
 
980
  $user = $this->get_user_by_wp_user_id($wp_user_id);
981
  return $user;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
982
  }
983
 
984
  function replace_date($text) {
@@ -1068,7 +1056,7 @@ class Newsletter extends NewsletterModule {
1068
  $text = str_replace('%7Bkey%7D', $user->id . '-' . $user->token, $text);
1069
 
1070
  if (strpos($text, '{profile_form}') !== false) {
1071
- $text = str_replace('{profile_form}', NewsletterSubscription::instance()->get_profile_form_html5($user), $text);
1072
  }
1073
 
1074
  for ($i = 1; $i < NEWSLETTER_PROFILE_MAX; $i++) {
@@ -1088,7 +1076,7 @@ class Newsletter extends NewsletterModule {
1088
  $nk = $user->id . '-' . $user->token;
1089
 
1090
  $options_subscription = NewsletterSubscription::instance()->options;
1091
-
1092
  if ($email) {
1093
  $text = str_replace('{email_id}', $email->id, $text);
1094
  $text = str_replace('{email_subject}', $email->subject, $text);
@@ -1222,11 +1210,6 @@ class Newsletter extends NewsletterModule {
1222
  }
1223
 
1224
  function save_email($email, $return_format = OBJECT) {
1225
- if (isset($email['subject'])) {
1226
- if (mb_strlen($email['subject'], 'UTF-8') > 250) {
1227
- $email['subject'] = mb_substr($email['subject'], 0, 250, 'UTF-8');
1228
- }
1229
- }
1230
  return $this->store->save(NEWSLETTER_EMAILS_TABLE, $email, $return_format);
1231
  }
1232
 
@@ -1370,32 +1353,6 @@ class Newsletter extends NewsletterModule {
1370
  return $value;
1371
  }
1372
 
1373
- /**
1374
- * Retrieve the extensions form the tnp site
1375
- * @return array
1376
- */
1377
- function getTnpExtensions() {
1378
-
1379
- $url = "http://www.thenewsletterplugin.com/wp-content/extensions.json";
1380
- if (!empty($this->options['contract_key'])) {
1381
- $url = "http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/extensions.php?k=" . $this->options['contract_key'];
1382
- }
1383
-
1384
- $extensions_json = get_transient('tnp_extensions_json');
1385
-
1386
- if (false === $extensions_json) {
1387
- $extensions_response = wp_remote_get($url);
1388
- $extensions_json = wp_remote_retrieve_body($extensions_response);
1389
- if (!empty($extensions_json)) {
1390
- set_transient('tnp_extensions_json', $extensions_json, 24 * 60 * 60);
1391
- }
1392
- }
1393
-
1394
- $extensions = json_decode($extensions_json);
1395
-
1396
- return $extensions;
1397
- }
1398
-
1399
  /**
1400
  * Load plugin textdomain.
1401
  *
@@ -1435,9 +1392,19 @@ require_once NEWSLETTER_DIR . '/wp/wp.php';
1435
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-feed')) {
1436
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/feed/feed.php')) {
1437
  require_once WP_CONTENT_DIR . '/extensions/newsletter/feed/feed.php';
 
 
 
 
 
 
1438
  }
1439
  }
1440
 
 
 
 
 
1441
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-followup')) {
1442
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php')) {
1443
  require_once WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php';
@@ -1481,8 +1448,7 @@ if (!is_dir(WP_PLUGIN_DIR . '/newsletter-mandrill')) {
1481
  }
1482
 
1483
 
1484
- require_once(dirname(__FILE__) . '/widget/standard.php');
1485
- require_once(dirname(__FILE__) . '/widget/minimal.php');
1486
 
1487
  register_activation_hook(__FILE__, 'newsletter_activate');
1488
 
@@ -1505,7 +1471,7 @@ function newsletter_deactivate() {
1505
 
1506
  function tnpc_render_callback() {
1507
  $block_options = get_option('newsletter_main');
1508
- include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.php';
1509
  wp_die(); // this is required to terminate immediately and return a proper response
1510
  }
1511
 
@@ -1528,102 +1494,3 @@ function tnpc_css_callback() {
1528
  include NEWSLETTER_DIR . '/emails/tnp-composer/css/newsletter.css';
1529
  wp_die(); // this is required to terminate immediately and return a proper response
1530
  }
1531
-
1532
- if (is_admin()) {
1533
- add_action('plugins_loaded', 'newsletter_plugin_loaded');
1534
- }
1535
-
1536
- function newsletter_plugin_loaded() {
1537
-
1538
- // Check the TGM version?
1539
- // if (class_exists('TGM_Plugin_Activation') && TGM_Plugin_Activation::TGMPA_VERSION != '2.6.1') {
1540
- // // Something
1541
- // }
1542
-
1543
- // TGM PLUGIN ACTIVATION
1544
- // see http://tgmpluginactivation.com/configuration/ for detailed documentation.
1545
- require_once dirname(__FILE__) . '/includes/class-tgm-plugin-activation.php';
1546
-
1547
- add_action('tgmpa_register', 'newsletter_register_required_plugins');
1548
-
1549
- // Register the available extensions
1550
- function newsletter_register_required_plugins() {
1551
-
1552
- global $wpdb;
1553
-
1554
- $extensions = Newsletter::instance()->getTnpExtensions();
1555
- $plugins = array();
1556
-
1557
- if (is_array($extensions)) {
1558
- foreach ($extensions AS $e) {
1559
- $plugins[] = array(
1560
- 'name' => $e->title,
1561
- 'slug' => $e->slug, // The plugin slug (typically the folder name).
1562
- 'source' => $e->download_url . '&k=' . Newsletter::instance()->options['contract_key'], // The plugin source.
1563
- 'required' => false, // If false, the plugin is only 'recommended' instead of required.
1564
- 'external_url' => $e->url, // If set, overrides default API URL and points to an external URL.
1565
- );
1566
- }
1567
- }
1568
-
1569
- $show_estensions_notices = false;
1570
- //$user_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
1571
- // $sent_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_EMAILS_TABLE . " where status='sent'");
1572
- // if ($sent_count > 0) {
1573
- // $show_estensions_notices = true;
1574
- // }
1575
-
1576
- $config = array(
1577
- 'id' => 'newsletter', // Unique ID for hashing notices for multiple instances of TGMPA.
1578
- 'default_path' => '', // Default absolute path to bundled plugins.
1579
- 'menu' => 'tgmpa-install-plugins', // Menu slug.
1580
- 'parent_slug' => 'plugins.php', // Parent menu slug.
1581
- 'capability' => 'manage_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
1582
- 'has_notices' => $show_estensions_notices, // Show admin notices or not.
1583
- 'dismissable' => true, // If false, a user cannot dismiss the nag message.
1584
- 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
1585
- 'is_automatic' => true, // Automatically activate plugins after installation or not.
1586
- 'message' => '', // Message to output right before the plugins table.
1587
- 'strings' => array(
1588
- 'page_title' => __('Newsletter Extensions and Integrations', 'newsletter'),
1589
- 'notice_can_install_required' => _n_noop(
1590
- /* translators: 1: plugin name(s). */
1591
- 'Newsletter requires the following plugin: %1$s.', 'Newsletter requires the following plugins: %1$s.', 'newsletter'
1592
- ),
1593
- 'notice_can_install_recommended' => _n_noop(
1594
- /* translators: 1: plugin name(s). */
1595
- 'This theme recommends the following plugin: %1$s.', 'Newsletter recommends the following plugins: %1$s.', 'newsletter'
1596
- ),
1597
- 'notice_ask_to_update' => _n_noop(
1598
- /* translators: 1: plugin name(s). */
1599
- 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with Newsletter: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with Newsletter: %1$s.', 'newsletter'
1600
- ),
1601
- 'notice_can_activate_recommended' => _n_noop(
1602
- /* translators: 1: plugin name(s). */
1603
- 'The following recommended extension is currently inactive: %1$s.', 'The following recommended extensions are currently inactive: %1$s.', 'newsletter'
1604
- ),
1605
- 'install_link' => _n_noop(
1606
- 'Begin installing extension', 'Begin installing extensions', 'newsletter'
1607
- ),
1608
- 'update_link' => _n_noop(
1609
- 'Begin updating extension', 'Begin updating extensions', 'newsletter'
1610
- ),
1611
- 'activate_link' => _n_noop(
1612
- 'Begin activating extension', 'Begin activating extensions', 'newsletter'
1613
- ),
1614
- 'plugin_activated' => __('Extension activated successfully.', 'newsletter'),
1615
- 'activated_successfully' => __('The following extension was activated successfully:', 'newsletter'),
1616
- /* translators: 1: plugin name. */
1617
- 'plugin_already_active' => __('No action taken. Extension %1$s was already active.', 'newsletter'),
1618
- /* translators: 1: plugin name. */
1619
- 'plugin_needs_higher_version' => __('Extension not activated. A higher version of %s is needed for Newsletter. Please update the extension.', 'newsletter'),
1620
- /* translators: 1: dashboard link. */
1621
- 'complete' => __('All extensions installed and activated successfully. %1$s', 'newsletter'),
1622
- 'notice_cannot_install_activate' => __('There are one or more required or recommended extensions to install, update or activate.', 'newsletter'),
1623
- ),
1624
- );
1625
-
1626
- tgmpa($plugins, $config);
1627
- }
1628
-
1629
- }
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 4.5.5
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
11
  Text Domain: newsletter
12
 
13
+ Copyright 2009-2016 The Newsletter Team (email: info@thenewsletterplugin.com, web: http://www.thenewsletterplugin.com)
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '4.5.5');
18
 
19
  global $wpdb, $newsletter;
20
 
106
  var $action = '';
107
  static $instance;
108
 
109
+ const MAX_CRON_SAMPLES = 300;
110
 
111
  /**
112
  * @return Newsletter
127
  $this->action = $_POST['na'];
128
  }
129
 
 
 
 
 
 
130
  $this->time_start = time();
131
 
132
  // Here because the upgrade is called by the parent constructor and uses the scheduler
150
 
151
  if (defined('DOING_CRON') && DOING_CRON) {
152
  $calls = get_option('newsletter_diagnostic_cron_calls', array());
153
+ if (empty($calls)) {
154
+ add_option('newsletter_diagnostic_cron_calls', $calls, null, 'no');
155
+ }
156
  $calls[] = time();
157
  if (count($calls) > self::MAX_CRON_SAMPLES) {
158
  array_shift($calls);
159
  }
160
+ update_option('newsletter_diagnostic_cron_calls', $calls);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  return;
162
  }
163
 
185
  add_action('wp_ajax_tnpc_render', 'tnpc_render_callback');
186
  add_action('wp_ajax_tnpc_preview', 'tnpc_preview_callback');
187
  add_action('wp_ajax_tnpc_css', 'tnpc_css_callback');
 
 
188
  }
189
  }
190
 
348
 
349
  $this->add_menu_page('index', 'Dashboard');
350
  $this->add_menu_page('main', 'Settings and More');
 
351
  $this->add_admin_page('smtp', 'SMTP');
 
352
  $this->add_admin_page('info', 'Company info');
353
  $this->add_admin_page('diagnostic', 'Diagnostic');
354
  $this->add_admin_page('startup', 'Quick Startup');
355
  }
356
 
 
 
 
 
357
  /**
358
  * Returns a set of warnings about this installtion the suser should be aware of. Return an empty string
359
  * if there are no warnings.
365
  $warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
366
  } else if (time() - $x > 900) {
367
  $warnings .= 'The cron system seems not running correctly. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
 
 
 
 
 
368
  }
369
 
370
  if (!empty($warnings)) {
377
  function hook_init() {
378
  global $cache_stop, $hyper_cache_stop, $wpdb;
379
 
 
 
 
 
 
380
  if (is_admin()) {
381
  if ($this->is_admin_page()) {
382
  wp_enqueue_script('jquery-ui-tabs');
383
+ wp_enqueue_script('media-upload');
384
+ wp_enqueue_script('thickbox');
385
+ wp_enqueue_style('thickbox');
386
  wp_enqueue_media();
387
 
388
  $dismissed = get_option('newsletter_dismissed', array());
418
  $this->message = $options_followup['unsubscribed_text'];
419
  return;
420
  }
 
 
 
 
 
421
  }
422
 
423
  function is_admin_page() {
445
  echo $this->options['css'];
446
  echo "</style>";
447
  }
448
+
449
+ // TODO: move on subscription module
450
+ $profile_options = get_option('newsletter_profile');
451
+ if (!empty($profile_options['style'])) {
452
+ echo '<link href="' . NewsletterSubscription::instance()->get_style_url($profile_options['style']) . '" type="text/css" rel="stylesheet">';
453
+ }
454
+ if (!empty($profile_options['widget_style'])) {
455
+ echo '<link href="' . NewsletterSubscription::instance()->get_style_url($profile_options['widget_style']) . '" type="text/css" rel="stylesheet">';
456
+ }
457
  }
458
 
459
+ function relink($text, $email_id, $user_id) {
460
+ return NewsletterStatistics::instance()->relink($text, $email_id, $user_id);
461
  }
462
 
463
  /**
469
  $this->logger->debug('hook_newsletter> Start');
470
 
471
  // Do not accept job activation before at least 4 minutes are elapsed from the last run.
472
+ if (!$this->check_transient('engine', NEWSLETTER_CRON_INTERVAL))
473
  return;
 
474
 
475
  // Retrieve all email in "sending" status
476
  $emails = $wpdb->get_results("select * from " . NEWSLETTER_EMAILS_TABLE . " where status='sending' and send_on<" . time() . " order by id asc");
477
  $this->logger->debug('hook_newsletter> Emails found in sending status: ' . count($emails));
478
+ foreach ($emails as &$email) {
479
  $this->logger->debug('hook_newsletter> Sending email ' . $email->id);
480
+ if (!$this->send($email))
481
  break;
 
482
  }
483
  // Remove the semaphore so the delivery engine can be activated again
484
  $this->delete_transient('engine');
487
  }
488
 
489
  /**
490
+ * Sends an email to targeted users ot to users passed on. If a list of users is given (usually a list of test users)
491
  * the query inside the email to retrieve users is not used.
492
  *
493
  * @global wpdb $wpdb
499
  function send($email, $users = null) {
500
  global $wpdb;
501
 
502
+ if (is_array($email))
503
  $email = (object) $email;
 
504
 
505
+ // This stops the update of last_id and sent fields since it's not a scheduled delivery but a test.
506
  $test = $users != null;
507
 
508
  if ($users == null) {
525
  }
526
  }
527
 
528
+ foreach ($users as &$user) {
 
 
 
 
529
 
530
  // Before try to send, check the limits.
531
+ if (!$test && $this->limits_exceeded())
532
+ return false;
 
 
533
 
534
  $headers = array('List-Unsubscribe' => '<' . home_url('/') . '?na=u&nk=' . $user->id . '-' . $user->token . '>');
535
  $headers['Precedence'] = 'bulk';
545
 
546
 
547
  if ($email->track == 1) {
548
+ $m = $this->relink($m, $email->id, $user->id);
549
  }
550
 
551
  $s = $this->replace($email->subject, $user);
569
  $wpdb->query($wpdb->prepare("insert into " . $wpdb->prefix . 'newsletter_sent (user_id, email_id, time, status, error) values (%d, %d, %d, %d, %s) on duplicate key update time=%d, status=%d, error=%s', $user->id, $email->id, time(), $status, $this->mail_last_error, time(), $status, $this->mail_last_error));
570
 
571
  $this->email_limit--;
 
572
  }
 
 
 
 
 
 
 
 
573
 
574
+ return true;
 
 
575
  }
576
 
577
  /**
608
  @set_time_limit((int) $this->options['php_time_limit']);
609
  } else if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
610
  @set_time_limit(NEWSLETTER_MAX_EXECUTION_TIME);
 
 
611
  }
612
 
613
  $max_time = (int) (@ini_get('max_execution_time') * 0.95);
663
 
664
  function mail($to, $subject, $message, $headers = null) {
665
  $this->mail_last_error = '';
666
+ $this->logger->debug('mail> To: ' . $to);
667
+ $this->logger->debug('mail> Subject: ' . $subject);
668
  if (empty($subject)) {
669
+ $this->logger->debug('mail> Subject empty, skipped');
670
  return true;
671
  }
672
 
690
  }
691
 
692
  if ($this->mail_method != null) {
693
+ $this->logger->debug('mail> alternative mail method found');
694
  return call_user_func($this->mail_method, $to, $subject, $message, $headers);
695
  }
696
 
795
  require_once ABSPATH . WPINC . '/class-smtp.php';
796
 
797
  $smtp_options = $this->get_smtp_options();
798
+ // $smtp_options['enabled'] = $this->options['smtp_enabled'];
799
+ // $smtp_options['host'] = $this->options['smtp_host'];
800
+ // $smtp_options['port'] = $this->options['smtp_port'];
801
+ // $smtp_options['user'] = $this->options['smtp_user'];
802
+ // $smtp_options['pass'] = $this->options['smtp_pass'];
803
+ // $smtp_options['secure'] = $this->options['smtp_secure'];
804
+ //$smtp_options = apply_filters('newsletter_smtp', $smtp_options);
805
 
806
 
807
  if ($smtp_options['enabled'] == 1) {
930
 
931
  $user = $this->get_user_by_wp_user_id($wp_user_id);
932
  return $user;
933
+
934
+
935
+ /*
936
+ if ($this->options_main['wp_integration'] != 1) {
937
+ return null;
938
+ }
939
+
940
+ get_currentuserinfo();
941
+
942
+ // Retrieve the related newsletter user
943
+ $user = $wpdb->get_row("select * from " . NEWSLETTER_USERS_TABLE . " where wp_user_id=" . $current_user->ID . " limit 1");
944
+ // There is an email matching?
945
+ if (empty($user)) {
946
+ $user = $wpdb->get_row($wpdb->prepare("select * from " . NEWSLETTER_USERS_TABLE . " where email=%s limit 1", strtolower($current_user->user_email)));
947
+ // If not found, create a new Newsletter user, else update the wp_user_id since this email must be linked
948
+ // to the WP user email.
949
+ if (empty($user)) {
950
+ return null;
951
+ //echo 'WP user not found';
952
+ $user = array();
953
+ $user['status'] = 'C';
954
+ $user['wp_user_id'] = $current_user->ID;
955
+ $user['token'] = $this->get_token();
956
+ $user['email'] = strtolower($current_user->user_email);
957
+
958
+ $id = $wpdb->insert(NEWSLETTER_USERS_TABLE, $user);
959
+ $user = NewsletterUsers::instance()->get_user($id);
960
+ } else {
961
+ //echo 'WP user found via email';
962
+ $wpdb->query($wpdb->prepare("update " . NEWSLETTER_USERS_TABLE . " set wp_user_id=" . $current_user->ID . ", email=%s", $current_user->user_email));
963
+ }
964
+ } else {
965
+ //echo 'WP user found via id';
966
+ }
967
+
968
+ return $user;
969
+ */
970
  }
971
 
972
  function replace_date($text) {
1056
  $text = str_replace('%7Bkey%7D', $user->id . '-' . $user->token, $text);
1057
 
1058
  if (strpos($text, '{profile_form}') !== false) {
1059
+ $text = str_replace('{profile_form}', NewsletterSubscription::instance()->get_profile_form($user), $text);
1060
  }
1061
 
1062
  for ($i = 1; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1076
  $nk = $user->id . '-' . $user->token;
1077
 
1078
  $options_subscription = NewsletterSubscription::instance()->options;
1079
+
1080
  if ($email) {
1081
  $text = str_replace('{email_id}', $email->id, $text);
1082
  $text = str_replace('{email_subject}', $email->subject, $text);
1210
  }
1211
 
1212
  function save_email($email, $return_format = OBJECT) {
 
 
 
 
 
1213
  return $this->store->save(NEWSLETTER_EMAILS_TABLE, $email, $return_format);
1214
  }
1215
 
1353
  return $value;
1354
  }
1355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1356
  /**
1357
  * Load plugin textdomain.
1358
  *
1392
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-feed')) {
1393
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/feed/feed.php')) {
1394
  require_once WP_CONTENT_DIR . '/extensions/newsletter/feed/feed.php';
1395
+ } else {
1396
+ if (get_option('newsletter_feed_demo_disable') != 1) {
1397
+ if (is_file(NEWSLETTER_DIR . '/feed/feed.php')) {
1398
+ require_once NEWSLETTER_DIR . '/feed/feed.php';
1399
+ }
1400
+ }
1401
  }
1402
  }
1403
 
1404
+ //if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/updates/updates.php')) {
1405
+ // require_once WP_CONTENT_DIR . '/extensions/newsletter/updates/updates.php';
1406
+ //}
1407
+
1408
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-followup')) {
1409
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php')) {
1410
  require_once WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php';
1448
  }
1449
 
1450
 
1451
+ require_once(dirname(__FILE__) . '/widget.php');
 
1452
 
1453
  register_activation_hook(__FILE__, 'newsletter_activate');
1454
 
1471
 
1472
  function tnpc_render_callback() {
1473
  $block_options = get_option('newsletter_main');
1474
+ include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.block';
1475
  wp_die(); // this is required to terminate immediately and return a proper response
1476
  }
1477
 
1494
  include NEWSLETTER_DIR . '/emails/tnp-composer/css/newsletter.css';
1495
  wp_die(); // this is required to terminate immediately and return a proper response
1496
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
- Tested up to: 4.7.1
5
- Stable tag: 4.7.8
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -77,128 +77,7 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
80
- = 4.7.8 =
81
-
82
- * Old TGMPA library compatibility
83
-
84
- = 4.7.7 =
85
-
86
- * New extensions panel
87
- * Minor fixes and enhancements
88
- * New media selection on newsletter edit panel
89
- * Removed enqueuing of no more used scripts
90
- * Fixed the subscriber count on targeting panel
91
-
92
- = 4.7.6 =
93
-
94
- * New status panel
95
-
96
- = 4.7.5 =
97
-
98
- * Removed references to old css
99
- * Fixed the relative URLs problem in the composer
100
-
101
- = 4.7.4 =
102
-
103
- * Improved widget CSS
104
- * Added Instagram to social icons
105
- * Little style improvements
106
-
107
- = 4.7.3 =
108
-
109
- * Added custom CSS field to customize the forms appearance
110
- * Added codemirror for CSS edit
111
- * Added plugin version to style link
112
- * Added plugin version to script link
113
- * Corrected a tag in newsletter widget minimal
114
- * Added line height on form fields
115
- * Changed CSS class prefixes to tnp
116
- * Fixed a divide by zero on diagnostic panel
117
- * Improved the collection of emails sending speed data
118
- * Fixed a bug when adding a new subscriber from the admin panel
119
-
120
- = 4.7.2 =
121
-
122
- * Fixed a debug notice
123
-
124
- = 4.7.1 =
125
-
126
- * Fixed missing files in the package
127
-
128
- = 4.7.0 =
129
-
130
- * Added the selection for the Newsletter messages dedicated page
131
- * New forms CSS and validator
132
- * New widget for a minimal form
133
- * Use shortcode attribute "layout" to revert to old style table forms, using layout=table
134
- * Added reset button for diagnostic scheduler statistics
135
-
136
- = 4.6.8 =
137
-
138
- * Fixed the image browser/upload URL error in themes
139
-
140
- = 4.6.7 =
141
-
142
- * Fixed blank page without a newsletter dedicated page
143
-
144
- = 4.6.6 =
145
-
146
- * Fixed the blocks reload
147
-
148
- = 4.6.5 =
149
-
150
- * Fixed the style stripped when switching back and forth betwenn the visual and raw editor (from version 4.6.4)
151
-
152
- = 4.6.4 =
153
-
154
- * Fixed the profile link in admin panels
155
- * Fixed the composer editor
156
- * Cleanup of old code
157
- * Force the composer editor to keep the absolute urls
158
-
159
- = 4.6.3 =
160
-
161
- * Fixed the profile save with new action url
162
-
163
- = 4.6.2 =
164
-
165
- * Fixed the import option "override status" not working in update mode
166
- * Fixed the missing http when the couldflare plugin is installed (!)
167
- * Improved controls and security on open tracking link
168
- * Added few new diagnostic parameters
169
-
170
- = 4.6.1 =
171
-
172
- * Fixed a security issue on admin side only exploitable by logged in admins
173
-
174
- = 4.6.0 =
175
-
176
- * Fixed debug notices on composer post blocks
177
- * Improved image styles on composer hero block
178
- * Added support for WP_Error in the logger
179
- * Improved the license checking
180
-
181
- = 4.5.9 =
182
-
183
- * Fixed a PHP syntax error on composer panel
184
-
185
- = 4.5.8 =
186
-
187
- * Edit image alt text in the composer
188
- * Fixed german characters problem on visual composer
189
- * Added new data to diagnostic panel
190
- * Change the export to be more compatible with specific blog installations
191
- * Added translations to export panel
192
-
193
- = 4.5.7 =
194
-
195
- * Fixed the total sent email in dashboard
196
- * Fixed the total sent number on newsletter list when an already sent newsletter is edited
197
- * Removed the save button on sent newsletter
198
- * Code cleanup
199
- * Service message for stats panel of draft newsletters
200
-
201
- = 4.5.6 =
202
 
203
  * New unified themes and composer selection screen
204
  * Fixed the WP integration panel (incompatibility with WP 4.5.3)
@@ -427,7 +306,7 @@ Thank you, The Newsletter Team
427
  * Added import subscribers from CSV file
428
  * Updated the WP compatibility version number
429
  * Fixed the save button on sent emails
430
- * Fixed the List-�Unsubscribe header with new URL schema
431
 
432
  = 3.7.8 =
433
 
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
+ Tested up to: 4.5.3
5
+ Stable tag: 4.5.5
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
77
 
78
  == Changelog ==
79
 
80
+ = 4.5.5 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  * New unified themes and composer selection screen
83
  * Fixed the WP integration panel (incompatibility with WP 4.5.3)
306
  * Added import subscribers from CSV file
307
  * Updated the WP compatibility version number
308
  * Fixed the save button on sent emails
309
+ * Fixed the List-§Unsubscribe header with new URL schema
310
 
311
  = 3.7.8 =
312
 
statistics/index.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
  /* @var $wpdb wpdb */
3
- if (!defined('ABSPATH')) exit;
4
-
5
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $module = NewsletterStatistics::instance();
7
  $controls = new NewsletterControls();
@@ -50,24 +48,25 @@ $open_count_total = 0;
50
  $click_count_total = 0;
51
  foreach ($emails as $email) {
52
  $entry = array();
53
- $total_sent += $email->sent;
54
- if (empty($email->sent)) {
55
  // $entry[0] = date('Y-m-d', $email->send_on);
56
  // $entry[1] = 0;
57
- // $entry[2] = $email->subject;// . ' (' . percent($open_count, $email->sent) . ')';
58
  // $entry[3] = 0;
59
  continue;
60
  }
61
  //$entry[0] = $email->subject . ' [' . date('Y-m-d', $email->send_on) . ', ' . $email->type . ']';
 
62
  $entry[0] = date('Y-m-d', $email->send_on);
63
  $open_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email->id);
64
  $open_count_total += $open_count;
65
- $entry[1] = $open_count / $email->sent * 100;
66
  $entry[1] = round($entry[1], 2);
67
- $entry[2] = $email->subject; // . ' (' . percent($open_count, $email->sent) . ')';
68
  $click_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email->id);
69
  $click_count_total += $click_count;
70
- $entry[3] = $click_count / $email->sent * 100;
71
  $entry[3] = round($entry[3], 2);
72
 
73
  $overview_labels[] = strftime('%a, %e %b', $email->send_on);
1
  <?php
2
  /* @var $wpdb wpdb */
 
 
3
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
4
  $module = NewsletterStatistics::instance();
5
  $controls = new NewsletterControls();
48
  $click_count_total = 0;
49
  foreach ($emails as $email) {
50
  $entry = array();
51
+ $total_sent += $email->total;
52
+ if (empty($email->total)) {
53
  // $entry[0] = date('Y-m-d', $email->send_on);
54
  // $entry[1] = 0;
55
+ // $entry[2] = $email->subject;// . ' (' . percent($open_count, $email->total) . ')';
56
  // $entry[3] = 0;
57
  continue;
58
  }
59
  //$entry[0] = $email->subject . ' [' . date('Y-m-d', $email->send_on) . ', ' . $email->type . ']';
60
+ $total_sent += $email->total;
61
  $entry[0] = date('Y-m-d', $email->send_on);
62
  $open_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email->id);
63
  $open_count_total += $open_count;
64
+ $entry[1] = $open_count / $email->total * 100;
65
  $entry[1] = round($entry[1], 2);
66
+ $entry[2] = $email->subject; // . ' (' . percent($open_count, $email->total) . ')';
67
  $click_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email->id);
68
  $click_count_total += $click_count;
69
+ $entry[3] = $click_count / $email->total * 100;
70
  $entry[3] = round($entry[3], 2);
71
 
72
  $overview_labels[] = strftime('%a, %e %b', $email->send_on);
statistics/link.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $wpdb;
3
+
4
+ if (!defined('ABSPATH')) {
5
+ include '../../../../wp-load.php';
6
+ }
7
+ list($email_id, $user_id, $url, $anchor, $key) = explode(';', base64_decode($_GET['r']), 5);
8
+
9
+ if (!is_user_logged_in()) {
10
+ if (empty($email_id) || empty($user_id) || empty($url)) {
11
+ header("HTTP/1.0 404 Not Found");
12
+ die();
13
+ }
14
+ }
15
+
16
+ $parts = parse_url($url);
17
+ //die($url);
18
+ $verified = $parts['host'] == $_SERVER['HTTP_HOST'];
19
+ if (!$verified) {
20
+ $options = NewsletterStatistics::instance()->options;
21
+ $verified = $key == md5($email_id . ';' . $user_id . ';' . $url . ';' . $anchor . $options['key']);
22
+ }
23
+
24
+ // For feed by mail tests
25
+ if ($verified && empty($email_id) && is_user_logged_in()) {
26
+ header('Location: ' . $url);
27
+ die();
28
+ }
29
+
30
+ $ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
31
+
32
+ if ($verified) {
33
+ $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
34
+ 'email_id' => $email_id,
35
+ 'user_id' => $user_id,
36
+ 'url' => $url,
37
+ //'anchor' => $anchor,
38
+ 'ip' => $ip
39
+ )
40
+ );
41
+
42
+ $wpdb->query($wpdb->prepare("update " . NEWSLETTER_SENT_TABLE . " set open=2, ip=%s where email_id=%d and user_id=%d limit 1", $ip, $email_id, $user_id));
43
+
44
+ $user = Newsletter::instance()->get_user($user_id);
45
+ if ($user) {
46
+ setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
47
+ }
48
+ header('Location: ' . $url);
49
+ die();
50
+ } else {
51
+ header("HTTP/1.0 404 Not Found");
52
+ //header('Location: ' . home_url());
53
+ //die();
54
+ }
55
+ ?><html>
56
+ <head>
57
+ <style>
58
+ body {
59
+ font-family: sans-serif;
60
+ }
61
+ </style>
62
+ </head>
63
+ <body>
64
+ <div style="max-width: 100%; width: 500px; margin: 40px auto; text-align: center">
65
+ <p>The requested URL (<?php echo esc_html($url) ?>) has not been verified.</p>
66
+ <p>You can follow it if you recognize it as a valid URL.</p>
67
+ </div>
68
+ </body>
69
+ </html>
statistics/newsletters.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $module = NewsletterStatistics::instance();
6
  $controls = new NewsletterControls();
@@ -70,9 +68,9 @@ function percentValue($value, $total) {
70
  <?php if ($email->type != 'message' && $email->type != 'feed') continue; ?>
71
  <tr>
72
  <td><?php echo $email->id; ?></td>
73
- <td><?php echo esc_html($email->subject); ?></td>
74
- <td><?php echo esc_html($module->get_email_type_label($email)) ?></td>
75
- <td><?php echo esc_html($module->get_email_status_label($email)) ?></td>
76
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
77
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
78
  <td><?php echo $email->track == 1 ? 'Yes' : 'No'; ?></td>
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $module = NewsletterStatistics::instance();
4
  $controls = new NewsletterControls();
68
  <?php if ($email->type != 'message' && $email->type != 'feed') continue; ?>
69
  <tr>
70
  <td><?php echo $email->id; ?></td>
71
+ <td><?php echo htmlspecialchars($email->subject); ?></td>
72
+ <td><?php echo $module->get_email_type_label($email) ?></td>
73
+ <td><?php echo $module->get_email_status_label($email)?></td>
74
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
75
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
76
  <td><?php echo $email->track == 1 ? 'Yes' : 'No'; ?></td>
statistics/open.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $wpdb;
3
+
4
+ if (!defined('ABSPATH')) {
5
+ require_once '../../../../wp-load.php';
6
+ }
7
+ list($email_id, $user_id) = explode(';', base64_decode($_GET['r']), 2);
8
+ $ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
9
+ $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
10
+ 'email_id' => $email_id,
11
+ 'user_id' => $user_id,
12
+ 'ip' => $ip
13
+ )
14
+ );
15
+
16
+ $wpdb->query($wpdb->prepare("update " . NEWSLETTER_SENT_TABLE . " set open=1, ip=%s where email_id=%d and user_id=%d and open=0 limit 1", $ip, $email_id, $user_id));
17
+
18
+ header('Content-Type: image/gif');
19
+ echo base64_decode('_R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
20
+ die();
21
+
statistics/settings.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $module = NewsletterStatistics::instance();
6
  $controls = new NewsletterControls();
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $module = NewsletterStatistics::instance();
4
  $controls = new NewsletterControls();
statistics/statistics.php CHANGED
@@ -1,8 +1,5 @@
1
  <?php
2
 
3
- if (!defined('ABSPATH'))
4
- exit;
5
-
6
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
7
 
8
  class NewsletterStatistics extends NewsletterModule {
@@ -20,128 +17,38 @@ class NewsletterStatistics extends NewsletterModule {
20
  }
21
 
22
  function __construct() {
 
 
23
  parent::__construct('statistics', '1.1.6');
 
24
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
25
  }
26
 
27
- /**
28
- *
29
- * @global wpdb $wpdb
30
- */
31
  function hook_wp_loaded() {
32
  global $wpdb;
33
 
34
  // Newsletter Link Tracking
35
  if (isset($_GET['nltr'])) {
36
-
37
- list($email_id, $user_id, $url, $anchor, $signature) = explode(';', base64_decode($_GET['nltr']), 5);
38
-
39
- $url = esc_url_raw($url);
40
- $user_id = (int) $user_id;
41
- $email_id = (int) $email_id;
42
-
43
- if (empty($user_id) || empty($url)) {
44
- header("HTTP/1.0 404 Not Found");
45
- die('Invalid data');
46
- }
47
-
48
- $parts = parse_url($url);
49
-
50
- $verified = $parts['host'] == $_SERVER['HTTP_HOST'];
51
- if (!$verified) {
52
- $verified = $signature == md5($email_id . ';' . $user_id . ';' . $url . ';' . $anchor . $this->options['key']);
53
- }
54
-
55
- if (!$verified) {
56
- header("HTTP/1.0 404 Not Found");
57
- die('Url not verified');
58
- }
59
-
60
- $user = Newsletter::instance()->get_user($user_id);
61
- if (!$user) {
62
- header("HTTP/1.0 404 Not Found");
63
- die('Invalid subscriber');
64
- }
65
-
66
- // Test emails
67
- if (empty($email_id)) {
68
- header('Location: ' . $url);
69
- die();
70
- }
71
-
72
- $email = $this->get_email($email_id);
73
- if (!$email) {
74
- header("HTTP/1.0 404 Not Found");
75
- die('Invalid newsletter');
76
- }
77
-
78
- setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
79
-
80
- $ip = preg_replace('/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR']);
81
-
82
- $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
83
- 'email_id' => $email_id,
84
- 'user_id' => $user_id,
85
- 'url' => $url,
86
- 'ip' => $ip
87
- )
88
- );
89
-
90
- $wpdb->query($wpdb->prepare("update " . NEWSLETTER_SENT_TABLE . " set open=2, ip=%s where email_id=%d and user_id=%d limit 1", $ip, $email_id, $user_id));
91
-
92
- header('Location: ' . $url);
93
  die();
94
  }
95
 
96
  // Newsletter Open Traking Image
97
  if (isset($_GET['noti'])) {
98
- $this->logger->debug('Open tracking: ' . $_GET['noti']);
99
-
100
- list($email_id, $user_id, $signature) = explode(';', base64_decode($_GET['noti']), 3);
101
-
102
- $email = $this->get_email($email_id);
103
- if (!$email) {
104
- $this->logger->error('Open tracking request for unexistant email');
105
- die();
106
- }
107
-
108
- $user = $this->get_user($user_id);
109
- if (!$user) {
110
- $this->logger->error('Open tracking request for unexistant subscriber');
111
- die();
112
- }
113
-
114
- if ($email->token) {
115
- $this->logger->debug('Signature: ' . $signature);
116
- $s = md5($email_id . $user_id . $email->token);
117
- if ($s != $signature) {
118
- $this->logger->error('Open tracking request with wrong signature. Email token: ' . $email->token);
119
- die();
120
- }
121
- } else {
122
- $this->logger->info('Email with no token hence not signature to check');
123
- }
124
-
125
- $row = $wpdb->get_row($wpdb->prepare("select * from " . NEWSLETTER_STATS_TABLE . " where email_id=%d and user_id=%d and url='' limit 1", $email->id, $user->id));
126
- if ($row) {
127
- $this->logger->info('Open already registered');
128
- // MAybe an update for some fields?
129
- } else {
130
-
131
- $res = $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
132
- 'email_id' => (int) $email_id,
133
- 'user_id' => (int) $user_id,
134
- 'ip' => $_SERVER['REMOTE_ADDR'])
135
- );
136
- if (!$res) {
137
- $this->logger->fatal($wpdb->last_error);
138
- }
139
- }
140
 
141
  header('Content-Type: image/gif');
142
  echo base64_decode('_R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
143
  die();
144
  }
 
145
  }
146
 
147
  function upgrade() {
@@ -181,6 +88,7 @@ class NewsletterStatistics extends NewsletterModule {
181
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_emails` ADD COLUMN `open_count` int UNSIGNED NOT NULL DEFAULT 0");
182
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_emails` ADD COLUMN `click_count` int UNSIGNED NOT NULL DEFAULT 0");
183
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_emails change column read_count open_count int not null default 0");
 
184
  }
185
 
186
  function admin_menu() {
@@ -193,16 +101,12 @@ class NewsletterStatistics extends NewsletterModule {
193
  $this->add_admin_page('view_users', 'Statistics');
194
  }
195
 
196
- function relink($text, $email_id, $user_id, $email_token = '') {
197
  $this->relink_email_id = $email_id;
198
  $this->relink_user_id = $user_id;
199
- $this->relink_email_token = $email_token;
200
-
201
- $this->logger->debug('Relink with token: ' . $email_token);
202
  $text = preg_replace_callback('/(<[aA][^>]+href=["\'])([^>"\']+)(["\'][^>]*>)(.*?)(<\/[Aa]>)/', array($this, 'relink_callback'), $text);
203
 
204
- $signature = md5($email_id . $user_id . $email_token);
205
- $text = str_replace('</body>', '<img width="1" height="1" alt="" src="' . home_url('/') . '?noti=' . urlencode(base64_encode($email_id . ';' . $user_id . ';' . $signature)) . '"/></body>', $text);
206
  return $text;
207
  }
208
 
1
  <?php
2
 
 
 
 
3
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
4
 
5
  class NewsletterStatistics extends NewsletterModule {
17
  }
18
 
19
  function __construct() {
20
+ global $wpdb;
21
+
22
  parent::__construct('statistics', '1.1.6');
23
+
24
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
25
  }
26
 
 
 
 
 
27
  function hook_wp_loaded() {
28
  global $wpdb;
29
 
30
  // Newsletter Link Tracking
31
  if (isset($_GET['nltr'])) {
32
+ $_GET['r'] = $_GET['nltr'];
33
+ include dirname(__FILE__) . '/link.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  die();
35
  }
36
 
37
  // Newsletter Open Traking Image
38
  if (isset($_GET['noti'])) {
39
+ list($email_id, $user_id) = explode(';', base64_decode($_GET['noti']), 2);
40
+
41
+ $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
42
+ 'email_id' => (int)$email_id,
43
+ 'user_id' => (int)$user_id,
44
+ 'ip' => $_SERVER['REMOTE_ADDR'])
45
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  header('Content-Type: image/gif');
48
  echo base64_decode('_R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
49
  die();
50
  }
51
+
52
  }
53
 
54
  function upgrade() {
88
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_emails` ADD COLUMN `open_count` int UNSIGNED NOT NULL DEFAULT 0");
89
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_emails` ADD COLUMN `click_count` int UNSIGNED NOT NULL DEFAULT 0");
90
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_emails change column read_count open_count int not null default 0");
91
+
92
  }
93
 
94
  function admin_menu() {
101
  $this->add_admin_page('view_users', 'Statistics');
102
  }
103
 
104
+ function relink($text, $email_id, $user_id) {
105
  $this->relink_email_id = $email_id;
106
  $this->relink_user_id = $user_id;
 
 
 
107
  $text = preg_replace_callback('/(<[aA][^>]+href=["\'])([^>"\']+)(["\'][^>]*>)(.*?)(<\/[Aa]>)/', array($this, 'relink_callback'), $text);
108
 
109
+ $text = str_replace('</body>', '<img width="1" height="1" alt="" src="' . home_url('/') . '?noti=' . urlencode(base64_encode($email_id . ';' . $user_id)) . '"/></body>', $text);
 
110
  return $text;
111
  }
112
 
statistics/view-retarget.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  $email_id = (int) $_GET['id'];
5
  $module = NewsletterStatistics::instance();
6
 
1
  <?php
 
 
2
  $email_id = (int) $_GET['id'];
3
  $module = NewsletterStatistics::instance();
4
 
statistics/view-urls.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  $email_id = (int) $_GET['id'];
5
  $module = NewsletterStatistics::instance();
6
 
1
  <?php
 
 
2
  $email_id = (int) $_GET['id'];
3
  $module = NewsletterStatistics::instance();
4
 
statistics/view-users.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  $email_id = (int) $_GET['id'];
5
  $module = NewsletterStatistics::instance();
6
 
1
  <?php
 
 
2
  $email_id = (int) $_GET['id'];
3
  $module = NewsletterStatistics::instance();
4
 
statistics/view.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
 
6
  $module = NewsletterStatistics::instance();
@@ -34,21 +32,19 @@ if (true || $count == 0) {
34
  $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter_sent s1 join " . $wpdb->prefix . "newsletter_stats s2 on s1.user_id=s2.user_id and s1.email_id=s2.email_id and s2.url<>'' and s1.email_id=%d set s1.open=2, s1.ip=s2.ip", $email->id));
35
  }
36
 
37
- $total_count = $total_sent = $email->sent;
38
  $open_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
39
  $click_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email_id);
40
 
41
  function percent($value, $total) {
42
- if ($total == 0) {
43
  return '-';
44
- }
45
  return sprintf("%.2f", $value / $total * 100) . '%';
46
  }
47
 
48
  function percentValue($value, $total) {
49
- if ($total == 0) {
50
  return 0;
51
- }
52
  return round($value / $total * 100);
53
  }
54
  ?>
@@ -69,12 +65,6 @@ function percentValue($value, $total) {
69
 
70
 
71
  <div id="tnp-body" style="min-width: 500px">
72
-
73
- <?php if ($email->status == 'new') { ?>
74
-
75
- <div class="tnp-warning"><?php _e('No data, newsletter not sent yet.', 'newsletter')?></div>
76
-
77
- <?php } else { ?>
78
 
79
  <form action="" method="post">
80
  <?php $controls->init(); ?>
@@ -153,7 +143,7 @@ function percentValue($value, $total) {
153
  <div class="tnp-data-value"><?php echo $email->sent; ?> of <?php echo $email->total; ?></div>
154
  <?php else: ?>
155
  <div class="tnp-data-title">Total Sent</div>
156
- <div class="tnp-data-value"><?php echo $email->sent; ?></div>
157
  <?php endif; ?>
158
  </div>
159
  <div class="tnp-data">
@@ -194,8 +184,6 @@ function percentValue($value, $total) {
194
 
195
 
196
  </form>
197
-
198
- <?php } // if "new" ?>
199
 
200
  </div>
201
  <?php include NEWSLETTER_DIR . '/tnp-footer.php' ?>
1
  <?php
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
 
4
  $module = NewsletterStatistics::instance();
32
  $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter_sent s1 join " . $wpdb->prefix . "newsletter_stats s2 on s1.user_id=s2.user_id and s1.email_id=s2.email_id and s2.url<>'' and s1.email_id=%d set s1.open=2, s1.ip=s2.ip", $email->id));
33
  }
34
 
35
+ $total_count = $total_sent = $email->total;
36
  $open_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
37
  $click_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email_id);
38
 
39
  function percent($value, $total) {
40
+ if ($total == 0)
41
  return '-';
 
42
  return sprintf("%.2f", $value / $total * 100) . '%';
43
  }
44
 
45
  function percentValue($value, $total) {
46
+ if ($total == 0)
47
  return 0;
 
48
  return round($value / $total * 100);
49
  }
50
  ?>
65
 
66
 
67
  <div id="tnp-body" style="min-width: 500px">
 
 
 
 
 
 
68
 
69
  <form action="" method="post">
70
  <?php $controls->init(); ?>
143
  <div class="tnp-data-value"><?php echo $email->sent; ?> of <?php echo $email->total; ?></div>
144
  <?php else: ?>
145
  <div class="tnp-data-title">Total Sent</div>
146
+ <div class="tnp-data-value"><?php echo $email->total; ?></div>
147
  <?php endif; ?>
148
  </div>
149
  <div class="tnp-data">
184
 
185
 
186
  </form>
 
 
187
 
188
  </div>
189
  <?php include NEWSLETTER_DIR . '/tnp-footer.php' ?>
subscription/forms.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
subscription/languages/en_US.php CHANGED
@@ -38,8 +38,8 @@ $options['subscription_text'] =
38
  // Message show after a subbscription request has made.
39
  $options['confirmation_text'] =
40
  "<p>You have successfully subscribed to the newsletter. You'll
41
- receive a confirmation email in a few minutes. Please follow the
42
- link to confirm your subscription. If the email takes
43
  more than 15 minutes to appear in your mailbox, please check
44
  your spam folder.</p>";
45
 
38
  // Message show after a subbscription request has made.
39
  $options['confirmation_text'] =
40
  "<p>You have successfully subscribed to the newsletter. You'll
41
+ receive a confirmation email in few minutes. Please follow the
42
+ link in it to confirm your subscription. If the email takes
43
  more than 15 minutes to appear in your mailbox, please check
44
  your spam folder.</p>";
45
 
subscription/lists.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
subscription/options.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
@@ -53,10 +51,6 @@ if ($controls->is_action()) {
53
 
54
  $controls->data['confirmed_url'] = trim($controls->data['confirmed_url']);
55
  $controls->data['confirmation_url'] = trim($controls->data['confirmation_url']);
56
-
57
- if (!empty($controls->data['page'])) {
58
- $controls->data['url'] = ''; // do not unset
59
- }
60
 
61
  $module->merge_options($controls->data);
62
  $controls->add_message_saved();
@@ -76,7 +70,7 @@ if ($controls->is_action()) {
76
  $page_id = wp_insert_post($page);
77
 
78
  $controls->data['url'] = get_permalink($page_id);
79
- $module->merge_options($controls->data);
80
  }
81
 
82
  if ($controls->is_action('reset')) {
@@ -127,44 +121,8 @@ if ($controls->is_action()) {
127
  } else {
128
  $controls->data = get_option('newsletter', array());
129
  }
130
-
131
- if (empty($controls->data['page'])) {
132
- $controls->messages .= '<p>You should set a dedicated page for Newsletter which used to interact with your subscribers.</p>';
133
- } else {
134
- $post = get_post($controls->data['page']);
135
-
136
- if (!$post || $post->post_status != 'publish') {
137
- $controls->errors .= '<p>The dedicated page selected below does not exist anymore or has been unpublished. Please, select a different one.</p>';
138
- } else {
139
- if (strpos($post->post_content, '[newsletter]') === false) {
140
- $controls->errors .= '<p>The dedicated page selected DOES NOT contain the [newsletter] shortcode. Please fix it. It should contain ONLY the [newsletter] shortcode.</p>';
141
- }
142
- }
143
- }
144
-
145
  ?>
146
 
147
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.css" type="text/css">
148
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/show-hint.css">
149
- <style>
150
- .CodeMirror {
151
- border: 1px solid #ddd;
152
- }
153
- </style>
154
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.js"></script>
155
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.js"></script>
156
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/show-hint.js"></script>
157
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/css-hint.js"></script>
158
- <script>
159
- jQuery(function () {
160
- var editor = CodeMirror.fromTextArea(document.getElementById("options-css"), {
161
- lineNumbers: true,
162
- mode: 'css',
163
- extraKeys: {"Ctrl-Space": "autocomplete"}
164
- });
165
- });
166
- </script>
167
-
168
  <div class="wrap" id="tnp-wrap">
169
 
170
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
@@ -213,20 +171,25 @@ if (empty($controls->data['page'])) {
213
  <tr valign="top">
214
  <th>Newsletter dedicated page</th>
215
  <td>
216
- <?php $controls->page('page', 'The Newsletter standard unstyled page'); ?>
217
  <?php
218
- if (empty($controls->data['url']) && empty($controls->data['page'])) {
219
  $controls->button('create', 'Create a page for me');
220
  }
221
  ?>
222
- <?php if (!empty($controls->data['url'])) { ?>
223
  <p class="description">
224
- <strong>
225
- You're currently using the URL <code><?php echo esc_html($controls->data['url'])?></code>
226
- as dedicated page. Please select the corrisponding page above (new as version 4.6.5+).
227
- </strong>
 
 
 
 
 
 
228
  </p>
229
- <?php } ?>
230
  </td>
231
  </tr>
232
  <tr valign="top">
@@ -239,15 +202,6 @@ if (empty($controls->data['page'])) {
239
  </p>
240
  </td>
241
  </tr>
242
- <tr valign="top">
243
- <th><?php _e('Custom styles', 'newsletter')?></th>
244
- <td>
245
- <?php if (apply_filters('newsletter_enqueue_style', true) === false) { ?>
246
- <p><strong>Warning: Newsletter styles and custom styles are disable by your theme or a plugin.</strong></p>
247
- <?php } ?>
248
- <?php $controls->textarea('css'); ?>
249
- </td>
250
- </tr>
251
  </table>
252
  </div>
253
 
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
51
 
52
  $controls->data['confirmed_url'] = trim($controls->data['confirmed_url']);
53
  $controls->data['confirmation_url'] = trim($controls->data['confirmation_url']);
 
 
 
 
54
 
55
  $module->merge_options($controls->data);
56
  $controls->add_message_saved();
70
  $page_id = wp_insert_post($page);
71
 
72
  $controls->data['url'] = get_permalink($page_id);
73
+ $module->save_options($controls->data);
74
  }
75
 
76
  if ($controls->is_action('reset')) {
121
  } else {
122
  $controls->data = get_option('newsletter', array());
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  ?>
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  <div class="wrap" id="tnp-wrap">
127
 
128
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
171
  <tr valign="top">
172
  <th>Newsletter dedicated page</th>
173
  <td>
174
+ <?php $controls->text('url', 70); ?>
175
  <?php
176
+ if (empty($controls->data['url'])) {
177
  $controls->button('create', 'Create a page for me');
178
  }
179
  ?>
180
+
181
  <p class="description">
182
+ Optional (but recommended) an address of a WordPress page (eg. <?php echo get_option('home') . '/newsletter'; ?>)
183
+ you <strong>manually created</strong> for subscription and messages.
184
+ <br>
185
+ The page must have in its body <strong>only</strong> the short code <strong>[newsletter]</strong> (as is).
186
+
187
+ <?php if (!empty($controls->data['url'])) { ?>
188
+ <br>
189
+ If something is not working as expected with this address you can empty the field above and save: a button will appear
190
+ to create that page automatically.
191
+ <?php } ?>
192
  </p>
 
193
  </td>
194
  </tr>
195
  <tr valign="top">
202
  </p>
203
  </td>
204
  </tr>
 
 
 
 
 
 
 
 
 
205
  </table>
206
  </div>
207
 
subscription/page.php CHANGED
@@ -12,7 +12,7 @@
12
  //
13
  // and modify that copy.
14
 
15
- if (!defined('ABSPATH')) exit;
16
 
17
  $module = NewsletterSubscription::instance();
18
  $user = $module->get_user_from_request();
12
  //
13
  // and modify that copy.
14
 
15
+ include '../../../../wp-load.php';
16
 
17
  $module = NewsletterSubscription::instance();
18
  $user = $module->get_user_from_request();
subscription/profile.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
@@ -54,6 +52,7 @@ $rules = array(0 => 'Optional', 1 => 'Required');
54
  <li><a href="#tabs-2">Main profile fields</a></li>
55
  <li><a href="#tabs-3">Extra profile fields</a></li>
56
  <li><a href="#tabs-5">Form code</a></li>
 
57
  </ul>
58
 
59
  <div id="tabs-2">
@@ -107,7 +106,6 @@ $rules = array(0 => 'Optional', 1 => 'Required');
107
  male: <?php $controls->text('sex_male'); ?>
108
  not specified: <?php $controls->text('sex_none'); ?>
109
  </td></tr>
110
- <tr><th>Rules</th><td><?php $controls->select('sex_rules', $rules); ?></td></tr>
111
 
112
  <tr><th>Salutation titles</th><td>
113
 
@@ -210,6 +208,24 @@ $rules = array(0 => 'Optional', 1 => 'Required');
210
 
211
  </div>
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  </div>
214
 
215
  <p>
@@ -222,4 +238,4 @@ $rules = array(0 => 'Optional', 1 => 'Required');
222
 
223
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
224
 
225
- </div>
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
52
  <li><a href="#tabs-2">Main profile fields</a></li>
53
  <li><a href="#tabs-3">Extra profile fields</a></li>
54
  <li><a href="#tabs-5">Form code</a></li>
55
+ <li><a href="#tabs-6">Form style</a></li>
56
  </ul>
57
 
58
  <div id="tabs-2">
106
  male: <?php $controls->text('sex_male'); ?>
107
  not specified: <?php $controls->text('sex_none'); ?>
108
  </td></tr>
 
109
 
110
  <tr><th>Salutation titles</th><td>
111
 
208
 
209
  </div>
210
 
211
+ <div id="tabs-6">
212
+
213
+ <table class="form-table">
214
+ <tr>
215
+ <th>Subscription form style</th>
216
+ <td>
217
+ <?php $controls->select('style', $module->get_styles()); ?>
218
+ </td>
219
+ </tr>
220
+ <tr>
221
+ <th>Widget style</th>
222
+ <td>
223
+ <?php $controls->select('widget_style', $module->get_styles()); ?>
224
+ </td>
225
+ </tr>
226
+ </table>
227
+ </div>
228
+
229
  </div>
230
 
231
  <p>
238
 
239
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
240
 
241
+ </div>
subscription/style.css DELETED
@@ -1,261 +0,0 @@
1
- /*
2
-
3
- THIS FILE IS OVERWRITTEN EVERY TIME YOU UPDATE THE PLUGIN.
4
- USE THE CUSOTM CSS OPTION IN THE SUBSCRIPTION SETTING PANEL FOR YOUR
5
- CUSTOM CSS RULES.
6
-
7
- */
8
-
9
- .tnp-subscription {
10
- font-size: 13px;
11
- display: block;
12
- margin: 15px auto;
13
- max-width: 500px;
14
- width: 100%;
15
- }
16
-
17
- /* Generic field wrapper */
18
- .tnp-subscription div.tnp-field {
19
- margin-bottom: 10px;
20
- border: 0;
21
- padding: 0;
22
- }
23
-
24
- .tnp-subscription label {
25
- display: block;
26
- color: inherit;
27
- font-size: 14px;
28
- font-weight: 700;
29
- line-height: normal;
30
- padding: 5px;
31
- margin: 0;
32
- }
33
-
34
- .tnp-subscription input[type=text], .tnp-subscription input[type=email], .tnp-subscription input[type=submit], .tnp-subscription select {
35
- width: 100%;
36
- padding: 10px;
37
- display: block;
38
- border: 1px;
39
- border-color: #ddd;
40
- background-color: #f4f4f4;
41
- color: #444;
42
- font-size: 14px;
43
- margin: 0;
44
- line-height: normal;
45
- box-sizing: border-box;
46
- }
47
-
48
- .tnp-subscription input[type=checkbox], .tnp-widget input[type=radio] {
49
- width: auto;
50
- display: inline;
51
- }
52
-
53
- /* Antireset - http://www.satollo.net/css-and-select-space-between-the-options-and-the-arrow */
54
- .tnp-subscription select option {
55
- margin-right: 10px;
56
- }
57
-
58
- .tnp-subscription input.tnp-submit {
59
- background-color: #444;
60
- color: #fff;
61
- width: auto;
62
- }
63
-
64
- @media all and (max-width: 480px) {
65
- .tnp-subscription input[type=submit] {
66
- width: 100%;
67
- }
68
- }
69
-
70
-
71
- /* Profile form */
72
-
73
- .tnp-profile {
74
- font-size: 13px;
75
- }
76
-
77
- .tnp-profile form .tnp-field {
78
- margin-bottom: 10px;
79
- border: 0;
80
- padding: 0;
81
- }
82
-
83
- tnp-profile form .tnp-field label {
84
- display: block;
85
- color: #333;
86
- font-size: 14px;
87
- }
88
-
89
- .tnp-profile form .tnp-field input[type=text],
90
- .tnp-profile form .tnp-field input[type=email],
91
- .tnp-profile form .tnp-field input[type=submit],
92
- .tnp-profile form .tnp-field select {
93
- padding: 10px;
94
- display: block;
95
- border: 1px;
96
- border-color: #ddd;
97
- background-color: #f4f4f4;
98
- color: #444;
99
- font-size: 14px;
100
- margin: 0;
101
- line-height: normal;
102
- box-sizing: border-box;
103
- border-radius: 0;
104
- }
105
-
106
- .tnp-profile form input[type=checkbox], .tnp-profile input[type=radio] {
107
- width: auto;
108
- display: inline;
109
- }
110
-
111
- .tnp-profile form .tnp-list-label {
112
- margin-left: 15px;
113
- }
114
-
115
- /* Antireset - http://www.satollo.net/css-and-select-space-between-the-options-and-the-arrow */
116
- .tnp-profile form select option {
117
- margin-right: 10px;
118
- }
119
-
120
- .tnp-profile form .tnp-field input[type=submit] {
121
- background-color: #444;
122
- color: #fff;
123
- }
124
-
125
-
126
-
127
- .tnp-widget {
128
- width: 100%;
129
- display: block;
130
- box-sizing: border-box;
131
- }
132
-
133
- .tnp-widget .tnp-field {
134
- margin-bottom: 10px;
135
- border: 0;
136
- padding: 0;
137
- }
138
-
139
- .tnp-widget label {
140
- display: block;
141
- color: inherit;
142
- font-size: 14px;
143
- }
144
-
145
- .tnp-widget input[type=text], .tnp-widget input[type=email], .tnp-widget input[type=submit], .tnp-widget select {
146
- width: 100%;
147
- padding: 10px;
148
- display: block;
149
- border: 1px solid #ddd ;
150
- border-color: #ddd;
151
- background-color: #f4f4f4;
152
- color: #444;
153
- font-size: 14px;
154
- line-height: normal;
155
- box-sizing: border-box;
156
- }
157
-
158
- .tnp-widget input[type=checkbox], .tnp-widget input[type=radio] {
159
- width: auto;
160
- display: inline;
161
- }
162
-
163
- /* Antireset - http://www.satollo.net/css-and-select-space-between-the-options-and-the-arrow */
164
- .tnp-widget select option {
165
- margin-right: 10px;
166
- }
167
-
168
- .tnp-widget input.tnp-submit {
169
- background-color: #444;
170
- color: #fff;
171
- }
172
-
173
- .tnp-field input[type="submit"] {
174
- position: inherit;
175
- }
176
-
177
- .tnp-field label {
178
-
179
- }
180
-
181
- /* Newsletter Widget Minimal */
182
-
183
- .tnp-widget-minimal {
184
- width: 100%;
185
- }
186
-
187
- .tnp-widget-minimal form {
188
- margin: 0;
189
- padding: 0;
190
- border: 0;
191
- }
192
-
193
- .tnp-widget-minimal input.tnp-email {
194
- width: 100%;
195
- box-sizing: border-box;
196
- padding: 10px;
197
- display: inline-block;
198
- border: 1px;
199
- border-color: #ddd;
200
- background-color: #f4f4f4;
201
- color: #444;
202
- font-size: 14px;
203
- box-sizing: border-box;
204
- }
205
-
206
- .tnp-widget-minimal input.tnp-submit {
207
- width: 100%;
208
- box-sizing: border-box;
209
- padding: 10px;
210
- display: inline-block;
211
- border: 1px;
212
- border-color: #ddd;
213
- background-color: #444;
214
- color: #fff;
215
- font-size: 14px;
216
- line-height: normal;
217
- border-radius: 0px;
218
- box-sizing: border-box;
219
- }
220
-
221
-
222
- .tnp-subscription-minimal {
223
- width: 100%;
224
- box-sizing: border-box;
225
- }
226
-
227
- .tnp-subscription-minimal form {
228
- margin: 0;
229
- padding: 0;
230
- border: 0;
231
- }
232
-
233
- .tnp-subscription-minimal input.tnp-email {
234
- width: 70%;
235
- max-width: 300px;
236
- box-sizing: border-box;
237
- padding: 10px;
238
- display: inline-block;
239
- border: 1px;
240
- border-color: #ddd;
241
- background-color: #f4f4f4;
242
- color: #444;
243
- font-size: 14px;
244
- box-sizing: border-box;
245
- border-radius: 0px;
246
- }
247
-
248
- .tnp-subscription-minimal input.tnp-submit {
249
- width: 29%;
250
- box-sizing: border-box;
251
- display: inline-block;
252
- border: 1px;
253
- border-color: #ddd;
254
- background-color: #444;
255
- color: #fff;
256
- font-size: 14px;
257
- box-sizing: border-box;
258
- border-radius: 0px;
259
- }
260
-
261
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
subscription/styles/gray.css ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter {
2
+ text-align: center;
3
+ }
4
+
5
+ .newsletter table {
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ text-align: left;
9
+ border: 1px solid #eee;
10
+ background-color: #f9f9f9;
11
+ box-shadow: 0px 0px 10px #999;
12
+ padding: 10px;
13
+ width: auto;
14
+ }
15
+
16
+ .newsletter th, .newsletter td {
17
+ padding: 10px;
18
+ border: 0;
19
+ }
20
+
21
+ .newsletter th {
22
+ text-align: right;
23
+ }
24
+
25
+ .newsletter-td-submit {
26
+ text-align: center;
27
+ }
28
+
29
+ .newsletter-submit {
30
+ font-size: 18px;
31
+ background-color: #eee;
32
+ padding: 10px;
33
+ border: 1px solid #ddd;
34
+ }
subscription/styles/neutral.css ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter, .newsletter td {
2
+ text-align: left;
3
+ font-family: sans-serif;
4
+ font-size: 14px;
5
+ line-height: normal;
6
+ }
7
+
8
+ .newsletter p {
9
+ margin: 0 0 10px 0;
10
+ padding: 0;
11
+ }
12
+
13
+ .newsletter input, .newsletter select {
14
+ border: 1px solid #ccc;
15
+ border-radius: 5px;
16
+ padding: 5px 8px 5px 8px;
17
+ color: #666;
18
+ background-color: #fff!important;
19
+ box-shadow: none;
20
+ line-height: normal;
21
+ font-size: 14px;
22
+ font-family: sans-serif;
23
+ }
24
+
25
+ .newsletter option {
26
+ padding-left: 0;
27
+ margin-left: 0;
28
+ }
29
+ .newsletter .newsletter-email {
30
+
31
+ }
32
+
33
+ .newsletter .newsletter-firstname {
34
+
35
+ }
36
+
37
+ .newsletter .newsletter-lastname {
38
+
39
+ }
40
+
41
+ .newsletter .newsletter-sex {
42
+
43
+ }
44
+
45
+ .newsletter .newsletter-profile {
46
+
47
+ }
48
+
49
+ .newsletter .newsletter-submit {
50
+ border: 1px solid #ccc;
51
+ border-radius: 3px;
52
+ background-image: url(widget-neutral/button.png);
53
+ color: #fff;
54
+ }
55
+
56
+ .newsletter td {
57
+ border: 0;
58
+ }
59
+
60
+ .newsletter table {
61
+ border: 0;
62
+ }
subscription/styles/shortcode/default.css ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter-form {
2
+ width: 100%;
3
+ display: block;
4
+ margin: 15px 0;
5
+ border: 0;
6
+ }
7
+
8
+ .newsletter-field {
9
+ clear: both;
10
+ text-align: left;
11
+ }
12
+
13
+ .newsletter-field label {
14
+ display: block;
15
+ font-size: 14px;
16
+ line-height: normal;
17
+ }
18
+
19
+ .newsletter-field input, .newsletter-field select {
20
+ padding: 5px;
21
+ font-size: 14px;
22
+ margin-right: 0;
23
+ line-height: normal;
24
+ border: 1px solid rgba(0,0,0,.1);
25
+ border-radius: 2px;
26
+ }
27
+
28
+ .newsletter-field-checkbox label, .newsletter-field-preference label, .newsletter-field-list label {
29
+ text-align: left;
30
+ display: inline;
31
+ padding-left: 1em;
32
+ }
33
+
34
+ @media all and (max-width: 480px) {
35
+ }
36
+
subscription/styles/white.css ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter {
2
+ text-align: center;
3
+ }
4
+
5
+ .newsletter table {
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ text-align: left;
9
+ border: 1px solid #eee;
10
+ background-color: #fff;
11
+ box-shadow: 0px 0px 10px #999;
12
+ padding: 10px;
13
+ width: auto;
14
+ }
15
+
16
+ .newsletter th, .newsletter td {
17
+ padding: 10px;
18
+ border: 0;
19
+ }
20
+
21
+ .newsletter th {
22
+ text-align: right;
23
+ }
24
+
25
+ .newsletter-td-submit {
26
+ text-align: center;
27
+ }
28
+
29
+ .newsletter-submit {
30
+ font-size: 18px;
31
+ background-color: #eee;
32
+ padding: 10px;
33
+ border: 1px solid #ddd;
34
+ }
subscription/styles/widget-neutral.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter-widget {
2
+ text-align: left;
3
+ font-family: sans-serif;
4
+ font-size: 14px;
5
+ line-height: normal;
6
+ }
7
+
8
+ .newsletter-widget p {
9
+ margin: 0 0 10px 0!important;
10
+ padding: 0;
11
+ }
12
+
13
+ .newsletter-widget input, .newsletter-widget select {
14
+ border: 1px solid #ccc;
15
+ border-radius: 5px;
16
+ padding: 5px 8px 5px 8px;
17
+ color: #666;
18
+ background-color: #fff!important;
19
+ box-shadow: none;
20
+ line-height: normal;
21
+ font-size: 14px;
22
+ font-family: sans-serif;
23
+ }
24
+
25
+ .newsletter-widget option {
26
+ padding-left: 0;
27
+ margin-left: 0;
28
+ }
29
+ .newsletter-widget .newsletter-email {
30
+
31
+ }
32
+
33
+ .newsletter-widget .newsletter-firstname {
34
+
35
+ }
36
+
37
+ .newsletter-widget .newsletter-lastname {
38
+
39
+ }
40
+
41
+ .newsletter-widget .newsletter-sex {
42
+
43
+ }
44
+
45
+ .newsletter-widget .newsletter-profile {
46
+
47
+ }
48
+
49
+ .newsletter-widget .newsletter-submit {
50
+ border: 1px solid #ccc;
51
+ border-radius: 3px;
52
+ background-image: url(widget-neutral/button.png);
53
+ color: #fff;
54
+ }
subscription/styles/widget-neutral/button.png ADDED
Binary file
subscription/subscription.php CHANGED
@@ -1,14 +1,12 @@
1
  <?php
2
 
3
- if (!defined('ABSPATH'))
4
- exit;
5
-
6
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
7
 
8
  class NewsletterSubscription extends NewsletterModule {
9
 
10
  const MESSAGE_CONFIRMED = 'confirmed';
11
 
 
12
  static $instance;
13
 
14
  /**
@@ -23,7 +21,11 @@ class NewsletterSubscription extends NewsletterModule {
23
 
24
  function __construct() {
25
 
26
- parent::__construct('subscription', '2.0.3');
 
 
 
 
27
 
28
  // Must be called after the Newsletter::hook_init, since some constants are defined
29
  // there.
@@ -32,113 +34,62 @@ class NewsletterSubscription extends NewsletterModule {
32
 
33
  function hook_init() {
34
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
35
- if (is_admin()) {
36
- // Something
37
- } else {
38
- add_action('wp_enqueue_scripts', array($this, 'hook_wp_enqueue_scripts'));
39
- add_action('wp_head', array($this, 'hook_wp_head'), 100);
40
- add_action('wp_footer', array($this, 'hook_wp_footer'));
41
- add_shortcode('newsletter', array($this, 'shortcode_newsletter'));
42
- add_shortcode('newsletter_form', array($this, 'shortcode_newsletter_form'));
43
- add_shortcode('newsletter_profile', array($this, 'shortcode_newsletter_profile'));
44
- add_shortcode('newsletter_field', array($this, 'shortcode_newsletter_field'));
45
- }
46
- }
47
 
48
- function hook_wp_enqueue_scripts() {
49
- if (apply_filters('newsletter_enqueue_style', true)) {
50
- wp_enqueue_style('newsletter-subscription', plugins_url('newsletter') . '/subscription/style.css', array(), NEWSLETTER_VERSION);
51
- if (!empty($this->options['css'])) {
52
- wp_add_inline_style('newsletter-subscription', $this->options['css']);
53
- }
54
- }
55
-
56
- wp_enqueue_script('newsletter-subscription', plugins_url('newsletter') . '/subscription/validate.js', array(), NEWSLETTER_VERSION, true);
57
- $options = $this->get_options('profile');
58
- $data = array();
59
- $data['messages'] = array();
60
- if (isset($options['email_error'])) {
61
- $data['messages']['email_error'] = $options['email_error'];
62
- }
63
- if (isset($options['name_error'])) {
64
- $data['messages']['name_error'] = $options['name_error'];
65
- }
66
- if (isset($options['surname_error'])) {
67
- $data['messages']['surname_error'] = $options['surname_error'];
68
- }
69
- if (isset($options['profile_error'])) {
70
- $data['messages']['profile_error'] = $options['profile_error'];
71
- }
72
- if (isset($options['privacy_error'])) {
73
- $data['messages']['privacy_error'] = $options['privacy_error'];
74
- }
75
- $data['profile_max'] = NEWSLETTER_PROFILE_MAX;
76
- wp_localize_script('newsletter-subscription', 'newsletter', $data);
77
  }
78
 
 
 
 
 
 
 
 
 
79
  function hook_wp_loaded() {
80
  global $newsletter, $wpdb;
81
 
82
  switch ($newsletter->action) {
83
- case 'm':
84
- include dirname(__FILE__) . '/page.php';
85
- die();
86
-
87
- // normal subscription
88
  case 's':
89
- case 'subscribe':
90
- if (isset($this->options['antibot_disable']) || $this->antibot_form_check()) {
91
 
92
- $user = $this->subscribe();
 
 
93
 
94
  if ($user->status == 'E')
95
- $this->show_message('error', $user->id);
96
  if ($user->status == 'C')
97
- $this->show_message('confirmed', $user->id);
98
  if ($user->status == 'A')
99
- $this->show_message('already_confirmed', $user->id);
100
  if ($user->status == 'S')
101
- $this->show_message('confirmation', $user->id);
102
  } else {
103
 
104
- $this->request_to_antibot_form('Subscribe');
105
  }
106
  die();
107
-
108
- // AJAX subscription
109
- case 'ajaxsub':
110
- $user = $this->subscribe();
111
- if ($user->status == 'E')
112
- $key = 'error';
113
- if ($user->status == 'C')
114
- $key = 'confirmed';
115
- if ($user->status == 'A')
116
- $key = 'already_confirmed';
117
- if ($user->status == 'S')
118
- $key = 'confirmation';
119
- $module = NewsletterSubscription::instance();
120
- $message = $newsletter->replace($module->options[$key . '_text'], $user);
121
- $message .= $module->options[$key . '_tracking'];
122
- echo $message;
123
- die();
124
-
125
  case 'u':
126
- $user = $this->get_user_from_request();
127
  $email = $this->get_email_from_request();
128
  if ($user == null) {
129
- $this->show_message('unsubscription_error', null);
130
  } else {
131
- $this->show_message('unsubscription', $user, null, $email);
132
  }
133
  die();
134
  break;
135
  case 'uc':
136
  if ($this->antibot_form_check()) {
137
- $user = $this->unsubscribe();
138
  if ($user->status == 'E') {
139
- $this->show_message('unsubscription_error', $user);
140
  } else {
141
- $this->show_message('unsubscribed', $user);
142
  }
143
  return;
144
  } else {
@@ -148,50 +99,34 @@ class NewsletterSubscription extends NewsletterModule {
148
  break;
149
  case 'p':
150
  case 'pe':
151
- $user = $this->check_user();
152
  if ($user == null) {
153
  die('No subscriber found.');
154
  }
155
 
156
- $this->show_message('profile', $user);
157
  die();
158
  break;
159
-
160
- case 'ps':
161
- $user = $this->save_profile();
162
- // $user->alert is a temporary field
163
- $this->show_message('profile', $user, $user->alert);
164
- die();
165
- break;
166
-
167
  case 'c':
168
- case 'confirm':
169
  if ($this->antibot_form_check()) {
170
- $user = $this->confirm();
171
  if ($user->status == 'E') {
172
- $this->show_message('error', $user->id);
173
  } else {
174
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
175
- $this->show_message('confirmed', $user);
176
  }
177
  } else {
178
  $this->request_to_antibot_form('Confirm');
179
  }
180
  die();
181
  break;
182
-
183
  default:
184
  return;
185
  }
186
  }
187
 
188
- function hook_wp_head() {
189
- }
190
-
191
- function hook_wp_footer() {
192
- // Consider this: http://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript
193
- }
194
-
195
  function upgrade() {
196
  global $wpdb, $charset_collate, $newsletter;
197
 
@@ -200,6 +135,8 @@ class NewsletterSubscription extends NewsletterModule {
200
  $this->init_options('profile');
201
  $this->init_options('lists');
202
 
 
 
203
  $default_options = $this->get_default_options();
204
 
205
  if (empty($this->options['error_text'])) {
@@ -226,40 +163,133 @@ class NewsletterSubscription extends NewsletterModule {
226
  update_option('newsletter_profile', $options_profile);
227
  }
228
 
229
- if ($this->old_version < '2.0.0') {
230
- if (!isset($this->options['url']) && !empty($newsletter->options['url'])) {
231
- $this->options['url'] = $newsletter->options['url'];
232
- $this->save_options($this->options);
233
- }
234
 
235
- $options_template = $this->get_options('template');
236
- if (empty($options_template) && isset($this->options['template'])) {
237
- $options_template['enabled'] = isset($this->options['template_enabled']) ? 1 : 0;
238
- $options_template['template'] = $this->options['template'];
239
- add_option('newsletter_subscription_template', $options_template, null, 'no');
240
- }
 
 
 
 
 
 
 
241
 
242
- if (isset($this->options['template'])) {
243
- unset($this->options['template']);
244
- unset($this->options['template_enabled']);
245
- $this->save_options($this->options);
246
- }
247
  }
248
-
249
  $this->init_options('template', false);
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  return true;
252
  }
253
 
254
  function admin_menu() {
255
  $this->add_menu_page('options', 'List building');
256
  $this->add_admin_page('profile', 'Subscription Form');
 
 
257
  $this->add_admin_page('forms', 'Forms');
258
  $this->add_admin_page('lists', 'Lists');
259
  $this->add_admin_page('template', 'Template');
260
  $this->add_admin_page('unsubscription', 'Unsubscription');
261
  }
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  /**
264
  * This method has been redefined for compatibility with the old options naming. It would
265
  * be better to change them instead. The subscription options should be named
@@ -294,6 +324,27 @@ class NewsletterSubscription extends NewsletterModule {
294
  return parent::get_options($sub);
295
  }
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  /**
298
  * Return the subscribed user.
299
  *
@@ -401,7 +452,6 @@ class NewsletterSubscription extends NewsletterModule {
401
 
402
  // Notification to admin (only for new confirmed subscriptions)
403
  if ($user->status == 'C') {
404
- do_action('newsletter_user_confirmed', $user);
405
  $this->notify_admin($user, 'Newsletter subscription');
406
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
407
  }
@@ -466,7 +516,7 @@ class NewsletterSubscription extends NewsletterModule {
466
  }
467
 
468
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
469
- if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {
470
  $this->logger->debug($_REQUEST['nl']);
471
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
472
  // If not zero it is selectable by user (on subscription or on profile)
@@ -556,7 +606,6 @@ class NewsletterSubscription extends NewsletterModule {
556
  }
557
 
558
  if ($user->status == 'C') {
559
- do_action('newsletter_user_confirmed', $user);
560
  return $user;
561
  }
562
 
@@ -568,7 +617,6 @@ class NewsletterSubscription extends NewsletterModule {
568
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
569
  $newsletter->set_user_status($user->id, 'C');
570
  $user->status = 'C';
571
- do_action('newsletter_user_confirmed', $user);
572
  $this->notify_admin($user, 'Newsletter subscription');
573
 
574
  // Check if is connected to a wp user
@@ -753,7 +801,7 @@ class NewsletterSubscription extends NewsletterModule {
753
  }
754
 
755
  if (isset($_REQUEST['ncu'])) {
756
- $this->options['confirmation_url'] = esc_url($_REQUEST['ncu']);
757
  }
758
 
759
  if ($email) {
@@ -767,20 +815,14 @@ class NewsletterSubscription extends NewsletterModule {
767
  die();
768
  }
769
 
770
- if (!empty($this->options['page'])) {
771
- $url = get_permalink($this->options['page']);
772
- }
773
-
774
- // Old URL
775
- if (empty($url) && !empty($this->options['url'])) {
776
- $url = $this->options['url'];
777
- }
778
-
779
- if (empty($url)) {
780
- $url = home_url('/') . '?na=m';
781
  }
782
 
783
- header('Location: ' . self::add_qs($url, 'nm=' . $key . '&nk=' . $user->id . '-' . $user->token, false) . $params);
 
784
  die();
785
  }
786
 
@@ -928,11 +970,11 @@ class NewsletterSubscription extends NewsletterModule {
928
  }
929
 
930
  if (!empty($label)) {
931
- $buffer .= '<div class="tnp-field tnp-field-button">';
932
  if (strpos($label, 'http') === 0) {
933
- $buffer .= '<input class="tnp-button-image" type="image" src="' . $label . '">';
934
  } else {
935
- $buffer .= '<input class="tnp-button" type="submit" value="' . $label . '">';
936
  }
937
  $buffer .= '</div>';
938
  }
@@ -943,72 +985,60 @@ class NewsletterSubscription extends NewsletterModule {
943
  }
944
 
945
  function _shortcode_label($name, $attrs, $suffix = null) {
946
- if (!$suffix) {
947
  $suffix = $name;
948
- }
949
  $options_profile = get_option('newsletter_profile');
950
- $buffer = '<label for="tnp-' . $suffix . '">';
951
- if (isset($attrs['label'])) {
952
- if (empty($attrs['label'])) {
953
- return;
954
- } else {
955
- $buffer .= esc_html($attrs['label']);
956
- }
957
  } else {
958
- $buffer .= esc_html($options_profile[$name]);
959
  }
960
  $buffer .= "</label>\n";
961
  return $buffer;
962
  }
963
 
964
- function shortcode_newsletter_field($attrs, $content) {
965
  $options_profile = get_option('newsletter_profile');
966
  $name = $attrs['name'];
967
 
968
  $buffer = '';
969
 
970
  if ($name == 'email') {
971
- $buffer .= '<div class="tnp-field tnp-field-email">';
972
  $buffer .= $this->_shortcode_label('email', $attrs);
973
 
974
- $buffer .= '<input class="tnp-email" type="email" name="ne" value=""';
975
- if (isset($attrs['placeholder']))
976
- $buffer .= ' placeholder="' . esc_attr($attrs['placeholder']) . '"';
977
- $buffer .= 'required>';
978
  if (isset($attrs['button_label'])) {
979
  $label = $attrs['button_label'];
980
  if (strpos($label, 'http') === 0) {
981
- $buffer .= ' <input class="tnp-submit-image" type="image" src="' . esc_attr(esc_url_raw($label)) . '">';
982
  } else {
983
- $buffer .= ' <input class="tnp-submit" type="submit" value="' . esc_attr($label) . '" style="width: 29%">';
984
  }
985
  }
986
- $buffer .= "</div>\n";
987
  return $buffer;
988
  }
989
 
990
  if ($name == 'first_name' || $name == 'name') {
991
- $buffer .= '<div class="tnp-field tnp-field-firstname">';
992
  $buffer .= $this->_shortcode_label('name', $attrs);
993
 
994
- $buffer .= '<input class="tnp-name" type="text" name="nn" value=""';
995
- if (isset($attrs['placeholder']))
996
- $buffer .= ' placeholder="' . esc_attr($attrs['placeholder']) . '"';
997
  if ($options_profile['name_rules'] == 1) {
998
  $buffer .= ' required';
999
  }
1000
  $buffer .= '>';
1001
- $buffer .= "</div>\n";
1002
  return $buffer;
1003
  }
1004
 
1005
  if ($name == 'last_name' || $name == 'surname') {
1006
- $buffer .= '<div class="tnp-field tnp-field-surname">';
1007
  $buffer .= $this->_shortcode_label('surname', $attrs);
1008
 
1009
- $buffer .= '<input class="tnp-surname" type="text" name="ns" value=""';
1010
- if (isset($attrs['placeholder']))
1011
- $buffer .= ' placeholder="' . esc_attr($attrs['placeholder']) . '"';
1012
  if ($options_profile['surname_rules'] == 1) {
1013
  $buffer .= ' required';
1014
  }
@@ -1020,57 +1050,56 @@ class NewsletterSubscription extends NewsletterModule {
1020
  if ($name == 'preference' || $name == 'list') {
1021
  $list = (int) $attrs['number'];
1022
  if (isset($attrs['hidden'])) {
1023
- return '<input type="hidden" name="nl[]" value="' . esc_attr($list) . '">';
1024
  }
1025
- $buffer .= '<div class="tnp-field tnp-field-checkbox tnp-field-list">';
1026
- $buffer .= '<input type="checkbox" id="nl' . esc_attr($list) . '" name="nl[]" value="' . esc_attr($list) . '"';
1027
  if (isset($attrs['checked'])) {
1028
  $buffer .= ' checked';
1029
  }
1030
  $buffer .= '>';
1031
  if (isset($attrs['label'])) {
1032
  if ($attrs['label'] != '')
1033
- $buffer .= '<label for="nl' . esc_attr($list) . '">' . esc_html($attrs['label']) . '</label>';
1034
  } else {
1035
- $buffer .= '<label for="nl' . esc_attr($list) . '">' . esc_html($options_profile['list_' . $list]) . '</label>';
1036
  }
1037
- $buffer .= "</div>\n";
1038
 
1039
  return $buffer;
1040
  }
1041
 
1042
- // All the lists
1043
  if ($name == 'lists' || $name == 'preferences') {
1044
  $lists = '';
1045
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1046
  if ($options_profile['list_' . $i . '_status'] != 2) {
1047
  continue;
1048
  }
1049
- $lists .= '<div class="tnp-field tnp-field-checkbox tnp-field-list">';
1050
  $lists .= '<input type="checkbox" id="nl' . $i . '" name="nl[]" value="' . $i . '"';
1051
  if ($options_profile['list_' . $i . '_checked'] == 1)
1052
  $lists .= ' checked';
1053
- $lists .= '> <label for="nl' . $i . '>' . esc_html($options_profile['list_' . $i]) . '</label>';
1054
- $lists .= "</div>\n";
1055
  }
1056
  return $lists;
1057
  }
1058
 
1059
  // TODO: add the "not specified"
1060
  if ($name == 'sex' || $name == 'gender') {
1061
- $buffer .= '<div class="tnp-field tnp-field-gender">';
1062
  if (isset($attrs['label'])) {
1063
  if ($attrs['label'] != '')
1064
- $buffer .= '<label for="">' . esc_html($attrs['label']) . '</label>';
1065
  } else {
1066
- $buffer .= '<label for="">' . esc_html($options_profile['sex']) . '</label>';
1067
  }
1068
 
1069
- $buffer .= '<select name="nx" class="tnp-gender">';
1070
- $buffer .= '<option value="m">' . esc_html($options_profile['sex_male']) . '</option>';
1071
- $buffer .= '<option value="f">' . esc_html($options_profile['sex_female']) . '</option>';
1072
  $buffer .= '</select>';
1073
- $buffer .= "</div>\n";
1074
  return $buffer;
1075
  }
1076
 
@@ -1078,13 +1107,13 @@ class NewsletterSubscription extends NewsletterModule {
1078
  $number = (int) $attrs['number'];
1079
  $type = $options_profile['profile_' . $number . '_type'];
1080
  $size = isset($attrs['size']) ? $attrs['size'] : '';
1081
- $buffer .= '<div class="tnp-field tnp-field-profile">';
1082
  if (isset($attrs['label'])) {
1083
  if ($attrs['label'] != '') {
1084
- $buffer .= '<label>' . esc_html($attrs['label']) . '</label>';
1085
  }
1086
  } else {
1087
- $buffer .= '<label>' . esc_html($options_profile['profile_' . $number]) . '</label>';
1088
  }
1089
  $placeholder = isset($attrs['placeholder']) ? $attrs['placeholder'] : $options_profile['profile_' . $number . '_placeholder'];
1090
 
@@ -1092,7 +1121,7 @@ class NewsletterSubscription extends NewsletterModule {
1092
 
1093
  // Text field
1094
  if ($type == 'text') {
1095
- $buffer .= '<input class="tnp-profile tnp-profile-' . $number . '" type="text" size="' . esc_attr($size) . '" name="np' . $number . '" placeholder="' . esc_attr($placeholder) . '"';
1096
  if ($required) {
1097
  $buffer .= ' required';
1098
  }
@@ -1101,7 +1130,7 @@ class NewsletterSubscription extends NewsletterModule {
1101
 
1102
  // Select field
1103
  if ($type == 'select') {
1104
- $buffer .= '<select class="tnp-profile tnp-profile-' . $number . '" name="np' . $number . '"';
1105
  if ($required) {
1106
  $buffer .= ' required';
1107
  }
@@ -1111,12 +1140,12 @@ class NewsletterSubscription extends NewsletterModule {
1111
  }
1112
  $opts = explode(',', $options_profile['profile_' . $number . '_options']);
1113
  for ($j = 0; $j < count($opts); $j++) {
1114
- $buffer .= '<option>' . esc_html(trim($opts[$j])) . '</option>';
1115
  }
1116
- $buffer .= "</select>\n";
1117
  }
1118
 
1119
- $buffer .= "</div>\n";
1120
 
1121
  return $buffer;
1122
  }
@@ -1131,10 +1160,10 @@ class NewsletterSubscription extends NewsletterModule {
1131
  $attrs['label'] = $options_profile['list_' . $i];
1132
  }
1133
 
1134
- $buffer .= '<div class="tnp-field tnp-field-checkbox tnp-field-privacy">';
1135
 
1136
- $buffer .= '<input type="checkbox" name="ny" required class="tnp-privacy" id="tnp-privacy"> ';
1137
- $buffer .= '<label for="tnp-privacy">';
1138
  if (!empty($attrs['url'])) {
1139
  $buffer .= '<a target="_blank" href="' . esc_attr($options_profile['privacy_url']) . '">';
1140
  }
@@ -1171,7 +1200,7 @@ class NewsletterSubscription extends NewsletterModule {
1171
 
1172
  $buffer = $this->get_form_javascript();
1173
 
1174
- $buffer .= '<div class="tnp tnp-subscription">' . "\n";
1175
  $buffer .= '<form method="post" action="' . $action . '" onsubmit="return newsletter_check(this)">' . "\n\n";
1176
 
1177
  if (isset($attrs['confirmation_url'])) {
@@ -1191,21 +1220,21 @@ class NewsletterSubscription extends NewsletterModule {
1191
  $buffer .= '<table cellspacing="0" cellpadding="3" border="0">' . "\n\n";
1192
  if ($options_profile['name_status'] == 2) {
1193
  $buffer .= "<!-- first name -->\n";
1194
- $buffer .= "<tr>\n\t" . '<th>' . $options_profile['name'] . '</th>' . "\n\t" . '<td><input class="tnp-firstname" type="text" name="nn" size="30"' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></td>' . "\n" . '</tr>' . "\n\n";
1195
  }
1196
 
1197
  if ($options_profile['surname_status'] == 2) {
1198
  $buffer .= "<!-- last name -->\n";
1199
- $buffer .= "<tr>\n\t" . '<th>' . $options_profile['surname'] . '</th>' . "\n\t" . '<td><input class="tnp-lastname" type="text" name="ns" size="30"' . ($options_profile['surname_rules'] == 1 ? 'required' : '') . '></td>' . "\n" . '</tr>' . "\n\n";
1200
  }
1201
 
1202
  $buffer .= "<!-- email -->\n";
1203
- $buffer .= "<tr>\n\t" . '<th>' . $options_profile['email'] . '</th>' . "\n\t" . '<td align="left"><input class="tnp-email" type="email" name="ne" size="30" required></td>' . "\n" . '</tr>' . "\n\n";
1204
 
1205
  if ($options_profile['sex_status'] == 2) {
1206
  $buffer .= "<!-- sex -->\n";
1207
  $buffer .= "<tr>\n\t<th>" . $options_profile['sex'] . "</th>\n";
1208
- $buffer .= "\t<td>\n\t" . '<select name="nx" class="tnp-gender">' . "\n";
1209
  $buffer .= "\t\t" . '<option value="m">' . $options_profile['sex_male'] . '</option>' . "\n";
1210
  $buffer .= "\t\t" . '<option value="f">' . $options_profile['sex_female'] . '</option>' . "\n";
1211
  $buffer .= "\t</select>\n\t</td></tr>\n";
@@ -1246,7 +1275,7 @@ class NewsletterSubscription extends NewsletterModule {
1246
  // Text field
1247
  if ($options_profile['profile_' . $i . '_type'] == 'text') {
1248
  $buffer .= "<tr>\n\t<th>" . $options_profile['profile_' . $i] . "</th>\n\t<td>\n\t\t";
1249
- $buffer .= '<input class="tnp-profile tnp-profile-' . $i . '" type="text" size="30" name="np' . $i . '"';
1250
  $buffer .= ' placeholder="' . esc_attr($options_profile['profile_' . $i . '_placeholder']) . '"';
1251
  if (!empty($options_profile['profile_' . $i . '_rules'])) {
1252
  $buffer .= ' required';
@@ -1256,7 +1285,7 @@ class NewsletterSubscription extends NewsletterModule {
1256
 
1257
  // Select field
1258
  if ($options_profile['profile_' . $i . '_type'] == 'select') {
1259
- $buffer .= "<tr>\n\t<th>" . $options_profile['profile_' . $i] . "</th>\n\t<td>\n\t\t" . '<select class="tnp-profile tnp-profile-' . $i . '" name="np' . $i . '"';
1260
  if (!empty($options_profile['profile_' . $i . '_rules'])) {
1261
  $buffer .= ' required';
1262
  }
@@ -1279,7 +1308,7 @@ class NewsletterSubscription extends NewsletterModule {
1279
  }
1280
 
1281
  if ($options_profile['privacy_status'] == 1) {
1282
- $buffer .= "<tr>\n\t" . '<td colspan="2" class="tnp-td-privacy">' . "\n";
1283
  $buffer .= "\t\t" . '<input type="checkbox" name="ny" required>&nbsp;';
1284
  if (!empty($options_profile['privacy_url'])) {
1285
  $buffer .= '<a target="_blank" href="' . $options_profile['privacy_url'] . '">';
@@ -1290,26 +1319,18 @@ class NewsletterSubscription extends NewsletterModule {
1290
  $buffer .= "\n\t</td>\n</tr>\n\n";
1291
  }
1292
 
1293
- $buffer .= "<tr>\n\t" . '<td colspan="2" class="tnp-td-submit">' . "\n";
1294
 
1295
  if (strpos($options_profile['subscribe'], 'http://') !== false) {
1296
- $buffer .= "\t\t" . '<input class="tnp-submit-image" type="image" src="' . $options_profile['subscribe'] . '"/>' . "\n\t</td>\n</tr>\n\n";
1297
  } else {
1298
- $buffer .= "\t\t" . '<input class="tnp-submit" type="submit" value="' . $options_profile['subscribe'] . '"/>' . "\n\t</td>\n</tr>\n\n";
1299
  }
1300
 
1301
  $buffer .= "</table>\n</form>\n</div>";
1302
  return $buffer;
1303
  }
1304
 
1305
- /**
1306
- * The new standard form.
1307
- *
1308
- * @param type $referrer
1309
- * @param type $action
1310
- * @param type $attrs
1311
- * @return string
1312
- */
1313
  function get_subscription_form_html5($referrer = null, $action = null, $attrs = array()) {
1314
  if (isset($attrs['action'])) {
1315
  $action = $attrs['action'];
@@ -1320,23 +1341,18 @@ class NewsletterSubscription extends NewsletterModule {
1320
  $options_profile = get_option('newsletter_profile');
1321
  $options = get_option('newsletter');
1322
 
1323
- $buffer = '';
1324
 
1325
  if (empty($action)) {
1326
- $action = home_url('/') . '?na=s';
1327
  }
1328
 
1329
- if ($referrer != 'widget') {
1330
- if (isset($attrs['class'])) {
1331
- $buffer .= '<div class="tnp tnp-subscription ' . $attrs['class'] . '">' . "\n";
1332
- } else {
1333
- $buffer .= '<div class="tnp tnp-subscription">' . "\n";
1334
- }
1335
- }
1336
- $buffer .= '<form method="post" action="' . esc_attr($action) . '" onsubmit="return newsletter_check(this)">' . "\n\n";
1337
 
1338
  if (!empty($referrer)) {
1339
- $buffer .= '<input type="hidden" name="nr" value="' . esc_attr($referrer) . '">' . "\n";
1340
  }
1341
  if (isset($attrs['confirmation_url'])) {
1342
  $buffer .= "<input type='hidden' name='ncu' value='" . esc_attr($attrs['confirmation_url']) . "'>\n";
@@ -1345,36 +1361,31 @@ class NewsletterSubscription extends NewsletterModule {
1345
  if (isset($attrs['list'])) {
1346
  $arr = explode(',', $attrs['list']);
1347
  foreach ($arr as $a) {
1348
- $buffer .= "<input type='hidden' name='nl[]' value='" . ((int) trim($a)) . "'>\n";
1349
  }
1350
  }
1351
 
1352
  if ($options_profile['name_status'] == 2) {
1353
- $buffer .= '<div class="tnp-field tnp-field-firstname"><label>' . esc_html($options_profile['name']) . '</label>';
1354
- $buffer .= '<input class="tnp-firstname" type="text" name="nn" ' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></div>';
1355
  $buffer .= "\n";
1356
  }
1357
 
1358
  if ($options_profile['surname_status'] == 2) {
1359
- $buffer .= '<div class="tnp-field tnp-field-lastname"><label>' . esc_html($options_profile['surname']) . '</label>';
1360
- $buffer .= '<input class="tnp-lastname" type="text" name="ns" ' . ($options_profile['surname_rules'] == 1 ? 'required' : '') . '></div>';
1361
  $buffer .= "\n";
1362
  }
1363
 
1364
- $buffer .= '<div class="tnp-field tnp-field-email"><label>' . esc_html($options_profile['email']) . '</label>';
1365
- $buffer .= '<input class="tnp-email" type="email" name="ne" required></div>';
1366
  $buffer .= "\n";
1367
 
1368
- if (isset($options_profile['sex_status']) && $options_profile['sex_status'] == 2) {
1369
- $buffer .= '<div class="tnp-field tnp-field-gender"><label>' . esc_html($options_profile['sex']) . '</label>';
1370
- $buffer .= '<select name="nx" class="tnp-gender"';
1371
- if ($options_profile['sex_rules'] == 1) {
1372
- $buffer .= ' required><option value=""></option>';
1373
- } else {
1374
- $buffer .= '><option value="n">' . esc_html($options_profile['sex_none']) . '</option>';
1375
- }
1376
- $buffer .= '<option value="m">' . esc_html($options_profile['sex_male']) . '</option>';
1377
- $buffer .= '<option value="f">' . esc_html($options_profile['sex_female']) . '</option>';
1378
  $buffer .= '</select></div>';
1379
  $buffer .= "\n";
1380
  }
@@ -1384,14 +1395,14 @@ class NewsletterSubscription extends NewsletterModule {
1384
  if ($options_profile['list_' . $i . '_status'] != 2) {
1385
  continue;
1386
  }
1387
- $lists .= '<div class="tnp-field tnp-field-list"><label><input class="tnp-preference" type="checkbox" name="nl[]" value="' . $i . '"';
1388
  if ($options_profile['list_' . $i . '_checked'] == 1) {
1389
  $lists .= ' checked';
1390
  }
1391
- $lists .= '/>&nbsp;' . esc_html($options_profile['list_' . $i]) . '</label></div>';
1392
  }
1393
  if (!empty($lists)) {
1394
- $buffer .= '<div class="tnp-lists">' . $lists . '</div>';
1395
  }
1396
 
1397
  // Extra profile fields
@@ -1402,21 +1413,23 @@ class NewsletterSubscription extends NewsletterModule {
1402
  }
1403
 
1404
 
1405
- $buffer .= '<div class="tnp-field tnp-field-profile"><label>' .
1406
- esc_html($options_profile['profile_' . $i]) . '</label>';
1407
 
1408
  // Text field
1409
  if ($options_profile['profile_' . $i . '_type'] == 'text') {
1410
- $buffer .= '<input class="tnp-profile tnp-profile-' . $i . '" type="text"' . ($options_profile['profile_' . $i . '_rules'] == 1 ? ' required' : '') . ' name="np' . $i . '">';
 
 
 
1411
  }
1412
 
1413
  // Select field
1414
  if ($options_profile['profile_' . $i . '_type'] == 'select') {
1415
- $buffer .= '<select class="tnp-profile tnp-profile-' . $i . '" name="np' . $i . '" required>' . "\n";
1416
- $buffer .= "<option></option>\n";
1417
  $opts = explode(',', $options_profile['profile_' . $i . '_options']);
1418
  for ($j = 0; $j < count($opts); $j++) {
1419
- $buffer .= "<option>" . esc_html(trim($opts[$j])) . "</option>\n";
1420
  }
1421
  $buffer .= "</select>\n";
1422
  }
@@ -1424,48 +1437,44 @@ class NewsletterSubscription extends NewsletterModule {
1424
  }
1425
 
1426
  $extra = apply_filters('newsletter_subscription_extra', array());
1427
- foreach ($extra as $x) {
1428
  $label = $x['label'];
1429
  if (empty($label)) {
1430
  $label = '&nbsp;';
1431
  }
1432
  $name = '';
1433
- if (!empty($x['name'])) {
1434
  $name = $x['name'];
1435
- }
1436
- $buffer .= '<div class="tnp-field tnp-field-' . $name . '"><label>' . $label . "</label>";
1437
  $buffer .= $x['field'] . "</div>\n";
1438
  }
1439
 
1440
  if ($options_profile['privacy_status'] == 1) {
1441
- $buffer .= '<div class="tnp-field tnp-field-privacy">';
1442
- $buffer .= '<label><input type="checkbox" name="ny" required class="tnp-privacy">&nbsp;';
1443
  if (!empty($options_profile['privacy_url'])) {
1444
- $buffer .= '<a target="_blank" href="' . esc_attr($options_profile['privacy_url']) . '"></label>';
1445
- $buffer .= esc_attr($options_profile['privacy']) . '</a>';
1446
  } else {
1447
- $buffer .= esc_html($options_profile['privacy']);
1448
  }
1449
-
1450
- $buffer .= "</label></div>\n";
1451
  }
1452
 
1453
- $buffer .= '<div class="tnp-field tnp-field-button">';
1454
 
1455
  if (strpos($options_profile['subscribe'], 'http://') !== false) {
1456
- $buffer .= '<input class="tnp-submit-image" type="image" src="' . esc_attr($options_profile['subscribe']) . '">' . "\n";
1457
  } else {
1458
- $buffer .= '<input class="tnp-submit" type="submit" value="' . esc_attr($options_profile['subscribe']) . '">' . "\n";
1459
  }
1460
 
1461
- $buffer .= "</div>\n</form>\n";
1462
- if ($referrer != 'widget') {
1463
- $buffer .= "</div>\n";
1464
- }
1465
  return $buffer;
1466
  }
1467
 
1468
- function shortcode_newsletter_profile($attrs, $content) {
1469
  $user = $this->check_user();
1470
 
1471
  if (empty($user)) {
@@ -1476,11 +1485,7 @@ class NewsletterSubscription extends NewsletterModule {
1476
  }
1477
  }
1478
 
1479
- if (isset($attrs['layout']) && $attrs['layout'] == 'table') {
1480
- return $this->get_profile_form($user);
1481
- } else {
1482
- return $this->get_profile_form_html5($user);
1483
- }
1484
  }
1485
 
1486
  /**
@@ -1489,23 +1494,26 @@ class NewsletterSubscription extends NewsletterModule {
1489
  function get_profile_form($user) {
1490
  $options = get_option('newsletter_profile');
1491
 
1492
- $buffer .= '<div class="tnp-profile">';
1493
- $buffer .= '<form action="' . esc_attr(home_url('/') . '?na=ps') . '" method="post">';
1494
  // TODO: use nk
1495
- $buffer .= '<input type="hidden" name="nk" value="' . esc_attr($user->id . '-' . $user->token) . '">';
1496
  $buffer .= '<table cellspacing="0" cellpadding="3" border="0">';
1497
- $buffer .= '<tr><th align="right">' . esc_html($options['email']) . '</th><td><input class="tnp-email" type="text" size="30" name="ne" required value="' . esc_attr($user->email) . '"></td></tr>';
1498
  if ($options['name_status'] >= 1) {
1499
- $buffer .= '<tr><th align="right">' . esc_html($options['name']) . '</th><td><input class="tnp-firstname" type="text" size="30" name="nn" value="' . esc_attr($user->name) . '"></td></tr>';
1500
  }
1501
  if ($options['surname_status'] >= 1) {
1502
- $buffer .= '<tr><th align="right">' . esc_html($options['surname']) . '</th><td><input class="tnp-lastname" type="text" size="30" name="ns" value="' . esc_attr($user->surname) . '"></td></tr>';
1503
  }
1504
  if ($options['sex_status'] >= 1) {
1505
- $buffer .= '<tr><th align="right">' . esc_html($options['sex']) . '</th><td><select name="nx" class="tnp-gender">';
1506
- $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';
1507
- $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';
1508
- $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';
 
 
 
1509
  $buffer .= '</select></td></tr>';
1510
  }
1511
 
@@ -1514,23 +1522,23 @@ class NewsletterSubscription extends NewsletterModule {
1514
  if ($options['profile_' . $i . '_status'] == 0)
1515
  continue;
1516
 
1517
- $buffer .= '<tr><th align="right">' . esc_html($options['profile_' . $i]) . '</th><td>';
1518
-
1519
  $field = 'profile_' . $i;
1520
 
1521
  if ($options['profile_' . $i . '_type'] == 'text') {
1522
- $buffer .= '<input class="tnp-profile tnp-profile-' . $i . '" type="text" size="50" name="np' . $i . '" value="' . esc_attr($user->$field) . '"/>';
1523
  }
1524
 
1525
  if ($options['profile_' . $i . '_type'] == 'select') {
1526
- $buffer .= '<select class="tnp-profile tnp-profile-' . $i . '" name="np' . $i . '">';
1527
  $opts = explode(',', $options['profile_' . $i . '_options']);
1528
  for ($j = 0; $j < count($opts); $j++) {
1529
  $opts[$j] = trim($opts[$j]);
1530
  $buffer .= '<option';
1531
  if ($opts[$j] == $user->$field)
1532
  $buffer .= ' selected';
1533
- $buffer .= '>' . esc_html($opts[$j]) . '</option>';
1534
  }
1535
  $buffer .= '</select>';
1536
  }
@@ -1539,17 +1547,17 @@ class NewsletterSubscription extends NewsletterModule {
1539
  }
1540
 
1541
  // Lists
1542
- $buffer .= '<tr><th>&nbsp;</th><td style="text-align: left"><div class="tnp-lists">';
1543
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1544
  if ($options['list_' . $i . '_status'] == 0) {
1545
  continue;
1546
  }
1547
- $buffer .= '<input class="tnp-list" type="checkbox" name="nl[]" value="' . $i . '"';
1548
  $list = 'list_' . $i;
1549
  if ($user->$list == 1) {
1550
  $buffer .= ' checked';
1551
  }
1552
- $buffer .= '/>&nbsp;<span class="tnp-list-label">' . esc_html($options['list_' . $i]) . '</span><br />';
1553
  }
1554
  $buffer .= '</div></td></tr>';
1555
 
@@ -1559,12 +1567,12 @@ class NewsletterSubscription extends NewsletterModule {
1559
  $buffer .= $x['field'] . "\n\t</td>\n</tr>\n\n";
1560
  }
1561
 
1562
- $buffer .= '<tr><td colspan="2" class="tnp-td-submit">';
1563
 
1564
  if (strpos($options['save'], 'http://') !== false) {
1565
- $buffer .= '<input class="tnp-submit-image" type="image" src="' . esc_attr($options['save']) . '"></td></tr>';
1566
  } else {
1567
- $buffer .= '<input class="tnp-submit" type="submit" value="' . esc_attr($options['save']) . '"/></td></tr>';
1568
  }
1569
 
1570
  $buffer .= '</table></form></div>';
@@ -1572,113 +1580,6 @@ class NewsletterSubscription extends NewsletterModule {
1572
  return $buffer;
1573
  }
1574
 
1575
- function get_profile_form_html5($user) {
1576
- $options = get_option('newsletter_profile');
1577
-
1578
- $buffer .= '<div class="tnp tnp-profile">';
1579
- $buffer .= '<form action="' . esc_attr(home_url('/') . '?na=ps') . '" method="post">';
1580
- $buffer .= '<input type="hidden" name="nk" value="' . esc_attr($user->id . '-' . $user->token) . '">';
1581
-
1582
- $buffer .= '<div class="tnp-field tnp-field-email">';
1583
- $buffer .= '<label>' . esc_html($options['email']) . '</label>';
1584
- $buffer .= '<input class="tnp-email" type="text" name="ne" required value="' . esc_attr($user->email) . '">';
1585
- $buffer .= "</div>\n";
1586
-
1587
-
1588
- if ($options['name_status'] >= 1) {
1589
- $buffer .= '<div class="tnp-field tnp-field-firstname">';
1590
- $buffer .= '<label>' . esc_html($options['name']) . '</label>';
1591
- $buffer .= '<input class="tnp-firstname" type="text" name="nn" value="' . esc_attr($user->name) . '">';
1592
- $buffer .= "</div>\n";
1593
- }
1594
-
1595
- if ($options['surname_status'] >= 1) {
1596
- $buffer .= '<div class="tnp-field tnp-field-lastname">';
1597
- $buffer .= '<label>' . esc_html($options['surname']) . '</label>';
1598
- $buffer .= '<input class="tnp-lastname" type="text" name="ns" value="' . esc_attr($user->surname) . '">';
1599
- $buffer .= "</div>\n";
1600
- }
1601
-
1602
- if ($options['sex_status'] >= 1) {
1603
- $buffer .= '<div class="tnp-field tnp-field-gender">';
1604
- $buffer .= '<label>' . esc_html($options['sex']) . '</label>';
1605
- $buffer .= '<select name="nx" class="tnp-gender">';
1606
- $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';
1607
- $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';
1608
- $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';
1609
- $buffer .= '</select>';
1610
- $buffer .= "</div>\n";
1611
- }
1612
-
1613
- // Profile
1614
- for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
1615
- if ($options['profile_' . $i . '_status'] == 0) {
1616
- continue;
1617
- }
1618
-
1619
- $buffer .= '<div class="tnp-field tnp-field-profile">';
1620
- $buffer .= '<label>' . esc_html($options['profile_' . $i]) . '</label>';
1621
-
1622
- $field = 'profile_' . $i;
1623
-
1624
- if ($options['profile_' . $i . '_type'] == 'text') {
1625
- $buffer .= '<input class="tnp-profile tnp-profile-' . $i . '" type="text" name="np' . $i . '" value="' . esc_attr($user->$field) . '">';
1626
- }
1627
-
1628
- if ($options['profile_' . $i . '_type'] == 'select') {
1629
- $buffer .= '<select class="tnp-profile tnp-profile-' . $i . '" name="np' . $i . '">';
1630
- $opts = explode(',', $options['profile_' . $i . '_options']);
1631
- for ($j = 0; $j < count($opts); $j++) {
1632
- $opts[$j] = trim($opts[$j]);
1633
- $buffer .= '<option';
1634
- if ($opts[$j] == $user->$field)
1635
- $buffer .= ' selected';
1636
- $buffer .= '>' . esc_html($opts[$j]) . '</option>';
1637
- }
1638
- $buffer .= '</select>';
1639
- }
1640
-
1641
- $buffer .= "</div>\n";
1642
- }
1643
-
1644
- // Lists
1645
- $lists = '';
1646
- for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1647
- if ($options['list_' . $i . '_status'] == 0) {
1648
- continue;
1649
- }
1650
-
1651
- $lists .= '<div class="tnp-field tnp-field-list">';
1652
- $lists .= '<label><input class="tnp-list tnp-list-' . $i . '" type="checkbox" name="nl[]" value="' . $i . '"';
1653
- $field = 'list_' . $i;
1654
- if ($user->$field == 1) {
1655
- $lists .= ' checked';
1656
- }
1657
- $lists .= '><span class="tnp-list-label">' . esc_html($options['list_' . $i]) . '</span></label>';
1658
- $lists .= "</div>\n";
1659
- }
1660
-
1661
- if (!empty($lists)) {
1662
- $buffer .= '<div class="tnp-lists">' . "\n" . $lists . "\n" . '</div>';
1663
- }
1664
-
1665
- $extra = apply_filters('newsletter_profile_extra', array(), $user);
1666
- foreach ($extra as $x) {
1667
- $buffer .= '<div class="tnp-field">';
1668
- $buffer .= '<label>' . $x['label'] . "</label>";
1669
- $buffer .= $x['field'];
1670
- $buffer .= "</div>\n";
1671
- }
1672
-
1673
- $buffer .= '<div class="tnp-field tnp-field-button">';
1674
- $buffer .= '<input class="tnp-submit" type="submit" value="' . esc_attr($options['save']) . '">';
1675
- $buffer .= "</div>\n";
1676
-
1677
- $buffer .= "</form>\n</div>\n";
1678
-
1679
- return $buffer;
1680
- }
1681
-
1682
  function get_form($number) {
1683
  $options = get_option('newsletter_forms');
1684
 
@@ -1721,9 +1622,8 @@ class NewsletterSubscription extends NewsletterModule {
1721
 
1722
  function notify_admin($user, $subject) {
1723
 
1724
- if ($this->options['notify'] != 1) {
1725
  return;
1726
- }
1727
 
1728
  $message = "Subscriber details:\n\n" .
1729
  "email: " . $user->email . "\n" .
@@ -1733,143 +1633,167 @@ class NewsletterSubscription extends NewsletterModule {
1733
 
1734
  $options_profile = get_option('newsletter_profile');
1735
 
1736
- for ($i = 0; $i < NEWSLETTER_LIST_MAX; $i++) {
1737
- if (empty($options_profile['list_' . $i])) {
1738
- continue;
1739
- }
1740
- $field = 'list_' . $i;
1741
- $message .= $options_profile['list_' . $i] . ': ' . (empty($user->$field) ? "NO" : "YES") . "\n";
1742
- }
1743
-
1744
  for ($i = 0; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1745
- if (empty($options_profile['profile_' . $i])) {
1746
  continue;
1747
- }
1748
  $field = 'profile_' . $i;
1749
  $message .= $options_profile['profile_' . $i] . ': ' . $user->$field . "\n";
1750
  }
1751
 
1752
-
 
 
 
 
 
1753
 
1754
  $message .= "token: " . $user->token . "\n" .
1755
  "status: " . $user->status . "\n";
1756
  $email = trim($this->options['notify_email']);
1757
- if (empty($email)) {
1758
  $email = get_option('admin_email');
1759
- }
1760
  $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1761
- Newsletter::instance()->mail($email, '[' . $blogname . '] ' . $subject, array('text' => $message));
 
1762
  }
1763
 
1764
- function get_subscription_form_minimal($attrs) {
1765
- $options_profile = get_option('newsletter_profile');
1766
- if (!is_array($attrs))
1767
- $attrs = array();
1768
- $attrs = array_merge(array('referrer' => 'minimal', 'button' => $options_profile['subscribe'], 'placeholder' => $options_profile['email']), $attrs);
1769
-
1770
- $form = '';
1771
- $form .= '<div class="tnp tnp-subscription-minimal">';
1772
- $form .= '<form action="' . esc_attr(home_url('/')) . '?na=s" method="post">';
1773
- $form .= '<input type="hidden" name="nr" value="' . esc_attr($attrs['referrer']) . '">';
1774
- $form .= '<input class="tnp-email" type="email" required name="ne" value="" placeholder="' . esc_attr($attrs['placeholder']) . '">';
1775
- $form .= '<input class="tnp-submit" type="submit" value="' . esc_attr($attrs['button']) . '">';
1776
- $form .= "</form></div>\n";
1777
 
1778
- return $form;
1779
- }
1780
 
1781
- function shortcode_newsletter_form($attrs, $content) {
 
1782
 
1783
- if (isset($attrs['type']) && $attrs['type'] == 'minimal') {
1784
- return NewsletterSubscription::instance()->get_subscription_form_minimal($attrs);
1785
- }
1786
 
1787
- if (!empty($content)) {
1788
- return NewsletterSubscription::instance()->shortcode_subscription($attrs, $content);
1789
- }
1790
- if (isset($attrs['form'])) {
1791
- return NewsletterSubscription::instance()->get_form((int) $attrs['form']);
1792
- } else if (isset($attrs['number'])) {
1793
- return NewsletterSubscription::instance()->get_form((int) $attrs['number']);
 
 
 
 
1794
  } else {
1795
- if (isset($attrs['layout']) && $attrs['layout'] == 'table') {
1796
- return NewsletterSubscription::instance()->get_subscription_form(null, null, $attrs);
1797
- } else {
1798
- return NewsletterSubscription::instance()->get_subscription_form_html5(null, null, $attrs);
1799
- }
1800
  }
1801
  }
 
1802
 
1803
- /**
1804
- *
1805
- * @global type $wpdb
1806
- * @global boolean $cache_stop
1807
- * @global Newsletter $newsletter
1808
- * @param type $attrs
1809
- * @param type $content
1810
- * @return string
1811
- */
1812
- function shortcode_newsletter($attrs, $content) {
1813
- global $wpdb, $cache_stop, $newsletter;
 
 
1814
 
1815
- $cache_stop = true;
1816
 
1817
- $module = NewsletterSubscription::instance();
1818
- $user = $module->get_user_from_request();
1819
- $message_key = $module->get_message_key_from_request();
1820
 
1821
  // if ($message_key != 'subscription' && $user == null) {
1822
  // die('Invalid subscriber');
1823
  // }
1824
 
1825
 
1826
- $message = $module->options[$message_key . '_text'];
1827
 
1828
- // TODO: the if can be removed
1829
- if ($message_key == 'confirmed') {
1830
- $message .= $module->options[$message_key . '_tracking'];
1831
- }
1832
 
1833
- // Now check what form must be added
1834
- if ($message_key == 'subscription') {
1835
 
1836
- // Compatibility check
1837
- if (stripos($message, '<form') !== false) {
1838
- $message .= $module->get_form_javascript();
1839
- $message = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" onsubmit="return newsletter_check(this)"', $message);
1840
- } else {
1841
 
1842
- if (strpos($message, '{subscription_form') === false) {
1843
- $message .= '{subscription_form}';
1844
- }
1845
 
1846
- if (isset($attrs['form'])) {
1847
- $message = str_replace('{subscription_form}', $module->get_form($attrs['form']), $message);
 
 
 
1848
  } else {
1849
- if (isset($attrs['layout']) && $attrs['layout'] == 'table') {
1850
- $message = str_replace('{subscription_form}', $module->get_subscription_form('page'), $message);
1851
- } else {
1852
- $message = str_replace('{subscription_form}', $module->get_subscription_form_html5('page'), $message);
1853
- }
1854
  }
1855
  }
1856
  }
 
1857
 
1858
- $email = NewsletterSubscription::instance()->get_email_from_request();
1859
-
1860
- $message = $newsletter->replace($message, $user, $email, 'page');
1861
 
1862
- if (isset($_REQUEST['alert'])) {
1863
- // slashes are already added by wordpress!
1864
- $message .= '<script>alert("' . strip_tags($_REQUEST['alert']) . '");</script>';
1865
- }
1866
 
1867
- return $message;
 
 
1868
  }
1869
 
 
1870
  }
1871
 
1872
- NewsletterSubscription::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1873
 
1874
  // Compatibility code
1875
 
@@ -1880,3 +1804,20 @@ function newsletter_form($number = null) {
1880
  echo NewsletterSubscription::instance()->get_subscription_form();
1881
  }
1882
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
 
 
 
3
  require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
4
 
5
  class NewsletterSubscription extends NewsletterModule {
6
 
7
  const MESSAGE_CONFIRMED = 'confirmed';
8
 
9
+ // var $options_lock;
10
  static $instance;
11
 
12
  /**
21
 
22
  function __construct() {
23
 
24
+ parent::__construct('subscription', '2.0.1');
25
+
26
+ // $this->options_lock = $this->get_options('lock');
27
+
28
+ //add_action('wp_login', array($this, 'hook_wp_login'));
29
 
30
  // Must be called after the Newsletter::hook_init, since some constants are defined
31
  // there.
34
 
35
  function hook_init() {
36
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
37
+ //add_action('delete_user', array($this, 'hook_delete_user'));
 
 
 
 
 
 
 
 
 
 
 
38
 
39
+ add_shortcode('newsletter_profile', array($this, 'shortcode_profile'));
40
+ add_shortcode('newsletter_field', array($this, 'shortcode_field'));
41
+ add_action('wp_footer', array($this, 'hook_wp_footer'));
42
+ //add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
+ // function hook_delete_user($id) {
46
+ // global $wpdb;
47
+ // $options = $this->get_options('wp');
48
+ // if ($options['delete'] == 1) {
49
+ // $wpdb->delete(NEWSLETTER_USERS_TABLE, array('wp_user_id' => $id));
50
+ // }
51
+ // }
52
+
53
  function hook_wp_loaded() {
54
  global $newsletter, $wpdb;
55
 
56
  switch ($newsletter->action) {
 
 
 
 
 
57
  case 's':
 
 
58
 
59
+ if (isset($this->options['antibot_disable']) || NewsletterModule::antibot_form_check()) {
60
+
61
+ $user = NewsletterSubscription::instance()->subscribe();
62
 
63
  if ($user->status == 'E')
64
+ NewsletterSubscription::instance()->show_message('error', $user->id);
65
  if ($user->status == 'C')
66
+ NewsletterSubscription::instance()->show_message('confirmed', $user->id);
67
  if ($user->status == 'A')
68
+ NewsletterSubscription::instance()->show_message('already_confirmed', $user->id);
69
  if ($user->status == 'S')
70
+ NewsletterSubscription::instance()->show_message('confirmation', $user->id);
71
  } else {
72
 
73
+ NewsletterModule::request_to_antibot_form('Subscribe');
74
  }
75
  die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  case 'u':
77
+ $user = NewsletterSubscription::instance()->get_user_from_request();
78
  $email = $this->get_email_from_request();
79
  if ($user == null) {
80
+ NewsletterSubscription::instance()->show_message('unsubscription_error', null);
81
  } else {
82
+ NewsletterSubscription::instance()->show_message('unsubscription', $user, null, $email);
83
  }
84
  die();
85
  break;
86
  case 'uc':
87
  if ($this->antibot_form_check()) {
88
+ $user = NewsletterSubscription::instance()->unsubscribe();
89
  if ($user->status == 'E') {
90
+ NewsletterSubscription::instance()->show_message('unsubscription_error', $user);
91
  } else {
92
+ NewsletterSubscription::instance()->show_message('unsubscribed', $user);
93
  }
94
  return;
95
  } else {
99
  break;
100
  case 'p':
101
  case 'pe':
102
+ $user = NewsletterSubscription::instance()->check_user();
103
  if ($user == null) {
104
  die('No subscriber found.');
105
  }
106
 
107
+ NewsletterSubscription::instance()->show_message('profile', $user);
108
  die();
109
  break;
 
 
 
 
 
 
 
 
110
  case 'c':
 
111
  if ($this->antibot_form_check()) {
112
+ $user = NewsletterSubscription::instance()->confirm();
113
  if ($user->status == 'E') {
114
+ NewsletterSubscription::instance()->show_message('error', $user->id);
115
  } else {
116
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
117
+ NewsletterSubscription::instance()->show_message('confirmed', $user);
118
  }
119
  } else {
120
  $this->request_to_antibot_form('Confirm');
121
  }
122
  die();
123
  break;
124
+
125
  default:
126
  return;
127
  }
128
  }
129
 
 
 
 
 
 
 
 
130
  function upgrade() {
131
  global $wpdb, $charset_collate, $newsletter;
132
 
135
  $this->init_options('profile');
136
  $this->init_options('lists');
137
 
138
+
139
+
140
  $default_options = $this->get_default_options();
141
 
142
  if (empty($this->options['error_text'])) {
163
  update_option('newsletter_profile', $options_profile);
164
  }
165
 
166
+ // Very old...
167
+ if (!isset($this->options['url']) && !empty($newsletter->options['url'])) {
168
+ $this->options['url'] = $newsletter->options['url'];
169
+ $this->save_options($this->options);
170
+ }
171
 
172
+ // Locked content configuration migration
173
+ // $options_lock = $this->get_options('lock');
174
+ // if (empty($options_lock)) {
175
+ // $options_main = Newsletter::instance()->get_options();
176
+ // if (isset($options_main['lock_message'])) {
177
+ // $options_lock['ids'] = $options_main['lock_ids'];
178
+ // $options_lock['url'] = $options_main['lock_url'];
179
+ // $options_lock['message'] = $options_main['lock_message'];
180
+ // update_option('newsletter_subscription_lock', $options_lock);
181
+ // }
182
+ // }
183
+ //
184
+ // $this->init_options('lock');
185
 
186
+ $options_template = $this->get_options('template');
187
+ if (empty($options_template)) {
188
+ $options_template['enabled'] = isset($this->options['template_enabled']) ? 1 : 0;
189
+ $options_template['template'] = isset($this->options['template']) ? $this->options['template'] : '';
190
+ add_option('newsletter_subscription_template', $options_template, null, 'no');
191
  }
 
192
  $this->init_options('template', false);
193
 
194
+ // $options_wp = $this->get_options('wp');
195
+ // if (empty($options_wp)) {
196
+ // if (isset($this->options['wp_welcome'])) {
197
+ // $options_wp['welcome'] = $this->options['wp_welcome'];
198
+ // }
199
+ // if (isset($this->options['wp_delete'])) {
200
+ // $options_wp['delete'] = $this->options['wp_delete'];
201
+ // }
202
+ // if (isset($this->options['subscribe_wp_users_label'])) {
203
+ // $options_wp['subscribe_label'] = $this->options['subscribe_wp_users_label'];
204
+ // }
205
+ // if (isset($this->options['subscribe_wp_users'])) {
206
+ // $options_wp['subscribe'] = $this->options['subscribe_wp_users'];
207
+ // }
208
+ // if (isset($this->options['send_confirmation'])) {
209
+ // $options_wp['confirmation'] = $this->options['send_confirmation'];
210
+ // }
211
+ // $this->save_options($options_wp, 'wp');
212
+ //
213
+ // unset($this->options['wp_welcome']);
214
+ // unset($this->options['wp_delete']);
215
+ // unset($this->options['subscribe_wp_users_label']);
216
+ // unset($this->options['subscribe_wp_users']);
217
+ // unset($this->options['send_confirmation']);
218
+ // $this->save_options($this->options);
219
+ // }
220
+ //
221
+ // $this->init_options('wp', false);
222
+
223
+ // Because users do not understand how to create an "extensions" folder...
224
+ //@wp_mkdir_p(WP_CONTENT_DIR . '/extensions/newsletter/subscription');
225
  return true;
226
  }
227
 
228
  function admin_menu() {
229
  $this->add_menu_page('options', 'List building');
230
  $this->add_admin_page('profile', 'Subscription Form');
231
+ //$this->add_admin_page('lock', 'Locked content');
232
+ // $this->add_admin_page('wpusers', 'WP Registration');
233
  $this->add_admin_page('forms', 'Forms');
234
  $this->add_admin_page('lists', 'Lists');
235
  $this->add_admin_page('template', 'Template');
236
  $this->add_admin_page('unsubscription', 'Unsubscription');
237
  }
238
 
239
+ // function hook_the_content($content) {
240
+ // global $post, $cache_stop;
241
+ //
242
+ // if ($this->lock_found || !is_singular() || is_user_logged_in()) {
243
+ // return $content;
244
+ // }
245
+ //
246
+ // if (!empty($this->options_lock['ids'])) {
247
+ // $ids = explode(',', $this->options_lock['ids']);
248
+ // }
249
+ //
250
+ // if (!empty($ids) && (has_tag($ids) || in_category($ids) || in_array($post->post_name, $ids))) {
251
+ // $cache_stop = true;
252
+ // $user = $this->check_user();
253
+ // if ($user == null || $user->status != 'C') {
254
+ // $buffer = $this->replace($this->options_lock['message']);
255
+ // return '<div class="newsletter-lock">' . do_shortcode($buffer) . '</div>';
256
+ // }
257
+ // }
258
+ //
259
+ // return $content;
260
+ // }
261
+
262
+ // function shortcode_newsletter_lock($attrs, $content = null) {
263
+ // global $hyper_cache_stop, $cache_stop;
264
+ //
265
+ // //$this->logger->debug('Lock short code start');
266
+ // $hyper_cache_stop = true;
267
+ // $cache_stop = true;
268
+ //
269
+ // $this->lock_found = true;
270
+ //
271
+ // $user = $this->check_user();
272
+ // if ($user != null && $user->status == 'C') {
273
+ // return do_shortcode($content);
274
+ // }
275
+ //
276
+ // $buffer = $this->options_lock['message'];
277
+ //// ob_start();
278
+ //// eval('? >' . $buffer . "\n");
279
+ //// $buffer = ob_get_clean();
280
+ // // TODO: add the newsletter check on submit
281
+ // $buffer = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '"', $buffer);
282
+ // $buffer = Newsletter::instance()->replace($buffer, null, null, 'lock');
283
+ //
284
+ // $buffer = do_shortcode($buffer);
285
+ //
286
+ // return '<div class="newsletter-lock">' . $buffer . '</div>';
287
+ // }
288
+
289
+ function hook_wp_footer() {
290
+
291
+ }
292
+
293
  /**
294
  * This method has been redefined for compatibility with the old options naming. It would
295
  * be better to change them instead. The subscription options should be named
324
  return parent::get_options($sub);
325
  }
326
 
327
+ /**
328
+ * See wp-includes/user.php function wp_signon().
329
+ */
330
+ // function hook_wp_login($user_login) {
331
+ //
332
+ // $newsletter = Newsletter::instance();
333
+ //
334
+ // //$this->logger->info(__METHOD__ . '> Start with ' . $user_login);
335
+ // $wp_user = get_user_by('login', $user_login);
336
+ // if (!empty($wp_user)) {
337
+ // //$this->logger->info($wp_user);
338
+ // // We have a user able to login, so his subscription can be confirmed if not confirmed
339
+ // $user = $newsletter->get_user($wp_user->user_email);
340
+ // if (!empty($user)) {
341
+ // $wp_options = $this->get_options('wp');
342
+ // $this->confirm($user->id, $wp_options['welcome'] == 1);
343
+ // }
344
+ // }
345
+ // //$this->logger->info(__METHOD__ . '> End');
346
+ // }
347
+
348
  /**
349
  * Return the subscribed user.
350
  *
452
 
453
  // Notification to admin (only for new confirmed subscriptions)
454
  if ($user->status == 'C') {
 
455
  $this->notify_admin($user, 'Newsletter subscription');
456
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
457
  }
516
  }
517
 
518
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
519
+ if (is_array($_REQUEST['nl'])) {
520
  $this->logger->debug($_REQUEST['nl']);
521
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
522
  // If not zero it is selectable by user (on subscription or on profile)
606
  }
607
 
608
  if ($user->status == 'C') {
 
609
  return $user;
610
  }
611
 
617
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
618
  $newsletter->set_user_status($user->id, 'C');
619
  $user->status = 'C';
 
620
  $this->notify_admin($user, 'Newsletter subscription');
621
 
622
  // Check if is connected to a wp user
801
  }
802
 
803
  if (isset($_REQUEST['ncu'])) {
804
+ $this->options['confirmation_url'] = $_REQUEST['ncu'];
805
  }
806
 
807
  if ($email) {
815
  die();
816
  }
817
 
818
+ // Is there a dedicated page?
819
+ if (!empty($this->options['url'])) {
820
+ header('Location: ' . self::add_qs($this->options['url'], 'nm=' . $key . '&nk=' . $user->id . '-' . $user->token, false) . $params);
821
+ die();
 
 
 
 
 
 
 
822
  }
823
 
824
+ // Use the standard page.
825
+ header('Location: ' . plugins_url('newsletter') . '/subscription/page.php?nm=' . $key . '&nk=' . $user->id . '-' . $user->token . $params);
826
  die();
827
  }
828
 
970
  }
971
 
972
  if (!empty($label)) {
973
+ $buffer .= '<div class="newsletter-field newsletter-field-button">';
974
  if (strpos($label, 'http') === 0) {
975
+ $buffer .= '<input class="newsletter-button-image" type="image" src="' . $label . '">';
976
  } else {
977
+ $buffer .= '<input class="newsletter-button" type="submit" value="' . $label . '">';
978
  }
979
  $buffer .= '</div>';
980
  }
985
  }
986
 
987
  function _shortcode_label($name, $attrs, $suffix = null) {
988
+ if (!$suffix)
989
  $suffix = $name;
 
990
  $options_profile = get_option('newsletter_profile');
991
+ $buffer = '<label for="newsletter-' . $suffix . '">';
992
+ if (isset($attrs['label']) && $attrs['label'] != '') {
993
+ $buffer .= $attrs['label'];
 
 
 
 
994
  } else {
995
+ $buffer .= $options_profile[$name];
996
  }
997
  $buffer .= "</label>\n";
998
  return $buffer;
999
  }
1000
 
1001
+ function shortcode_field($attrs, $content) {
1002
  $options_profile = get_option('newsletter_profile');
1003
  $name = $attrs['name'];
1004
 
1005
  $buffer = '';
1006
 
1007
  if ($name == 'email') {
1008
+ $buffer .= '<div class="newsletter-field newsletter-field-email">';
1009
  $buffer .= $this->_shortcode_label('email', $attrs);
1010
 
1011
+ $buffer .= '<input class="newsletter-email" id="newsletter-email" type="email" name="ne" required style="width: 69%">';
 
 
 
1012
  if (isset($attrs['button_label'])) {
1013
  $label = $attrs['button_label'];
1014
  if (strpos($label, 'http') === 0) {
1015
+ $buffer .= ' <input class="newsletter-button-image" type="image" src="' . $label . '">';
1016
  } else {
1017
+ $buffer .= ' <input class="newsletter-button" type="submit" value="' . $label . '" style="width: 29%">';
1018
  }
1019
  }
1020
+ $buffer .= '</div>';
1021
  return $buffer;
1022
  }
1023
 
1024
  if ($name == 'first_name' || $name == 'name') {
1025
+ $buffer .= '<div class="newsletter-field newsletter-field-name">';
1026
  $buffer .= $this->_shortcode_label('name', $attrs);
1027
 
1028
+ $buffer .= '<input class="newsletter-name" type="text" name="nn" id="newsletter-name"';
 
 
1029
  if ($options_profile['name_rules'] == 1) {
1030
  $buffer .= ' required';
1031
  }
1032
  $buffer .= '>';
1033
+ $buffer .= '</div>';
1034
  return $buffer;
1035
  }
1036
 
1037
  if ($name == 'last_name' || $name == 'surname') {
1038
+ $buffer .= '<div class="newsletter-field newsletter-field-surname">';
1039
  $buffer .= $this->_shortcode_label('surname', $attrs);
1040
 
1041
+ $buffer .= '<input class="newsletter-surname" type="text" name="ns" id="newsletter-surname"';
 
 
1042
  if ($options_profile['surname_rules'] == 1) {
1043
  $buffer .= ' required';
1044
  }
1050
  if ($name == 'preference' || $name == 'list') {
1051
  $list = (int) $attrs['number'];
1052
  if (isset($attrs['hidden'])) {
1053
+ return '<input type="hidden" name="nl[]" value="' . $list . '">';
1054
  }
1055
+ $buffer .= '<div class="newsletter-field newsletter-field-checkbox newsletter-field-list">';
1056
+ $buffer .= '<input type="checkbox" id="nl' . $list . '" name="nl[]" value="' . $list . '"';
1057
  if (isset($attrs['checked'])) {
1058
  $buffer .= ' checked';
1059
  }
1060
  $buffer .= '>';
1061
  if (isset($attrs['label'])) {
1062
  if ($attrs['label'] != '')
1063
+ $buffer .= '<label for="nl' . $list . '">' . $attrs['label'] . '</label>';
1064
  } else {
1065
+ $buffer .= '<label for="nl' . $list . '">' . $options_profile['list_' . $list] . '</label>';
1066
  }
1067
+ $buffer .= '</div>';
1068
 
1069
  return $buffer;
1070
  }
1071
 
 
1072
  if ($name == 'lists' || $name == 'preferences') {
1073
  $lists = '';
1074
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1075
  if ($options_profile['list_' . $i . '_status'] != 2) {
1076
  continue;
1077
  }
1078
+ $lists .= '<div class="newsletter-field newsletter-field-checkbox newsletter-field-list">';
1079
  $lists .= '<input type="checkbox" id="nl' . $i . '" name="nl[]" value="' . $i . '"';
1080
  if ($options_profile['list_' . $i . '_checked'] == 1)
1081
  $lists .= ' checked';
1082
+ $lists .= '> <label for="nl' . $i . '>' . $options_profile['list_' . $i] . '</label>';
1083
+ $lists .= '</div>';
1084
  }
1085
  return $lists;
1086
  }
1087
 
1088
  // TODO: add the "not specified"
1089
  if ($name == 'sex' || $name == 'gender') {
1090
+ $buffer .= '<div class="newsletter-field newsletter-field-gender">';
1091
  if (isset($attrs['label'])) {
1092
  if ($attrs['label'] != '')
1093
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
1094
  } else {
1095
+ $buffer .= '<label for="">' . $options_profile['sex'] . '</label>';
1096
  }
1097
 
1098
+ $buffer .= '<select name="nx" class="newsletter-gender">';
1099
+ $buffer .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
1100
+ $buffer .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
1101
  $buffer .= '</select>';
1102
+ $buffer .= '</div>';
1103
  return $buffer;
1104
  }
1105
 
1107
  $number = (int) $attrs['number'];
1108
  $type = $options_profile['profile_' . $number . '_type'];
1109
  $size = isset($attrs['size']) ? $attrs['size'] : '';
1110
+ $buffer .= '<div class="newsletter-field newsletter-field-profile">';
1111
  if (isset($attrs['label'])) {
1112
  if ($attrs['label'] != '') {
1113
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
1114
  }
1115
  } else {
1116
+ $buffer .= '<label for="">' . $options_profile['profile_' . $number] . '</label>';
1117
  }
1118
  $placeholder = isset($attrs['placeholder']) ? $attrs['placeholder'] : $options_profile['profile_' . $number . '_placeholder'];
1119
 
1121
 
1122
  // Text field
1123
  if ($type == 'text') {
1124
+ $buffer .= '<input class="newsletter-profile newsletter-profile-' . $number . '" type="text" size="' . $size . '" name="np' . $number . '" placeholder="' . esc_attr($placeholder) . '"';
1125
  if ($required) {
1126
  $buffer .= ' required';
1127
  }
1130
 
1131
  // Select field
1132
  if ($type == 'select') {
1133
+ $buffer .= '<select class="newsletter-profile newsletter-profile-' . $number . '" name="np' . $number . '"';
1134
  if ($required) {
1135
  $buffer .= ' required';
1136
  }
1140
  }
1141
  $opts = explode(',', $options_profile['profile_' . $number . '_options']);
1142
  for ($j = 0; $j < count($opts); $j++) {
1143
+ $buffer .= '<option>' . trim($opts[$j]) . '</option>';
1144
  }
1145
+ $buffer .= '</select>';
1146
  }
1147
 
1148
+ $buffer .= '</div>';
1149
 
1150
  return $buffer;
1151
  }
1160
  $attrs['label'] = $options_profile['list_' . $i];
1161
  }
1162
 
1163
+ $buffer .= '<div class="newsletter-field newsletter-field-checkbox newsletter-field-privacy">';
1164
 
1165
+ $buffer .= '<input type="checkbox" name="ny" required class="newsletter-privacy" id="newsletter-privacy"> ';
1166
+ $buffer .= '<label for="newsletter-privacy">';
1167
  if (!empty($attrs['url'])) {
1168
  $buffer .= '<a target="_blank" href="' . esc_attr($options_profile['privacy_url']) . '">';
1169
  }
1200
 
1201
  $buffer = $this->get_form_javascript();
1202
 
1203
+ $buffer .= '<div class="newsletter newsletter-subscription">' . "\n";
1204
  $buffer .= '<form method="post" action="' . $action . '" onsubmit="return newsletter_check(this)">' . "\n\n";
1205
 
1206
  if (isset($attrs['confirmation_url'])) {
1220
  $buffer .= '<table cellspacing="0" cellpadding="3" border="0">' . "\n\n";
1221
  if ($options_profile['name_status'] == 2) {
1222
  $buffer .= "<!-- first name -->\n";
1223
+ $buffer .= "<tr>\n\t" . '<th>' . $options_profile['name'] . '</th>' . "\n\t" . '<td><input class="newsletter-firstname" type="text" name="nn" size="30"' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></td>' . "\n" . '</tr>' . "\n\n";
1224
  }
1225
 
1226
  if ($options_profile['surname_status'] == 2) {
1227
  $buffer .= "<!-- last name -->\n";
1228
+ $buffer .= "<tr>\n\t" . '<th>' . $options_profile['surname'] . '</th>' . "\n\t" . '<td><input class="newsletter-lastname" type="text" name="ns" size="30"' . ($options_profile['surname_rules'] == 1 ? 'required' : '') . '></td>' . "\n" . '</tr>' . "\n\n";
1229
  }
1230
 
1231
  $buffer .= "<!-- email -->\n";
1232
+ $buffer .= "<tr>\n\t" . '<th>' . $options_profile['email'] . '</th>' . "\n\t" . '<td align="left"><input class="newsletter-email" type="email" name="ne" size="30" required></td>' . "\n" . '</tr>' . "\n\n";
1233
 
1234
  if ($options_profile['sex_status'] == 2) {
1235
  $buffer .= "<!-- sex -->\n";
1236
  $buffer .= "<tr>\n\t<th>" . $options_profile['sex'] . "</th>\n";
1237
+ $buffer .= "\t<td>\n\t" . '<select name="nx" class="newsletter-sex">' . "\n";
1238
  $buffer .= "\t\t" . '<option value="m">' . $options_profile['sex_male'] . '</option>' . "\n";
1239
  $buffer .= "\t\t" . '<option value="f">' . $options_profile['sex_female'] . '</option>' . "\n";
1240
  $buffer .= "\t</select>\n\t</td></tr>\n";
1275
  // Text field
1276
  if ($options_profile['profile_' . $i . '_type'] == 'text') {
1277
  $buffer .= "<tr>\n\t<th>" . $options_profile['profile_' . $i] . "</th>\n\t<td>\n\t\t";
1278
+ $buffer .= '<input class="newsletter-profile newsletter-profile-' . $i . '" type="text" size="30" name="np' . $i . '"';
1279
  $buffer .= ' placeholder="' . esc_attr($options_profile['profile_' . $i . '_placeholder']) . '"';
1280
  if (!empty($options_profile['profile_' . $i . '_rules'])) {
1281
  $buffer .= ' required';
1285
 
1286
  // Select field
1287
  if ($options_profile['profile_' . $i . '_type'] == 'select') {
1288
+ $buffer .= "<tr>\n\t<th>" . $options_profile['profile_' . $i] . "</th>\n\t<td>\n\t\t" . '<select class="newsletter-profile newsletter-profile-' . $i . '" name="np' . $i . '"';
1289
  if (!empty($options_profile['profile_' . $i . '_rules'])) {
1290
  $buffer .= ' required';
1291
  }
1308
  }
1309
 
1310
  if ($options_profile['privacy_status'] == 1) {
1311
+ $buffer .= "<tr>\n\t" . '<td colspan="2" class="newsletter-td-privacy">' . "\n";
1312
  $buffer .= "\t\t" . '<input type="checkbox" name="ny" required>&nbsp;';
1313
  if (!empty($options_profile['privacy_url'])) {
1314
  $buffer .= '<a target="_blank" href="' . $options_profile['privacy_url'] . '">';
1319
  $buffer .= "\n\t</td>\n</tr>\n\n";
1320
  }
1321
 
1322
+ $buffer .= "<tr>\n\t" . '<td colspan="2" class="newsletter-td-submit">' . "\n";
1323
 
1324
  if (strpos($options_profile['subscribe'], 'http://') !== false) {
1325
+ $buffer .= "\t\t" . '<input class="newsletter-submit-image" type="image" src="' . $options_profile['subscribe'] . '"/>' . "\n\t</td>\n</tr>\n\n";
1326
  } else {
1327
+ $buffer .= "\t\t" . '<input class="newsletter-submit" type="submit" value="' . $options_profile['subscribe'] . '"/>' . "\n\t</td>\n</tr>\n\n";
1328
  }
1329
 
1330
  $buffer .= "</table>\n</form>\n</div>";
1331
  return $buffer;
1332
  }
1333
 
 
 
 
 
 
 
 
 
1334
  function get_subscription_form_html5($referrer = null, $action = null, $attrs = array()) {
1335
  if (isset($attrs['action'])) {
1336
  $action = $attrs['action'];
1341
  $options_profile = get_option('newsletter_profile');
1342
  $options = get_option('newsletter');
1343
 
1344
+ $buffer = $this->get_form_javascript();
1345
 
1346
  if (empty($action)) {
1347
+ $action = esc_attr(home_url('/') . '?na=s');
1348
  }
1349
 
1350
+ $buffer .= '<div class="newsletter newsletter-subscription">' . "\n";
1351
+
1352
+ $buffer .= '<form method="post" action="' . $action . '" onsubmit="return newsletter_check(this)">' . "\n\n";
 
 
 
 
 
1353
 
1354
  if (!empty($referrer)) {
1355
+ $buffer .= "<input type='hidden' name='nr' value='$referrer'>\n";
1356
  }
1357
  if (isset($attrs['confirmation_url'])) {
1358
  $buffer .= "<input type='hidden' name='ncu' value='" . esc_attr($attrs['confirmation_url']) . "'>\n";
1361
  if (isset($attrs['list'])) {
1362
  $arr = explode(',', $attrs['list']);
1363
  foreach ($arr as $a) {
1364
+ $buffer .= "<input type='hidden' name='nl[]' value='" . esc_attr(trim($a)) . "'>\n";
1365
  }
1366
  }
1367
 
1368
  if ($options_profile['name_status'] == 2) {
1369
+ $buffer .= '<div class="newsletter-field newsletter-field-name"><label>' . $options_profile['name'] . '</label>';
1370
+ $buffer .= '<input class="newsletter-name" type="text" name="nn" ' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></div>';
1371
  $buffer .= "\n";
1372
  }
1373
 
1374
  if ($options_profile['surname_status'] == 2) {
1375
+ $buffer .= '<div class="newsletter-field newsletter-field-lastname"><label>' . $options_profile['surname'] . '</label>';
1376
+ $buffer .= '<input class="newsletter-lastname" type="text" name="ns" ' . ($options_profile['surname_rules'] == 1 ? 'required' : '') . '></div>';
1377
  $buffer .= "\n";
1378
  }
1379
 
1380
+ $buffer .= '<div class="newsletter-field newsletter-field-email"><label>' . $options_profile['email'] . '</label>';
1381
+ $buffer .= '<input class="newsletter-email" type="email" name="ne" required></div>';
1382
  $buffer .= "\n";
1383
 
1384
+ if ($options_profile['sex_status'] == 2) {
1385
+ $buffer .= '<div class="newsletter-field newsletter-field-gender"><label>' . $options_profile['sex'] . '</label>';
1386
+ $buffer .= '<select name="nx" class="newsletter-sex">';
1387
+ $buffer .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
1388
+ $buffer .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
 
 
 
 
 
1389
  $buffer .= '</select></div>';
1390
  $buffer .= "\n";
1391
  }
1395
  if ($options_profile['list_' . $i . '_status'] != 2) {
1396
  continue;
1397
  }
1398
+ $lists .= "\t\t" . '<div class="newsletter-field newsletter-field-list"><label><input class="newsletter-preference" type="checkbox" name="nl[]" value="' . $i . '"';
1399
  if ($options_profile['list_' . $i . '_checked'] == 1) {
1400
  $lists .= ' checked';
1401
  }
1402
+ $lists .= '/>&nbsp;' . $options_profile['list_' . $i] . '</label></div>';
1403
  }
1404
  if (!empty($lists)) {
1405
+ $buffer .= '<div class="newsletter-lists">' . $lists . '</div>';
1406
  }
1407
 
1408
  // Extra profile fields
1413
  }
1414
 
1415
 
1416
+ $buffer .= '<div class="newsletter-field newsletter-field-profile"><label>' .
1417
+ $options_profile['profile_' . $i] . '</label>';
1418
 
1419
  // Text field
1420
  if ($options_profile['profile_' . $i . '_type'] == 'text') {
1421
+ $buffer .= '<div class="newsletter-field newsletter-field-profile"><label>' .
1422
+ $options_profile['profile_' . $i] . "</label>' . "
1423
+ . '<input class="newsletter-profile newsletter-profile-' . $i . '" type="text" name="np' . $i . '">' .
1424
+ "\n";
1425
  }
1426
 
1427
  // Select field
1428
  if ($options_profile['profile_' . $i . '_type'] == 'select') {
1429
+ $buffer .= '<select class="newsletter-profile newsletter-profile-' . $i . '" name="np' . $i . '">' . "\n";
 
1430
  $opts = explode(',', $options_profile['profile_' . $i . '_options']);
1431
  for ($j = 0; $j < count($opts); $j++) {
1432
+ $buffer .= "<option>" . trim($opts[$j]) . "</option>\n";
1433
  }
1434
  $buffer .= "</select>\n";
1435
  }
1437
  }
1438
 
1439
  $extra = apply_filters('newsletter_subscription_extra', array());
1440
+ foreach ($extra as &$x) {
1441
  $label = $x['label'];
1442
  if (empty($label)) {
1443
  $label = '&nbsp;';
1444
  }
1445
  $name = '';
1446
+ if (!empty($x['name']))
1447
  $name = $x['name'];
1448
+ $buffer .= '<div class="newsletter-field newsletter-field-' . $name . '"><label>' . $label . "</label>";
 
1449
  $buffer .= $x['field'] . "</div>\n";
1450
  }
1451
 
1452
  if ($options_profile['privacy_status'] == 1) {
1453
+ $buffer .= "<p class='newsletter-privacy-div'>\n\t";
1454
+ $buffer .= '<input type="checkbox" name="ny" required class="newsletter-privacy">&nbsp;';
1455
  if (!empty($options_profile['privacy_url'])) {
1456
+ $buffer .= '<label><a target="_blank" href="' . $options_profile['privacy_url'] . '"></label>';
1457
+ $buffer .= $options_profile['privacy'] . '</a>';
1458
  } else {
1459
+ $buffer .= '<label>' . $options_profile['privacy'] . '</label>';
1460
  }
1461
+ $buffer .= '</div>';
1462
+ $buffer .= "\n";
1463
  }
1464
 
1465
+ $buffer .= '<div class="newsletter-field newsletter-field-button">';
1466
 
1467
  if (strpos($options_profile['subscribe'], 'http://') !== false) {
1468
+ $buffer .= "\t\t" . '<input class="newsletter-submit-image" type="image" src="' . $options_profile['subscribe'] . '">' . "\n\t";
1469
  } else {
1470
+ $buffer .= "\t\t" . '<input class="newsletter-submit" type="submit" value="' . $options_profile['subscribe'] . '">' . "\n\t";
1471
  }
1472
 
1473
+ $buffer .= "</div>\n</form>\n</div>";
 
 
 
1474
  return $buffer;
1475
  }
1476
 
1477
+ function shortcode_profile($attrs, $content) {
1478
  $user = $this->check_user();
1479
 
1480
  if (empty($user)) {
1485
  }
1486
  }
1487
 
1488
+ return $this->get_profile_form($user);
 
 
 
 
1489
  }
1490
 
1491
  /**
1494
  function get_profile_form($user) {
1495
  $options = get_option('newsletter_profile');
1496
 
1497
+ $buffer .= '<div class="newsletter newsletter-profile">';
1498
+ $buffer .= '<form action="' . plugins_url('newsletter/do/save.php') . '" method="post">';
1499
  // TODO: use nk
1500
+ $buffer .= '<input type="hidden" name="nk" value="' . $user->id . '-' . $user->token . '"/>';
1501
  $buffer .= '<table cellspacing="0" cellpadding="3" border="0">';
1502
+ $buffer .= '<tr><th align="right">' . $options['email'] . '</th><td><input class="newsletter-email" type="text" size="30" name="ne" value="' . htmlspecialchars($user->email) . '"/></td></tr>';
1503
  if ($options['name_status'] >= 1) {
1504
+ $buffer .= '<tr><th align="right">' . $options['name'] . '</th><td><input class="newsletter-firstname" type="text" size="30" name="nn" value="' . htmlspecialchars($user->name) . '"/></td></tr>';
1505
  }
1506
  if ($options['surname_status'] >= 1) {
1507
+ $buffer .= '<tr><th align="right">' . $options['surname'] . '</th><td><input class="newsletter-lastname" type="text" size="30" name="ns" value="' . htmlspecialchars($user->surname) . '"/></td></tr>';
1508
  }
1509
  if ($options['sex_status'] >= 1) {
1510
+ $buffer .= '<tr><th align="right">' . $options['sex'] . '</th><td><select name="nx" class="newsletter-sex">';
1511
+ // if (!empty($options['sex_none'])) {
1512
+ // $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . $options['sex_none'] . '</option>';
1513
+ // }
1514
+ $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . $options['sex_female'] . '</option>';
1515
+ $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . $options['sex_male'] . '</option>';
1516
+ $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . $options['sex_none'] . '</option>';
1517
  $buffer .= '</select></td></tr>';
1518
  }
1519
 
1522
  if ($options['profile_' . $i . '_status'] == 0)
1523
  continue;
1524
 
1525
+ $buffer .= '<tr><th align="right">' . $options['profile_' . $i] . '</th><td>';
1526
+ //if ($options['list_type_' . $i] != 'public') continue;
1527
  $field = 'profile_' . $i;
1528
 
1529
  if ($options['profile_' . $i . '_type'] == 'text') {
1530
+ $buffer .= '<input class="newsletter-profile newsletter-profile-' . $i . '" type="text" size="50" name="np' . $i . '" value="' . htmlspecialchars($user->$field) . '"/>';
1531
  }
1532
 
1533
  if ($options['profile_' . $i . '_type'] == 'select') {
1534
+ $buffer .= '<select class="newsletter-profile newsletter-profile-' . $i . '" name="np' . $i . '">';
1535
  $opts = explode(',', $options['profile_' . $i . '_options']);
1536
  for ($j = 0; $j < count($opts); $j++) {
1537
  $opts[$j] = trim($opts[$j]);
1538
  $buffer .= '<option';
1539
  if ($opts[$j] == $user->$field)
1540
  $buffer .= ' selected';
1541
+ $buffer .= '>' . $opts[$j] . '</option>';
1542
  }
1543
  $buffer .= '</select>';
1544
  }
1547
  }
1548
 
1549
  // Lists
1550
+ $buffer .= '<tr><th>&nbsp;</th><td style="text-align: left"><div class="newsletter-preferences">';
1551
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1552
  if ($options['list_' . $i . '_status'] == 0) {
1553
  continue;
1554
  }
1555
+ $buffer .= '<input class="newsletter-preference" type="checkbox" name="nl[]" value="' . $i . '"';
1556
  $list = 'list_' . $i;
1557
  if ($user->$list == 1) {
1558
  $buffer .= ' checked';
1559
  }
1560
+ $buffer .= '/>&nbsp;<span class="newsletter-preference-label">' . htmlspecialchars($options['list_' . $i]) . '</span><br />';
1561
  }
1562
  $buffer .= '</div></td></tr>';
1563
 
1567
  $buffer .= $x['field'] . "\n\t</td>\n</tr>\n\n";
1568
  }
1569
 
1570
+ $buffer .= '<tr><td colspan="2" class="newsletter-td-submit">';
1571
 
1572
  if (strpos($options['save'], 'http://') !== false) {
1573
+ $buffer .= '<input class="newsletter-submit" type="image" src="' . $options['save'] . '"/></td></tr>';
1574
  } else {
1575
+ $buffer .= '<input class="newsletter-submit" type="submit" value="' . $options['save'] . '"/></td></tr>';
1576
  }
1577
 
1578
  $buffer .= '</table></form></div>';
1580
  return $buffer;
1581
  }
1582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1583
  function get_form($number) {
1584
  $options = get_option('newsletter_forms');
1585
 
1622
 
1623
  function notify_admin($user, $subject) {
1624
 
1625
+ if ($this->options['notify'] != 1)
1626
  return;
 
1627
 
1628
  $message = "Subscriber details:\n\n" .
1629
  "email: " . $user->email . "\n" .
1633
 
1634
  $options_profile = get_option('newsletter_profile');
1635
 
 
 
 
 
 
 
 
 
1636
  for ($i = 0; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1637
+ if ($options_profile['profile_' . $i] == '')
1638
  continue;
 
1639
  $field = 'profile_' . $i;
1640
  $message .= $options_profile['profile_' . $i] . ': ' . $user->$field . "\n";
1641
  }
1642
 
1643
+ for ($i = 0; $i < NEWSLETTER_LIST_MAX; $i++) {
1644
+ if ($options_profile['list_' . $i] == '')
1645
+ continue;
1646
+ $field = 'list_' . $i;
1647
+ $message .= $options_profile['list_' . $i] . ': ' . $user->$field . "\n";
1648
+ }
1649
 
1650
  $message .= "token: " . $user->token . "\n" .
1651
  "status: " . $user->status . "\n";
1652
  $email = trim($this->options['notify_email']);
1653
+ if (empty($email))
1654
  $email = get_option('admin_email');
 
1655
  $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1656
+ Newsletter::instance()->mail($email, '[' . $blogname . '] ' . $subject, array('text'=>$message));
1657
+ //wp_mail($email, '[' . $blogname . '] ' . $subject, array('text'=>$message));
1658
  }
1659
 
1660
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1661
 
1662
+ NewsletterSubscription::instance();
 
1663
 
1664
+ // TODO: Remove in version 3.5. For compatibility.
1665
+ add_shortcode('newsletter_embed', 'newsletter_shortcode_form');
1666
 
1667
+ add_shortcode('newsletter_form', 'newsletter_shortcode_form');
 
 
1668
 
1669
+ function newsletter_shortcode_form($attrs, $content) {
1670
+ if (!empty($content)) {
1671
+ return NewsletterSubscription::instance()->shortcode_subscription($attrs, $content);
1672
+ }
1673
+ if (isset($attrs['form'])) {
1674
+ return NewsletterSubscription::instance()->get_form((int) $attrs['form']);
1675
+ } else if (isset($attrs['number'])) {
1676
+ return NewsletterSubscription::instance()->get_form((int) $attrs['number']);
1677
+ } else {
1678
+ if (isset($attrs['layout']) && $attrs['layout'] == 'html5') {
1679
+ return NewsletterSubscription::instance()->get_subscription_form_html5(null, null, $attrs);
1680
  } else {
1681
+ return NewsletterSubscription::instance()->get_subscription_form(null, null, $attrs);
 
 
 
 
1682
  }
1683
  }
1684
+ }
1685
 
1686
+ add_shortcode('newsletter', 'newsletter_shortcode');
1687
+
1688
+ /**
1689
+ *
1690
+ * @global type $wpdb
1691
+ * @global boolean $cache_stop
1692
+ * @global Newsletter $newsletter
1693
+ * @param type $attrs
1694
+ * @param type $content
1695
+ * @return string
1696
+ */
1697
+ function newsletter_shortcode($attrs, $content) {
1698
+ global $wpdb, $cache_stop, $newsletter;
1699
 
1700
+ $cache_stop = true;
1701
 
1702
+ $module = NewsletterSubscription::instance();
1703
+ $user = $module->get_user_from_request();
1704
+ $message_key = $module->get_message_key_from_request();
1705
 
1706
  // if ($message_key != 'subscription' && $user == null) {
1707
  // die('Invalid subscriber');
1708
  // }
1709
 
1710
 
1711
+ $message = $module->options[$message_key . '_text'];
1712
 
1713
+ // TODO: the if can be removed
1714
+ if ($message_key == 'confirmed') {
1715
+ $message .= $module->options[$message_key . '_tracking'];
1716
+ }
1717
 
1718
+ // Now check what form must be added
1719
+ if ($message_key == 'subscription') {
1720
 
1721
+ // Compatibility check
1722
+ if (stripos($message, '<form') !== false) {
1723
+ $message .= $module->get_form_javascript();
1724
+ $message = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" onsubmit="return newsletter_check(this)"', $message);
1725
+ } else {
1726
 
1727
+ if (strpos($message, '{subscription_form') === false) {
1728
+ $message .= '{subscription_form}';
1729
+ }
1730
 
1731
+ if (isset($attrs['form'])) {
1732
+ $message = str_replace('{subscription_form}', $module->get_form($attrs['form']), $message);
1733
+ } else {
1734
+ if (isset($attrs['layout']) && $attrs['layout'] == 'html5') {
1735
+ $message = str_replace('{subscription_form}', $module->get_subscription_form_html5('page'), $message);
1736
  } else {
1737
+ $message = str_replace('{subscription_form}', $module->get_subscription_form('page'), $message);
 
 
 
 
1738
  }
1739
  }
1740
  }
1741
+ }
1742
 
1743
+ $email = NewsletterSubscription::instance()->get_email_from_request();
 
 
1744
 
1745
+ $message = $newsletter->replace($message, $user, $email, 'page');
 
 
 
1746
 
1747
+ if (isset($_REQUEST['alert'])) {
1748
+ // slashes are already added by wordpress!
1749
+ $message .= '<script>alert("' . strip_tags($_REQUEST['alert']) . '");</script>';
1750
  }
1751
 
1752
+ return $message;
1753
  }
1754
 
1755
+ //// The hook is always active so the module can be activated only on registration (otherwise we should check that
1756
+ //// option on every page load. The registration code should be moved inside the module...
1757
+ //add_action('user_register', 'newsletter_subscription_user_register');
1758
+ //
1759
+ //function newsletter_subscription_user_register($wp_user_id) {
1760
+ // global $wpdb, $newsletter;
1761
+ //
1762
+ // $module = NewsletterSubscription::instance();
1763
+ // $wp_options = $module->get_options('wp');
1764
+ // // If the integration is disabled...
1765
+ // if ($wp_options['subscribe'] == 0) {
1766
+ // return;
1767
+ // }
1768
+ //
1769
+ // // If not forced and the user didn't choose the newsletter...
1770
+ // if ($wp_options['subscribe'] != 1) {
1771
+ // if (!isset($_REQUEST['newsletter'])) {
1772
+ // return;
1773
+ // }
1774
+ // }
1775
+ //
1776
+ // $module->logger->info('Adding a registered WordPress user (' . $wp_user_id . ')');
1777
+ // $wp_user = $wpdb->get_row($wpdb->prepare("select * from $wpdb->users where id=%d limit 1", $wp_user_id));
1778
+ // if (empty($wp_user)) {
1779
+ // $module->logger->error('User not found?!');
1780
+ // return;
1781
+ // }
1782
+ //
1783
+ // // Yes, some registration procedures allow empty email
1784
+ // if (!NewsletterModule::is_email($wp_user->user_email)) {
1785
+ // return;
1786
+ // }
1787
+ //
1788
+ // $_REQUEST['ne'] = $wp_user->user_email;
1789
+ // $_REQUEST['nr'] = 'registration';
1790
+ // // Upon registration there is no last name and first name, sorry.
1791
+ // // $status is determined by the opt in
1792
+ // $user = $module->subscribe(null, $wp_options['confirmation'] == 1);
1793
+ //
1794
+ // // Now we associate it with wp
1795
+ // $module->set_user_wp_user_id($user->id, $wp_user_id);
1796
+ //}
1797
 
1798
  // Compatibility code
1799
 
1804
  echo NewsletterSubscription::instance()->get_subscription_form();
1805
  }
1806
  }
1807
+
1808
+ //add_action('register_form', 'newsletter_register_form');
1809
+ //
1810
+ //function newsletter_register_form() {
1811
+ // $module = NewsletterSubscription::instance();
1812
+ // $wp_options = $module->get_options('wp');
1813
+ // if ($wp_options['subscribe'] == 2 || $wp_options['subscribe'] == 3) {
1814
+ // echo '<p>';
1815
+ // echo '<input type="checkbox" value="1" name="newsletter"';
1816
+ // if ($wp_options['subscribe'] == 3) {
1817
+ // echo ' checked';
1818
+ // }
1819
+ // echo '>&nbsp;';
1820
+ // echo $wp_options['subscribe_label'];
1821
+ // echo '</p>';
1822
+ // }
1823
+ //}
subscription/template.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
-
5
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $controls = new NewsletterControls();
7
  $module = NewsletterSubscription::instance();
@@ -13,21 +10,21 @@ if (!$controls->is_action()) {
13
  $module->save_options($controls->data, 'template');
14
 
15
  if (strpos($controls->data['template'], '{message}') === false) {
16
- $controls->errors = __('The tag {message} is missing in your template', 'newsletter');
17
  }
18
 
19
- $controls->add_message_saved();
20
  }
21
  if ($controls->is_action('reset')) {
22
  $controls->data['template'] = file_get_contents(dirname(__FILE__) . '/email.html');
23
- $controls->add_message_done();
24
  }
25
 
26
  if ($controls->is_action('test')) {
27
 
28
  $users = NewsletterUsers::instance()->get_test_users();
29
  if (count($users) == 0) {
30
- $controls->errors = __('No test subscribers found.', 'newsletter') . ' <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank"><i class="fa fa-info-circle"></i></a>';
31
  } else {
32
  $template = $controls->data['template'];
33
  if (strpos($template, '{message}') === false) {
@@ -46,32 +43,12 @@ if (!$controls->is_action()) {
46
  Newsletter::instance()->mail($user->email, 'Newsletter Messages Template Test', $newsletter->replace($message, $user));
47
  }
48
  $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers: ' .
49
- implode(', ', $addresses) . '.' . ' <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank"><i class="fa fa-info-circle"></i></a>';
50
  }
51
  }
52
  }
53
  ?>
54
- <!--
55
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.css" type="text/css">
56
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/show-hint.css">
57
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.js"></script>
58
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/xml/xml.js"></script>
59
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.js"></script>
60
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/javascript/javascript.js"></script>
61
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/htmlmixed/htmlmixed.js"></script>
62
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/show-hint.js"></script>
63
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/xml-hint.js"></script>
64
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/addon/hint/html-hint.js"></script>
65
- <script>
66
- jQuery(function () {
67
- var editor = CodeMirror.fromTextArea(document.getElementById("options-template"), {
68
- lineNumbers: true,
69
- mode: 'htmlmixed',
70
- extraKeys: {"Ctrl-Space": "autocomplete"}
71
- });
72
- });
73
- </script>
74
- -->
75
  <div class="wrap" id="tnp-wrap">
76
 
77
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
1
  <?php
 
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
10
  $module->save_options($controls->data, 'template');
11
 
12
  if (strpos($controls->data['template'], '{message}') === false) {
13
+ $controls->errors = 'Warning: the tag {message} is missing in your template';
14
  }
15
 
16
+ $controls->messages = 'Saved.';
17
  }
18
  if ($controls->is_action('reset')) {
19
  $controls->data['template'] = file_get_contents(dirname(__FILE__) . '/email.html');
20
+ $controls->messages = 'Done.';
21
  }
22
 
23
  if ($controls->is_action('test')) {
24
 
25
  $users = NewsletterUsers::instance()->get_test_users();
26
  if (count($users) == 0) {
27
+ $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
28
  } else {
29
  $template = $controls->data['template'];
30
  if (strpos($template, '{message}') === false) {
43
  Newsletter::instance()->mail($user->email, 'Newsletter Messages Template Test', $newsletter->replace($message, $user));
44
  }
45
  $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers: ' .
46
+ implode(', ', $addresses) . '. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
47
  }
48
  }
49
  }
50
  ?>
51
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  <div class="wrap" id="tnp-wrap">
53
 
54
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
subscription/unsubscription.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
1
  <?php
 
 
2
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterSubscription::instance();
subscription/validate.js DELETED
@@ -1,31 +0,0 @@
1
- function newsletter_check_field(field, message) {
2
- if (!field) return true;
3
- if (field.type == "checkbox" && !field.checked) {
4
- alert(message);
5
- return false;
6
- }
7
-
8
- if (field.required !== undefined && field.required !== false && field.value == "") {
9
- alert(message);
10
- return false;
11
- }
12
- return true;
13
- }
14
-
15
- function newsletter_check(f) {
16
- var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/;
17
- if (!re.test(f.elements["ne"].value)) {
18
- alert(newsletter.messages.email_error);
19
- return false;
20
- }
21
- if (!newsletter_check_field(f.elements["nn"], newsletter.messages.name_error)) return false;
22
- if (!newsletter_check_field(f.elements["ns"], newsletter.messages.surname_error)) return false;
23
-
24
- for (var i=1; i<newsletter.profile_max; i++) {
25
- if (!newsletter_check_field(f.elements["np" + i], newsletter.messages.profile_error)) return false;
26
- }
27
-
28
- if (!newsletter_check_field(f.elements["ny"], newsletter.messages.privacy_error)) return false;
29
-
30
- return true;
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tnp-footer.php CHANGED
@@ -1,6 +1,3 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- ?>
4
  <div id="tnp-footer">
5
  <div>
6
  <ul>
 
 
 
1
  <div id="tnp-footer">
2
  <div>
3
  <ul>
tnp-header.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
  global $current_user, $wpdb, $newsletter;
3
 
4
- if (!defined('ABSPATH')) exit;
5
-
6
  $dismissed = get_option('newsletter_dismissed', array());
7
 
8
  $user_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
@@ -24,7 +22,6 @@ function newsletter_print_entries($group) {
24
  }
25
  }
26
  }
27
-
28
  ?>
29
 
30
  <div class="tnp-drowpdown" id="tnp-header">
@@ -53,7 +50,7 @@ function newsletter_print_entries($group) {
53
  <small><?php _e('The subscription process in detail', 'newsletter') ?></small></a></li>
54
  <li><a href="?page=newsletter_wp_index"><i class="fa fa-wordpress"></i> <?php _e('WP Registration', 'newsletter') ?>
55
  <small><?php _e('Subscribe on WP registration', 'newsletter') ?></small></a></li>
56
- <li><a href="?page=newsletter_subscription_profile"><i class="fa fa-check-square-o"></i> <?php _e('Subscription Form Fields, Buttons, Labels', 'newsletter') ?>
57
  <small><?php _e('When and what data to collect', 'newsletter') ?></small></a></li>
58
  <li><a href="?page=newsletter_subscription_lists"><i class="fa fa-th-list"></i> <?php _e('Lists', 'newsletter') ?>
59
  <small><?php _e('Profile the subscribers for a better targeting', 'newsletter') ?></small></a></li>
@@ -98,7 +95,6 @@ function newsletter_print_entries($group) {
98
  ?>
99
  </ul>
100
  </li>
101
- <li><a href="?page=newsletter_main_status"><i class="fa fa-thermometer"></i> <?php _e('Status', 'newsletter') ?></a></li>
102
  <?php
103
  if (empty(Newsletter::instance()->options['contract_key'])) {
104
  ?>
@@ -110,12 +106,12 @@ function newsletter_print_entries($group) {
110
  <?php if (empty(Newsletter::instance()->options['licence_expires'])) { ?>
111
  <li class="tnp-professional-extensions-button-red">
112
  <a href="?page=newsletter_main_main">
113
- <i class="fa fa-hand-paper-o" style="color: white"></i> <?php _e('Licence not valid', 'newsletter') ?>
114
  </a>
115
  <?php } else { ?>
116
  <?php if (Newsletter::instance()->options['licence_expires'] > time()) { ?>
117
  <li class="tnp-professional-extensions-button">
118
- <a href="?page=newsletter_main_extensions">
119
  <i class="fa fa-check-square-o"></i> <?php _e('Licence active', 'newsletter') ?>
120
  </a>
121
  <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
@@ -181,7 +177,7 @@ function newsletter_print_entries($group) {
181
  </div>
182
  <?php } ?>
183
 
184
- <?php if (NEWSLETTER_DEBUG || !isset($dismissed['newsletter-page']) && empty(NewsletterSubscription::instance()->options['page'])) { ?>
185
  <div class="tnp-notice">
186
  <a href="<?php echo $_SERVER['REQUEST_URI'] . '&noheader=1&dismiss=newsletter-page' ?>" class="tnp-dismiss">&times;</a>
187
 
@@ -191,6 +187,28 @@ function newsletter_print_entries($group) {
191
  </div>
192
  <?php } ?>
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  <div id="tnp-notification">
195
  <?php Newsletter::instance()->warnings(); ?>
196
  <?php
1
  <?php
2
  global $current_user, $wpdb, $newsletter;
3
 
 
 
4
  $dismissed = get_option('newsletter_dismissed', array());
5
 
6
  $user_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
22
  }
23
  }
24
  }
 
25
  ?>
26
 
27
  <div class="tnp-drowpdown" id="tnp-header">
50
  <small><?php _e('The subscription process in detail', 'newsletter') ?></small></a></li>
51
  <li><a href="?page=newsletter_wp_index"><i class="fa fa-wordpress"></i> <?php _e('WP Registration', 'newsletter') ?>
52
  <small><?php _e('Subscribe on WP registration', 'newsletter') ?></small></a></li>
53
+ <li><a href="?page=newsletter_subscription_profile"><i class="fa fa-check-square-o"></i> <?php _e('Subscription Form Fields', 'newsletter') ?>
54
  <small><?php _e('When and what data to collect', 'newsletter') ?></small></a></li>
55
  <li><a href="?page=newsletter_subscription_lists"><i class="fa fa-th-list"></i> <?php _e('Lists', 'newsletter') ?>
56
  <small><?php _e('Profile the subscribers for a better targeting', 'newsletter') ?></small></a></li>
95
  ?>
96
  </ul>
97
  </li>
 
98
  <?php
99
  if (empty(Newsletter::instance()->options['contract_key'])) {
100
  ?>
106
  <?php if (empty(Newsletter::instance()->options['licence_expires'])) { ?>
107
  <li class="tnp-professional-extensions-button-red">
108
  <a href="?page=newsletter_main_main">
109
+ <i class="fa fa-hand-paper-o" style="color: white"></i> <?php _e('Licence expired or not valid', 'newsletter') ?>
110
  </a>
111
  <?php } else { ?>
112
  <?php if (Newsletter::instance()->options['licence_expires'] > time()) { ?>
113
  <li class="tnp-professional-extensions-button">
114
+ <a href="?page=newsletter_main_main">
115
  <i class="fa fa-check-square-o"></i> <?php _e('Licence active', 'newsletter') ?>
116
  </a>
117
  <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
177
  </div>
178
  <?php } ?>
179
 
180
+ <?php if (NEWSLETTER_DEBUG || !isset($dismissed['newsletter-page']) && empty(NewsletterSubscription::instance()->options['url'])) { ?>
181
  <div class="tnp-notice">
182
  <a href="<?php echo $_SERVER['REQUEST_URI'] . '&noheader=1&dismiss=newsletter-page' ?>" class="tnp-dismiss">&times;</a>
183
 
187
  </div>
188
  <?php } ?>
189
 
190
+ <?php if (!isset($dismissed['wpmail'])) { ?>
191
+ <div class="tnp-notice">
192
+ <a href="<?php echo $_SERVER['REQUEST_URI'] . '&noheader=1&dismiss=wpmail' ?>" class="tnp-dismiss">&times;</a>
193
+
194
+ Important change: now Newsletter sends emails using WordPress! <a href="http://www.thenewsletterplugin.com/configuration-tnin-send-email" target="_blank">Read more</a>.
195
+
196
+ </div>
197
+ <?php } ?>
198
+
199
+ <?php /*
200
+ if (isset($_GET['page']) && !Newsletter::instance()->has_license()) {
201
+ $p = $_GET['page'];
202
+ if (strpos($p, 'newsletter_reports') === 0 || strpos($p, 'newsletter_automated') === 0 || strpos($p, 'newsletter_feed') === 0 ||
203
+ strpos($p, 'newsletter_followup') === 0 || strpos($p, 'newsletter_autoresponder') === 0 || strpos($p, 'newsletter_sendgrid') === 0) {
204
+ ?>
205
+ <div class="tnp-notice">
206
+ You have not set your licence
207
+ </div>
208
+ <?php
209
+ }
210
+ } */
211
+ ?>
212
  <div id="tnp-notification">
213
  <?php Newsletter::instance()->warnings(); ?>
214
  <?php
trunk/admin.css ADDED
@@ -0,0 +1,1120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ @import url(//fonts.googleapis.com/css?family=Montserrat:400,700);
3
+ @import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:700);
4
+ @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css);
5
+ @import url(css/dropdown.css);
6
+ @import url(css/jquery-ui/jquery-ui.css);
7
+ @import url(statistics/css/tnp-statistics.css);
8
+
9
+ /* Bootstrap like */
10
+
11
+ #tnp-wrap * {
12
+ -webkit-box-sizing: border-box;
13
+ -moz-box-sizing: border-box;
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ #tnp-wrap *:before,
18
+ #tnp-wrap *:after {
19
+ -webkit-box-sizing: border-box;
20
+ -moz-box-sizing: border-box;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ /*.row {
25
+ margin-right: -15px;
26
+ margin-left: -15px;
27
+ }*/
28
+
29
+ .row:before,
30
+ .row:after {
31
+ display: table;
32
+ content: " ";
33
+ }
34
+ .row:after {
35
+ clear: both;
36
+ }
37
+ .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
38
+ position: relative;
39
+ min-height: 1px;
40
+ padding-right: 15px;
41
+ padding-left: 15px;
42
+ }
43
+ .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
44
+ float: left;
45
+ }
46
+ .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
47
+ float: left;
48
+ }
49
+ .col-md-12 {width: 100%;}
50
+ .col-md-11 {width: 91.66666667%;}
51
+ .col-md-10 {width: 83.33333333%;}
52
+ .col-md-9 {width: 75%;}
53
+ .col-md-8 {width: 66.66666667%;}
54
+ .col-md-7 {width: 58.33333333%;}
55
+ .col-md-6 {width: 50%;}
56
+ .col-md-5 {width: 41.66666667%;}
57
+ .col-md-4 {width: 33.33333333%;}
58
+ .col-md-3 {width: 25%;}
59
+ .col-md-2 {width: 16.66666667%;}
60
+ .col-md-1 {width: 8.33333333%;}
61
+ .col-md-pull-12 {right: 100%;}
62
+ .col-md-pull-11 {right: 91.66666667%;}
63
+ .col-md-pull-10 {right: 83.33333333%;}
64
+ .col-md-pull-9 {right: 75%;}
65
+ .col-md-pull-8 {right: 66.66666667%;}
66
+ .col-md-pull-7 {right: 58.33333333%;}
67
+ .col-md-pull-6 {right: 50%;}
68
+ .col-md-pull-5 {right: 41.66666667%;}
69
+ .col-md-pull-4 {right: 33.33333333%;}
70
+ .col-md-pull-3 {right: 25%;}
71
+ .col-md-pull-2 {right: 16.66666667%;}
72
+ .col-md-pull-1 {right: 8.33333333%;}
73
+ .col-md-pull-0 {right: auto;}
74
+ .col-md-push-12 {left: 100%;}
75
+ .col-md-push-11 {left: 91.66666667%;}
76
+ .col-md-push-10 {left: 83.33333333%;}
77
+ .col-md-push-9 {left: 75%;}
78
+ .col-md-push-8 {left: 66.66666667%;}
79
+ .col-md-push-7 {left: 58.33333333%;}
80
+ .col-md-push-6 {left: 50%;}
81
+ .col-md-push-5 {left: 41.66666667%;}
82
+ .col-md-push-4 {left: 33.33333333%;}
83
+ .col-md-push-3 {left: 25%;}
84
+ .col-md-push-2 {left: 16.66666667%;}
85
+ .col-md-push-1 {left: 8.33333333%;}
86
+ .col-md-push-0 {left: auto;}
87
+ .col-md-offset-12 {margin-left: 100%;}
88
+ .col-md-offset-11 {margin-left: 91.66666667%;}
89
+ .col-md-offset-10 {margin-left: 83.33333333%;}
90
+ .col-md-offset-9 {margin-left: 75%;}
91
+ .col-md-offset-8 {margin-left: 66.66666667%;}
92
+ .col-md-offset-7 {margin-left: 58.33333333%;}
93
+ .col-md-offset-6 {margin-left: 50%;}
94
+ .col-md-offset-5 {margin-left: 41.66666667%;}
95
+ .col-md-offset-4 {margin-left: 33.33333333%;}
96
+ .col-md-offset-3 {margin-left: 25%;}
97
+ .col-md-offset-2 {margin-left: 16.66666667%;}
98
+ .col-md-offset-1 {margin-left: 8.33333333%;}
99
+ .col-md-offset-0 {margin-left: 0;}
100
+
101
+
102
+ /* jQuery UI tab patch */
103
+ .ui-widget-header {
104
+ background: none;
105
+ border: 0;
106
+ border-bottom: 1px solid #ddd;
107
+ }
108
+
109
+ /* HEADER *********************************************************************/
110
+ #tnp-header {
111
+ text-align: left;
112
+ font-size: 12px;
113
+ xheight: 110px;
114
+ color: #fff;
115
+ font-family: "Montserrat",sans-serif;
116
+ }
117
+
118
+ #tnp-header input {
119
+ font-size: 12px;
120
+ }
121
+
122
+ #tnp-header a {
123
+ text-decoration: none;
124
+ /*font-family: "Montserrat",sans-serif;*/
125
+ color: white;
126
+ letter-spacing: 0.1em;
127
+ }
128
+
129
+ #tnp-header a:hover {
130
+ color: #fff;
131
+ }
132
+
133
+ .error a, .error a:hover {
134
+ color: #000!important;
135
+ }
136
+
137
+ .updated a, .updated a:hover {
138
+ color: #000!important;
139
+ }
140
+
141
+ .tnp-error {
142
+ border-left: 5px solid #dd0000;
143
+ background-color: #fff;
144
+ padding: 10px;
145
+ margin: 15px 0;
146
+ }
147
+
148
+ .tnp-warning {
149
+ border-left: 5px solid #ffb900;
150
+ background-color: #fff;
151
+ padding: 10px;
152
+ margin: 15px 0;
153
+ }
154
+
155
+ .tnp-message {
156
+ border-left: 5px solid #46b450;
157
+ background-color: #fff;
158
+ padding: 10px;
159
+ margin: 15px 0;
160
+ }
161
+
162
+ /* Admin header for extensions */
163
+ #newsletter-header-ext {
164
+ text-align: left;
165
+ background-color: #fff;
166
+ padding: 10px;
167
+ font-size: 12px;
168
+ border: 1px solid #ccc;
169
+ float: right;
170
+ width: 300px;
171
+ }
172
+
173
+ #newsletter-header-ext a {
174
+ margin-right: 10px;
175
+ text-decoration: none;
176
+ }
177
+
178
+ #newsletter-path {
179
+
180
+ }
181
+
182
+ #newsletter-nav {
183
+ margin-bottom: 15px;
184
+ }
185
+
186
+ .newsletter-separator {
187
+ clear: both;
188
+ height: 5px;
189
+ }
190
+
191
+ /*
192
+ .tnp-wrap, .tnp-wrap td, .tnp-wrap th, .tnp-wrap input, .tnp-wrap textarea {
193
+ font-size: 13px;
194
+ font-family: sans-serif;
195
+ line-height: 130%;
196
+ }
197
+ */
198
+
199
+ .tnp-wrap select {
200
+ height: auto;
201
+ vertical-align: initial;
202
+ }
203
+ .tnp-wrap {
204
+ /*background-color: white;*/
205
+ /*padding: 10px;*/
206
+ }
207
+
208
+ .tnp-wrap td a {
209
+ text-decoration: underline;
210
+ }
211
+
212
+ .tnp-wrap a {
213
+ font-weight: bold;
214
+ }
215
+
216
+ .tnp-wrap h2 {
217
+ }
218
+
219
+ .tnp-wrap h3 {
220
+ }
221
+
222
+ .tnp-wrap h4 {
223
+ }
224
+
225
+ .tnp-wrap h5 {
226
+
227
+ }
228
+
229
+ .tnp-wrap ul li {
230
+ margin-left: 20px;
231
+ list-style-type: disc;
232
+ }
233
+
234
+ .form-table {
235
+ background-color: #fff;
236
+ border: 1px solid #ddd;
237
+ }
238
+
239
+ .form-table th {
240
+ text-align: right;
241
+ font-weight: bold;
242
+ border-right: 1px solid #ddd;
243
+ max-width: 200px;
244
+ color: #000000;
245
+ }
246
+ .form-table th small {
247
+ font-weight: normal;
248
+ }
249
+
250
+ .widefat th {
251
+ text-align: left;
252
+ }
253
+
254
+
255
+ p.submit {
256
+ margin-top: 5px;
257
+ padding: 5px;
258
+ }
259
+
260
+ .bordered-table {
261
+ border-collapse: collapse;
262
+ }
263
+
264
+ .bordered-table td, .bordered-table th {
265
+ border: 1px solid #ccc;
266
+ padding: 3px;
267
+ }
268
+
269
+ .newsletter-button {
270
+ font-size: 10px;
271
+ }
272
+ table.clicks td {
273
+ border: 1px solid #666;
274
+ padding: 2px;
275
+ font-size: 10px;
276
+ }
277
+
278
+ table.clicks {
279
+ border-collapse: collapse;
280
+ }
281
+
282
+ .grid {
283
+ border-collapse: collapse;
284
+ }
285
+ .grid td, .grid th {
286
+ padding: 10px;
287
+ border: 1px solid #ddd;
288
+ margin: 0;
289
+ }
290
+ .grid th {
291
+ background-color: #aaa;
292
+ }
293
+
294
+ .form-table textarea {
295
+ width: 100%;
296
+ }
297
+
298
+ .hints {
299
+ xborder: 1px solid #e4e4ee;
300
+ xbackground-color: #f4f4ff;
301
+ xpadding: 5px;
302
+ margin-top: 10px;
303
+ xborder-radius: 4px 4px;
304
+ font-size: 13px;
305
+ color: #666;
306
+ font-style: italic;
307
+ xbackground-color: #fcf8e3;
308
+ xborder-color: #faebcc;
309
+ }
310
+
311
+ .intro {
312
+ font-size: 11px;
313
+ margin: 6px 6px 8px;
314
+ }
315
+
316
+
317
+ .newsletter-badge {
318
+ color: #fff;
319
+ background-color: #666;
320
+ border-radius: 5px;
321
+ padding: 1px 5px;
322
+ }
323
+
324
+ .newsletter-checkbox-group, .nl-checkbox-group {
325
+ float: left;
326
+ margin-right: 5px;
327
+ border: 1px solid #ccc;
328
+ background-color: #f4f4f4;
329
+ margin-bottom: 5px;
330
+ padding: 5px;
331
+ white-space: nowrap;
332
+ overflow: hidden;
333
+ }
334
+
335
+ /* Checkbox group */
336
+ .newsletter-checkboxes-item {
337
+ float: left;
338
+ margin-right: 5px;
339
+ border: 1px solid #ddd;
340
+ border-radius: 3px;
341
+ background-color: #f4f4f4;
342
+ width: 150px;
343
+ margin-bottom: 5px;
344
+ padding: 3px;
345
+ white-space: nowrap;
346
+ overflow: hidden;
347
+ }
348
+
349
+ .newsletter-checkboxes-item input {
350
+ vertical-align: text-bottom;
351
+ }
352
+
353
+ .newsletter-checkboxes-item label {
354
+ display: inline;
355
+ }
356
+
357
+ .newsletter-preferences-item {
358
+ float: left;
359
+ margin-right: 5px;
360
+ border: 1px solid #ccc;
361
+ background-color: #f4f4f4;
362
+ width: 250px;
363
+ margin-bottom: 5px;
364
+ padding: 5px;
365
+ white-space: nowrap;
366
+ overflow: hidden;
367
+ }
368
+
369
+ .newsletter-preferences-item label {
370
+ display: inline;
371
+ }
372
+
373
+ .form-table td .nl-checkbox-group label {
374
+ display: inline;
375
+ }
376
+
377
+ .ui-tabs .ui-tabs-nav li a {
378
+ font-size: 12px;
379
+ }
380
+
381
+
382
+
383
+ .widefat td, .widefat th {
384
+ vertical-align: middle;
385
+ }
386
+
387
+ /*
388
+ .form-table td label {
389
+ font-size: 10px;
390
+ display: block;
391
+ }
392
+ */
393
+
394
+ .tnp-notice {
395
+ padding: 15px;
396
+ margin: 10px 0;
397
+ padding-right: 70px;
398
+ position: relative;
399
+ border: 1px sold #eee;
400
+ background-color: #fff;
401
+ color: #444;
402
+ font-size: 15px;
403
+ }
404
+
405
+ .tnp-notice a {
406
+ color: #0073aa;
407
+ text-decoration: none;
408
+ font-weight: bold;
409
+ }
410
+
411
+ .tnp-notice a.tnp-dismiss {
412
+ display: block;
413
+ position: absolute;
414
+ right: 10px;
415
+ top: 13px;
416
+ font-size: 25px;
417
+ text-decoration: none;
418
+ color: #666;
419
+ }
420
+
421
+ .newsletter-message {
422
+ background-color: #efe;
423
+ border-color: #393;
424
+ border-radius: 5px;
425
+ border-style: solid;
426
+ border-width: 3px;
427
+ padding: .6em;
428
+ margin-bottom: .6em;
429
+ }
430
+
431
+ .newsletter-error-span {
432
+ color: #f00;
433
+ font-weight: bold;
434
+ }
435
+
436
+ .newsletter-error {
437
+ background-color: #fee;
438
+ border-color: #933;
439
+ border-radius: 5px;
440
+ border-style: solid;
441
+ border-width: 2px;
442
+ padding: .6em;
443
+ margin-bottom: .6em;
444
+ }
445
+
446
+ .newsletter-error strong, .newsletter-message strong {
447
+ font-weight: bold;
448
+ }
449
+
450
+ #newsletter-warnings {
451
+ background-color: #FFEBE8;
452
+ border-color: #C00;
453
+ border-radius: 3px;
454
+ border-style: solid;
455
+ border-width: 1px;
456
+ padding: .6em;
457
+ margin-bottom: .6em;
458
+ }
459
+
460
+ .newsletter-buttons {
461
+ margin-top: 1em;
462
+ margin-bottom: 1em;
463
+ }
464
+
465
+ .newsletter-buttons-bottom {
466
+ }
467
+
468
+ .newsletter-buttons-top {
469
+ }
470
+
471
+ /* Text under the panel title to explain the panel purpose. */
472
+ /*
473
+ .preamble {
474
+ margin-bottom: 15px;
475
+ border-radius: 3px;
476
+ background-color: #f4f4f4;
477
+ padding: 10px;
478
+ background-image: url("images/preamble.png");
479
+ background-repeat: no-repeat;
480
+ background-position: left;
481
+ padding-left: 65px;
482
+ font-size: 13px;
483
+ font-family: sans-serif;
484
+ }
485
+
486
+ .preamble p {
487
+ margin: 0;
488
+ }
489
+ */
490
+
491
+ .newsletter-preamble {
492
+ margin-bottom: 15px;
493
+ xborder-radius: 3px;
494
+ xbackground-color: #f4f4f4;
495
+ xpadding: 10px;
496
+ xbackground-image: url("images/preamble.png");
497
+ xbackground-repeat: no-repeat;
498
+ xbackground-position: left;
499
+ xpadding-left: 65px;
500
+ font-size: 13px;
501
+ xfont-family: sans-serif;
502
+ }
503
+
504
+ .newsletter-preamble p {
505
+ margin: 0;
506
+ }
507
+
508
+ .tab-preamble {
509
+ font-size: 13px;
510
+ line-height: normal;
511
+ xfont-family: sans-serif;
512
+ xcolor: #3a87ad;
513
+ xbackground-color: #d9edf7;
514
+ xborder: 1px solid #bce8f1;
515
+ xpadding: 15px;
516
+ xmargin-bottom: 20px;
517
+ xborder-radius: 4px;
518
+ }
519
+
520
+ .tab-preamble p {
521
+ margin: 0 0 5px 0;
522
+ }
523
+
524
+ .tnp-paginator {
525
+ margin-top: 10px;
526
+ margin-bottom: 5px;
527
+ }
528
+
529
+ .newsletter-option-grid th {
530
+ text-align: right;
531
+ width: auto;
532
+ border: 0;
533
+ padding: 3px;
534
+ font-weight: normal;
535
+ vertical-align: top;
536
+ padding-right: 15px;
537
+ }
538
+ .newsletter-option-grid td {
539
+ border: 0;
540
+ padding: 3px;
541
+ vertical-align: top;
542
+ }
543
+
544
+ .newsletter-box {
545
+ border: 1px solid #ddd;
546
+ padding: 10px;
547
+ background-color: #fafafa;
548
+ margin-bottom: 15px;
549
+ }
550
+
551
+ .newsletter-box h3 {
552
+ margin-top: 0;
553
+ }
554
+
555
+ .newsletter-textarea-preview {
556
+ border: 1px solid #ddd;
557
+ }
558
+
559
+ .tnp-tab-notice {
560
+ background-color: #fff;
561
+ border: 1px solid #eee;
562
+ border-left: 3px solid gray;
563
+ padding: 10px;
564
+ margin: 10px 0;
565
+ color: #444;
566
+ }
567
+
568
+ .tnp-tab-warning {
569
+ background-color: #fff;
570
+ border: 1px solid #eee;
571
+ border-left: 3px solid orange;
572
+ padding: 10px;
573
+ margin: 10px 0;
574
+ color: #444;
575
+ }
576
+
577
+ .tnp-tab-success {
578
+ background-color: #fff;
579
+ border: 1px solid #eee;
580
+ border-left: 3px solid green;
581
+ padding: 10px;
582
+ margin: 10px 0;
583
+ color: #444;
584
+ }
585
+
586
+ .tnp-tab-error {
587
+ background-color: #fff;
588
+ border: 1px solid #eee;
589
+ border-left: 3px solid red;
590
+ padding: 10px;
591
+ margin: 10px 0;
592
+ color: #444;
593
+ }
594
+
595
+ .tnp-wrap a[target=_blank] {
596
+ }
597
+
598
+ /* .tnp-wrap a[target=_blank]:after {
599
+ content: "»";
600
+ }*/
601
+
602
+
603
+ /* CSS The Newsletter Team */
604
+
605
+ /* CSS Tips */
606
+
607
+ .tnp-tip {
608
+ margin-top: 5px;
609
+ }
610
+
611
+ .tip-button {
612
+ padding: 0px 5px;
613
+ color: #FD5F65;
614
+ text-transform: uppercase;
615
+ letter-spacing: 0.2em;
616
+ /*font-family: "Montserrat";*/
617
+ font-size: 10px;
618
+ border: 1px red solid;
619
+ }
620
+
621
+ .tip-content {
622
+ /*font-family: "Montserrat";*/
623
+ font-weight: 500;
624
+ font-size: 11px;
625
+ color: #999999;
626
+ }
627
+
628
+ /* CSS General Font Styles */
629
+
630
+ .tnp-wrap p {
631
+ /*font-family: "Montserrat";*/
632
+ font-weight: 400;
633
+ }
634
+
635
+ p.description {
636
+ font-size: 12px !important;
637
+ }
638
+
639
+
640
+ /* CSS Themes Preview */
641
+
642
+ .tnp-theme-preview {
643
+ display: inline-block;
644
+ text-align: center;
645
+ }
646
+
647
+ .tnp-theme-preview p {
648
+ /*font-family: "Montserrat";*/
649
+ font-size: 11px;
650
+ letter-spacing: 0.2em;
651
+ text-transform: uppercase;
652
+ color: #fff;
653
+ }
654
+
655
+ .tnp-theme-preview img:hover {
656
+ border: 5px solid #FD5F65;
657
+ border-radius: 10px;
658
+ padding: 5px;
659
+ background-color: #FD5F65;
660
+ }
661
+
662
+ .tnp-theme-preview img {
663
+ border: 5px solid transparent;
664
+ border-radius: 10px;
665
+ padding: 5px;
666
+ }
667
+
668
+
669
+ .tnp-header-logo {
670
+ margin-left: 10px;
671
+ }
672
+
673
+ /* Stefano 4.0 */
674
+
675
+ .ui-tabs {
676
+ border-color: #ddd;
677
+ background-color: #f2f2f2;
678
+ border: 0;
679
+ }
680
+
681
+ .ui-tabs .ui-tabs-nav {
682
+ margin: 0;
683
+ padding: .2em .2em 0 0;
684
+ background-color: #f2f2f2;
685
+ }
686
+
687
+ .ui-tabs .ui-tabs-panel {
688
+ padding: 1em 0;
689
+ background-color: #f2f2f2;
690
+ margin: 0;
691
+ border: 0;
692
+ }
693
+
694
+ /* Altrimenti si crea una striscia bianca in mezzo alla pagina! */
695
+
696
+
697
+ .wp-core-ui .button-primary {
698
+ background-color: #2b2f3a;
699
+ color: #fff;
700
+ }
701
+
702
+
703
+ /* Regole Generali*/
704
+
705
+ #tnp-body {
706
+ padding: 10px;
707
+ background-color: #34495E;
708
+ border-radius: 5px;
709
+ border-color: #34495E;
710
+ border-width: 10px;
711
+ border-style: solid;
712
+ }
713
+
714
+ .tnp-darkbg {
715
+ background-color: #34495E!important;
716
+ }
717
+
718
+ #tnp-body h3 {
719
+ margin-top: 15px;
720
+ clear: both;
721
+ }
722
+
723
+ .tnp-body-lite {
724
+ background-color: #F1F1F1 !important;
725
+ }
726
+
727
+
728
+ /* Header & Sub-header Pannelli */
729
+
730
+ #tnp-heading {
731
+ padding: 10px;
732
+ background-color: #34495E;
733
+ margin-bottom: 10px;
734
+ border-radius: 5px;
735
+ }
736
+
737
+ #tnp-heading a {
738
+ color: #fff;
739
+ font-weight: bold;
740
+ border-bottom: 1.5px solid #fff;
741
+ text-decoration: none;
742
+ }
743
+
744
+ #tnp-heading a:hover {
745
+ color: #27AE60;
746
+ border-bottom: 1.5px solid #27AE60;
747
+ }
748
+
749
+ #tnp-heading div p {
750
+ color: #666;
751
+ }
752
+
753
+ #tnp-heading h2 {
754
+ color: #fff;
755
+ font-family: "Montserrat", sans-serif;
756
+ letter-spacing: 0.1rem;
757
+ font-size: 1.1rem;
758
+ line-height: 1.8rem;
759
+ text-transform: uppercase;
760
+ vertical-align: middle;
761
+ font-weight: 700;
762
+ padding: 0;
763
+ margin: 0px;
764
+ }
765
+
766
+ #tnp-heading p {
767
+ margin: 0px;
768
+ color: #fff;
769
+ }
770
+
771
+ #tnp-heading .tnp-btn-h1 {
772
+ color: #fff;
773
+ background-color: #3498db;
774
+ border-radius: 3px;
775
+ padding: 6px 11px;
776
+ text-decoration: none;
777
+ text-transform: capitalize;
778
+ font-family: "Montserrat", sans-serif;
779
+ margin-left: 10px;
780
+ font-size: 0.75rem;
781
+ font-weight: 300;
782
+ border: none;
783
+ }
784
+
785
+ #tnp-heading .tnp-btn-h1:hover {
786
+ color: #fff;
787
+ background-color: #5DADE2;
788
+ -webkit-transition: background-color .25s linear;
789
+ transition: background-color .25s linear;
790
+ -webkit-font-smoothing: subpixel-antialiased;
791
+ border: none;
792
+ color: #fff;
793
+ }
794
+
795
+ .tnp-widget {
796
+ width: 100%;
797
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
798
+ background: #fff;
799
+ min-height: 350px;
800
+ }
801
+
802
+ /* Widget title */
803
+ .tnp-widget h3 {
804
+ font-family: "Montserrat", sans-serif;
805
+ letter-spacing: 0.05rem;
806
+ background-color: #2980B9;
807
+ color: #fff;
808
+ margin: 15px 0px;
809
+ padding: 9px;
810
+ border: 0;
811
+ font-size: 14px;
812
+ font-weight: 400;
813
+ }
814
+
815
+ /* Widget title button */
816
+ .tnp-widget h3 a {
817
+ float: right;
818
+ color: white;
819
+ text-decoration: none;
820
+ margin-left: 5px;
821
+ padding: 2px 8px;
822
+ background-color: #26C281;
823
+ border-radius: 2px;
824
+ font-weight: 300;
825
+ text-transform: capitalize;
826
+ font-size: 0.8rem;
827
+ }
828
+
829
+ /* Widget title button hover */
830
+ .tnp-widget h3 a:hover {
831
+ color: white;
832
+ text-decoration: none;
833
+ margin-left: 5px;
834
+ background-color: #2ECC71;
835
+ }
836
+
837
+ .tnp-widget .inside p, .tnp-widget .inside li {
838
+ font-size: 12px;
839
+ margin: 10px;
840
+ }
841
+
842
+ .tnp-widget .inside ul {
843
+ list-style-type: circle;
844
+ list-style-position: inside;
845
+ }
846
+
847
+
848
+
849
+ /* Dashboard Box */
850
+
851
+ .postbox {
852
+ border: none;
853
+ }
854
+
855
+ .postbox h3 a {
856
+ float: right;
857
+
858
+ }
859
+
860
+
861
+ #dashboard-widgets .postbox-container {
862
+ width: 33.333%
863
+ }
864
+
865
+ #dashboard-widgets .postbox-container .postbox h3 {
866
+ font-family: "Montserrat", sans-serif;
867
+ letter-spacing: 0.05rem;
868
+ background-color: #415b76;
869
+ color: #fff;
870
+ margin: 15px 0px;
871
+ padding: 9px;
872
+ }
873
+
874
+ #dashboard-widgets .postbox-container h3 a {
875
+ color: white;
876
+ text-decoration: none;
877
+ margin-left: 5px;
878
+ padding: 2px 8px;
879
+ background-color: #26C281;
880
+ border-radius: 2px;
881
+ font-weight: 300;
882
+ text-transform: capitalize;
883
+ font-size: 0.8rem;
884
+ }
885
+
886
+ #dashboard-widgets .postbox-container h3 a:hover {
887
+ color: white;
888
+ text-decoration: none;
889
+ margin-left: 5px;
890
+ background-color: #2ECC71;
891
+ }
892
+
893
+ .postbox-container i {
894
+ margin-right: 3px;
895
+ }
896
+ #tnp-dash-newsletters tr td:last-of-type {
897
+ width: 80px;
898
+ text-align: right;
899
+ }
900
+
901
+ #tnp-dash-subscribers tr td:last-of-type {
902
+ width: 80px;
903
+ text-align: right;
904
+ }
905
+
906
+ #tnp-dash-subscribers tr td:first-of-type {
907
+ width: 250px;
908
+ overflow: hidden;
909
+ }
910
+
911
+ #tnp-dash-subscribers table {
912
+ table-layout: fixed;
913
+ }
914
+
915
+ #tnp-dash-documentation .inside div {
916
+ margin-top: 10px;
917
+ }
918
+
919
+ #tnp-dash-documentation .inside a {
920
+ text-decoration: none;
921
+ color: #fff;
922
+ display: block;
923
+ font-family: "Montserrat", sans-serif;
924
+ padding: 5px 10px;
925
+ }
926
+
927
+
928
+ /* Footer */
929
+
930
+ #tnp-footer div {
931
+ width: 33%;
932
+ display: inline-block;
933
+ }
934
+
935
+ #tnp-footer {
936
+ margin-top: 10px;
937
+ padding: 20px 10px 10px 40px;
938
+ background-color: #34495E;
939
+ border-radius: 5px;
940
+ font-family: "Montserrat", sans-serif;
941
+ }
942
+
943
+ #tnp-footer a {
944
+ color: #fff;
945
+ text-decoration: none;
946
+ }
947
+
948
+ #tnp-footer a:hover {
949
+ color: #BDC3C7;
950
+ }
951
+
952
+ #tnp-footer input[type="submit"] {
953
+ background-color: #2ECC71;
954
+ border: none;
955
+ padding: 5px;
956
+ color: #fff;
957
+ }
958
+
959
+ #tnp-footer form {
960
+ white-space: nowrap;
961
+ }
962
+
963
+ #tnp-footer li {
964
+ display: inline;
965
+ margin-left: 15px;
966
+ padding: 2px 5px;
967
+ border-left: 3px solid #2ECC71;
968
+ }
969
+
970
+ /* Wrapper Background */
971
+
972
+ #wpwrap {
973
+ background-color: #2C3E50;
974
+ }
975
+
976
+ /* Global buttons styles */
977
+
978
+ #dashboard-widgets .button {
979
+ border: none;
980
+ background: none;
981
+ box-shadow: none;
982
+ color: #322C39;
983
+ }
984
+
985
+ #dashboard-widgets .button:hover {
986
+ background-color: #ECF0F1;
987
+ }
988
+
989
+ .wp-core-ui .button-secondary, .wp-core-ui .button, .wp-core-ui .button-primary {
990
+ background-color: #3498db;
991
+ border: none;
992
+ box-shadow: none;
993
+ color: #fff;
994
+ font-family: 'Montserrat',sans-serif;
995
+ margin: 0px 2px;
996
+ }
997
+
998
+ .wp-core-ui .button-secondary:hover, .wp-core-ui .button:hover, .wp-core-ui .button-primary:hover {
999
+ background-color: #5DADE2;
1000
+ color: #fff;
1001
+ }
1002
+
1003
+ span.wp-media-buttons-icon:before {
1004
+ color: #fff;
1005
+ }
1006
+
1007
+ .tnp-paginator [value="Go"] {
1008
+ background-color: #27AE60;
1009
+ }
1010
+
1011
+ .tnp-paginator [value="Go"]:hover {
1012
+ background-color: #2ECC71;
1013
+ }
1014
+
1015
+ .notice-dismiss {
1016
+ padding: 3px;
1017
+ }
1018
+
1019
+ /*.widefat .button-secondary {
1020
+ background: none;
1021
+ color: #3498db;
1022
+ }*/
1023
+
1024
+ /* Paginator */
1025
+
1026
+ .tnp-paginator {
1027
+ color: #fff;
1028
+ font-family: "Montserrat",sans-serif;
1029
+ margin: 10px 0px;
1030
+ }
1031
+
1032
+ .tnp-paginator .button-secondary {
1033
+ padding: 5px;
1034
+ line-height: normal;
1035
+ height: auto;
1036
+ font-size: 12px;
1037
+ height: 25px;
1038
+ border: none;
1039
+ border-radius: 3px;
1040
+ vertical-align: baseline;
1041
+ }
1042
+
1043
+ .tnp-paginator [value="Go"] {
1044
+ background-color: #27AE60 !important;
1045
+ }
1046
+
1047
+ .tnp-paginator [value="Go"]:hover {
1048
+ background-color: #2ECC71 !important;
1049
+ }
1050
+
1051
+ .tnp-paginator input {
1052
+ background-color: #2C3E50;
1053
+ border: none;
1054
+ border-radius: 3px;
1055
+ color: #fff;
1056
+ padding: 5px;
1057
+ line-height: normal;
1058
+ font-size: 12px;
1059
+ height: 25px;
1060
+ }
1061
+
1062
+ /* Subscribers Search Box */
1063
+
1064
+ .tnp-subscribers-search {
1065
+ color: #fff;
1066
+ font-family: "Montserrat", sans-serif;
1067
+ background-color: #2C3E50;
1068
+ padding: 20px;
1069
+ border-radius: 5px;
1070
+ margin-bottom: 20px;
1071
+ display: inline-block;
1072
+ }
1073
+
1074
+ .tnp-subscribers-search select {
1075
+ margin-left: 5px;
1076
+ padding: none;
1077
+ line-height: inherit;
1078
+ }
1079
+
1080
+
1081
+ /* Responsive Video Embeds */
1082
+
1083
+ .tnp-video-container {
1084
+ position: relative;
1085
+ padding-bottom: 56.25%;
1086
+ padding-top: 30px; height: 0; overflow: hidden;
1087
+ }
1088
+
1089
+ .tnp-video-container iframe,
1090
+ .tnp-video-container object,
1091
+ .tnp-video-container embed {
1092
+ position: absolute;
1093
+ top: 0;
1094
+ left: 0;
1095
+ width: 100%;
1096
+ height: 100%;
1097
+ }
1098
+
1099
+
1100
+ /* Colors Palette */
1101
+
1102
+ .orange {
1103
+ background-color: #F39C12; /*Orange #F39C12 */
1104
+ }
1105
+
1106
+ .blue {
1107
+ background-color: #2980B9; /* Blue #2980B9 */
1108
+ }
1109
+
1110
+ .purple {
1111
+ background-color: #8E44AD; /* Purple #8E44AD */
1112
+ }
1113
+
1114
+ .notice a {
1115
+ color: #000 !important;
1116
+ }
1117
+
1118
+ .tnp-chart {
1119
+ border: 1px solid #eee;
1120
+ }
trunk/admin.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery.cookie = function(name, value, options) {
2
+ if (typeof value != 'undefined') { // name and value given, set cookie
3
+ options = options || {};
4
+ if (value === null) {
5
+ value = '';
6
+ options.expires = -1;
7
+ }
8
+ var expires = '';
9
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
10
+ var date;
11
+ if (typeof options.expires == 'number') {
12
+ date = new Date();
13
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
14
+ } else {
15
+ date = options.expires;
16
+ }
17
+ expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
18
+ }
19
+ // CAUTION: Needed to parenthesize options.path and options.domain
20
+ // in the following expressions, otherwise they evaluate to undefined
21
+ // in the packed version for some reason...
22
+ var path = options.path ? '; path=' + (options.path) : '';
23
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
24
+ var secure = options.secure ? '; secure' : '';
25
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
26
+ } else { // only name given, get cookie
27
+ var cookieValue = null;
28
+ if (document.cookie && document.cookie != '') {
29
+ var cookies = document.cookie.split(';');
30
+ for (var i = 0; i < cookies.length; i++) {
31
+ var cookie = jQuery.trim(cookies[i]);
32
+ // Does this cookie string begin with the name we want?
33
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
34
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
35
+ break;
36
+ }
37
+ }
38
+ }
39
+ return cookieValue;
40
+ }
41
+ };
trunk/api/add.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $key = stripslashes($_REQUEST['nk']);
8
+ if (empty($newsletter->options['api_key']) || $key != $newsletter->options['api_key']) {
9
+ die('Wrong API key');
10
+ }
11
+
12
+ if (!is_email($_REQUEST['ne'])) {
13
+ die('Wrong email');
14
+ }
15
+
16
+ $subscriber = array();
17
+ $subscriber['name'] = stripslashes($_REQUEST['nn']);
18
+ $subscriber['surname'] = stripslashes($_REQUEST['ns']);
19
+ $subscriber['email'] = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
20
+
21
+ if (is_array($_REQUEST['nl'])) {
22
+ foreach ($_REQUEST['nl'] as $add_list) {
23
+ $subscriber['list_' . $add_list] = 1;
24
+ }
25
+ }
26
+ else if (!empty($_REQUEST['nl'])) {
27
+ $add_lists = explode('|', $_REQUEST['nl']);
28
+ foreach ($add_lists as $add_list) {
29
+ $subscriber['list_' . $add_list] = 1;
30
+ }
31
+ }
32
+
33
+ $options_feed = get_option('newsletter_feed', array());
34
+ if ($options_feed['add_new'] == 1) $subscriber['feed'] = 1;
35
+
36
+ $options_followup = get_option('newsletter_followup', array());
37
+ if ($options_followup['add_new'] == 1) {
38
+ $subscriber['followup'] = 1;
39
+ $subscriber['followup_time'] = time() + $options_followup['interval'] * 3600;
40
+ }
41
+
42
+ $subscriber['status'] = 'C';
43
+
44
+ // TODO: add control for already subscribed emails
45
+ NewsletterUsers::instance()->save_user($subscriber);
46
+ die('ok');
trunk/api/delete.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $key = stripslashes($_REQUEST['nk']);
8
+ if (empty(trim($newsletter->options['api_key'])) || $key != $newsletter->options['api_key'])
9
+ die('Wrong API key');
10
+
11
+ $email = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
12
+ $r = $wpdb->query($wpdb->prepare("delete from " . NEWSLETTER_USERS_TABLE . " where email=%s", $email));
13
+ die($r = 0 ? 'ko' : 'ok');
trunk/css/dropdown.css ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .tnp-drowpdown ul, .tnp-drowpdown li {
2
+ margin: 0; padding: 0; border: 0;
3
+ }
4
+
5
+ .tnp-drowpdown li {
6
+ min-width: 150px;
7
+ }
8
+
9
+ .tnp-drowpdown {
10
+ margin-top: 10px;
11
+ -webkit-transition-timing-function: ease;
12
+ padding: 5px;
13
+ font-size: 12px;
14
+ margin-bottom: 10px;
15
+ color: #fff;
16
+ }
17
+
18
+ .tnp-drowpdown a {
19
+ text-decoration: none;
20
+ color: white;
21
+ letter-spacing: 0.1em;
22
+ }
23
+
24
+ .tnp-drowpdown a:hover {
25
+ color: #fff;
26
+ }
27
+
28
+ .tnp-drowpdown {
29
+ -webkit-transition: width 2s;
30
+ transition: width 2s;
31
+ }
32
+
33
+ .tnp-drowpdown ul ul {
34
+ display: none;
35
+ z-index: 10000;
36
+ }
37
+
38
+ .tnp-drowpdown ul li:hover > ul {
39
+ display: block;
40
+ }
41
+
42
+ .tnp-drowpdown ul {
43
+ padding: 0 20px;
44
+ list-style: none;
45
+ position: relative;
46
+ display: inline-table;
47
+ }
48
+ .tnp-drowpdown ul:after {
49
+ content: "";
50
+ clear: both;
51
+ display: block;
52
+ }
53
+
54
+ .tnp-drowpdown ul li {
55
+ float: left;
56
+ margin-left: 10px;
57
+ text-transform: uppercase;
58
+ -webkit-transition: all 0.2s ease-in-out;
59
+ -moz-transition: all 0.2s ease-in-out;
60
+ -o-transition: all 0.2s ease-in-out;
61
+ transition: all 0.2s ease-in-out;
62
+ }
63
+ .tnp-drowpdown ul li:hover {
64
+ background-color: #34495E;
65
+ /*border: 1px solid #34495E;*/
66
+ }
67
+ .tnp-drowpdown ul li:hover a {
68
+ }
69
+
70
+ .tnp-drowpdown ul li a {
71
+ display: block;
72
+ padding: 10px 10px;
73
+ text-decoration: none;
74
+ }
75
+
76
+ .tnp-drowpdown ul li a small {
77
+ display: block;
78
+ color: #afafaf;
79
+ }
80
+
81
+ .tnp-drowpdown ul ul {
82
+ background: #332D39;
83
+ border-radius: 0px;
84
+ padding: 0;
85
+ position: absolute;
86
+ }
87
+ .tnp-drowpdown ul ul li {
88
+ float: none;
89
+ position: relative;
90
+ margin-left: 0;
91
+ border: none;
92
+ text-transform: none;
93
+ line-height: 1.6em;
94
+ }
95
+
96
+
97
+ .tnp-drowpdown ul ul li:nth-child(even) {
98
+ background-color: #3b3342;
99
+ }
100
+
101
+
102
+
103
+ .tnp-drowpdown ul ul li:hover {
104
+ background: inherit;
105
+ }
106
+ .tnp-drowpdown ul ul li a {
107
+ padding: 5px 15px;
108
+ color: #fff;
109
+ }
110
+ .tnp-drowpdown ul ul li a:hover {
111
+ background: #34495E;
112
+ }
113
+
114
+ .tnp-drowpdown ul ul ul {
115
+ position: absolute; left: 100%; top:0;
116
+ }
117
+
118
+ .tnp-wrap ul li {
119
+ list-style-type: none;
120
+ }
121
+
122
+ .tnp-professional-extensions-button {
123
+ background-color: #27AE60;
124
+ border: 1px solid #27AE60 !important;
125
+ -webkit-transition: all 1s ease-in-out;
126
+ -moz-transition: all 1s ease-in-out;
127
+ -o-transition: all 1s ease-in-out;
128
+ transition: all 1s ease-in-out;
129
+ border-radius: 3px;
130
+ }
131
+
132
+ .tnp-professional-extensions-button:hover {
133
+ background-color: #2ECC71 !important;
134
+ border: 1px solid #2ECC71 !important;
135
+ }
136
+
137
+ .tnp-professional-extensions-button-red {
138
+ background-color: #C0392B;
139
+ border: 1px solid #C0392B !important;
140
+ -webkit-transition: all 1s ease-in-out;
141
+ -moz-transition: all 1s ease-in-out;
142
+ -o-transition: all 1s ease-in-out;
143
+ transition: all 1s ease-in-out;
144
+ border-radius: 3px;
145
+ }
146
+
147
+ .tnp-professional-extensions-button-red:hover {
148
+ background-color: #E74C3C !important;
149
+ border: 1px solid #E74C3C !important;
150
+ }
trunk/css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_highlight-soft_25_0073ea_1x100.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_highlight-soft_50_dddddd_1x100.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_0073ea_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_222222_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_454545_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_666666_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_888888_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_ff0084_256x240.png ADDED
Binary file
trunk/css/jquery-ui/images/ui-icons_ffffff_256x240.png ADDED
Binary file
trunk/css/jquery-ui/jquery-ui.css ADDED
@@ -0,0 +1,1225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.4 - 2015-12-31
2
+ * http://jqueryui.com
3
+ * Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0); /* support: IE8 */
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-draggable-handle {
90
+ -ms-touch-action: none;
91
+ touch-action: none;
92
+ }
93
+ .ui-resizable {
94
+ position: relative;
95
+ }
96
+ .ui-resizable-handle {
97
+ position: absolute;
98
+ font-size: 0.1px;
99
+ display: block;
100
+ -ms-touch-action: none;
101
+ touch-action: none;
102
+ }
103
+ .ui-resizable-disabled .ui-resizable-handle,
104
+ .ui-resizable-autohide .ui-resizable-handle {
105
+ display: none;
106
+ }
107
+ .ui-resizable-n {
108
+ cursor: n-resize;
109
+ height: 7px;
110
+ width: 100%;
111
+ top: -5px;
112
+ left: 0;
113
+ }
114
+ .ui-resizable-s {
115
+ cursor: s-resize;
116
+ height: 7px;
117
+ width: 100%;
118
+ bottom: -5px;
119
+ left: 0;
120
+ }
121
+ .ui-resizable-e {
122
+ cursor: e-resize;
123
+ width: 7px;
124
+ right: -5px;
125
+ top: 0;
126
+ height: 100%;
127
+ }
128
+ .ui-resizable-w {
129
+ cursor: w-resize;
130
+ width: 7px;
131
+ left: -5px;
132
+ top: 0;
133
+ height: 100%;
134
+ }
135
+ .ui-resizable-se {
136
+ cursor: se-resize;
137
+ width: 12px;
138
+ height: 12px;
139
+ right: 1px;
140
+ bottom: 1px;
141
+ }
142
+ .ui-resizable-sw {
143
+ cursor: sw-resize;
144
+ width: 9px;
145
+ height: 9px;
146
+ left: -5px;
147
+ bottom: -5px;
148
+ }
149
+ .ui-resizable-nw {
150
+ cursor: nw-resize;
151
+ width: 9px;
152
+ height: 9px;
153
+ left: -5px;
154
+ top: -5px;
155
+ }
156
+ .ui-resizable-ne {
157
+ cursor: ne-resize;
158
+ width: 9px;
159
+ height: 9px;
160
+ right: -5px;
161
+ top: -5px;
162
+ }
163
+ .ui-selectable {
164
+ -ms-touch-action: none;
165
+ touch-action: none;
166
+ }
167
+ .ui-selectable-helper {
168
+ position: absolute;
169
+ z-index: 100;
170
+ border: 1px dotted black;
171
+ }
172
+ .ui-sortable-handle {
173
+ -ms-touch-action: none;
174
+ touch-action: none;
175
+ }
176
+ .ui-accordion .ui-accordion-header {
177
+ display: block;
178
+ cursor: pointer;
179
+ position: relative;
180
+ margin: 2px 0 0 0;
181
+ padding: .5em .5em .5em .7em;
182
+ min-height: 0; /* support: IE7 */
183
+ font-size: 100%;
184
+ }
185
+ .ui-accordion .ui-accordion-icons {
186
+ padding-left: 2.2em;
187
+ }
188
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
189
+ padding-left: 2.2em;
190
+ }
191
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
192
+ position: absolute;
193
+ left: .5em;
194
+ top: 50%;
195
+ margin-top: -8px;
196
+ }
197
+ .ui-accordion .ui-accordion-content {
198
+ padding: 1em 2.2em;
199
+ border-top: 0;
200
+ overflow: auto;
201
+ }
202
+ .ui-autocomplete {
203
+ position: absolute;
204
+ top: 0;
205
+ left: 0;
206
+ cursor: default;
207
+ }
208
+ .ui-button {
209
+ display: inline-block;
210
+ position: relative;
211
+ padding: 0;
212
+ line-height: normal;
213
+ margin-right: .1em;
214
+ cursor: pointer;
215
+ vertical-align: middle;
216
+ text-align: center;
217
+ overflow: visible; /* removes extra width in IE */
218
+ }
219
+ .ui-button,
220
+ .ui-button:link,
221
+ .ui-button:visited,
222
+ .ui-button:hover,
223
+ .ui-button:active {
224
+ text-decoration: none;
225
+ }
226
+ /* to make room for the icon, a width needs to be set here */
227
+ .ui-button-icon-only {
228
+ width: 2.2em;
229
+ }
230
+ /* button elements seem to need a little more width */
231
+ button.ui-button-icon-only {
232
+ width: 2.4em;
233
+ }
234
+ .ui-button-icons-only {
235
+ width: 3.4em;
236
+ }
237
+ button.ui-button-icons-only {
238
+ width: 3.7em;
239
+ }
240
+
241
+ /* button text element */
242
+ .ui-button .ui-button-text {
243
+ display: block;
244
+ line-height: normal;
245
+ }
246
+ .ui-button-text-only .ui-button-text {
247
+ padding: .4em 1em;
248
+ }
249
+ .ui-button-icon-only .ui-button-text,
250
+ .ui-button-icons-only .ui-button-text {
251
+ padding: .4em;
252
+ text-indent: -9999999px;
253
+ }
254
+ .ui-button-text-icon-primary .ui-button-text,
255
+ .ui-button-text-icons .ui-button-text {
256
+ padding: .4em 1em .4em 2.1em;
257
+ }
258
+ .ui-button-text-icon-secondary .ui-button-text,
259
+ .ui-button-text-icons .ui-button-text {
260
+ padding: .4em 2.1em .4em 1em;
261
+ }
262
+ .ui-button-text-icons .ui-button-text {
263
+ padding-left: 2.1em;
264
+ padding-right: 2.1em;
265
+ }
266
+ /* no icon support for input elements, provide padding by default */
267
+ input.ui-button {
268
+ padding: .4em 1em;
269
+ }
270
+
271
+ /* button icon element(s) */
272
+ .ui-button-icon-only .ui-icon,
273
+ .ui-button-text-icon-primary .ui-icon,
274
+ .ui-button-text-icon-secondary .ui-icon,
275
+ .ui-button-text-icons .ui-icon,
276
+ .ui-button-icons-only .ui-icon {
277
+ position: absolute;
278
+ top: 50%;
279
+ margin-top: -8px;
280
+ }
281
+ .ui-button-icon-only .ui-icon {
282
+ left: 50%;
283
+ margin-left: -8px;
284
+ }
285
+ .ui-button-text-icon-primary .ui-button-icon-primary,
286
+ .ui-button-text-icons .ui-button-icon-primary,
287
+ .ui-button-icons-only .ui-button-icon-primary {
288
+ left: .5em;
289
+ }
290
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
291
+ .ui-button-text-icons .ui-button-icon-secondary,
292
+ .ui-button-icons-only .ui-button-icon-secondary {
293
+ right: .5em;
294
+ }
295
+
296
+ /* button sets */
297
+ .ui-buttonset {
298
+ margin-right: 7px;
299
+ }
300
+ .ui-buttonset .ui-button {
301
+ margin-left: 0;
302
+ margin-right: -.3em;
303
+ }
304
+
305
+ /* workarounds */
306
+ /* reset extra padding in Firefox, see h5bp.com/l */
307
+ input.ui-button::-moz-focus-inner,
308
+ button.ui-button::-moz-focus-inner {
309
+ border: 0;
310
+ padding: 0;
311
+ }
312
+ .ui-datepicker {
313
+ width: 17em;
314
+ padding: .2em .2em 0;
315
+ display: none;
316
+ }
317
+ .ui-datepicker .ui-datepicker-header {
318
+ position: relative;
319
+ padding: .2em 0;
320
+ }
321
+ .ui-datepicker .ui-datepicker-prev,
322
+ .ui-datepicker .ui-datepicker-next {
323
+ position: absolute;
324
+ top: 2px;
325
+ width: 1.8em;
326
+ height: 1.8em;
327
+ }
328
+ .ui-datepicker .ui-datepicker-prev-hover,
329
+ .ui-datepicker .ui-datepicker-next-hover {
330
+ top: 1px;
331
+ }
332
+ .ui-datepicker .ui-datepicker-prev {
333
+ left: 2px;
334
+ }
335
+ .ui-datepicker .ui-datepicker-next {
336
+ right: 2px;
337
+ }
338
+ .ui-datepicker .ui-datepicker-prev-hover {
339
+ left: 1px;
340
+ }
341
+ .ui-datepicker .ui-datepicker-next-hover {
342
+ right: 1px;
343
+ }
344
+ .ui-datepicker .ui-datepicker-prev span,
345
+ .ui-datepicker .ui-datepicker-next span {
346
+ display: block;
347
+ position: absolute;
348
+ left: 50%;
349
+ margin-left: -8px;
350
+ top: 50%;
351
+ margin-top: -8px;
352
+ }
353
+ .ui-datepicker .ui-datepicker-title {
354
+ margin: 0 2.3em;
355
+ line-height: 1.8em;
356
+ text-align: center;
357
+ }
358
+ .ui-datepicker .ui-datepicker-title select {
359
+ font-size: 1em;
360
+ margin: 1px 0;
361
+ }
362
+ .ui-datepicker select.ui-datepicker-month,
363
+ .ui-datepicker select.ui-datepicker-year {
364
+ width: 45%;
365
+ }
366
+ .ui-datepicker table {
367
+ width: 100%;
368
+ font-size: .9em;
369
+ border-collapse: collapse;
370
+ margin: 0 0 .4em;
371
+ }
372
+ .ui-datepicker th {
373
+ padding: .7em .3em;
374
+ text-align: center;
375
+ font-weight: bold;
376
+ border: 0;
377
+ }
378
+ .ui-datepicker td {
379
+ border: 0;
380
+ padding: 1px;
381
+ }
382
+ .ui-datepicker td span,
383
+ .ui-datepicker td a {
384
+ display: block;
385
+ padding: .2em;
386
+ text-align: right;
387
+ text-decoration: none;
388
+ }
389
+ .ui-datepicker .ui-datepicker-buttonpane {
390
+ background-image: none;
391
+ margin: .7em 0 0 0;
392
+ padding: 0 .2em;
393
+ border-left: 0;
394
+ border-right: 0;
395
+ border-bottom: 0;
396
+ }
397
+ .ui-datepicker .ui-datepicker-buttonpane button {
398
+ float: right;
399
+ margin: .5em .2em .4em;
400
+ cursor: pointer;
401
+ padding: .2em .6em .3em .6em;
402
+ width: auto;
403
+ overflow: visible;
404
+ }
405
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
406
+ float: left;
407
+ }
408
+
409
+ /* with multiple calendars */
410
+ .ui-datepicker.ui-datepicker-multi {
411
+ width: auto;
412
+ }
413
+ .ui-datepicker-multi .ui-datepicker-group {
414
+ float: left;
415
+ }
416
+ .ui-datepicker-multi .ui-datepicker-group table {
417
+ width: 95%;
418
+ margin: 0 auto .4em;
419
+ }
420
+ .ui-datepicker-multi-2 .ui-datepicker-group {
421
+ width: 50%;
422
+ }
423
+ .ui-datepicker-multi-3 .ui-datepicker-group {
424
+ width: 33.3%;
425
+ }
426
+ .ui-datepicker-multi-4 .ui-datepicker-group {
427
+ width: 25%;
428
+ }
429
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
430
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
431
+ border-left-width: 0;
432
+ }
433
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
434
+ clear: left;
435
+ }
436
+ .ui-datepicker-row-break {
437
+ clear: both;
438
+ width: 100%;
439
+ font-size: 0;
440
+ }
441
+
442
+ /* RTL support */
443
+ .ui-datepicker-rtl {
444
+ direction: rtl;
445
+ }
446
+ .ui-datepicker-rtl .ui-datepicker-prev {
447
+ right: 2px;
448
+ left: auto;
449
+ }
450
+ .ui-datepicker-rtl .ui-datepicker-next {
451
+ left: 2px;
452
+ right: auto;
453
+ }
454
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
455
+ right: 1px;
456
+ left: auto;
457
+ }
458
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
459
+ left: 1px;
460
+ right: auto;
461
+ }
462
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
463
+ clear: right;
464
+ }
465
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
466
+ float: left;
467
+ }
468
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
469
+ .ui-datepicker-rtl .ui-datepicker-group {
470
+ float: right;
471
+ }
472
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
473
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
474
+ border-right-width: 0;
475
+ border-left-width: 1px;
476
+ }
477
+ .ui-dialog {
478
+ overflow: hidden;
479
+ position: absolute;
480
+ top: 0;
481
+ left: 0;
482
+ padding: .2em;
483
+ outline: 0;
484
+ }
485
+ .ui-dialog .ui-dialog-titlebar {
486
+ padding: .4em 1em;
487
+ position: relative;
488
+ }
489
+ .ui-dialog .ui-dialog-title {
490
+ float: left;
491
+ margin: .1em 0;
492
+ white-space: nowrap;
493
+ width: 90%;
494
+ overflow: hidden;
495
+ text-overflow: ellipsis;
496
+ }
497
+ .ui-dialog .ui-dialog-titlebar-close {
498
+ position: absolute;
499
+ right: .3em;
500
+ top: 50%;
501
+ width: 20px;
502
+ margin: -10px 0 0 0;
503
+ padding: 1px;
504
+ height: 20px;
505
+ }
506
+ .ui-dialog .ui-dialog-content {
507
+ position: relative;
508
+ border: 0;
509
+ padding: .5em 1em;
510
+ background: none;
511
+ overflow: auto;
512
+ }
513
+ .ui-dialog .ui-dialog-buttonpane {
514
+ text-align: left;
515
+ border-width: 1px 0 0 0;
516
+ background-image: none;
517
+ margin-top: .5em;
518
+ padding: .3em 1em .5em .4em;
519
+ }
520
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
521
+ float: right;
522
+ }
523
+ .ui-dialog .ui-dialog-buttonpane button {
524
+ margin: .5em .4em .5em 0;
525
+ cursor: pointer;
526
+ }
527
+ .ui-dialog .ui-resizable-se {
528
+ width: 12px;
529
+ height: 12px;
530
+ right: -5px;
531
+ bottom: -5px;
532
+ background-position: 16px 16px;
533
+ }
534
+ .ui-draggable .ui-dialog-titlebar {
535
+ cursor: move;
536
+ }
537
+ .ui-menu {
538
+ list-style: none;
539
+ padding: 0;
540
+ margin: 0;
541
+ display: block;
542
+ outline: none;
543
+ }
544
+ .ui-menu .ui-menu {
545
+ position: absolute;
546
+ }
547
+ .ui-menu .ui-menu-item {
548
+ position: relative;
549
+ margin: 0;
550
+ padding: 3px 1em 3px .4em;
551
+ cursor: pointer;
552
+ min-height: 0; /* support: IE7 */
553
+ /* support: IE10, see #8844 */
554
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
555
+ }
556
+ .ui-menu .ui-menu-divider {
557
+ margin: 5px 0;
558
+ height: 0;
559
+ font-size: 0;
560
+ line-height: 0;
561
+ border-width: 1px 0 0 0;
562
+ }
563
+ .ui-menu .ui-state-focus,
564
+ .ui-menu .ui-state-active {
565
+ margin: -1px;
566
+ }
567
+
568
+ /* icon support */
569
+ .ui-menu-icons {
570
+ position: relative;
571
+ }
572
+ .ui-menu-icons .ui-menu-item {
573
+ padding-left: 2em;
574
+ }
575
+
576
+ /* left-aligned */
577
+ .ui-menu .ui-icon {
578
+ position: absolute;
579
+ top: 0;
580
+ bottom: 0;
581
+ left: .2em;
582
+ margin: auto 0;
583
+ }
584
+
585
+ /* right-aligned */
586
+ .ui-menu .ui-menu-icon {
587
+ left: auto;
588
+ right: 0;
589
+ }
590
+ .ui-progressbar {
591
+ height: 2em;
592
+ text-align: left;
593
+ overflow: hidden;
594
+ }
595
+ .ui-progressbar .ui-progressbar-value {
596
+ margin: -1px;
597
+ height: 100%;
598
+ }
599
+ .ui-progressbar .ui-progressbar-overlay {
600
+ background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
601
+ height: 100%;
602
+ filter: alpha(opacity=25); /* support: IE8 */
603
+ opacity: 0.25;
604
+ }
605
+ .ui-progressbar-indeterminate .ui-progressbar-value {
606
+ background-image: none;
607
+ }
608
+ .ui-selectmenu-menu {
609
+ padding: 0;
610
+ margin: 0;
611
+ position: absolute;
612
+ top: 0;
613
+ left: 0;
614
+ display: none;
615
+ }
616
+ .ui-selectmenu-menu .ui-menu {
617
+ overflow: auto;
618
+ /* Support: IE7 */
619
+ overflow-x: hidden;
620
+ padding-bottom: 1px;
621
+ }
622
+ .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
623
+ font-size: 1em;
624
+ font-weight: bold;
625
+ line-height: 1.5;
626
+ padding: 2px 0.4em;
627
+ margin: 0.5em 0 0 0;
628
+ height: auto;
629
+ border: 0;
630
+ }
631
+ .ui-selectmenu-open {
632
+ display: block;
633
+ }
634
+ .ui-selectmenu-button {
635
+ display: inline-block;
636
+ overflow: hidden;
637
+ position: relative;
638
+ text-decoration: none;
639
+ cursor: pointer;
640
+ }
641
+ .ui-selectmenu-button span.ui-icon {
642
+ right: 0.5em;
643
+ left: auto;
644
+ margin-top: -8px;
645
+ position: absolute;
646
+ top: 50%;
647
+ }
648
+ .ui-selectmenu-button span.ui-selectmenu-text {
649
+ text-align: left;
650
+ padding: 0.4em 2.1em 0.4em 1em;
651
+ display: block;
652
+ line-height: 1.4;
653
+ overflow: hidden;
654
+ text-overflow: ellipsis;
655
+ white-space: nowrap;
656
+ }
657
+ .ui-slider {
658
+ position: relative;
659
+ text-align: left;
660
+ }
661
+ .ui-slider .ui-slider-handle {
662
+ position: absolute;
663
+ z-index: 2;
664
+ width: 1.2em;
665
+ height: 1.2em;
666
+ cursor: default;
667
+ -ms-touch-action: none;
668
+ touch-action: none;
669
+ }
670
+ .ui-slider .ui-slider-range {
671
+ position: absolute;
672
+ z-index: 1;
673
+ font-size: .7em;
674
+ display: block;
675
+ border: 0;
676
+ background-position: 0 0;
677
+ }
678
+
679
+ /* support: IE8 - See #6727 */
680
+ .ui-slider.ui-state-disabled .ui-slider-handle,
681
+ .ui-slider.ui-state-disabled .ui-slider-range {
682
+ filter: inherit;
683
+ }
684
+
685
+ .ui-slider-horizontal {
686
+ height: .8em;
687
+ }
688
+ .ui-slider-horizontal .ui-slider-handle {
689
+ top: -.3em;
690
+ margin-left: -.6em;
691
+ }
692
+ .ui-slider-horizontal .ui-slider-range {
693
+ top: 0;
694
+ height: 100%;
695
+ }
696
+ .ui-slider-horizontal .ui-slider-range-min {
697
+ left: 0;
698
+ }
699
+ .ui-slider-horizontal .ui-slider-range-max {
700
+ right: 0;
701
+ }
702
+
703
+ .ui-slider-vertical {
704
+ width: .8em;
705
+ height: 100px;
706
+ }
707
+ .ui-slider-vertical .ui-slider-handle {
708
+ left: -.3em;
709
+ margin-left: 0;
710
+ margin-bottom: -.6em;
711
+ }
712
+ .ui-slider-vertical .ui-slider-range {
713
+ left: 0;
714
+ width: 100%;
715
+ }
716
+ .ui-slider-vertical .ui-slider-range-min {
717
+ bottom: 0;
718
+ }
719
+ .ui-slider-vertical .ui-slider-range-max {
720
+ top: 0;
721
+ }
722
+ .ui-spinner {
723
+ position: relative;
724
+ display: inline-block;
725
+ overflow: hidden;
726
+ padding: 0;
727
+ vertical-align: middle;
728
+ }
729
+ .ui-spinner-input {
730
+ border: none;
731
+ background: none;
732
+ color: inherit;
733
+ padding: 0;
734
+ margin: .2em 0;
735
+ vertical-align: middle;
736
+ margin-left: .4em;
737
+ margin-right: 22px;
738
+ }
739
+ .ui-spinner-button {
740
+ width: 16px;
741
+ height: 50%;
742
+ font-size: .5em;
743
+ padding: 0;
744
+ margin: 0;
745
+ text-align: center;
746
+ position: absolute;
747
+ cursor: default;
748
+ display: block;
749
+ overflow: hidden;
750
+ right: 0;
751
+ }
752
+ /* more specificity required here to override default borders */
753
+ .ui-spinner a.ui-spinner-button {
754
+ border-top: none;
755
+ border-bottom: none;
756
+ border-right: none;
757
+ }
758
+ /* vertically center icon */
759
+ .ui-spinner .ui-icon {
760
+ position: absolute;
761
+ margin-top: -8px;
762
+ top: 50%;
763
+ left: 0;
764
+ }
765
+ .ui-spinner-up {
766
+ top: 0;
767
+ }
768
+ .ui-spinner-down {
769
+ bottom: 0;
770
+ }
771
+
772
+ /* TR overrides */
773
+ .ui-spinner .ui-icon-triangle-1-s {
774
+ /* need to fix icons sprite */
775
+ background-position: -65px -16px;
776
+ }
777
+ .ui-tabs {
778
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
779
+ padding: .2em;
780
+ }
781
+ .ui-tabs .ui-tabs-nav {
782
+ margin: 0;
783
+ padding: .2em .2em 0;
784
+ }
785
+ .ui-tabs .ui-tabs-nav li {
786
+ list-style: none;
787
+ float: left;
788
+ position: relative;
789
+ top: 0;
790
+ margin: 1px .2em 0 0;
791
+ border-bottom-width: 0;
792
+ padding: 0;
793
+ white-space: nowrap;
794
+ }
795
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
796
+ float: left;
797
+ padding: .5em 1em;
798
+ text-decoration: none;
799
+ }
800
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
801
+ margin-bottom: -1px;
802
+ padding-bottom: 1px;
803
+ }
804
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
805
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
806
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
807
+ cursor: text;
808
+ }
809
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
810
+ cursor: pointer;
811
+ }
812
+ .ui-tabs .ui-tabs-panel {
813
+ display: block;
814
+ border-width: 0;
815
+ padding: 1em 1.4em;
816
+ background: none;
817
+ }
818
+ .ui-tooltip {
819
+ padding: 8px;
820
+ position: absolute;
821
+ z-index: 9999;
822
+ max-width: 300px;
823
+ -webkit-box-shadow: 0 0 5px #aaa;
824
+ box-shadow: 0 0 5px #aaa;
825
+ }
826
+ body .ui-tooltip {
827
+ border-width: 2px;
828
+ }
829
+
830
+ /* Component containers
831
+ ----------------------------------*/
832
+ .ui-widget {
833
+ font-family: Verdana,Arial,sans-serif;
834
+ font-size: 1.1em;
835
+ }
836
+ .ui-widget .ui-widget {
837
+ font-size: 1em;
838
+ }
839
+ .ui-widget input,
840
+ .ui-widget select,
841
+ .ui-widget textarea,
842
+ .ui-widget button {
843
+ font-family: Verdana,Arial,sans-serif;
844
+ font-size: 1em;
845
+ }
846
+ .ui-widget-content {
847
+ border: 1px solid #aaaaaa;
848
+ background: #ffffff;
849
+ color: #222222;
850
+ }
851
+ .ui-widget-content a {
852
+ color: #222222;
853
+ }
854
+ .ui-widget-header {
855
+ border: 1px solid #aaaaaa;
856
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
857
+ color: #222222;
858
+ font-weight: bold;
859
+ }
860
+ .ui-widget-header a {
861
+ color: #222222;
862
+ }
863
+
864
+ /* Interaction states
865
+ ----------------------------------*/
866
+ .ui-state-default,
867
+ .ui-widget-content .ui-state-default,
868
+ .ui-widget-header .ui-state-default {
869
+ border: 1px solid #d3d3d3;
870
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
871
+ font-weight: normal;
872
+ color: #555555;
873
+ }
874
+ .ui-state-default a,
875
+ .ui-state-default a:link,
876
+ .ui-state-default a:visited {
877
+ color: #555555;
878
+ text-decoration: none;
879
+ }
880
+ .ui-state-hover,
881
+ .ui-widget-content .ui-state-hover,
882
+ .ui-widget-header .ui-state-hover,
883
+ .ui-state-focus,
884
+ .ui-widget-content .ui-state-focus,
885
+ .ui-widget-header .ui-state-focus {
886
+ border: 1px solid #999999;
887
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
888
+ font-weight: normal;
889
+ color: #212121;
890
+ }
891
+ .ui-state-hover a,
892
+ .ui-state-hover a:hover,
893
+ .ui-state-hover a:link,
894
+ .ui-state-hover a:visited,
895
+ .ui-state-focus a,
896
+ .ui-state-focus a:hover,
897
+ .ui-state-focus a:link,
898
+ .ui-state-focus a:visited {
899
+ color: #212121;
900
+ text-decoration: none;
901
+ }
902
+ .ui-state-active,
903
+ .ui-widget-content .ui-state-active,
904
+ .ui-widget-header .ui-state-active {
905
+ border: 1px solid #aaaaaa;
906
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
907
+ font-weight: normal;
908
+ color: #212121;
909
+ }
910
+ .ui-state-active a,
911
+ .ui-state-active a:link,
912
+ .ui-state-active a:visited {
913
+ color: #212121;
914
+ text-decoration: none;
915
+ }
916
+
917
+ /* Interaction Cues
918
+ ----------------------------------*/
919
+ .ui-state-highlight,
920
+ .ui-widget-content .ui-state-highlight,
921
+ .ui-widget-header .ui-state-highlight {
922
+ border: 1px solid #fcefa1;
923
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
924
+ color: #363636;
925
+ }
926
+ .ui-state-highlight a,
927
+ .ui-widget-content .ui-state-highlight a,
928
+ .ui-widget-header .ui-state-highlight a {
929
+ color: #363636;
930
+ }
931
+ .ui-state-error,
932
+ .ui-widget-content .ui-state-error,
933
+ .ui-widget-header .ui-state-error {
934
+ border: 1px solid #cd0a0a;
935
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
936
+ color: #cd0a0a;
937
+ }
938
+ .ui-state-error a,
939
+ .ui-widget-content .ui-state-error a,
940
+ .ui-widget-header .ui-state-error a {
941
+ color: #cd0a0a;
942
+ }
943
+ .ui-state-error-text,
944
+ .ui-widget-content .ui-state-error-text,
945
+ .ui-widget-header .ui-state-error-text {
946
+ color: #cd0a0a;
947
+ }
948
+ .ui-priority-primary,
949
+ .ui-widget-content .ui-priority-primary,
950
+ .ui-widget-header .ui-priority-primary {
951
+ font-weight: bold;
952
+ }
953
+ .ui-priority-secondary,
954
+ .ui-widget-content .ui-priority-secondary,
955
+ .ui-widget-header .ui-priority-secondary {
956
+ opacity: .7;
957
+ filter:Alpha(Opacity=70); /* support: IE8 */
958
+ font-weight: normal;
959
+ }
960
+ .ui-state-disabled,
961
+ .ui-widget-content .ui-state-disabled,
962
+ .ui-widget-header .ui-state-disabled {
963
+ opacity: .35;
964
+ filter:Alpha(Opacity=35); /* support: IE8 */
965
+ background-image: none;
966
+ }
967
+ .ui-state-disabled .ui-icon {
968
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
969
+ }
970
+
971
+ /* Icons
972
+ ----------------------------------*/
973
+
974
+ /* states and images */
975
+ .ui-icon {
976
+ width: 16px;
977
+ height: 16px;
978
+ }
979
+ .ui-icon,
980
+ .ui-widget-content .ui-icon {
981
+ background-image: url("images/ui-icons_222222_256x240.png");
982
+ }
983
+ .ui-widget-header .ui-icon {
984
+ background-image: url("images/ui-icons_222222_256x240.png");
985
+ }
986
+ .ui-state-default .ui-icon {
987
+ background-image: url("images/ui-icons_888888_256x240.png");
988
+ }
989
+ .ui-state-hover .ui-icon,
990
+ .ui-state-focus .ui-icon {
991
+ background-image: url("images/ui-icons_454545_256x240.png");
992
+ }
993
+ .ui-state-active .ui-icon {
994
+ background-image: url("images/ui-icons_454545_256x240.png");
995
+ }
996
+ .ui-state-highlight .ui-icon {
997
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
998
+ }
999
+ .ui-state-error .ui-icon,
1000
+ .ui-state-error-text .ui-icon {
1001
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
1002
+ }
1003
+
1004
+ /* positioning */
1005
+ .ui-icon-blank { background-position: 16px 16px; }
1006
+ .ui-icon-carat-1-n { background-position: 0 0; }
1007
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
1008
+ .ui-icon-carat-1-e { background-position: -32px 0; }
1009
+ .ui-icon-carat-1-se { background-position: -48px 0; }
1010
+ .ui-icon-carat-1-s { background-position: -64px 0; }
1011
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
1012
+ .ui-icon-carat-1-w { background-position: -96px 0; }
1013
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
1014
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
1015
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
1016
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
1017
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1018
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
1019
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
1020
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
1021
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1022
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
1023
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1024
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1025
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1026
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
1027
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1028
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
1029
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
1030
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
1031
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1032
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
1033
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1034
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1035
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1036
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1037
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1038
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1039
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1040
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1041
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1042
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
1043
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1044
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1045
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1046
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1047
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1048
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1049
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1050
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1051
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1052
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1053
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1054
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1055
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1056
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1057
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1058
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1059
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1060
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1061
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1062
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1063
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1064
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1065
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1066
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1067
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1068
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1069
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1070
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1071
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1072
+ .ui-icon-extlink { background-position: -32px -80px; }
1073
+ .ui-icon-newwin { background-position: -48px -80px; }
1074
+ .ui-icon-refresh { background-position: -64px -80px; }
1075
+ .ui-icon-shuffle { background-position: -80px -80px; }
1076
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1077
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1078
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1079
+ .ui-icon-folder-open { background-position: -16px -96px; }
1080
+ .ui-icon-document { background-position: -32px -96px; }
1081
+ .ui-icon-document-b { background-position: -48px -96px; }
1082
+ .ui-icon-note { background-position: -64px -96px; }
1083
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1084
+ .ui-icon-mail-open { background-position: -96px -96px; }
1085
+ .ui-icon-suitcase { background-position: -112px -96px; }
1086
+ .ui-icon-comment { background-position: -128px -96px; }
1087
+ .ui-icon-person { background-position: -144px -96px; }
1088
+ .ui-icon-print { background-position: -160px -96px; }
1089
+ .ui-icon-trash { background-position: -176px -96px; }
1090
+ .ui-icon-locked { background-position: -192px -96px; }
1091
+ .ui-icon-unlocked { background-position: -208px -96px; }
1092
+ .ui-icon-bookmark { background-position: -224px -96px; }
1093
+ .ui-icon-tag { background-position: -240px -96px; }
1094
+ .ui-icon-home { background-position: 0 -112px; }
1095
+ .ui-icon-flag { background-position: -16px -112px; }
1096
+ .ui-icon-calendar { background-position: -32px -112px; }
1097
+ .ui-icon-cart { background-position: -48px -112px; }
1098
+ .ui-icon-pencil { background-position: -64px -112px; }
1099
+ .ui-icon-clock { background-position: -80px -112px; }
1100
+ .ui-icon-disk { background-position: -96px -112px; }
1101
+ .ui-icon-calculator { background-position: -112px -112px; }
1102
+ .ui-icon-zoomin { background-position: -128px -112px; }
1103
+ .ui-icon-zoomout { background-position: -144px -112px; }
1104
+ .ui-icon-search { background-position: -160px -112px; }
1105
+ .ui-icon-wrench { background-position: -176px -112px; }
1106
+ .ui-icon-gear { background-position: -192px -112px; }
1107
+ .ui-icon-heart { background-position: -208px -112px; }
1108
+ .ui-icon-star { background-position: -224px -112px; }
1109
+ .ui-icon-link { background-position: -240px -112px; }
1110
+ .ui-icon-cancel { background-position: 0 -128px; }
1111
+ .ui-icon-plus { background-position: -16px -128px; }
1112
+ .ui-icon-plusthick { background-position: -32px -128px; }
1113
+ .ui-icon-minus { background-position: -48px -128px; }
1114
+ .ui-icon-minusthick { background-position: -64px -128px; }
1115
+ .ui-icon-close { background-position: -80px -128px; }
1116
+ .ui-icon-closethick { background-position: -96px -128px; }
1117
+ .ui-icon-key { background-position: -112px -128px; }
1118
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1119
+ .ui-icon-scissors { background-position: -144px -128px; }
1120
+ .ui-icon-clipboard { background-position: -160px -128px; }
1121
+ .ui-icon-copy { background-position: -176px -128px; }
1122
+ .ui-icon-contact { background-position: -192px -128px; }
1123
+ .ui-icon-image { background-position: -208px -128px; }
1124
+ .ui-icon-video { background-position: -224px -128px; }
1125
+ .ui-icon-script { background-position: -240px -128px; }
1126
+ .ui-icon-alert { background-position: 0 -144px; }
1127
+ .ui-icon-info { background-position: -16px -144px; }
1128
+ .ui-icon-notice { background-position: -32px -144px; }
1129
+ .ui-icon-help { background-position: -48px -144px; }
1130
+ .ui-icon-check { background-position: -64px -144px; }
1131
+ .ui-icon-bullet { background-position: -80px -144px; }
1132
+ .ui-icon-radio-on { background-position: -96px -144px; }
1133
+ .ui-icon-radio-off { background-position: -112px -144px; }
1134
+ .ui-icon-pin-w { background-position: -128px -144px; }
1135
+ .ui-icon-pin-s { background-position: -144px -144px; }
1136
+ .ui-icon-play { background-position: 0 -160px; }
1137
+ .ui-icon-pause { background-position: -16px -160px; }
1138
+ .ui-icon-seek-next { background-position: -32px -160px; }
1139
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1140
+ .ui-icon-seek-end { background-position: -64px -160px; }
1141
+ .ui-icon-seek-start { background-position: -80px -160px; }
1142
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1143
+ .ui-icon-seek-first { background-position: -80px -160px; }
1144
+ .ui-icon-stop { background-position: -96px -160px; }
1145
+ .ui-icon-eject { background-position: -112px -160px; }
1146
+ .ui-icon-volume-off { background-position: -128px -160px; }
1147
+ .ui-icon-volume-on { background-position: -144px -160px; }
1148
+ .ui-icon-power { background-position: 0 -176px; }
1149
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1150
+ .ui-icon-signal { background-position: -32px -176px; }
1151
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1152
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1153
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1154
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1155
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1156
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1157
+ .ui-icon-circle-close { background-position: -32px -192px; }
1158
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1159
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1160
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1161
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1162
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1163
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1164
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1165
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1166
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1167
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1168
+ .ui-icon-circle-check { background-position: -208px -192px; }
1169
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1170
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1171
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1172
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1173
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1174
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1175
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1176
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1177
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1178
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1179
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1180
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1181
+
1182
+
1183
+ /* Misc visuals
1184
+ ----------------------------------*/
1185
+
1186
+ /* Corner radius */
1187
+ .ui-corner-all,
1188
+ .ui-corner-top,
1189
+ .ui-corner-left,
1190
+ .ui-corner-tl {
1191
+ border-top-left-radius: 4px;
1192
+ }
1193
+ .ui-corner-all,
1194
+ .ui-corner-top,
1195
+ .ui-corner-right,
1196
+ .ui-corner-tr {
1197
+ border-top-right-radius: 4px;
1198
+ }
1199
+ .ui-corner-all,
1200
+ .ui-corner-bottom,
1201
+ .ui-corner-left,
1202
+ .ui-corner-bl {
1203
+ border-bottom-left-radius: 4px;
1204
+ }
1205
+ .ui-corner-all,
1206
+ .ui-corner-bottom,
1207
+ .ui-corner-right,
1208
+ .ui-corner-br {
1209
+ border-bottom-right-radius: 4px;
1210
+ }
1211
+
1212
+ /* Overlays */
1213
+ .ui-widget-overlay {
1214
+ background: #aaaaaa;
1215
+ opacity: .3;
1216
+ filter: Alpha(Opacity=30); /* support: IE8 */
1217
+ }
1218
+ .ui-widget-shadow {
1219
+ margin: -8px 0 0 -8px;
1220
+ padding: 8px;
1221
+ background: #aaaaaa;
1222
+ opacity: .3;
1223
+ filter: Alpha(Opacity=30); /* support: IE8 */
1224
+ border-radius: 8px;
1225
+ }
trunk/css/jqvmap.css ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .jqvmap-label
2
+ {
3
+ position: absolute;
4
+ display: none;
5
+ -webkit-border-radius: 3px;
6
+ -moz-border-radius: 3px;
7
+ border-radius: 3px;
8
+ background: #292929;
9
+ color: white;
10
+ font-family: sans-serif, Verdana;
11
+ font-size: smaller;
12
+ padding: 3px;
13
+ pointer-events:none;
14
+ }
15
+ .jqvmap-pin {
16
+ pointer-events:none;
17
+ }
18
+ .jqvmap-zoomin, .jqvmap-zoomout
19
+ {
20
+ position: absolute;
21
+ left: 10px;
22
+ -webkit-border-radius: 3px;
23
+ -moz-border-radius: 3px;
24
+ border-radius: 3px;
25
+ background: #000000;
26
+ padding: 3px;
27
+ color: white;
28
+ width: 10px;
29
+ height: 10px;
30
+ cursor: pointer;
31
+ line-height: 10px;
32
+ text-align: center;
33
+ }
34
+ .jqvmap-zoomin
35
+ {
36
+ top: 10px;
37
+ }
38
+ .jqvmap-zoomout
39
+ {
40
+ top: 30px;
41
+ }
42
+ .jqvmap-region
43
+ {
44
+ cursor: pointer;
45
+ }
46
+ .jqvmap-ajax_response
47
+ {
48
+ width: 100%;
49
+ height: 500px;
50
+ }
trunk/do/change.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header('Content-Type: text/html;charset=UTF-8');
4
+ header('X-Robots-Tag: noindex,nofollow,noarchive');
5
+ header('Cache-Control: no-cache,no-store,private');
6
+ include '../../../../wp-load.php';
7
+
8
+ $user = Newsletter::instance()->get_user_from_request(true);
9
+ $field = $_REQUEST['nf'];
10
+ $value = $_REQUEST['nv'];
11
+ $url = $_REQUEST['nu'];
12
+
13
+
14
+ switch ($field) {
15
+ case 'sex':
16
+ if (!in_array($value, array('f', 'm', 'n')))
17
+ die('Invalid sex value');
18
+ NewsletterUsers::instance()->set_user_field($user->id, 'sex', $value);
19
+ break;
20
+ // Should be managed by Feed by Mail
21
+ case 'feed':
22
+ if (isset($value) && ($value === '0' || $value === '1')) {
23
+ NewsletterUsers::instance()->set_user_field($user->id, 'feed', $value);
24
+ } else
25
+ die('Invalid feed value');
26
+ break;
27
+ }
28
+
29
+ if (strpos($field, 'preference_') === 0) {
30
+ $idx = (int) substr($field, 11);
31
+ $options_profile = get_option('newsletter_profile');
32
+
33
+ if ($options_profile['list_' . $idx . '_status'] == 0) {
34
+ die('Not allowed field.');
35
+ }
36
+
37
+ if (isset($value) && ($value === '0' || $value === '1')) {
38
+ NewsletterUsers::instance()->set_user_field($user->id, 'list_' . $idx, $value);
39
+ } else {
40
+ die('Invalid preference value');
41
+ }
42
+ }
43
+
44
+ if (isset($url)) {
45
+ header("Location: $url");
46
+ } else {
47
+ NewsletterSubscription::instance()->show_message('profile', $user, NewsletterSubscription::instance()->options['profile_saved']);
48
+ }
trunk/do/confirm.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'c';
5
+ require_once '../../../../wp-load.php';
6
+ }
trunk/do/profile.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'p';
5
+ require_once '../../../../wp-load.php';
6
+ }
7
+
trunk/do/save.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header('Content-Type: text/html;charset=UTF-8');
4
+ header('X-Robots-Tag: noindex,nofollow,noarchive');
5
+ header('Cache-Control: no-cache,no-store,private');
6
+ include '../../../../wp-load.php';
7
+
8
+ $user = NewsletterSubscription::instance()->save_profile();
9
+ // $user->alert is a temporary field
10
+ NewsletterSubscription::instance()->show_message('profile', $user, $user->alert);
trunk/do/subscribe.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ $_GET['na'] = 's';
5
+ require_once '../../../../wp-load.php';
6
+
trunk/do/subscription.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once '../../../../wp-load.php';
4
+
5
+ if (!isset($newsletter)) $newsletter = new Newsletter();
6
+
7
+ $options_main = get_option('newsletter_main', array());
8
+
9
+ if (!empty($options_main['url'])) {
10
+ header('Location: ' . $options_main['url']);
11
+ die();
12
+ }
13
+
14
+ $options = get_option('newsletter', array());
15
+
16
+ if (stripos($options['subscription_text'], '<form') !== false) {
17
+ $message = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" onsubmit="return newsletter_check(this)"', $options['subscription_text']);
18
+ $message = $this->replace_lists($message);
19
+ } else {
20
+ $form = $newsletter->subscription_form();
21
+
22
+ if (strpos($options['subscription_text'], '{subscription_form}') !== false)
23
+ $message = str_replace('{subscription_form}', $form, $options['subscription_text']);
24
+ else $message = $options['subscription_text'] . $form;
25
+ }
26
+ include NEWSLETTER_DIR . '/page.php';
trunk/do/unlock.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'ul';
5
+ include '../../../../wp-load.php';
6
+ }
trunk/do/unsubscribe.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ $_GET['na'] = 'uc';
4
+ require_once '../../../../wp-load.php';
5
+ }
trunk/do/unsubscription.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ $_GET['na'] = 'u';
5
+ require_once '../../../../wp-load.php';
6
+ }
trunk/do/view.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ $_GET['na'] = 'v';
3
+ require_once '../../../../wp-load.php';
trunk/editor.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ body {
2
+ font-size: 12px;
3
+ }
4
+
trunk/emails/composer.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $controls = new NewsletterControls();
4
+ $module = NewsletterEmails::instance();
5
+ // Add the color picker css file
6
+ wp_enqueue_style('wp-color-picker');
7
+ // Include our custom jQuery file with WordPress Color Picker dependency
8
+ wp_enqueue_script('wp-color-picker');
9
+
10
+ // TNP Composer style
11
+ wp_enqueue_style('tnpc-style', plugins_url('/tnp-composer/_css/newsletter-builder.css', __FILE__));
12
+ wp_enqueue_style('tnpc-newsletter-style', plugins_url('/tnp-composer/css/newsletter.css', __FILE__));
13
+
14
+ if (($controls->is_action('save') || $controls->is_action('preview')) && !$_GET['id']) {
15
+
16
+ $module->save_options($controls->data);
17
+
18
+ $email = array();
19
+ $email['status'] = 'new';
20
+ $email['subject'] = __('Here the email subject', 'newsletter');
21
+ $email['track'] = 1;
22
+
23
+ $email['message'] = $controls->data['body'];
24
+ $email['subject'] = $controls->data['subject'];
25
+
26
+ $email['message_text'] = 'This email requires a modern e-mail reader but you can view the email online here:
27
+ {email_url}.
28
+
29
+ Thank you, ' . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . '
30
+
31
+ To change your subscription follow: {profile_url}.';
32
+
33
+ $email['options'] = serialize(array('composer' => true));
34
+
35
+ $email['type'] = 'message';
36
+ $email['send_on'] = time();
37
+ $email = Newsletter::instance()->save_email($email, ARRAY_A);
38
+ } elseif (isset($_GET['id'])) {
39
+
40
+ $email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
41
+
42
+ if (empty($email)) {
43
+ echo 'Wrong email identifier';
44
+ return;
45
+ }
46
+
47
+ if ($controls->is_action('save') || $controls->is_action('preview')) {
48
+
49
+ $module->save_options($controls->data);
50
+ $email['message'] = $controls->data['body'];
51
+ $email = Newsletter::instance()->save_email($email, ARRAY_A);
52
+ }
53
+ }
54
+
55
+ if ($controls->is_action('preview')) {
56
+ ?>
57
+ <script>
58
+ location.href = "<?php echo $module->get_admin_page_url('cpreview'); ?>&id=<?php echo $email['id']; ?>";
59
+ </script>
60
+ <div class="wrap">
61
+ <p><a href="<?php echo $module->get_admin_page_url('cpreview'); ?>&id=<?php echo $email['id']; ?>">click here to proceed</a>.</p>
62
+ </div>
63
+ <?php
64
+ return;
65
+ }
66
+
67
+ if ($controls->data == null) {
68
+ $controls->data = $module->get_options();
69
+ }
70
+
71
+ //$body = $controls->data['body'];
72
+ $body = "";
73
+ if (isset($email)) {
74
+ $body = $email['message'];
75
+ }
76
+
77
+ ?>
78
+
79
+ <div class="wrap" id="tnp-wrap">
80
+
81
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
82
+ <?php //include NEWSLETTER_DIR . '/tnp-header.php'; ?>
83
+
84
+ <div id="tnp-heading" class="tnp-composer-heading">
85
+
86
+ <img src="http://cdn.thenewsletterplugin.com/tests/tnp-composer-heading.png">
87
+ <h2><?php _e('Compose a newsletter', 'newsletter') ?></h2>
88
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/composer" target="_blank"><i class="fa fa-life-ring"></i> <?php _e('Read the guide', 'newsletter') ?></a>
89
+ <form method="post" action="" id="tnpc-form">
90
+ <?php $controls->init(); ?>
91
+ <?php $controls->hidden('subject'); ?>
92
+ <?php $controls->hidden('body'); ?>
93
+ <?php $controls->button_reset(); ?>
94
+ <?php $controls->button('save', __('Save','newsletter'), 'create();'); ?>
95
+ <?php $controls->button('preview', __('Save & Preview','newsletter') . ' &raquo;', 'create();'); ?>
96
+ </form>
97
+ </div>
98
+
99
+ <div id="tnp-body" class="tnp-body-lite">
100
+
101
+ <?php include NEWSLETTER_DIR . '/emails/tnp-composer/index.php'; ?>
102
+
103
+ </div>
104
+
105
+ <?php //include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
106
+
107
+ </div>
trunk/emails/cpreview.php ADDED
@@ -0,0 +1,480 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $controls = new NewsletterControls();
4
+ $module = NewsletterEmails::instance();
5
+
6
+ $email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
7
+
8
+ // TNP Composer style
9
+ wp_enqueue_style('tnpc-style', plugins_url('/tnp-composer/_css/newsletter-builder.css', __FILE__));
10
+
11
+ if (empty($email)) {
12
+ echo 'Wrong email identifier';
13
+ return;
14
+ }
15
+ $email_id = $email['id'];
16
+
17
+ // If there is no action we assume we are enter the first time so we populate the
18
+ // $nc->data with the editable email fields
19
+ if (!$controls->is_action()) {
20
+ $controls->data = $email;
21
+ if (!empty($email['preferences'])) {
22
+ $controls->data['preferences'] = explode(',', $email['preferences']);
23
+ }
24
+ if (!empty($email['sex'])) {
25
+ $controls->data['sex'] = explode(',', $email['sex']);
26
+ }
27
+ $email_options = unserialize($email['options']);
28
+ if (is_array($email_options)) {
29
+ $controls->data = array_merge($controls->data, $email_options);
30
+ }
31
+ }
32
+
33
+ if ($controls->is_action('test') || $controls->is_action('save') || $controls->is_action('send') || $controls->is_action('editor')) {
34
+
35
+ // If we were editing with visual editor (==0), we must read the extra <body> content
36
+ if ($email['editor'] == 0) {
37
+ // no editing possible, just preview
38
+ } else {
39
+ $email['message'] = $controls->data['message'];
40
+ }
41
+
42
+ $email['message_text'] = $controls->data['message_text'];
43
+ $email['subject'] = $controls->data['subject'];
44
+ $email['track'] = $controls->data['track'];
45
+ $email['private'] = $controls->data['private'];
46
+
47
+ // Builds the extended options
48
+ $email['options'] = array();
49
+ $email['options']['preferences_status'] = $controls->data['preferences_status'];
50
+ if (isset($controls->data['preferences'])) {
51
+ $email['options']['preferences'] = $controls->data['preferences'];
52
+ }
53
+ if (isset($controls->data['sex'])) {
54
+ $email['options']['sex'] = $controls->data['sex'];
55
+ }
56
+
57
+ $email['options']['status'] = $controls->data['status'];
58
+ $email['options']['preferences_status_operator'] = $controls->data['preferences_status_operator'];
59
+ $email['options']['wp_users'] = $controls->data['wp_users'];
60
+ $email['options']['composer'] = true;
61
+
62
+ $email['options'] = serialize($email['options']);
63
+
64
+ if (isset($controls->data['preferences'])) {
65
+ $email['preferences'] = implode(',', $controls->data['preferences']);
66
+ } else {
67
+ $email['preferences'] = '';
68
+ }
69
+
70
+ if (isset($controls->data['sex'])) {
71
+ $email['sex'] = implode(',', $controls->data['sex']);
72
+ } else {
73
+ $email['sex'] = '';
74
+ }
75
+
76
+ // Before send, we build the query to extract subscriber, so the delivery engine does not
77
+ // have to worry about the email parameters
78
+ if ($controls->data['status'] == 'S') {
79
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='S'";
80
+ } else {
81
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
82
+ }
83
+
84
+ if ($controls->data['wp_users'] == '1') {
85
+ $query .= " and wp_user_id<>0";
86
+ }
87
+
88
+
89
+ if (isset($controls->data['preferences'])) {
90
+ $preferences = $controls->data['preferences'];
91
+
92
+ // Not set one of the preferences specified
93
+ $operator = $controls->data['preferences_status_operator'] == 0 ? ' or ' : ' and ';
94
+ if ($controls->data['preferences_status'] == 1) {
95
+ $query .= " and (";
96
+ foreach ($preferences as $x) {
97
+ $query .= "list_" . $x . "=0" . $operator;
98
+ }
99
+ $query = substr($query, 0, -4);
100
+ $query .= ")";
101
+ } else {
102
+ $query .= " and (";
103
+ foreach ($preferences as $x) {
104
+ $query .= "list_" . $x . "=1" . $operator;
105
+ }
106
+ $query = substr($query, 0, -4);
107
+ $query .= ")";
108
+ }
109
+ }
110
+
111
+ $sex = $controls->data['sex'];
112
+ if (is_array($sex)) {
113
+ $query .= " and sex in (";
114
+ foreach ($sex as $x) {
115
+ $query .= "'" . $x . "', ";
116
+ }
117
+ $query = substr($query, 0, -2);
118
+ $query .= ")";
119
+ }
120
+
121
+ $email['query'] = $query;
122
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
123
+
124
+ if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
125
+ $controls->data['send_on'] = time();
126
+ }
127
+ $email['send_on'] = $controls->data['send_on'];
128
+
129
+ if ($controls->is_action('editor')) {
130
+ $email['editor'] = $email['editor'] == 0 ? 1 : 0;
131
+ }
132
+
133
+ // Cleans up of tag
134
+ $email['message'] = NewsletterModule::clean_url_tags($email['message']);
135
+
136
+ $res = Newsletter::instance()->save_email($email);
137
+ if ($res === false) {
138
+ $controls->errors = 'Unable to save. Try to deactivate and reactivate the plugin may be the database is out of sync.';
139
+ }
140
+
141
+ $controls->data['message'] = $email['message'];
142
+
143
+ $controls->add_message_saved();
144
+ }
145
+
146
+ if ($controls->is_action('send')) {
147
+ // Todo subject check
148
+ if ($email['subject'] == '') {
149
+ $controls->errors = __('A subject is required to send', 'newsletter');
150
+ } else {
151
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
152
+ $email['status'] = 'sending';
153
+ $controls->messages .= __('Now sending, see the progress on newsletter list', 'newsletter');
154
+ }
155
+ }
156
+
157
+ if ($controls->is_action('pause')) {
158
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'paused'), array('id' => $email_id));
159
+ $email['status'] = 'paused';
160
+ }
161
+
162
+ if ($controls->is_action('continue')) {
163
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
164
+ $email['status'] = 'sending';
165
+ }
166
+
167
+ if ($controls->is_action('abort')) {
168
+ $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set last_id=0, sent=0, status='new' where id=" . $email_id);
169
+ $email['status'] = 'new';
170
+ $email['sent'] = 0;
171
+ $email['last_id'] = 0;
172
+ $controls->messages = __('Delivery definitively cancelled', 'newsletter');
173
+ }
174
+
175
+ if ($controls->is_action('test')) {
176
+ if ($email['subject'] == '') {
177
+ $controls->errors = __('A subject is required to send', 'newsletter');
178
+ } else {
179
+ $users = NewsletterUsers::instance()->get_test_users();
180
+ if (count($users) == 0) {
181
+ $controls->messages = '<strong>' . __('There are no test subscribers to send to', 'newsletter') . '</strong>';
182
+ } else {
183
+ Newsletter::instance()->send(Newsletter::instance()->get_email($email_id), $users);
184
+ $controls->messages = __('Test newsletter sent to:', 'newsletter');
185
+ foreach ($users as &$user) {
186
+ $controls->messages .= ' ' . $user->email;
187
+ }
188
+ $controls->messages .= '.';
189
+ }
190
+
191
+ $controls->messages .= '<br>';
192
+ $controls->messages .= '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">' .
193
+ __('Read more about test subscribers', 'newsletter') . '</a>.';
194
+
195
+ $controls->messages .= '<br>If diagnostic emails are delivered but test emails are not, try to change the encoding to "base 64" on main configuration panel';
196
+ }
197
+ }
198
+
199
+ //$template = '{message}';
200
+ //
201
+ //if ($email['editor'] == 0) {
202
+ // $x = strpos($controls->data['message'], '<body');
203
+ // // Some time the message in $nc->data is already cleaned up, it depends on action called
204
+ // if ($x !== false) {
205
+ // $x = strpos($controls->data['message'], '>', $x);
206
+ // $y = strpos($controls->data['message'], '</body>');
207
+ //
208
+ // $template = substr($controls->data['message'], 0, $x) . '{message}' . substr($controls->data['message'], $y);
209
+ // $controls->data['message'] = substr($controls->data['message'], $x + 1, $y - $x - 1);
210
+ // }
211
+ //}
212
+
213
+ ?>
214
+
215
+ <div class="wrap" id="tnp-wrap">
216
+
217
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
218
+
219
+ <div id="tnp-heading">
220
+
221
+ <h2><?php _e('Preview Newsletter', 'newsletter') ?></h2>
222
+
223
+ </div>
224
+
225
+ <div id="tnp-body">
226
+
227
+ <?php
228
+ if ($controls->data['status'] == 'S') {
229
+ echo '<div class="newsletter-message">Warning! This email is configured to be sent to NOT CONFIRMED subscribers.</div>';
230
+ }
231
+ ?>
232
+
233
+ <form method="post" action="" id="newsletter-form">
234
+
235
+ <?php $controls->init(array('cookie_name' => 'newsletter_emails_edit_tab')); ?>
236
+
237
+ <p class="submit">
238
+ <?php $controls->button_back('?page=newsletter_emails_composer&id=' . $email['id']) ?>
239
+ <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
240
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
241
+
242
+ <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
243
+ <?php if ($email['status'] == 'sending') $controls->button_confirm('pause', __('Pause', 'newsletter'), __('Pause the delivery?', 'newsletter')); ?>
244
+ <?php if ($email['status'] == 'paused') $controls->button_confirm('continue', __('Continue', 'newsletter'), 'Continue the delivery?'); ?>
245
+ <?php if ($email['status'] == 'paused') $controls->button_confirm('abort', __('Stop', 'newsletter'), __('This totally stop the delivery, ok?', 'newsletter')); ?>
246
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source editor' : 'Preview'), 'Sure?'); ?>
247
+ </p>
248
+
249
+ <div id="tabs">
250
+ <ul>
251
+ <li><a href="#tabs-a"><?php _e('Message', 'newsletter') ?></a></li>
252
+ <li><a href="#tabs-b"><?php _e('Message (textual)', 'newsletter') ?></a></li>
253
+ <li><a href="#tabs-c"><?php _e('Targeting', 'newsletter') ?></a></li>
254
+ <li><a href="#tabs-d"><?php _e('Other', 'newsletter') ?></a></li>
255
+ <li><a href="#tabs-status"><?php _e('Status', 'newsletter') ?></a></li>
256
+ </ul>
257
+
258
+
259
+ <div id="tabs-a" class="tnpc-subject">
260
+
261
+ <?php $controls->text('subject', 100, 'Subject'); ?>
262
+
263
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
264
+
265
+ <br><br>
266
+
267
+ <?php if ($email['editor'] == 0) { ?>
268
+
269
+ <div class="tnpc-preview">
270
+ <!-- Flat Laptop Browser -->
271
+ <div class="fake-browser-ui">
272
+ <div class="frame">
273
+ <span class="bt-1"></span>
274
+ <span class="bt-2"></span>
275
+ <span class="bt-3"></span>
276
+ </div>
277
+ <iframe id="tnpc-preview-desktop" src="" width="700" height="507" alt="Test" frameborder="0"></iframe>
278
+ </div>
279
+
280
+ <!-- Flat Mobile Browser -->
281
+ <div class="fake-mobile-browser-ui">
282
+ <iframe id="tnpc-preview-mobile" src="" width="250" height="445" alt="Test" frameborder="0"></iframe>
283
+ <div class="frame">
284
+ <span class="bt-4"></span>
285
+ </div>
286
+ </div>
287
+ </div>
288
+
289
+ <script type="text/javascript">
290
+ preview_url = ajaxurl + "?action=tnpc_preview&id=<?php echo $email_id ?>";
291
+ jQuery('#tnpc-preview-desktop, #tnpc-preview-mobile').attr("src", preview_url);
292
+ setTimeout(function () {
293
+ jQuery('#tnpc-preview-desktop, #tnpc-preview-mobile').contents().find("a").click(function (e) {
294
+ e.preventDefault();
295
+ })
296
+ }, 500);
297
+ </script>
298
+
299
+ <?php
300
+ } else {
301
+
302
+ // $controls->textarea_preview('message', '100%', '700');
303
+ ?>
304
+
305
+ <input id="options-message" name="options[message]" type="hidden">
306
+
307
+ <div id="tnpc-html-editor"><?php echo htmlentities($email['message']) ?></div>
308
+ <script src="<?php echo plugins_url('newsletter') ?>/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
309
+ <script>
310
+ var editor = ace.edit("tnpc-html-editor");
311
+ editor.setTheme("ace/theme/idle_fingers");
312
+ editor.getSession().setMode("ace/mode/html");
313
+ var message_input = jQuery('#options-message');
314
+ // editor.getSession().setValue(message_input.val());
315
+ message_input.val(editor.getSession().getValue());
316
+ editor.getSession().on('change', function () {
317
+ message_input.val(editor.getSession().getValue());
318
+ });
319
+ </script>
320
+
321
+ <?php }
322
+ ?>
323
+
324
+ </div>
325
+
326
+
327
+ <div id="tabs-b">
328
+ <p>
329
+ This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
330
+ is an anti-spam best practice to include a text only version.
331
+ </p>
332
+
333
+ <?php $controls->textarea_fixed('message_text', '100%', '500'); ?>
334
+ </div>
335
+
336
+
337
+ <div id="tabs-c">
338
+ <table class="form-table">
339
+
340
+ <tr valign="top">
341
+ <th><?php _e('Gender', 'newsletter'); ?></th>
342
+ <td>
343
+ <?php $controls->checkboxes_group('sex', array('f' => 'Women', 'm' => 'Men', 'n' => 'Not specified')); ?>
344
+ <p class="description">
345
+ Leaving all gender options unselected disable this filter.
346
+ </p>
347
+ </td>
348
+ </tr>
349
+ <tr valign="top">
350
+ <th><?php _e('Lists', 'newsletter'); ?></th>
351
+ <td>
352
+ Subscribers with
353
+ <?php $controls->select('preferences_status_operator', array(0 => 'at least one list', 1 => 'all lists')); ?>
354
+
355
+ <?php $controls->select('preferences_status', array(0 => 'active', 1 => 'not active')); ?>
356
+ <?php _e('checked below', 'newsletter') ?>
357
+
358
+ <?php $controls->preferences_group('preferences', true); ?>
359
+ <p class="description">
360
+ You can address the newsletter to subscribers who selected at least one of the options or to who
361
+ has not selected at least one of the options.
362
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Read more about the "NOT ACTIVE" usage</a>.
363
+ </p>
364
+ </td>
365
+ </tr>
366
+
367
+ <tr valign="top">
368
+ <th><?php _e('Status', 'newsletter') ?></th>
369
+ <td>
370
+ <?php $controls->select('status', array('C' => __('Confirmed', 'newsletter'), 'S' => __('Not confirmed', 'newsletter'))); ?>
371
+
372
+ <p class="description">
373
+ <?php _e('Send to not confirmed subscribers ONLY to ask for confirmation including the {subscription_confirm_url} tag.', 'newsletter') ?>
374
+ </p>
375
+ </td>
376
+ </tr>
377
+ <tr valign="top">
378
+ <th>Only to WordPress users?</th>
379
+ <td>
380
+ <?php $controls->yesno('wp_users'); ?>
381
+
382
+ <p class="description">
383
+ Limit to the subscribers which are WordPress users as well.
384
+ </p>
385
+ </td>
386
+ </tr>
387
+ <tr valign="top">
388
+ <th>
389
+ <?php _e('Subscribers count', 'newsletter') ?>
390
+ </th>
391
+ <td>
392
+ <?php
393
+ echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
394
+ ?>
395
+ <p class="description">
396
+ <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
397
+ </p>
398
+ </td>
399
+ </tr>
400
+ </table>
401
+ </div>
402
+
403
+
404
+ <div id="tabs-d">
405
+ <table class="form-table">
406
+ <tr valign="top">
407
+ <th><?php _e('Keep private', 'newsletter') ?></th>
408
+ <td>
409
+ <?php $controls->yesno('private'); ?>
410
+ <p class="description">
411
+ <?php _e('Hide/show from public sent newsletter list.', 'newsletter') ?>
412
+ <?php _e('Required', 'newsletter') ?>: <a href="" target="_blank">Newsletter Archive Extension</a>
413
+ </p>
414
+ </td>
415
+ </tr>
416
+ <tr valign="top">
417
+ <th><?php _e('Track clicks and message opening', 'newsletter') ?></th>
418
+ <td>
419
+ <?php $controls->yesno('track'); ?>
420
+ </td>
421
+ </tr>
422
+ <tr valign="top">
423
+ <th><?php _e('Send on', 'newsletter') ?></th>
424
+ <td>
425
+ <?php $controls->datetime('send_on'); ?> (now: <?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format')); ?>)
426
+ <p class="description">
427
+ If the current date and time are wrong, check your timezone on the General WordPress settings.
428
+ </p>
429
+ </td>
430
+ </tr>
431
+ </table>
432
+ </div>
433
+ <div id="tabs-status">
434
+ <table class="form-table">
435
+ <tr valign="top">
436
+ <th>Email status</th>
437
+ <td><?php echo $email['status']; ?></td>
438
+ </tr>
439
+ <tr valign="top">
440
+ <th>Messages sent</th>
441
+ <td><?php echo $email['sent']; ?> of <?php echo $email['total']; ?></td>
442
+ </tr>
443
+ <tr valign="top">
444
+ <th>Query (tech)</th>
445
+ <td><?php echo $email['query']; ?></td>
446
+ </tr>
447
+ </table>
448
+ </div>
449
+
450
+ <!--
451
+ <div id="tabs-5">
452
+ <p>Tags documented below can be used on newsletter body. Some of them can be used on subject as well.</p>
453
+
454
+ <p>
455
+ Special tags, like the preference setting tag, can be used to highly interact with your subscribers, see
456
+ the Newsletter Preferences page for examples.
457
+ </p>
458
+ --
459
+
460
+ <dl>
461
+ <dt>{set_preference_N}</dt>
462
+ <dd>
463
+ This tag creates a URL which, once clicked, set the preference numner N on the user profile and redirecting the
464
+ subscriber to his profile panel. Preferences can be configured on Subscription/Form fields panel.
465
+ </dd>
466
+ </dl>
467
+
468
+ </ul>
469
+ </div>
470
+ -->
471
+
472
+ </div>
473
+
474
+ </form>
475
+ </div>
476
+
477
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
478
+
479
+ </div>
480
+
trunk/emails/create.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Stops WP Super Cache which removes the logged_in cookie
4
+ $_GET['preview'] = 'true';
5
+
6
+ require_once '../../../../wp-load.php';
7
+
8
+ if (!is_user_logged_in()) {
9
+ die('No logged in user found. A plugin is almost surely removing the authentication cookies, usually a cache plugin. Try to report the issue on http://www.thenewsletterplugin.com forum.');
10
+ }
11
+
12
+ if (!current_user_can('manage_categories')) {
13
+ die('Not enough privileges');
14
+ }
15
+
16
+ if (Newsletter::instance()->options['editor'] != 1 && !current_user_can('manage_options')) {
17
+ die('Not enough privileges');
18
+ }
19
+
20
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
21
+ $controls = new NewsletterControls();
22
+ $module = NewsletterEmails::instance();
23
+
24
+ if ($controls->is_action('create')) {
25
+ $module->save_options($controls->data);
26
+
27
+ $email = array();
28
+ $email['status'] = 'new';
29
+ $email['subject'] = ''; //__('Here the email subject', 'newsletter');
30
+ $email['track'] = 1;
31
+
32
+ $theme_options = $module->get_current_theme_options();
33
+
34
+ $theme_url = $module->get_current_theme_url();
35
+ $theme_subject = '';
36
+
37
+ ob_start();
38
+ include $module->get_current_theme_file_path('theme.php');
39
+ $email['message'] = ob_get_clean();
40
+
41
+ if (!empty($theme_subject)) {
42
+ $email['subject'] = $theme_subject;
43
+ }
44
+
45
+ ob_start();
46
+ include $module->get_current_theme_file_path('theme-text.php');
47
+ $email['message_text'] = ob_get_clean();
48
+
49
+ $email['type'] = 'message';
50
+ $email['send_on'] = time();
51
+ $email = Newsletter::instance()->save_email($email);
52
+
53
+ header('Location: ' . $module->get_admin_page_url('edit') . '&id=' . $email->id);
54
+ }
trunk/emails/css.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ $email_id = (int)$_GET['id'];
6
+
7
+ $body = Newsletter::instance()->get_email_field($email_id, 'message');
8
+
9
+ $x = strpos($body, '<style');
10
+ if ($x === false) return;
11
+
12
+ $x = strpos($body, '>', $x);
13
+ $y = strpos($body, '</style>');
14
+
15
+ header('Content-Type: text/css');
16
+
17
+ echo substr($body, $x+1, $y-$x-1);
trunk/emails/edit.php ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $wpdb wpdb */
3
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
4
+ $controls = new NewsletterControls();
5
+ $module = NewsletterEmails::instance();
6
+
7
+ // Always required
8
+ $email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
9
+
10
+ if (empty($email)) {
11
+ echo 'Wrong email identifier';
12
+ return;
13
+ }
14
+ $email_id = $email['id'];
15
+
16
+ // If there is no action we assume we are enter the first time so we populate the
17
+ // $nc->data with the editable email fields
18
+ if (!$controls->is_action()) {
19
+ $controls->data = $email;
20
+ if (!empty($email['preferences'])) {
21
+ $controls->data['preferences'] = explode(',', $email['preferences']);
22
+ }
23
+ if (!empty($email['sex'])) {
24
+ $controls->data['sex'] = explode(',', $email['sex']);
25
+ }
26
+ $email_options = unserialize($email['options']);
27
+ if (is_array($email_options)) {
28
+ $controls->data = array_merge($controls->data, $email_options);
29
+ }
30
+ }
31
+
32
+ if ($controls->is_action('test') || $controls->is_action('save') || $controls->is_action('send') || $controls->is_action('editor')) {
33
+
34
+ // If we were editing with visual editor (==0), we must read the extra <body> content
35
+ if ($email['editor'] == 0) {
36
+ $x = strpos($email['message'], '<body');
37
+ if ($x !== false) {
38
+ $x = strpos($email['message'], '>', $x);
39
+ $email['message'] = substr($email['message'], 0, $x + 1) . $controls->data['message'] . '</body></html>';
40
+ } else {
41
+ $email['message'] = '<html><body>' . $controls->data['message'] . '</body></html>';
42
+ }
43
+ } else {
44
+ $email['message'] = $controls->data['message'];
45
+ }
46
+ $email['message_text'] = $controls->data['message_text'];
47
+ $email['subject'] = $controls->data['subject'];
48
+ $email['track'] = $controls->data['track'];
49
+ $email['private'] = $controls->data['private'];
50
+
51
+ // Builds the extended options
52
+ $email['options'] = array();
53
+ $email['options']['preferences_status'] = $controls->data['preferences_status'];
54
+ if (isset($controls->data['preferences'])) {
55
+ $email['options']['preferences'] = $controls->data['preferences'];
56
+ }
57
+ if (isset($controls->data['sex'])) {
58
+ $email['options']['sex'] = $controls->data['sex'];
59
+ }
60
+
61
+ $email['options']['status'] = $controls->data['status'];
62
+ $email['options']['preferences_status_operator'] = $controls->data['preferences_status_operator'];
63
+ $email['options']['wp_users'] = $controls->data['wp_users'];
64
+
65
+ $email['options'] = serialize($email['options']);
66
+
67
+ if (isset($controls->data['preferences'])) {
68
+ $email['preferences'] = implode(',', $controls->data['preferences']);
69
+ } else {
70
+ $email['preferences'] = '';
71
+ }
72
+
73
+ if (isset($controls->data['sex'])) {
74
+ $email['sex'] = implode(',', $controls->data['sex']);
75
+ } else {
76
+ $email['sex'] = '';
77
+ }
78
+
79
+ // Before send, we build the query to extract subscriber, so the delivery engine does not
80
+ // have to worry about the email parameters
81
+ if ($controls->data['status'] == 'S') {
82
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='S'";
83
+ } else {
84
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
85
+ }
86
+
87
+ if ($controls->data['wp_users'] == '1') {
88
+ $query .= " and wp_user_id<>0";
89
+ }
90
+
91
+
92
+ if (isset($controls->data['preferences'])) {
93
+ $preferences = $controls->data['preferences'];
94
+
95
+ // Not set one of the preferences specified
96
+ $operator = $controls->data['preferences_status_operator'] == 0 ? ' or ' : ' and ';
97
+ if ($controls->data['preferences_status'] == 1) {
98
+ $query .= " and (";
99
+ foreach ($preferences as $x) {
100
+ $query .= "list_" . ((int)$x) . "=0" . $operator;
101
+ }
102
+ $query = substr($query, 0, -4);
103
+ $query .= ")";
104
+ } else {
105
+ $query .= " and (";
106
+ foreach ($preferences as $x) {
107
+ $query .= "list_" . ((int)$x) . "=1" . $operator;
108
+ }
109
+ $query = substr($query, 0, -4);
110
+ $query .= ")";
111
+ }
112
+ }
113
+
114
+ $sex = $controls->data['sex'];
115
+ if (is_array($sex)) {
116
+ $query .= " and sex in (";
117
+ foreach ($sex as $x) {
118
+ $query .= "'" . esc_sql($x) . "', ";
119
+ }
120
+ $query = substr($query, 0, -2);
121
+ $query .= ")";
122
+ }
123
+
124
+ $email['query'] = $query;
125
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
126
+
127
+ if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
128
+ $controls->data['send_on'] = time();
129
+ }
130
+ $email['send_on'] = $controls->data['send_on'];
131
+
132
+ if ($controls->is_action('editor')) {
133
+ $email['editor'] = $email['editor'] == 0 ? 1 : 0;
134
+ }
135
+
136
+ // Cleans up of tag
137
+ $email['message'] = NewsletterModule::clean_url_tags($email['message']);
138
+
139
+ $res = Newsletter::instance()->save_email($email);
140
+ if ($res === false) {
141
+ $controls->errors = 'Unable to save. Try to deactivate and reactivate the plugin may be the database is out of sync.';
142
+ }
143
+
144
+ $controls->data['message'] = $email['message'];
145
+
146
+ $controls->add_message_saved();
147
+ }
148
+
149
+ if ($controls->is_action('send')) {
150
+ // Todo subject check
151
+ if ($email['subject'] == '') {
152
+ $controls->errors = __('A subject is required to send', 'newsletter');
153
+ } else {
154
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
155
+ $email['status'] = 'sending';
156
+ $controls->messages .= __('Now sending, see the progress on newsletter list', 'newsletter');
157
+ }
158
+ }
159
+
160
+ if ($controls->is_action('pause')) {
161
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'paused'), array('id' => $email_id));
162
+ $email['status'] = 'paused';
163
+ }
164
+
165
+ if ($controls->is_action('continue')) {
166
+ $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
167
+ $email['status'] = 'sending';
168
+ }
169
+
170
+ if ($controls->is_action('abort')) {
171
+ $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set last_id=0, sent=0, status='new' where id=" . $email_id);
172
+ $email['status'] = 'new';
173
+ $email['sent'] = 0;
174
+ $email['last_id'] = 0;
175
+ $controls->messages = __('Delivery definitively cancelled', 'newsletter');
176
+ }
177
+
178
+ if ($controls->is_action('test')) {
179
+ if ($email['subject'] == '') {
180
+ $controls->errors = __('A subject is required to send', 'newsletter');
181
+ } else {
182
+ $users = NewsletterUsers::instance()->get_test_users();
183
+ if (count($users) == 0) {
184
+ $controls->messages = '<strong>' . __('There are no test subscribers to send to', 'newsletter') . '</strong>';
185
+ } else {
186
+ Newsletter::instance()->send(Newsletter::instance()->get_email($email_id), $users);
187
+ $controls->messages = __('Test newsletter sent to:', 'newsletter');
188
+ foreach ($users as &$user) {
189
+ $controls->messages .= ' ' . $user->email;
190
+ }
191
+ $controls->messages .= '.';
192
+ }
193
+
194
+ $controls->messages .= '<br>';
195
+ $controls->messages .= '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">' .
196
+ __('Read more about test subscribers', 'newsletter') . '</a>.';
197
+
198
+ $controls->messages .= '<br>If diagnostic emails are delivered but test emails are not, try to change the encoding to "base 64" on main configuration panel';
199
+ }
200
+ }
201
+
202
+ $template = '{message}';
203
+ if ($email['editor'] == 0) {
204
+ $x = strpos($controls->data['message'], '<body');
205
+ // Some time the message in $nc->data is already cleaned up, it depends on action called
206
+ if ($x !== false) {
207
+ $x = strpos($controls->data['message'], '>', $x);
208
+ $y = strpos($controls->data['message'], '</body>');
209
+
210
+ $template = substr($controls->data['message'], 0, $x) . '{message}' . substr($controls->data['message'], $y);
211
+ $controls->data['message'] = substr($controls->data['message'], $x + 1, $y - $x - 1);
212
+ }
213
+ }
214
+ ?>
215
+
216
+ <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tiny_mce/tiny_mce.js"></script>
217
+ <script type="text/javascript">
218
+ var template = <?php echo json_encode($template) ?>;
219
+ tinyMCE.init({
220
+ height: 700,
221
+ mode: "specific_textareas",
222
+ editor_selector: "visual",
223
+ theme: "advanced",
224
+ entity_encoding: "raw",
225
+ plugins: "table,fullscreen,legacyoutput",
226
+ theme_advanced_disable: "styleselect",
227
+ theme_advanced_buttons1_add: "forecolor,blockquote,code,fontsizeselect,fontselect",
228
+ theme_advanced_buttons3_add: "tablecontrols,fullscreen",
229
+ relative_urls: false,
230
+ theme_advanced_statusbar_location: "bottom",
231
+ remove_script_host: false,
232
+ theme_advanced_resizing: true,
233
+ theme_advanced_toolbar_location: "top",
234
+ document_base_url: "<?php echo get_option('home'); ?>/",
235
+ content_css: ["<?php echo plugins_url('newsletter') ?>/emails/editor.css", "<?php echo plugins_url('newsletter') . '/emails/css.php?id=' . $email_id . '&' . time(); ?>"]
236
+ });
237
+
238
+ jQuery(document).ready(function () {
239
+ jQuery('#upload_image_button').click(function () {
240
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
241
+ return false;
242
+ });
243
+
244
+ window.send_to_editor = function (html) {
245
+ var imgURL = html.match(/src=\"(.*?)\"/);
246
+ tinyMCE.execCommand('mceInsertContent', false, '<img src="' + imgURL[1] + '" />');
247
+ tb_remove();
248
+ }
249
+ });
250
+
251
+ function template_refresh() {
252
+ var d = document.getElementById('options_preview').contentWindow.document;
253
+ d.open();
254
+ //d.write(template.replace("{messaggio}", templateEditor.getValue()));
255
+ d.write(template.replace("{message}", document.getElementById("options-message").value));
256
+ d.close();
257
+ jQuery("#options_preview").toggle();
258
+ }
259
+ </script>
260
+
261
+ <div class="wrap" id="tnp-wrap">
262
+
263
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
264
+
265
+ <div id="tnp-heading">
266
+
267
+ <h2><?php _e('Edit Newsletter', 'newsletter') ?></h2>
268
+
269
+ </div>
270
+
271
+ <div id="tnp-body">
272
+
273
+ <?php
274
+ if ($controls->data['status'] == 'S') {
275
+ echo '<div class="newsletter-message">Warning! This email is configured to be sent to NOT CONFIRMED subscribers.</div>';
276
+ }
277
+ ?>
278
+
279
+ <form method="post" action="" id="newsletter-form">
280
+ <?php $controls->init(array('cookie_name' => 'newsletter_emails_edit_tab')); ?>
281
+
282
+ <p class="submit">
283
+ <?php $controls->button_back('?page=newsletter_emails_index') ?>
284
+ <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
285
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
286
+
287
+ <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
288
+ <?php if ($email['status'] == 'sending') $controls->button_confirm('pause', __('Pause', 'newsletter'), __('Pause the delivery?', 'newsletter')); ?>
289
+ <?php if ($email['status'] == 'paused') $controls->button_confirm('continue', __('Continue', 'newsletter'), 'Continue the delivery?'); ?>
290
+ <?php if ($email['status'] == 'paused') $controls->button_confirm('abort', __('Stop', 'newsletter'), __('This totally stop the delivery, ok?', 'newsletter')); ?>
291
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source' : 'visual') . ' editor', 'Sure?'); ?>
292
+ </p>
293
+
294
+ <div id="tabs">
295
+ <ul>
296
+ <li><a href="#tabs-a"><?php _e('Message', 'newsletter') ?></a></li>
297
+ <li><a href="#tabs-b"><?php _e('Message (textual)', 'newsletter') ?></a></li>
298
+ <li><a href="#tabs-c"><?php _e('Targeting', 'newsletter') ?></a></li>
299
+ <li><a href="#tabs-d"><?php _e('Other', 'newsletter') ?></a></li>
300
+ <li><a href="#tabs-status"><?php _e('Status', 'newsletter') ?></a></li>
301
+ </ul>
302
+
303
+
304
+ <div id="tabs-a">
305
+
306
+ <?php $controls->text('subject', 70, 'Subject'); ?>
307
+
308
+
309
+
310
+ <input id="upload_image_button" type="button" value="Choose or upload an image" />
311
+
312
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
313
+
314
+ <br><br>
315
+
316
+
317
+
318
+ <?php
319
+ if ($email['editor'] == 0) {
320
+ $controls->editor('message', 30);
321
+ } else {
322
+ $controls->textarea_preview('message', '100%', '700');
323
+ }
324
+ ?>
325
+
326
+
327
+ </div>
328
+
329
+
330
+ <div id="tabs-b">
331
+ <?php if (Newsletter::instance()->options['phpmailer'] == 0) { ?>
332
+ <p class="tnp-tab-warning">The text part is sent only when Newsletter manages directly the sending process. <a href="admin.php?page=newsletter_main_main" target="_blank">See the main settings</a>.</p>
333
+ <?php } ?>
334
+ <p>
335
+ This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
336
+ is an anti-spam best practice to include a text only version.
337
+ </p>
338
+
339
+ <?php $controls->textarea_fixed('message_text', '100%', '500'); ?>
340
+ </div>
341
+
342
+
343
+ <div id="tabs-c">
344
+ <table class="form-table">
345
+
346
+ <tr valign="top">
347
+ <th><?php _e('Gender', 'newsletter'); ?></th>
348
+ <td>
349
+ <?php $controls->checkboxes_group('sex', array('f' => 'Women', 'm' => 'Men', 'n' => 'Not specified')); ?>
350
+ <p class="description">
351
+ Leaving all gender options unselected disable this filter.
352
+ </p>
353
+ </td>
354
+ </tr>
355
+ <tr valign="top">
356
+ <th><?php _e('Lists', 'newsletter'); ?></th>
357
+ <td>
358
+ Subscribers with
359
+ <?php $controls->select('preferences_status_operator', array(0 => 'at least one list', 1 => 'all lists')); ?>
360
+
361
+ <?php $controls->select('preferences_status', array(0 => 'active', 1 => 'not active')); ?>
362
+ <?php _e('checked below', 'newsletter') ?>
363
+
364
+ <?php $controls->preferences_group('preferences', true); ?>
365
+ <p class="description">
366
+ You can address the newsletter to subscribers who selected at least one of the options or to who
367
+ has not selected at least one of the options.
368
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Read more about the "NOT ACTIVE" usage</a>.
369
+ </p>
370
+ </td>
371
+ </tr>
372
+
373
+ <tr valign="top">
374
+ <th><?php _e('Status', 'newsletter') ?></th>
375
+ <td>
376
+ <?php $controls->select('status', array('C' => __('Confirmed', 'newsletter'), 'S' => __('Not confirmed', 'newsletter'))); ?>
377
+
378
+ <p class="description">
379
+ <?php _e('Send to not confirmed subscribers ONLY to ask for confirmation including the {subscription_confirm_url} tag.', 'newsletter') ?>
380
+ </p>
381
+ </td>
382
+ </tr>
383
+ <tr valign="top">
384
+ <th>Only to WordPress users?</th>
385
+ <td>
386
+ <?php $controls->yesno('wp_users'); ?>
387
+
388
+ <p class="description">
389
+ Limit to the subscribers which are WordPress users as well.
390
+ </p>
391
+ </td>
392
+ </tr>
393
+ <tr valign="top">
394
+ <th>
395
+ <?php _e('Subscribers count', 'newsletter') ?>
396
+ </th>
397
+ <td>
398
+ <?php
399
+ echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
400
+ ?>
401
+ <p class="description">
402
+ <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
403
+ </p>
404
+ </td>
405
+ </tr>
406
+ </table>
407
+ </div>
408
+
409
+
410
+ <div id="tabs-d">
411
+ <table class="form-table">
412
+ <tr valign="top">
413
+ <th><?php _e('Keep private', 'newsletter') ?></th>
414
+ <td>
415
+ <?php $controls->yesno('private'); ?>
416
+ <p class="description">
417
+ <?php _e('Hide/show from public sent newsletter list.', 'newsletter') ?>
418
+ <?php _e('Required', 'newsletter') ?>: <a href="" target="_blank">Newsletter Archive Extension</a>
419
+ </p>
420
+ </td>
421
+ </tr>
422
+ <tr valign="top">
423
+ <th><?php _e('Track clicks and message opening', 'newsletter') ?></th>
424
+ <td>
425
+ <?php $controls->yesno('track'); ?>
426
+ </td>
427
+ </tr>
428
+ <tr valign="top">
429
+ <th><?php _e('Send on', 'newsletter') ?></th>
430
+ <td>
431
+ <?php $controls->datetime('send_on'); ?> (now: <?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format')); ?>)
432
+ <p class="description">
433
+ If the current date and time are wrong, check your timezone on the General WordPress settings.
434
+ </p>
435
+ </td>
436
+ </tr>
437
+ </table>
438
+ </div>
439
+
440
+ <div id="tabs-status">
441
+ <table class="form-table">
442
+ <tr valign="top">
443
+ <th>Email status</th>
444
+ <td><?php echo $email['status']; ?></td>
445
+ </tr>
446
+ <tr valign="top">
447
+ <th>Messages sent</th>
448
+ <td><?php echo $email['sent']; ?> of <?php echo $email['total']; ?></td>
449
+ </tr>
450
+ <tr valign="top">
451
+ <th>Query (tech)</th>
452
+ <td><?php echo $email['query']; ?></td>
453
+ </tr>
454
+ </table>
455
+ </div>
456
+
457
+ <!--
458
+ <div id="tabs-5">
459
+ <p>Tags documented below can be used on newsletter body. Some of them can be used on subject as well.</p>
460
+
461
+ <p>
462
+ Special tags, like the preference setting tag, can be used to highly interact with your subscribers, see
463
+ the Newsletter Preferences page for examples.
464
+ </p>
465
+ --
466
+
467
+ <dl>
468
+ <dt>{set_preference_N}</dt>
469
+ <dd>
470
+ This tag creates a URL which, once clicked, set the preference numner N on the user profile and redirecting the
471
+ subscriber to his profile panel. Preferences can be configured on Subscription/Form fields panel.
472
+ </dd>
473
+ </dl>
474
+
475
+ </ul>
476
+ </div>
477
+ -->
478
+
479
+ </div>
480
+
481
+ </form>
482
+ </div>
483
+
484
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
485
+
486
+ </div>
trunk/emails/editor.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ body, td, pre {
2
+ font-size: 12px;
3
+ }
4
+
trunk/emails/emails.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
4
+ require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
5
+
6
+ class NewsletterEmails extends NewsletterModule {
7
+
8
+ static $instance;
9
+
10
+ /**
11
+ * @return NewsletterEmails
12
+ */
13
+ static function instance() {
14
+ if (self::$instance == null) {
15
+ self::$instance = new NewsletterEmails();
16
+ }
17
+ return self::$instance;
18
+ }
19
+
20
+ function __construct() {
21
+ $this->themes = new NewsletterThemes('emails');
22
+ parent::__construct('emails', '1.1.2');
23
+ add_action('wp_loaded', array($this, 'hook_wp_loaded'));
24
+ }
25
+
26
+ function hook_wp_loaded() {
27
+ global $newsletter, $wpdb;
28
+ switch ($newsletter->action) {
29
+ case 'v':
30
+ // TODO: Change to Newsletter::instance()->get:email(), not urgent
31
+ $email = $this->get_email((int) $_GET['id']);
32
+ if (empty($email)) {
33
+ die('Email not found');
34
+ }
35
+
36
+ if ($email->private == 1) {
37
+ die('Email not found');
38
+ }
39
+
40
+ $user = NewsletterSubscription::instance()->get_user_from_request();
41
+ header('Content-Type: text/html;charset=UTF-8');
42
+ header('X-Robots-Tag: noindex,nofollow,noarchive');
43
+ header('Cache-Control: no-cache,no-store,private');
44
+ if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/view.php')) {
45
+ include WP_CONTENT_DIR . '/extensions/newsletter/view.php';
46
+ die();
47
+ }
48
+
49
+ echo $newsletter->replace($email->message, $user, $email->id);
50
+
51
+ die();
52
+ }
53
+ }
54
+
55
+ function upgrade() {
56
+ global $wpdb, $charset_collate;
57
+
58
+ parent::upgrade();
59
+
60
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " change column `type` `type` varchar(50) not null default ''");
61
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column token varchar(10) not null default ''");
62
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column visibility");
63
+ $this->upgrade_query("update " . NEWSLETTER_EMAILS_TABLE . " set type='message' where type=''");
64
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column private tinyint(1) not null default 0");
65
+
66
+ // Force a token to email without one already set.
67
+ $token = self::get_token();
68
+ $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
69
+
70
+ return true;
71
+ }
72
+
73
+ function admin_menu() {
74
+ $this->add_menu_page('index', 'Newsletters');
75
+ $this->add_admin_page('list', 'Email List');
76
+ $this->add_admin_page('new', 'Email New');
77
+ $this->add_admin_page('edit', 'Email Edit');
78
+ $this->add_admin_page('theme', 'Email Themes');
79
+ $this->add_admin_page('composer', 'The Composer');
80
+ $this->add_admin_page('cpreview', 'The Composer Preview');
81
+ }
82
+
83
+ /**
84
+ * Returns the current selected theme.
85
+ */
86
+ function get_current_theme() {
87
+ $theme = $this->options['theme'];
88
+ if (empty($theme))
89
+ return 'blank';
90
+ else
91
+ return $theme;
92
+ }
93
+
94
+ function get_current_theme_options() {
95
+ $theme_options = $this->themes->get_options($this->get_current_theme());
96
+ // main options merge
97
+ $main_options = Newsletter::instance()->options;
98
+ foreach ($main_options as $key => $value) {
99
+ $theme_options['main_' . $key] = $value;
100
+ }
101
+ return $theme_options;
102
+ }
103
+
104
+ /**
105
+ * Returns the file path to a theme using the theme overriding rules.
106
+ * @param type $theme
107
+ * @param type $file
108
+ */
109
+ function get_theme_file_path($theme, $file) {
110
+ return $this->themes->get_file_path($theme);
111
+ }
112
+
113
+ function get_current_theme_file_path($file) {
114
+ return $this->themes->get_file_path($this->get_current_theme(), $file);
115
+ }
116
+
117
+ function get_current_theme_url() {
118
+ return $this->themes->get_theme_url($this->get_current_theme());
119
+ }
120
+
121
+ /**
122
+ * Returns true if the emails database still contain old 2.5 format emails.
123
+ *
124
+ * @return boolean
125
+ */
126
+ function has_old_emails() {
127
+ return $this->store->get_count(NEWSLETTER_EMAILS_TABLE, "where type='email'") > 0;
128
+ }
129
+
130
+ function convert_old_emails() {
131
+ global $newsletter;
132
+ $list = $newsletter->get_emails('email', ARRAY_A);
133
+ foreach ($list as &$email) {
134
+ $email['type'] = 'message';
135
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
136
+
137
+ if ($email['list'] != 0)
138
+ $query .= " and list_" . $email['list'] . "=1";
139
+ $email['preferences'] = $email['list'];
140
+
141
+ if (!empty($email['sex'])) {
142
+ $query .= " and sex='" . $email['sex'] . "'";
143
+ }
144
+ $email['query'] = $query;
145
+
146
+ $newsletter->save_email($email);
147
+ }
148
+ }
149
+
150
+ }
151
+
152
+ NewsletterEmails::instance();
trunk/emails/index.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $controls = new NewsletterControls();
4
+ $module = NewsletterEmails::instance();
5
+
6
+ if ($controls->is_action('convert')) {
7
+ $module->convert_old_emails();
8
+ $controls->messages = 'Converted!';
9
+ }
10
+
11
+ if ($controls->is_action('unconvert')) {
12
+ $wpdb->query("update wp_newsletter_emails set type='email' where type='message'");
13
+ $controls->messages = 'Unconverted!';
14
+ }
15
+
16
+ if ($controls->is_action('send')) {
17
+ $newsletter->hook_newsletter();
18
+ $controls->messages .= __('Delivery engine triggered.', 'newsletter');
19
+ }
20
+
21
+ if ($controls->is_action('copy')) {
22
+ $original = Newsletter::instance()->get_email($_POST['btn']);
23
+ $email = array();
24
+ $email['subject'] = $original->subject;
25
+ $email['message'] = $original->message;
26
+ $email['message_text'] = $original->message_text;
27
+ $email['send_on'] = time();
28
+ $email['type'] = 'message';
29
+ $email['editor'] = $original->editor;
30
+ $email['track'] = $original->track;
31
+ if(isset($original->options)) {
32
+ $original_options = unserialize($original->options);
33
+ $email['options'] = serialize(array('composer' => $original_options['composer']));
34
+ }
35
+
36
+ Newsletter::instance()->save_email($email);
37
+ $controls->messages .= __('Message duplicated.', 'newsletter');
38
+ }
39
+
40
+ if ($controls->is_action('delete')) {
41
+ Newsletter::instance()->delete_email($_POST['btn']);
42
+ $controls->messages .= __('Message deleted.', 'newsletter');
43
+ }
44
+
45
+ if ($controls->is_action('delete_selected')) {
46
+ $r = Newsletter::instance()->delete_email($_POST['ids']);
47
+ $controls->messages .= $r . ' message(s) deleted';
48
+ }
49
+
50
+ $emails = Newsletter::instance()->get_emails('message');
51
+ ?>
52
+
53
+ <div class="wrap" id="tnp-wrap">
54
+
55
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
56
+
57
+ <div id="tnp-heading">
58
+
59
+ <h2><?php _e('Newsletters', 'newsletter') ?></h2>
60
+
61
+ </div>
62
+
63
+ <div id="tnp-body">
64
+
65
+ <form method="post" action="">
66
+ <?php $controls->init(); ?>
67
+
68
+ <?php if ($module->has_old_emails()) { ?>
69
+ <div class="newsletter-message">
70
+ <p>
71
+ Your Newsletter installation has emails still in old format. To get them listed, you should convert them in
72
+ a new format. Would you to convert them now?
73
+ </p>
74
+ <p>
75
+ <?php $controls->button('convert', 'Convert now'); ?>
76
+ </p>
77
+ </div>
78
+ <?php } ?>
79
+
80
+ <p>
81
+ <a href="<?php echo $module->get_admin_page_url('theme'); ?>" class="button"><?php _e('New newsletter', 'newsletter') ?></a>
82
+ <?php $controls->button_confirm('delete_selected', __('Delete selected newsletters', 'newsletter'), __('Proceed?', 'newsletter'));
83
+ ?>
84
+ <?php $controls->button('send', __('Trigger the delivery engine', 'newsletter')); ?>
85
+ </p>
86
+ <table class="widefat">
87
+ <thead>
88
+ <tr>
89
+ <th>&nbsp;</th>
90
+ <th>Id</th>
91
+ <th><?php _e('Subject', 'newsletter') ?></th>
92
+ <th><?php _e('Status', 'newsletter') ?></th>
93
+ <th><?php _e('Progress', 'newsletter') ?>&nbsp;(*)</th>
94
+ <th><?php _e('Date', 'newsletter') ?></th>
95
+ <th><?php _e('Tracking', 'newsletter') ?></th>
96
+ <th>&nbsp;</th>
97
+ <th>&nbsp;</th>
98
+ <th>&nbsp;</th>
99
+ <th>&nbsp;</th>
100
+ </tr>
101
+ </thead>
102
+
103
+ <tbody>
104
+ <?php foreach ($emails as &$email) {
105
+ $email_options = unserialize($email->options);
106
+ ?>
107
+ <tr>
108
+ <td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
109
+ <td><?php echo $email->id; ?></td>
110
+ <td><?php
111
+ if ($email->subject)
112
+ echo htmlspecialchars($email->subject);
113
+ else
114
+ echo "Newsletter #" . $email->id;
115
+ ?></td>
116
+
117
+ <td>
118
+ <?php
119
+ if ($email->status == 'sending') {
120
+ if ($email->send_on > time()) {
121
+ _e('Scheduled', 'newsletter');
122
+ } else {
123
+ _e('Sending', 'newsletter');
124
+ }
125
+ } else {
126
+ echo $email->status;
127
+ }
128
+ ?>
129
+ </td>
130
+ <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
131
+ <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
132
+ <td><?php echo $email->track == 1 ? __('Yes', 'newsletter') : __('Yes', 'newsletter'); ?></td>
133
+ <td><a class="button" href="<?php echo $module->get_admin_page_url(is_array($email_options) && array_key_exists('composer', $email_options) && $email_options['composer'] ? 'composer' : 'edit'); ?>&amp;id=<?php echo $email->id; ?>"><i class="fa fa-pencil"></i> <?php _e('Edit', 'newsletter') ?></a></td>
134
+ <td>
135
+ <a class="button" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>"><i class="fa fa-bar-chart"></i> <?php _e('Statistics', 'newsletter') ?></a>
136
+ </td>
137
+ <td><?php $controls->button_copy($email->id); ?></td>
138
+ <td><?php $controls->button_delete($email->id); ?></td>
139
+ </tr>
140
+ <?php } ?>
141
+ </tbody>
142
+ <tfoot>
143
+ <tr>
144
+ <td colspan="11">
145
+ (*) <?php _e('Expected total at the end of the delivery may differ, due to subscriptions/unsubscriptions occured meanwhile.', 'newsletter') ?>
146
+ </td>
147
+ </tr>
148
+ </tfoot>
149
+ </table>
150
+ </form>
151
+ </div>
152
+
153
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
154
+
155
+ </div>
trunk/emails/languages/en_US.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // This file is used only on first installation!
4
+
5
+ $options = array(
6
+ 'theme'=>'default'
7
+ );
trunk/emails/languages/en_US.po ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Content-Type: text/plain; charset=utf-8\n"
4
+ "Content-Transfer-Encoding: 8bit\n"
5
+
6
+ #. Text in echo
7
+ #: emails/new.php:132
8
+ msgid "Back to the themes"
9
+ msgstr ""
10
+
11
+ #. Text in function
12
+ #: emails/index.php:131
13
+ msgid "Copy"
14
+ msgstr ""
15
+
16
+ #. Text in echo
17
+ #: emails/new.php:131
18
+ msgid "Create a newsletter"
19
+ msgstr ""
20
+
21
+ #. Text in echo
22
+ #: emails/index.php:94
23
+ msgid "Date"
24
+ msgstr ""
25
+
26
+ #. Text in function
27
+ #: emails/index.php:132
28
+ msgid "Delete"
29
+ msgstr ""
30
+
31
+ #. Text in function
32
+ #: emails/index.php:82
33
+ msgid "Delete selected newsletters"
34
+ msgstr ""
35
+
36
+ #. Text in function
37
+ #: emails/index.php:1
38
+ msgid "Delivery engine triggered."
39
+ msgstr ""
40
+
41
+ #. Text in echo
42
+ #: emails/edit.php:302
43
+ msgid "Gender"
44
+ msgstr ""
45
+
46
+ #. Text in function
47
+ #: emails/new.php:1
48
+ #: emails/new.php:43
49
+ msgid "Here the email subject"
50
+ msgstr ""
51
+
52
+ #. Text in echo
53
+ #: emails/edit.php:259
54
+ msgid "Message"
55
+ msgstr ""
56
+
57
+ #. Text in echo
58
+ #: emails/edit.php:260
59
+ msgid "Message (textual)"
60
+ msgstr ""
61
+
62
+ #. Text in function
63
+ #: emails/index.php:1
64
+ msgid "Message deleted."
65
+ msgstr ""
66
+
67
+ #. Text in function
68
+ #: emails/index.php:1
69
+ msgid "Message duplicated."
70
+ msgstr ""
71
+
72
+ #. Text in echo
73
+ #: emails/index.php:81
74
+ msgid "New newsletter"
75
+ msgstr ""
76
+
77
+ #. Text in echo
78
+ #: emails/index.php:58
79
+ msgid "Newsletters"
80
+ msgstr ""
81
+
82
+ #. Text in function
83
+ #: emails/index.php:82
84
+ #: emails/index.php:131
85
+ #: emails/index.php:132
86
+ msgid "Proceed?"
87
+ msgstr ""
88
+
89
+ #. Text in echo
90
+ #: emails/index.php:93
91
+ msgid "Progress"
92
+ msgstr ""
93
+
94
+ #. Text in function
95
+ #: emails/edit.php:1
96
+ msgid "Read more about test subscribers"
97
+ msgstr ""
98
+
99
+ #. Text in echo
100
+ #: emails/new.php:146
101
+ msgid "Refresh the preview"
102
+ msgstr ""
103
+
104
+ #. Text in echo
105
+ #: emails/index.php:111
106
+ msgid "Scheduled"
107
+ msgstr ""
108
+
109
+ #. Text in echo
110
+ #: emails/theme.php:54
111
+ msgid "Select a theme"
112
+ msgstr ""
113
+
114
+ #. Text in echo
115
+ #: emails/index.php:111
116
+ msgid "Sending"
117
+ msgstr ""
118
+
119
+ #. Text in echo
120
+ #: emails/index.php:92
121
+ msgid "Status"
122
+ msgstr ""
123
+
124
+ #. Text in echo
125
+ #: emails/index.php:91
126
+ msgid "Subject"
127
+ msgstr ""
128
+
129
+ #. Text in echo
130
+ #: emails/edit.php:311
131
+ msgid "Subscriber preferences"
132
+ msgstr ""
133
+
134
+ #. Text in function
135
+ #: emails/edit.php:1
136
+ msgid "Test newsletter sent to:"
137
+ msgstr ""
138
+
139
+ #. Text in echo
140
+ #: emails/index.php:137
141
+ msgid "The expected total can change at the delivery end due to subscriptions/unsubscriptions in the meanwhile."
142
+ msgstr ""
143
+
144
+ #. Text in echo
145
+ #: emails/new.php:147
146
+ msgid "Theme options are saved for next time you\\'ll use this theme."
147
+ msgstr ""
148
+
149
+ #. Text in function
150
+ #: emails/edit.php:1
151
+ msgid "There are no test subscribers."
152
+ msgstr ""
153
+
154
+ #. Text in echo
155
+ #: emails/index.php:95
156
+ msgid "Tracking"
157
+ msgstr ""
158
+
159
+ #. Text in function
160
+ #: emails/index.php:84
161
+ msgid "Trigger the delivery engine"
162
+ msgstr ""
163
+
164
+ #. Text in function
165
+ #: emails/index.php:126
166
+ msgid "Yes"
167
+ msgstr ""
168
+
169
+ #. Text in function
170
+ #: emails/index.php:124
171
+ msgid "of"
172
+ msgstr ""
trunk/emails/languages/it_IT.mo ADDED
Binary file
trunk/emails/languages/it_IT.po ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Content-Type: text/plain; charset=UTF-8\n"
4
+ "Content-Transfer-Encoding: 8bit\n"
5
+ "Project-Id-Version: \n"
6
+ "POT-Creation-Date: \n"
7
+ "PO-Revision-Date: \n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "X-Generator: Poedit 1.7.3\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "Language: it_IT\n"
14
+
15
+ #. Text in echo
16
+ #: emails/new.php:132
17
+ msgid "Back to the themes"
18
+ msgstr "Torna ai temi"
19
+
20
+ #. Text in function
21
+ #: emails/index.php:131
22
+ msgid "Copy"
23
+ msgstr "Copia"
24
+
25
+ #. Text in echo
26
+ #: emails/new.php:131
27
+ msgid "Create a newsletter"
28
+ msgstr "Crea una newsletter"
29
+
30
+ #. Text in echo
31
+ #: emails/index.php:94
32
+ msgid "Date"
33
+ msgstr "Data"
34
+
35
+ #. Text in function
36
+ #: emails/index.php:132
37
+ msgid "Delete"
38
+ msgstr "Elimina"
39
+
40
+ #. Text in function
41
+ #: emails/index.php:82
42
+ msgid "Delete selected newsletters"
43
+ msgstr "Cancella le newsletter selezionate"
44
+
45
+ #. Text in function
46
+ #: emails/index.php:1
47
+ msgid "Delivery engine triggered."
48
+ msgstr ""
49
+
50
+ #. Text in echo
51
+ #: emails/edit.php:302
52
+ msgid "Gender"
53
+ msgstr "Genere"
54
+
55
+ #. Text in function
56
+ #: emails/new.php:1 emails/new.php:43
57
+ msgid "Here the email subject"
58
+ msgstr "Qui l'oggetto dell'email"
59
+
60
+ #. Text in echo
61
+ #: emails/edit.php:259
62
+ msgid "Message"
63
+ msgstr "Messaggio"
64
+
65
+ #. Text in echo
66
+ #: emails/edit.php:260
67
+ msgid "Message (textual)"
68
+ msgstr "Messaggio (testo)"
69
+
70
+ #. Text in function
71
+ #: emails/index.php:1
72
+ msgid "Message deleted."
73
+ msgstr "Messaggio cancellato."
74
+
75
+ #. Text in function
76
+ #: emails/index.php:1
77
+ msgid "Message duplicated."
78
+ msgstr "Messaggio duplicato."
79
+
80
+ #. Text in echo
81
+ #: emails/index.php:81
82
+ msgid "New newsletter"
83
+ msgstr "Nuova newsletter"
84
+
85
+ #. Text in echo
86
+ #: emails/index.php:58
87
+ msgid "Newsletters"
88
+ msgstr ""
89
+
90
+ #. Text in function
91
+ #: emails/index.php:82 emails/index.php:131 emails/index.php:132
92
+ msgid "Proceed?"
93
+ msgstr ""
94
+
95
+ #. Text in echo
96
+ #: emails/index.php:93
97
+ msgid "Progress"
98
+ msgstr ""
99
+
100
+ #. Text in function
101
+ #: emails/edit.php:1
102
+ msgid "Read more about test subscribers"
103
+ msgstr ""
104
+
105
+ #. Text in echo
106
+ #: emails/new.php:146
107
+ msgid "Refresh the preview"
108
+ msgstr ""
109
+
110
+ #. Text in echo
111
+ #: emails/index.php:111
112
+ msgid "Scheduled"
113
+ msgstr ""
114
+
115
+ #. Text in echo
116
+ #: emails/theme.php:54
117
+ msgid "Select a theme"
118
+ msgstr ""
119
+
120
+ #. Text in echo
121
+ #: emails/index.php:111
122
+ msgid "Sending"
123
+ msgstr ""
124
+
125
+ #. Text in echo
126
+ #: emails/index.php:92
127
+ msgid "Status"
128
+ msgstr ""
129
+
130
+ #. Text in echo
131
+ #: emails/index.php:91
132
+ msgid "Subject"
133
+ msgstr ""
134
+
135
+ #. Text in echo
136
+ #: emails/edit.php:311
137
+ msgid "Subscriber preferences"
138
+ msgstr ""
139
+
140
+ #. Text in function
141
+ #: emails/edit.php:1
142
+ msgid "Test newsletter sent to:"
143
+ msgstr ""
144
+
145
+ #. Text in echo
146
+ #: emails/index.php:137
147
+ msgid ""
148
+ "The expected total can change at the delivery end due to subscriptions/"
149
+ "unsubscriptions in the meanwhile."
150
+ msgstr ""
151
+
152
+ #. Text in echo
153
+ #: emails/new.php:147
154
+ msgid "Theme options are saved for next time you\\'ll use this theme."
155
+ msgstr ""
156
+
157
+ #. Text in function
158
+ #: emails/edit.php:1
159
+ msgid "There are no test subscribers."
160
+ msgstr ""
161
+
162
+ #. Text in echo
163
+ #: emails/index.php:95
164
+ msgid "Tracking"
165
+ msgstr ""
166
+
167
+ #. Text in function
168
+ #: emails/index.php:84
169
+ msgid "Trigger the delivery engine"
170
+ msgstr ""
171
+
172
+ #. Text in function
173
+ #: emails/index.php:126
174
+ msgid "Yes"
175
+ msgstr ""
176
+
177
+ #. Text in function
178
+ #: emails/index.php:124
179
+ msgid "of"
180
+ msgstr ""
trunk/emails/new.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $controls = new NewsletterControls();
4
+ $module = NewsletterEmails::instance();
5
+
6
+ if ($controls->is_action('theme')) {
7
+ $controls->merge($module->themes->get_options($controls->data['theme']));
8
+ $module->save_options($controls->data);
9
+
10
+ // If this theme has no intermediate options...
11
+ if (!file_exists($module->get_current_theme_file_path('theme-options.php'))) {
12
+ $email = array();
13
+ $email['status'] = 'new';
14
+ $email['subject'] = __('Here the email subject', 'newsletter');
15
+ $email['track'] = 1;
16
+
17
+ $theme_options = $module->get_current_theme_options();
18
+ $theme_url = $module->get_current_theme_url();
19
+ $theme_subject = '';
20
+
21
+ ob_start();
22
+ include $module->get_current_theme_file_path('theme.php');
23
+ $email['message'] = ob_get_clean();
24
+
25
+ if (!empty($theme_subject)) {
26
+ $email['subject'] = $theme_subject;
27
+ }
28
+
29
+ ob_start();
30
+ include $module->get_current_theme_file_path('theme-text.php');
31
+ $email['message_text'] = ob_get_clean();
32
+
33
+ $email['type'] = 'message';
34
+ $email['send_on'] = time();
35
+ $email = Newsletter::instance()->save_email($email);
36
+ ?>
37
+ <script>
38
+ location.href = "<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
39
+ </script>
40
+ <div class="wrap">
41
+ <p>If you are not automatically redirected to the composer, <a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here</a>.</p>
42
+ </div>
43
+ <?php
44
+ return;
45
+ }
46
+ }
47
+
48
+ if ($controls->is_action('save')) {
49
+ $module->save_options($controls->data);
50
+ //$controls->messages = 'Saved.';
51
+ }
52
+
53
+ if ($controls->is_action('create')) {
54
+ $module->save_options($controls->data);
55
+
56
+ $email = array();
57
+ $email['status'] = 'new';
58
+ $email['subject'] = __('Here the email subject', 'newsletter');
59
+ $email['track'] = 1;
60
+
61
+ $theme_options = $module->get_current_theme_options();
62
+
63
+ $theme_url = $module->get_current_theme_url();
64
+ $theme_subject = '';
65
+
66
+ ob_start();
67
+ include $module->get_current_theme_file_path('theme.php');
68
+ $email['message'] = ob_get_clean();
69
+
70
+ if (!empty($theme_subject)) {
71
+ $email['subject'] = $theme_subject;
72
+ }
73
+
74
+ ob_start();
75
+ include $module->get_current_theme_file_path('theme-text.php');
76
+ $email['message_text'] = ob_get_clean();
77
+
78
+ $email['type'] = 'message';
79
+ $email['send_on'] = time();
80
+ $email = Newsletter::instance()->save_email($email);
81
+ ?>
82
+ <script>
83
+ location.href = "<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
84
+ </script>
85
+ <div class="wrap">
86
+ <p><a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here to proceed</a>.</p>
87
+ </div>
88
+ <?php
89
+ return;
90
+ }
91
+
92
+ if ($controls->data == null) {
93
+ $controls->data = $module->get_options();
94
+ }
95
+
96
+ function newsletter_emails_update_options($options) {
97
+ add_option('newsletter_emails', '', null, 'no');
98
+ update_option('newsletter_emails', $options);
99
+ }
100
+
101
+ function newsletter_emails_update_theme_options($theme, $options) {
102
+ $x = strrpos($theme, '/');
103
+ if ($x !== false) {
104
+ $theme = substr($theme, $x + 1);
105
+ }
106
+ add_option('newsletter_emails_' . $theme, '', null, 'no');
107
+ update_option('newsletter_emails_' . $theme, $options);
108
+ }
109
+
110
+ function newsletter_emails_get_options() {
111
+ $options = get_option('newsletter_emails', array());
112
+ return $options;
113
+ }
114
+
115
+ function newsletter_emails_get_theme_options($theme) {
116
+ $x = strrpos($theme, '/');
117
+ if ($x !== false) {
118
+ $theme = substr($theme, $x + 1);
119
+ }
120
+ $options = get_option('newsletter_emails_' . $theme, array());
121
+ return $options;
122
+ }
123
+ ?>
124
+
125
+ <div class="wrap" id="tnp-wrap">
126
+
127
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
128
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
129
+
130
+ <div id="tnp-heading">
131
+
132
+ <h2><?php _e('Create a newsletter', 'newsletter') ?>
133
+ <a class="tnp-btn-h1" href="<?php echo NewsletterEmails::instance()->get_admin_page_url('theme'); ?>"><?php _e('Back to newsletter themes', 'newsletter') ?></a>
134
+ </h2>
135
+ <br>
136
+ <p>Theme options are saved for next time you'll use this theme.</p>
137
+
138
+ </div>
139
+
140
+ <div id="tnp-body" class="tnp-body-lite">
141
+
142
+ <form method="post" action="<?php echo $module->get_admin_page_url('new'); ?>">
143
+ <?php $controls->init(); ?>
144
+ <?php $controls->hidden('theme'); ?>
145
+
146
+ <table style="width: 100%; border-collapse: collapse">
147
+ <tr>
148
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
149
+ <div style="float: right; margin-left: 15px;"><?php $controls->button_primary('save', __('Refresh the preview', 'newsletter')); ?></div>
150
+
151
+ </td>
152
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
153
+ <div style="float: right"><?php $controls->button_primary('create', 'Proceed to edit &raquo;', 'this.form.action=\'' . plugins_url('newsletter') . '/emails/create.php\';this.form.submit()'); ?></div>
154
+ <img style="position: relative; left: 5px; top: 10px;"src="<?php echo plugins_url('newsletter') ?>/images/arrow.png" height="35">
155
+ </td>
156
+ </tr>
157
+ <tr>
158
+ <td style="width: 600px; vertical-align: top; padding-top: 10px">
159
+ <?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
160
+ </td>
161
+ <td style="vertical-align: top; padding-top: 15px; padding-left: 15px">
162
+ <iframe src="<?php echo wp_nonce_url(plugins_url('newsletter') . '/emails/preview.php?' . time(), 'view'); ?>" height="700" style="width: 100%; border: 1px solid #ccc"></iframe>
163
+ </td>
164
+ </tr>
165
+ </table>
166
+
167
+ </form>
168
+ </div>
169
+
170
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
171
+
172
+ </div>
trunk/emails/preview-text.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ header('Content-Type: text/plain;charset=UTF-8');
3
+
4
+ include '../../../../wp-load.php';
5
+
6
+ if (!check_admin_referer('view'))
7
+ die('Only the administrator can view the preview');
8
+
9
+ // Used by theme code
10
+ $theme_options = NewsletterEmails::instance()->get_current_theme_options();
11
+
12
+ $file = NewsletterEmails::instance()->get_current_theme_file_path('theme-text.php');
13
+ if (is_file($file)) {
14
+ include(NewsletterEmails::instance()->get_current_theme_file_path('theme-text.php'));
15
+ }
trunk/emails/preview.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include '../../../../wp-load.php';
4
+
5
+ if (!check_admin_referer('view'))
6
+ die('Only the administrator can view the preview');
7
+
8
+ // Used by theme code
9
+ $theme_options = NewsletterEmails::instance()->get_current_theme_options();
10
+ $theme_url = NewsletterEmails::instance()->get_current_theme_url();
11
+ header('Content-Type: text/html;charset=UTF-8');
12
+
13
+ include(NewsletterEmails::instance()->get_current_theme_file_path('theme.php'));
trunk/emails/theme.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
+ $controls = new NewsletterControls();
4
+ $module = NewsletterEmails::instance();
5
+
6
+
7
+ if ($controls->is_action('theme')) {
8
+ $controls->merge($module->themes->get_options($controls->data['theme']));
9
+ $module->save_options($controls->data);
10
+ }
11
+
12
+
13
+ if ($controls->data == null) {
14
+ $controls->data = $module->get_options();
15
+ }
16
+
17
+ function newsletter_emails_update_options($options) {
18
+ add_option('newsletter_emails', '', null, 'no');
19
+ update_option('newsletter_emails', $options);
20
+ }
21
+
22
+ function newsletter_emails_update_theme_options($theme, $options) {
23
+ $x = strrpos($theme, '/');
24
+ if ($x !== false) {
25
+ $theme = substr($theme, $x + 1);
26
+ }
27
+ add_option('newsletter_emails_' . $theme, '', null, 'no');
28
+ update_option('newsletter_emails_' . $theme, $options);
29
+ }
30
+
31
+ function newsletter_emails_get_options() {
32
+ $options = get_option('newsletter_emails', array());
33
+ return $options;
34
+ }
35
+
36
+ function newsletter_emails_get_theme_options($theme) {
37
+ $x = strrpos($theme, '/');
38
+ if ($x !== false) {
39
+ $theme = substr($theme, $x + 1);
40
+ }
41
+ $options = get_option('newsletter_emails_' . $theme, array());
42
+ return $options;
43
+ }
44
+
45
+ $themes = $module->themes->get_all_with_data();
46
+ ?>
47
+
48
+ <div class="wrap" id="tnp-wrap">
49
+
50
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
51
+
52
+ <div id="tnp-heading">
53
+
54
+ <h2><?php _e('Select a theme', 'newsletter') ?>
55
+ <a class="tnp-btn-h1" href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Custom themes</a>
56
+ </h2>
57
+
58
+ </div>
59
+ <div id="tnp-body" class="tnp-darkbg">
60
+
61
+ <form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
62
+ <?php $controls->init(); ?>
63
+ <?php $controls->hidden('theme'); ?>
64
+
65
+ <div class="tnp-theme-preview">
66
+ <p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
67
+ <a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
68
+ <img src="<?php echo plugins_url('newsletter') . '/emails/themes/composer.gif' ?>" width="420" height="200">
69
+ </a>
70
+ </div>
71
+
72
+ <?php foreach ($themes as $key => &$data) { ?>
73
+ <div class="tnp-theme-preview">
74
+ <p><?php echo $data['name']; ?></p>
75
+ <a href="#" onclick="var f = document.getElementById('newsletter-form');
76
+ f.act.value = 'theme';
77
+ f.elements['options[theme]'].value = '<?php echo $data['id']; ?>';
78
+ f.submit();
79
+ return false;" style="margin-right: 20px; margin-bottom: 20px">
80
+ <img src="<?php echo $data['screenshot'] ?>" width="200" height="200">
81
+ </a>
82
+ </div>
83
+ <?php } ?>
84
+ </form>
85
+ </div>
86
+
87
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
88
+
89
+ </div>
trunk/emails/themes/blank/screenshot.png ADDED
Binary file
trunk/emails/themes/blank/theme-options.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Disable social links</th>
4
+ <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
5
+ </tr>
6
+ </table>
trunk/emails/themes/blank/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/blank/theme.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <style>
4
+ body {
5
+ font-family: sans-serif;
6
+ font-size: 12px;
7
+ background-color: #ffffff;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body bgcolor="#ffffff">
12
+ <h1>Your awesome title</h1>
13
+
14
+ <p>
15
+ Hi {name} (but you should remove that if you're not collecting subscriber names),
16
+ </p>
17
+
18
+ <p>
19
+ here the forewords of your shiny new newsletter. Most of the times a simple layout is the best.
20
+ </p>
21
+ <h2>There is more for you!</h2>
22
+
23
+ <p>Still not secure to sign up for our premium service? Even with a standard service plan you'll receive our t-shirt!</p>
24
+
25
+ <p>
26
+ Goodbye!
27
+ </p>
28
+
29
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
30
+
31
+ <hr>
32
+ <p>
33
+ To unsubscribe <a href="{unsubscription_url}">click here</a>, to edit your subscription
34
+ <a href="{profile_url}">click here</a>.
35
+ </p>
36
+ <p>
37
+ <?php echo $theme_options['main_footer_contact'] ?>
38
+ </p>
39
+ <p>
40
+ <?php echo $theme_options['main_footer_legal'] ?>
41
+ </p>
42
+ </body>
43
+ </html>
trunk/emails/themes/composer.gif ADDED
Binary file
trunk/emails/themes/cta-2015/images/facebook.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/flickr.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/googleplus.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/instagram.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/linkedin.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/pinterest.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/twitter.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/vimeo.png ADDED
Binary file
trunk/emails/themes/cta-2015/images/youtube.png ADDED
Binary file
trunk/emails/themes/cta-2015/screenshot.png ADDED
Binary file
trunk/emails/themes/cta-2015/theme-options.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Main color</th>
4
+ <td>
5
+ <?php $controls->color('theme_color'); ?> (eg. #87aa14)
6
+ </td>
7
+ </tr>
8
+ </table>
trunk/emails/themes/cta-2015/theme.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Name: CTA 2015
4
+ * Type: standard
5
+ * Description: Single call to action marketing template
6
+ */
7
+
8
+ $color = '#87aa14';
9
+ if (!empty($theme_options['theme_color'])) {
10
+ $color = $theme_options['theme_color'];
11
+ }
12
+
13
+ $header = '';
14
+ $header_color = '#000000';
15
+ if (!empty($theme_options['main_header_logo']['url'])) {
16
+ $header = '<img src="' . $theme_options['main_header_logo']['url'] . '" style="max-width: 500px">';
17
+ } else {
18
+ if (!empty($theme_options['main_header_title'])) {
19
+ $header = '<h2 style="color: ' . $header_color . '">' . $theme_options['main_header_title'] . '</h2>';
20
+ } else {
21
+ $header = '<h2 style="color: ' . $header_color . '">' . get_option('blogname') . '</h2>';
22
+ }
23
+ if (!empty($theme_options['main_header_sub'])) {
24
+ $header .= '<p style="color: #666666">' . $theme_options['main_header_sub'] . '</p>';
25
+ }
26
+ }
27
+ $font_family = 'Verdana';
28
+ //$cta_bgcolor = '#008800';
29
+ //if (!empty($theme_options['theme_cta_bgcolor'])) {
30
+ // $cta_bgcolor = $theme_options['theme_cta_bgcolor'];
31
+ //}
32
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/cta-2015/images';
33
+ ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
34
+ <html>
35
+ <head>
36
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37
+ <title></title>
38
+ </head>
39
+ <body bgcolor="#ffffff">
40
+ <table width="500" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0">
41
+ <tr>
42
+ <td align="center" style="font-family: Verdana">
43
+ <table cellpadding="10" cellspacing="0" border="0" width="100%">
44
+ <tr>
45
+ <td style="font-size: 12px" align="center">
46
+ <a href="{email_url}" style="text-decoration: none">View online</a>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+
53
+ <!-- header -->
54
+ <tr>
55
+ <td align="center" style="font-family: Verdana">
56
+ <?php echo $header; ?>
57
+ </td>
58
+ </tr>
59
+
60
+ <!-- body -->
61
+ <tr>
62
+ <td style="font-family: Verdana">
63
+
64
+ <!-- main text -->
65
+ <table cellpadding="15" cellspacing="0" align="center" border="0" width="100%">
66
+ <tr>
67
+ <td style="font-size: 15px" align="center">
68
+ <h1>Super catching title</h1>
69
+ <p>
70
+ Here you should introduce your incredible offer. Remeber the golden rule: write
71
+ something useful for your readers, not for yourself.
72
+ </p>
73
+ <p>
74
+ If a reader ask the question: what's here for me, the content is answering?
75
+ </p>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+
80
+ <!-- cta -->
81
+ <table cellpadding="15" cellspacing="0" align="center" bgcolor="<?php echo $color ?>" border="0" style="border-radius: 5px">
82
+ <tr>
83
+ <td><a href="#" style="font-size: 15px; color: #ffffff; text-decoration: none">Call to action</a></td>
84
+ </tr>
85
+ </table>
86
+
87
+ <!-- spacer -->
88
+ <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
89
+ <tr>
90
+ <td>
91
+ &nbsp;
92
+ </td>
93
+ </tr>
94
+ </table>
95
+
96
+ <!-- social -->
97
+ <table cellpadding="5" align="center">
98
+ <tr>
99
+ <?php if (!empty($theme_options['main_facebook_url'])) { ?>
100
+ <td align="center" valign="top">
101
+ <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
102
+ </td>
103
+ <?php } ?>
104
+
105
+ <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
106
+ <td align="center" valign="top">
107
+ <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
108
+ </td>
109
+ <?php } ?>
110
+
111
+ <?php if (!empty($theme_options['main_twitter_url'])) { ?>
112
+ <td align="center" valign="top">
113
+ <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
114
+ </td>
115
+ <?php } ?>
116
+
117
+ <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
118
+ <td align="center" valign="top">
119
+ <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
120
+ </td>
121
+ <?php } ?>
122
+
123
+ <?php if (!empty($theme_options['main_youtube_url'])) { ?>
124
+ <td align="center" valign="top">
125
+ <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
126
+ </td>
127
+ <?php } ?>
128
+
129
+ <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
130
+ <td align="center" valign="top">
131
+ <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
132
+ </td>
133
+ <?php } ?>
134
+ </tr>
135
+ </table>
136
+
137
+ <!-- spacer -->
138
+ <table cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" border="0" width="100%">
139
+ <tr>
140
+ <td>
141
+ &nbsp;
142
+ </td>
143
+ </tr>
144
+ </table>
145
+
146
+ <!-- footer -->
147
+ <table cellpadding="15" cellspacing="0" align="center" width="100%" bgcolor="#eeeeee" border="0">
148
+ <tr>
149
+ <td style="font-size: 12px">
150
+ <p><a href="{profile_url}">Manage your subscription</a></p>
151
+ <p><?php echo $theme_options['main_footer_contact'] ?></p>
152
+ <p><?php echo $theme_options['main_footer_legal'] ?></p>
153
+ </td>
154
+ </tr>
155
+ </table>
156
+ </td>
157
+ </tr>
158
+ </table>
159
+ </body>
160
+ </html>
trunk/emails/themes/default/footer.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <!-- Footer -->
2
+ <div style="text-align: center; font-weight: bold; margin: 40px 0 10px;"><?php echo $theme_options['main_footer_title'] ?></div>
3
+ <div style="text-align: center; margin: 10px 0 20px;"><?php echo $theme_options['main_footer_contact'] ?></div>
4
+
5
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
6
+
7
+ <div style="text-align: center; color: #888; margin-top: 20px;"><?php echo $theme_options['main_footer_legal'] ?></div>
8
+ <div style="text-align: center; color: #888">To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.</div>
trunk/emails/themes/default/images/facebook.png ADDED
Binary file
trunk/emails/themes/default/images/googleplus.png ADDED
Binary file
trunk/emails/themes/default/images/linkedin.png ADDED
Binary file
trunk/emails/themes/default/images/pinterest.png ADDED
Binary file
trunk/emails/themes/default/images/soundcloud.png ADDED
Binary file
trunk/emails/themes/default/images/tumblr.png ADDED
Binary file
trunk/emails/themes/default/images/twitter.png ADDED
Binary file
trunk/emails/themes/default/images/vimeo.png ADDED
Binary file
trunk/emails/themes/default/images/youtube.png ADDED
Binary file
trunk/emails/themes/default/screenshot.png ADDED
Binary file
trunk/emails/themes/default/social-options.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3>Social icons</h3>
2
+ <table class="form-table">
3
+ <tr>
4
+ <th>Social block</th>
5
+ <td><?php $controls->checkbox('theme_social_disable'); ?> Disable</td>
6
+ </tr>
7
+ <tr>
8
+ <th>Facebook</th>
9
+ <td><?php $controls->text_url('theme_facebook', 30); ?></td>
10
+ </tr>
11
+ <tr>
12
+ <th>Twitter</th>
13
+ <td><?php $controls->text_url('theme_twitter', 30); ?></td>
14
+ </tr>
15
+ <tr>
16
+ <th>Pinterest</th>
17
+ <td><?php $controls->text_url('theme_pinterest', 30); ?></td>
18
+ </tr>
19
+ <tr>
20
+ <th>Google+</th>
21
+ <td><?php $controls->text_url('theme_googleplus', 30); ?></td>
22
+ </tr>
23
+ <tr>
24
+ <th>LinkedIn</th>
25
+ <td><?php $controls->text_url('theme_linkedin', 30); ?></td>
26
+ </tr>
27
+ <tr>
28
+ <th>Tumblr</th>
29
+ <td><?php $controls->text_url('theme_tumblr', 30); ?></td>
30
+ </tr>
31
+ <tr>
32
+ <th>YouTube</th>
33
+ <td><?php $controls->text_url('theme_youtube', 30); ?></td>
34
+ </tr>
35
+ <tr>
36
+ <th>Soundcloud</th>
37
+ <td><?php $controls->text_url('theme_soundcloud', 30); ?></td>
38
+ </tr>
39
+ </table>
trunk/emails/themes/default/social.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Social -->
2
+ <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
+ ?>
6
+ <table cellpadding="5" align="center">
7
+ <tr>
8
+ <?php if (!empty($theme_options['theme_facebook'])) { ?>
9
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
10
+ <a href="<?php echo $theme_options['theme_facebook'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png"><br>Facebook</a>
11
+ </td>
12
+ <?php } ?>
13
+
14
+ <?php if (!empty($theme_options['theme_twitter'])) { ?>
15
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
16
+ <a href="<?php echo $theme_options['theme_twitter'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"><br>Twitter</a>
17
+ </td>
18
+ <?php } ?>
19
+
20
+ <?php if (!empty($theme_options['theme_googleplus'])) { ?>
21
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
22
+ <a href="<?php echo $theme_options['theme_googleplus'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"><br>Google+</a>
23
+ </td>
24
+ <?php } ?>
25
+
26
+ <?php if (!empty($theme_options['theme_pinterest'])) { ?>
27
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
28
+ <a href="<?php echo $theme_options['theme_pinterest'] ?>"><img src="<?php echo $social_icon_url ?>/pinterest.png"><br>Pinterest</a>
29
+ </td>
30
+ <?php } ?>
31
+
32
+ <?php if (!empty($theme_options['theme_linkedin'])) { ?>
33
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
34
+ <a href="<?php echo $theme_options['theme_linkedin'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"><br>LinkedIn</a>
35
+ </td>
36
+ <?php } ?>
37
+
38
+ <?php if (!empty($theme_options['theme_tumblr'])) { ?>
39
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
40
+ <a href="<?php echo $theme_options['theme_tumblr'] ?>"><img src="<?php echo $social_icon_url ?>/tumblr.png"><br>Tumblr</a>
41
+ </td>
42
+ <?php } ?>
43
+
44
+ <?php if (!empty($theme_options['theme_youtube'])) { ?>
45
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
46
+ <a href="<?php echo $theme_options['theme_youtube'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"><br>Youtube</a>
47
+ </td>
48
+ <?php } ?>
49
+
50
+ <?php if (!empty($theme_options['theme_soundcloud'])) { ?>
51
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
52
+ <a href="<?php echo $theme_options['theme_soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png"><br>SoundCloud</a>
53
+ </td>
54
+ <?php } ?>
55
+ </tr>
56
+ </table>
trunk/emails/themes/default/social_main.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Social -->
2
+ <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
+ ?>
6
+ <table cellpadding="5" align="center">
7
+ <tr>
8
+ <?php if (!empty($theme_options['main_facebook_url'])) { ?>
9
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
10
+ <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
11
+ </td>
12
+ <?php } ?>
13
+
14
+ <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
15
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
16
+ <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
17
+ </td>
18
+ <?php } ?>
19
+
20
+ <?php if (!empty($theme_options['main_twitter_url'])) { ?>
21
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
22
+ <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
23
+ </td>
24
+ <?php } ?>
25
+
26
+ <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
27
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
28
+ <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
29
+ </td>
30
+ <?php } ?>
31
+
32
+ <?php if (!empty($theme_options['main_youtube_url'])) { ?>
33
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
34
+ <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
35
+ </td>
36
+ <?php } ?>
37
+
38
+ <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
39
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
40
+ <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
41
+ </td>
42
+ <?php } ?>
43
+ </tr>
44
+ </table>
trunk/emails/themes/default/theme-options.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--<div id="tabs">
2
+ <ul>
3
+ <li><a href="#tab-general">General</a></li>
4
+ <li><a href="#tab-posts">Posts</a></li>
5
+ </ul>
6
+
7
+ <div id="tab-general">-->
8
+ <table class="form-table">
9
+ <tr><td colspan="2">General options for header, social links and footer sections could also be set in <a href="?page=newsletter_main_main">Blog Info panel</a>.</td></tr>
10
+ <tr>
11
+ <th>Base color</th>
12
+ <td>
13
+ <?php $controls->color('theme_color'); ?>
14
+ <p class="description" style="display: inline">Hex values, e.g. #FF0000</p>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <th>Disable social links</th>
19
+ <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
20
+ </tr>
21
+ <!-- <tr>
22
+ <th>Banner/Title</th>
23
+ <td>
24
+ <?php //$controls->wp_editor('theme_banner'); ?>
25
+ <div class="hints">
26
+ Create a content with an image (500 pixel wide) that will be your newsletter banner and that will replace the
27
+ title with your blog name.
28
+ </div>
29
+ <?php $controls->media('theme_header_logo', 'full'); ?>
30
+ <p class="description">
31
+ Click to change. This should be your logo in .png or .jpg format.
32
+ </p>
33
+ </td>
34
+ </tr>-->
35
+ </table>
36
+ <h3>Posts</h3>
37
+ <table class="form-table">
38
+ <tr>
39
+ <th>Posts</th>
40
+ <td>
41
+ <?php $controls->checkbox('theme_posts', 'Add latest posts'); ?>
42
+ <br>
43
+ <?php $controls->checkbox('theme_thumbnails', 'Add post thumbnails'); ?>
44
+ <br>
45
+ <?php $controls->checkbox('theme_excerpts', 'Add post excerpts'); ?>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <th>Categories</th>
50
+ <td>
51
+ <?php $controls->categories_group('theme_categories'); ?>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <th>Tags</th>
56
+ <td>
57
+ <?php $controls->text('theme_tags', 30); ?>
58
+ <p class="description" style="display: inline"> comma separated</p>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <th>Max posts</th>
63
+ <td>
64
+ <?php $controls->text('theme_max_posts', 5); ?>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <th>Post types to include</th>
69
+ <td>
70
+ <?php $controls->post_types('theme_post_types'); ?>
71
+ <div class="hints">Leave all unchecked for default behaviour.</div>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ <!--</div>-->
76
+ <!--<div id="tab-posts">-->
77
+ <!--</div>-->
78
+ <!--</div>-->
trunk/emails/themes/default/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/default/theme.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Name: Default
4
+ * Type: standard
5
+ * Some variables are already defined:
6
+ *
7
+ * - $theme_options An array with all theme options
8
+ * - $theme_url Is the absolute URL to the theme folder used to reference images
9
+ * - $theme_subject Will be the email subject if set by this theme
10
+ *
11
+ */
12
+
13
+ global $newsletter, $post;
14
+
15
+ $color = $theme_options['theme_color'];
16
+ if (empty($color)) $color = '#000000';
17
+
18
+ if (isset($theme_options['theme_posts'])) {
19
+ $filters = array();
20
+
21
+ if (empty($theme_options['theme_max_posts'])) $filters['posts_per_page'] = 10;
22
+ else $filters['posts_per_page'] = (int)$theme_options['theme_max_posts'];
23
+
24
+ if (!empty($theme_options['theme_categories'])) {
25
+ $filters['category__in'] = $theme_options['theme_categories'];
26
+ }
27
+
28
+ if (!empty($theme_options['theme_tags'])) {
29
+ $filters['tag'] = $theme_options['theme_tags'];
30
+ }
31
+
32
+ if (!empty($theme_options['theme_post_types'])) {
33
+ $filters['post_type'] = $theme_options['theme_post_types'];
34
+ }
35
+
36
+ $posts = get_posts($filters);
37
+ }
38
+
39
+ ?><!DOCTYPE html>
40
+ <html>
41
+ <head>
42
+ <!-- Not all email client take care of styles inserted here -->
43
+ <style type="text/css" media="all">
44
+ a {
45
+ text-decoration: none;
46
+ color: <?php echo $color; ?>;
47
+ }
48
+ </style>
49
+ </head>
50
+ <body style="background-color: #ddd; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
51
+ <br>
52
+ <table align="center">
53
+ <tr>
54
+ <td valign="top" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
55
+ <div style="text-align: left; background-color: #fff; max-width: 500px;">
56
+ <div style="text-align: center">
57
+ <?php //HEADER
58
+ // if (!empty($theme_options['theme_banner'])) {
59
+ // echo $theme_options['theme_banner'];
60
+ if (!empty($theme_options['theme_header_logo']['url'])) { ?>
61
+ <img style="max-width: 500px" alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['theme_header_logo']['url'] ?>" />
62
+ <?php } elseif (!empty($theme_options['main_header_logo']['url'])) { ?>
63
+ <img style="max-width: 500px" alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['main_header_logo']['url'] ?>" />
64
+ <?php } elseif (!empty($theme_options['main_header_title'])) { ?>
65
+ <div style="padding: 30px 0; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
66
+ <?php echo $theme_options['main_header_title'] ?>
67
+ </div>
68
+ <?php if (!empty($theme_options['main_header_sub'])) { ?>
69
+ <div style="padding: 10px 0; color: #000; font-size: 16px; text-align: center;">
70
+ <?php echo $theme_options['main_header_sub'] ?>
71
+ </div>
72
+ <?php } ?>
73
+ <?php } else { ?>
74
+ <div style="padding: 30px 20px; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
75
+ <?php echo get_option('blogname'); ?>
76
+ </div>
77
+ <?php if (!empty($theme_options['main_header_sub'])) { ?>
78
+ <div style="padding: 10px 0; color: #000; font-size: 16px; text-align: center;">
79
+ <?php echo $theme_options['main_header_sub'] ?>
80
+ </div>
81
+ <?php } ?>
82
+ <?php } ?>
83
+ </div>
84
+
85
+
86
+ <div style="padding: 10px 20px 20px 20px; background-color: #fff; line-height: 18px">
87
+
88
+ <p style="text-align: center; font-size: small;"><a target="_blank" href="{email_url}">View this email online</a></p>
89
+
90
+ <p>Here you can start to write your message. Be polite with your readers! Don't forget the subject of this message.</p>
91
+ <?php if (!empty($posts)) { ?>
92
+ <table cellpadding="5">
93
+ <?php foreach ($posts as $post) { setup_postdata($post); ?>
94
+ <tr>
95
+ <?php if (isset($theme_options['theme_thumbnails'])) { ?>
96
+ <td valign="top"><a target="_blank" href="<?php echo get_permalink($post); ?>"><img width="75" src="<?php echo newsletter_get_post_image($post->ID); ?>" alt="image"></a></td>
97
+ <?php } ?>
98
+ <td valign="top">
99
+ <a target="_blank" href="<?php echo get_permalink(); ?>" style="font-size: 20px; line-height: 26px"><?php the_title(); ?></a>
100
+ <?php if (isset($theme_options['theme_excerpts'])) newsletter_the_excerpt($post); ?>
101
+ </td>
102
+ </tr>
103
+ <?php } ?>
104
+ </table>
105
+ <?php } ?>
106
+
107
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/footer.php'; ?>
108
+
109
+ </div>
110
+
111
+ </div>
112
+ </td>
113
+ </tr>
114
+ </table>
115
+ </body>
116
+ </html>
trunk/emails/themes/linear/images/facebook.png ADDED
Binary file
trunk/emails/themes/linear/images/purple.png ADDED
Binary file
trunk/emails/themes/linear/images/twitter.png ADDED
Binary file
trunk/emails/themes/linear/images/youtube.png ADDED
Binary file
trunk/emails/themes/linear/screenshot.png ADDED
Binary file
trunk/emails/themes/linear/theme-options.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="form-table">
2
+ <tr>
3
+ <th>Max posts</th>
4
+ <td><?php $controls->text('theme_max_posts', 5); ?></td>
5
+ </tr>
6
+ <tr>
7
+ <th>Categories</th>
8
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
9
+ </tr>
10
+ <tr>
11
+ <th>Post types</th>
12
+ <td>
13
+ <?php $controls->post_types('theme_post_types'); ?>
14
+ <p class="description">Leave all uncheck for a default behavior.</p>
15
+ </td>
16
+ </tr>
17
+ </table>
18
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
trunk/emails/themes/linear/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/linear/theme.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $post;
3
+
4
+ $filters = array();
5
+ if (!empty($theme_options['theme_categories'])) {
6
+ $filters['category__in'] = $theme_options['theme_categories'];
7
+ }
8
+
9
+ if (empty($theme_options['theme_max_posts'])) {
10
+ $filters['posts_per_page'] = 10;
11
+ } else {
12
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
13
+ }
14
+
15
+ if (!empty($theme_options['theme_post_types'])) {
16
+ $filters['post_type'] = $theme_options['theme_post_types'];
17
+ }
18
+
19
+ $posts = get_posts($filters);
20
+
21
+ ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
22
+ <html>
23
+ <head>
24
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
25
+
26
+ <style type="text/css">
27
+ </style>
28
+ </head>
29
+ <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="background-color: #efefef;">
30
+
31
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
32
+ <tr>
33
+ <td align="center" valign="top">
34
+
35
+ <table border="0" cellpadding="10" cellspacing="0" width="600" style="background-color: #FAFAFA;">
36
+ <tr>
37
+ <td valign="top">
38
+ <table border="0" cellpadding="10" cellspacing="0" width="100%">
39
+ <tr>
40
+ <td valign="top" align="left" style="color: #505050;font-family: Arial;font-size: 10px;">
41
+ You are receiving this email because you subscribed to <?php echo get_option('blogname'); ?>. <a href="{profile_url}">Click here to change your subscription</a>.
42
+ </td>
43
+ <td valign="top" width="190" align="left" style="color: #505050;font-family: Arial;font-size: 10px;">
44
+ Is this email not displaying correctly?<br><a href="{email_url}" style="color: #336699;font-weight: normal;text-decoration: underline;">View it online</a>.
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </td>
49
+ </tr>
50
+ </table>
51
+
52
+ <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
53
+ <tr>
54
+ <td align="center" valign="middle" height="150" style="color: #202020;font-family: Arial;font-size: 34px;font-weight: bold;line-height: 100%;padding: 5px 0 -2px 0;border-width: 1px 0px;border-style: solid;border-color: #dddddd;">
55
+ <?php echo get_option('blogname'); ?>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
60
+ <tr>
61
+
62
+ <td valign="top">
63
+ <table border="0" cellpadding="20" cellspacing="0" width="200">
64
+ <tr>
65
+ <td valign="top" align="left" style="color: #505050;font-family: Arial;font-size: 12px;line-height: 150%;">
66
+ Sidebar text
67
+ </td>
68
+ </tr>
69
+ <?php
70
+ if (!isset($theme_options['theme_social_disable'])) {
71
+ $social_icon_url = plugins_url('emails/themes/default/images', 'newsletter/plugin.pnp');
72
+ ?>
73
+ <tr>
74
+ <td valign="top" align="left">
75
+ <?php
76
+ foreach (array('facebook', 'twitter', 'youtube', 'linkedin', 'googleplus', 'pinterest', 'tumblr') as $social) {
77
+ if (empty($theme_options["theme_$social"]))
78
+ continue;
79
+ ?>
80
+ <a href="<?php echo $theme_options["theme_$social"]; ?>"><img src="<?php echo $social_icon_url; ?>/<?php echo $social; ?>.png" alt="<?php echo $social; ?>"></a>
81
+ <?php } ?>
82
+ </td>
83
+ </tr>
84
+ <?php } ?>
85
+ </table>
86
+ </td>
87
+
88
+ <td valign="top">
89
+ <table border="0" cellpadding="20" cellspacing="0" width="100%" bgcolor="#ffffff">
90
+ <tr>
91
+ <td valign="top">
92
+
93
+ <?php foreach ($posts as $post) {
94
+ setup_postdata($post);
95
+ ?>
96
+ <h2 style="color: #202020;font-family: Arial;font-size: 20px;font-weight: bold;margin-top: 0;margin-bottom: 10px;border-bottom: 1px solid #efefef;">
97
+ <?php the_title(); ?>
98
+ </h2>
99
+ <center><img src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>"></center>
100
+ <div style="color: #505050;font-family: Arial;font-size: 14px;line-height: 150%;">
101
+ <?php the_excerpt(); ?>
102
+ </div>
103
+ <?php } ?>
104
+ </td>
105
+ </tr>
106
+ </table>
107
+ </td>
108
+
109
+ </tr>
110
+ </table>
111
+ </td>
112
+ </tr>
113
+
114
+ </table>
115
+ <br><br>
116
+
117
+ </body>
118
+ </html>
trunk/emails/themes/pint/images/bg.jpg ADDED
Binary file
trunk/emails/themes/pint/screenshot.png ADDED
Binary file
trunk/emails/themes/pint/theme-options.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ This theme requires posts with at least one image and a number of posts like
3
+ 3, 6, 9, ...
4
+ </p>
5
+ <table class="form-table">
6
+ <tr>
7
+ <th>Max posts</th>
8
+ <td><?php $controls->text('theme_max_posts', 5); ?></td>
9
+ </tr>
10
+ <tr>
11
+ <th>Categories</th>
12
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
13
+ </tr>
14
+ </table>
15
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
trunk/emails/themes/pint/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/pint/theme.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Some variables are already defined:
4
+ *
5
+ * - $theme_options An array with all theme options
6
+ * - $theme_url Is the absolute URL to the theme folder used to reference images
7
+ * - $theme_subject Will be the email subject if set by this theme
8
+ *
9
+ */
10
+
11
+ global $newsletter, $post;
12
+
13
+ $filters = array();
14
+ if (!empty($theme_options['theme_categories'])) {
15
+ $filters['category__in'] = $theme_options['theme_categories'];
16
+ }
17
+ if (empty($theme_options['theme_max_posts']))
18
+ $filters['posts_per_page'] = 9;
19
+ else
20
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
21
+
22
+ $posts = get_posts($filters);
23
+
24
+ ?><!DOCTYPE html>
25
+ <html>
26
+ <head>
27
+ </style>
28
+ </head>
29
+ <body style="background-color: #eee; background-image: url('<?php echo $theme_url; ?>/images/bg.jpg'); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
30
+ <br>
31
+ <table align="center">
32
+ <tr>
33
+ <td align="center">
34
+ <small><a target="_tab" href="{email_url}" style="color: #666; text-decoration: none">View this email online</a></small>
35
+ <br>
36
+ <div style="color: #b00; font-size: 50px; font-family: serif; font-style: italic;">
37
+ <?php echo get_option('blogname'); ?>
38
+ </div>
39
+ <br>
40
+ <br>
41
+
42
+ <table cellpadding="5">
43
+ <tr>
44
+ <?php for ($i=0; $i<3; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
45
+ <td align="center" valign="top">
46
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
47
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
48
+ </td>
49
+ <?php } ?>
50
+ </tr>
51
+ <tr>
52
+ <?php for ($i=3; $i<6; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
53
+ <td align="center" valign="top">
54
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
55
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
56
+ </td>
57
+ <?php } ?>
58
+ </tr>
59
+ <tr>
60
+ <?php for ($i=6; $i<9; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
61
+ <td align="center" valign="top">
62
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
63
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
64
+ </td>
65
+ <?php } ?>
66
+ </tr>
67
+ </table>
68
+
69
+ <br><br>
70
+
71
+ <?php
72
+ if (!isset($theme_options['theme_social_disable'])) {
73
+ include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php';
74
+ }
75
+ ?>
76
+
77
+ <small>To change your subscription, <a target="_tab" href="{profile_url}" style="color: #666; text-decoration: none">click here</a></small>
78
+
79
+ </td>
80
+ </tr>
81
+ </table>
82
+ </body>
83
+ </html>
trunk/emails/themes/simple/screenshot.png ADDED
Binary file
trunk/emails/themes/simple/theme-options.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
trunk/emails/themes/simple/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/simple/theme.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Some variables are already defined:
4
+ *
5
+ * - $theme_options An array with all theme options
6
+ * - $theme_url Is the absolute URL to the theme folder used to reference images
7
+ * - $theme_subject Will be the email subject if set by this theme
8
+ *
9
+ */
10
+
11
+ global $newsletter, $post;
12
+
13
+ $color = $theme_options['theme_color'];
14
+ if (empty($color))
15
+ $color = '#0088cc';
16
+
17
+ if (isset($theme_options['theme_posts'])) {
18
+ $filters = array();
19
+
20
+ if (empty($theme_options['theme_max_posts']))
21
+ $filters['posts_per_page'] = 10;
22
+ else
23
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
24
+
25
+ if (!empty($theme_options['theme_categories'])) {
26
+ $filters['category__in'] = $theme_options['theme_categories'];
27
+ }
28
+
29
+ if (!empty($theme_options['theme_tags'])) {
30
+ $filters['tag'] = $theme_options['theme_tags'];
31
+ }
32
+
33
+ if (!empty($theme_options['theme_post_types'])) {
34
+ $filters['post_type'] = $theme_options['theme_post_types'];
35
+ }
36
+
37
+ $posts = get_posts($filters);
38
+ }
39
+ ?><!DOCTYPE html>
40
+ <html>
41
+ <head>
42
+ <style type="text/css">
43
+ .ReadMsgBody {
44
+ width: 100%;
45
+ }
46
+ .ExternalClass {
47
+ width: 100%; background-color:#e7e8e9 !important;
48
+ }
49
+ .yshortcuts {color: #2979be;}
50
+ body {
51
+ background-color: #e7e8e9;}
52
+
53
+ </style>
54
+ </head>
55
+ <body style="background-color:#e7e8e9;">
56
+ <br>
57
+ <br>
58
+ <table border="0" cellspacing="0" cellpadding="1" width="550" align="center">
59
+ <tbody>
60
+ <tr>
61
+ <td style="background-color: #fff;" width="550" valign="top">
62
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
63
+ <tbody>
64
+ <tr>
65
+ <td valign="top" style="background-color: #333; color: #f4f4f4; font-size: 20px; padding: 7px">
66
+ <?php echo get_option('blogname') ?>
67
+ </td>
68
+ </tr>
69
+ <!-- main content here -->
70
+ <tr>
71
+ <td>
72
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
73
+ <tbody>
74
+ <tr>
75
+ <td rowspan="10" width="35"></td>
76
+ <td height="30"><br /></td>
77
+ <td rowspan="9" width="35"></td>
78
+ </tr>
79
+ <tr>
80
+ <td style="font-size: 32px; font-family: Arial; color: #217abe;">Here the title</td>
81
+ </tr>
82
+ <tr>
83
+ <td style="font-size: 22px; font-family: Arial; color: #262729;">Here the subtitle</td>
84
+ </tr>
85
+ <tr>
86
+ <td style="font-size: 14px; font-family: Arial; color: #444; text-align: left">
87
+ <p>Hi {name},</p>
88
+ <p>here a great new from me. I absoutely need to share this secret with you.</p>
89
+ <p>Here a unordered list:</p>
90
+ <ul>
91
+ <li>List item 1</li>
92
+ <li>List item 2</li>
93
+ <li>List item 3</li>
94
+ </ul>
95
+ <p>Some other words before say good bye!</p>
96
+ <p>See you soon.</p>
97
+ </td>
98
+ </tr>
99
+
100
+ <tr>
101
+ <td height="30"></td>
102
+ </tr>
103
+ </tbody>
104
+ </table>
105
+ </td>
106
+ </tr>
107
+ <!-- end main content -->
108
+ <tr>
109
+ <td>
110
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
111
+ <tbody>
112
+ <tr>
113
+ <td width="35" height="20"></td>
114
+ <td></td>
115
+ <td rowspan="3" width="35"></td>
116
+ </tr>
117
+ <tr>
118
+ <td></td>
119
+ <td>
120
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
121
+ <tbody>
122
+ <tr>
123
+ <td align="center" style="font-size: 14px; font-family: Arial;">
124
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
125
+ </td>
126
+ </tr>
127
+ </tbody>
128
+ </table>
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td height="20"></td>
133
+ <td></td>
134
+ </tr>
135
+ </tbody>
136
+ </table>
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <td style="background-color: #000000;" height="2"></td>
141
+ </tr>
142
+ <tr>
143
+ <td style="background-color: #1b1c1e; font-size: 13px; color: #f4f4f4;" height="20" align="center">
144
+ To unsubscribe <a style="color: #ccc" href="{unsubscription_url}">click here</a>, to edit your profile
145
+ <a style="color: #ccc" href="{profile_url}">click here</a>.
146
+ </td>
147
+ </tr>
148
+ </tbody>
149
+ </table>
150
+ </td>
151
+ </tr>
152
+ </tbody>
153
+ </table>
154
+ </body>
155
+ </html>
trunk/emails/themes/theme-1/screenshot.png ADDED
Binary file
trunk/emails/themes/theme-1/theme-options.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>10,
19
+ 'theme_categories'=>array()
20
+ );
21
+
22
+ // Mandatory!
23
+ $controls->merge_defaults($theme_defaults);
24
+ ?>
25
+
26
+ <table class="form-table">
27
+ <tr valign="top">
28
+ <th>Max new posts to include</th>
29
+ <td>
30
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
31
+ </td>
32
+ </tr>
33
+ <tr valign="top">
34
+ <th>Categories</th>
35
+ <td>
36
+ <?php $controls->categories_group('theme_categories'); ?>
37
+ </td>
38
+ </tr>
39
+ </table>
40
+
41
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
42
+
trunk/emails/themes/theme-1/theme-text.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $newsletter; // Newsletter object
3
+ global $post; // Current post managed by WordPress
4
+
5
+ // This file is included inside a function so it inherit all the local variables.
6
+
7
+ // Since a theme has it's own options, it must check if there is new content to send
8
+ // out.
9
+ // Inside $theme_options['last_time'] there is the time stamps of the last run
10
+ // to be used to decide if we need to stop or not.
11
+
12
+ $filters = array();
13
+
14
+ $filters['posts_per_page'] = (int)$theme_options['max_posts'];
15
+ if ($filters['posts_per_page'] == 0) $filters['posts_per_page'] = 10;
16
+
17
+ // This theme has an option with categories to be included.
18
+ if (is_array($theme_options['categories'])) {
19
+ $filters['cat'] = implode(',', $theme_options['categories']);
20
+ }
21
+
22
+ $posts = get_posts($filters);
23
+
24
+ // Retrieve the posts asking them to WordPress
25
+ $posts = get_posts($filters);
26
+
27
+ ?><?php echo $theme_options['theme_opening_text']; ?>
28
+
29
+ * <?php echo $theme_options['theme_title']; ?>
30
+
31
+
32
+ <?php
33
+ foreach ($posts as $post) {
34
+ // Setup the post (WordPress requirement)
35
+ setup_postdata($post);
36
+ ?>
37
+ <?php the_title(); ?>
38
+
39
+ <?php the_permalink(); ?>
40
+
41
+
42
+ <?php } ?>
43
+
44
+
45
+ <?php echo $theme_options['theme_footer_text']; ?>
46
+
trunk/emails/themes/theme-1/theme.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $newsletter; // Newsletter object
3
+ global $post; // Current post managed by WordPress
4
+
5
+ /*
6
+ * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
+ * for example the theme options used to build the email body as configured by blog
8
+ * owner.
9
+ *
10
+ * $theme_options - is an associative array with theme options: every option starts
11
+ * with "theme_" as required. See the theme-options.php file for details.
12
+ * Inside that array there are the autmated email options as well, if needed.
13
+ * A special value can be present in theme_options and is the "last_run" which indicates
14
+ * when th automated email has been composed last time. Is should be used to find if
15
+ * there are now posts or not.
16
+ *
17
+ * $is_test - if true it means we are composing an email for test purpose.
18
+ */
19
+
20
+
21
+ // This array will be passed to WordPress to extract the posts
22
+ $filters = array();
23
+
24
+ // Maximum number of post to retrieve
25
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
26
+ if ($filters['posts_per_page'] == 0)
27
+ $filters['posts_per_page'] = 10;
28
+
29
+
30
+ // Include only posts from specified categories. Do not filter per category is no
31
+ // one category has been selected.
32
+ if (is_array($theme_options['theme_categories'])) {
33
+ $filters['cat'] = implode(',', $theme_options['theme_categories']);
34
+ }
35
+
36
+ // Retrieve the posts asking them to WordPress
37
+ $posts = get_posts($filters);
38
+ ?>
39
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
40
+ <html>
41
+ <head>
42
+ <title></title>
43
+ </head>
44
+
45
+ <body>
46
+ <table bgcolor="#c0c0c0" width="100%" cellpadding="20" cellspacing="0" border="0">
47
+ <tr>
48
+ <td align="center">
49
+ <table width="500" bgcolor="#ffffff" align="center" cellspacing="10" cellpadding="0" style="border: 1px solid #666;">
50
+ <tr>
51
+ <td style="font-size: 30px">
52
+ <i><?php echo get_option('blogname'); ?></i>
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td style="border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 12px; color: #999">
57
+ <br />NEWSLETTER<br /><br />
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td style="font-size: 14px; color: #666">
62
+ <p>Dear {name}, here an update from <?php echo get_option('blogname'); ?>.</p>
63
+ </td>
64
+ </tr>
65
+ <?php
66
+ // Do not use &post, it leads to problems...
67
+ foreach ($posts as $post) {
68
+
69
+ // Setup the post (WordPress requirement)
70
+ setup_postdata($post);
71
+
72
+ // The theme can "suggest" a subject replacing the one configured, for example. In this case
73
+ // the theme, is there is no subject, suggest the first post title.
74
+ if (empty($theme_options['subject']))
75
+ $theme_options['subject'] = $post->post_title;
76
+
77
+ // Extract a thumbnail, return null if no thumb can be found
78
+ $image = nt_post_image(get_the_ID());
79
+ ?>
80
+ <tr>
81
+ <td style="font-size: 14px; color: #666">
82
+ <?php if ($image != null) { ?>
83
+ <img src="<?php echo $image; ?>" alt="picture" align="left"/>
84
+ <?php } ?>
85
+ <p><a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 16px; color: #000; text-decoration: none"><?php the_title(); ?></a></p>
86
+
87
+ <?php the_excerpt(); ?>
88
+ </td>
89
+ </tr>
90
+ <?php
91
+ }
92
+ ?>
93
+ <?php if (!isset($theme_options['theme_social_disable'])) { ?>
94
+ <tr>
95
+ <td style="font-family: Arial; font-size: 12px">
96
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
97
+ </td>
98
+ </tr>
99
+ <?php } ?>
100
+ <tr>
101
+ <td style="border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 12px; color: #999">
102
+ You received this email because you subscribed for it as {email}. If you'd like, you can <a target="_tab" href="{unsubscription_url}">unsubscribe</a>.
103
+ </td>
104
+ </tr>
105
+ </table>
106
+ </td>
107
+ </tr>
108
+ </table>
109
+ </body>
110
+ </html>
trunk/emails/themes/theme-3/header.jpg ADDED
Binary file
trunk/emails/themes/theme-3/screenshot.png ADDED
Binary file
trunk/emails/themes/theme-3/theme-options.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>10,
19
+
20
+ 'theme_categories'=>array()
21
+ );
22
+
23
+ // Mandatory!
24
+ $controls->merge_defaults($theme_defaults);
25
+ ?>
26
+ <p>This theme build an email loading all new posts after the date of the last run.</p>
27
+ <table class="form-table">
28
+ <tr valign="top">
29
+ <th>Max new posts to include</th>
30
+ <td>
31
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
32
+ </td>
33
+ </tr>
34
+ <tr valign="top">
35
+ <th>Categories</th>
36
+ <td>
37
+ <?php $controls->categories_group('theme_categories'); ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+
42
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
43
+
trunk/emails/themes/theme-3/theme-text.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $newsletter; // Newsletter object
3
+ global $post; // Current post managed by WordPress
4
+
5
+ // This file is included inside a function so it inherit all the local variables.
6
+
7
+ // Since a theme has it's own options, it must check if there is new content to send
8
+ // out.
9
+ // Inside $theme_options['last_time'] there is the time stamps of the last run
10
+ // to be used to decide if we need to stop or not.
11
+
12
+ $filters = array();
13
+
14
+ $filters['posts_per_page'] = (int)$theme_options['max_posts'];
15
+ if ($filters['posts_per_page'] == 0) $filters['posts_per_page'] = 10;
16
+
17
+ // This theme has an option with categories to be included.
18
+ if (is_array($theme_options['categories'])) {
19
+ $filters['cat'] = implode(',', $theme_options['categories']);
20
+ }
21
+
22
+ $posts = get_posts($filters);
23
+
24
+ // Retrieve the posts asking them to WordPress
25
+ $posts = get_posts($filters);
26
+
27
+ ?><?php echo $theme_options['theme_opening_text']; ?>
28
+
29
+ * <?php echo $theme_options['theme_title']; ?>
30
+
31
+
32
+ <?php
33
+ foreach ($posts as $post) {
34
+ // Setup the post (WordPress requirement)
35
+ setup_postdata($post);
36
+ ?>
37
+ <?php the_title(); ?>
38
+
39
+ <?php the_permalink(); ?>
40
+
41
+
42
+ <?php } ?>
43
+
44
+
45
+ <?php echo $theme_options['theme_footer_text']; ?>
46
+
trunk/emails/themes/theme-3/theme.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $newsletter; // Newsletter object
3
+ global $post; // Current post managed by WordPress
4
+
5
+ /*
6
+ * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
+ * for example the theme options used to build the email body as configured by blog
8
+ * owner.
9
+ *
10
+ * $theme_options - is an associative array with theme options: every option starts
11
+ * with "theme_" as required. See the theme-options.php file for details.
12
+ * Inside that array there are the autmated email options as well, if needed.
13
+ * A special value can be present in theme_options and is the "last_run" which indicates
14
+ * when th automated email has been composed last time. Is should be used to find if
15
+ * there are now posts or not.
16
+ *
17
+ * $is_test - if true it means we are composing an email for test purpose.
18
+ */
19
+
20
+
21
+ // This array will be passed to WordPress to extract the posts
22
+ $filters = array();
23
+
24
+ // Maximum number of post to retrieve
25
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
26
+ if ($filters['posts_per_page'] == 0)
27
+ $filters['posts_per_page'] = 10;
28
+
29
+
30
+ // Include only posts from specified categories. Do not filter per category is no
31
+ // one category has been selected.
32
+ if (isset($theme_options['theme_categories']) && is_array($theme_options['theme_categories'])) {
33
+ $filters['cat'] = implode(',', $theme_options['theme_categories']);
34
+ }
35
+
36
+ // Retrieve the posts asking them to WordPress
37
+ $posts = get_posts($filters);
38
+ ?>
39
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
40
+ <html>
41
+ <head>
42
+ <title></title>
43
+ </head>
44
+
45
+ <body>
46
+ <br />
47
+
48
+ <table cellspacing="0" align="center" border="0" style="max-width:600px; width:600px; background-color: #eee;" cellpadding="0" width="600px">
49
+ <!-- Header -->
50
+ <tr style="background: #455560; background-image: url(<?php echo plugins_url('header.jpg', __FILE__); ?>); height:80px;width:600px;" cellspacing="0" border="0" align="center" cellpadding="0" width="600" height="80">
51
+ <td height="80" width="600" style="color: #fff; font-size: 30px; font-family: Arial;" align="center" valign="middle">
52
+ <?php echo get_option('blogname'); ?>
53
+ </td>
54
+ </tr>
55
+ <tr style="background: #d0d0d0; height:20px;width:600px;">
56
+ <td valign="top" height="20" width="600" bgcolor="#ffffff" align="center" style="font-family: Arial; font-size: 12px">
57
+ <?php echo get_option('blogdescription'); ?>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td>
62
+ <table cellspacing="0" border="0" style="max-width:600px; width:600px; background-color: #eee;font-family:helvetica,arial,sans-serif;color:#555;font-size:13px;line-height:15px;" align="center" cellpadding="20" width="600px">
63
+ <tr>
64
+ <td>
65
+ <table cellpadding="0" cellspacing="0" border="0" bordercolor="" width="100%" bgcolor="#ffffff">
66
+ <?php
67
+ // Do not use &post, it leads to problems...
68
+ foreach ($posts as $post) {
69
+
70
+ // Setup the post (WordPress requirement)
71
+ setup_postdata($post);
72
+
73
+ // The theme can "suggest" a subject replacing the one configured, for example. In this case
74
+ // the theme, is there is no subject, suggest the first post title.
75
+ if (empty($theme_options['subject']))
76
+ $theme_options['subject'] = $post->post_title;
77
+
78
+ // Extract a thumbnail, return null if no thumb can be found
79
+ $image = nt_post_image(get_the_ID());
80
+ ?>
81
+ <tr>
82
+ <td style="font-family: Arial; font-size: 12px">
83
+ <?php if ($image != null) { ?>
84
+ <img src="<?php echo $image; ?>" alt="picture" align="left" width="100" height="100" style="margin-right: 10px"/>
85
+ <?php } ?>
86
+ <a target="_tab" href="<?php echo get_permalink(); ?>" style="color: #000; text-decoration: none"><b><?php the_title(); ?></b></a><br />
87
+
88
+ <?php the_excerpt(); ?>
89
+ </td>
90
+ </tr>
91
+ <?php
92
+ }
93
+ ?>
94
+ </table>
95
+
96
+ </td>
97
+ </tr>
98
+ </table>
99
+ </td>
100
+ </tr>
101
+ <?php if (!isset($theme_options['theme_social_disable'])) { ?>
102
+ <tr>
103
+ <td style="font-family: Arial; font-size: 12px">
104
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
105
+ </td>
106
+ </tr>
107
+ <?php } ?>
108
+ <tr>
109
+ <td bgcolor="#ffffff" style="font-family: Arial; font-size: 12px">
110
+
111
+ This email was sent to <b>{email}</b> because you opted in on <?php echo get_option('blogname'); ?> website.
112
+ <br />
113
+
114
+ <a target="_tab" href="{profile_url}">Manage the subscription</a> |
115
+
116
+ <a target="_tab" href="{unsubscription_url}">Unsubscribe</a>
117
+ </td>
118
+ </tr>
119
+ </table>
120
+ </body>
121
+ </html>
trunk/emails/themes/vimeo-like/bg_header_email.gif ADDED
Binary file
trunk/emails/themes/vimeo-like/screenshot.png ADDED
Binary file
trunk/emails/themes/vimeo-like/theme-options.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This is a pre packaged theme options page. Every option name
4
+ * must start with "theme_" so Newsletter can distinguish them from other
5
+ * options that are specific to the object using the theme.
6
+ *
7
+ * An array of theme default options should always be present and that default options
8
+ * should be merged with the current complete set of options as shown below.
9
+ *
10
+ * Every theme can define its own set of options, the will be used in the theme.php
11
+ * file while composing the email body. Newsletter knows nothing about theme options
12
+ * (other than saving them) and does not use or relies on any of them.
13
+ *
14
+ * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
+ * a decent system will be implemented.
16
+ */
17
+ $theme_defaults = array(
18
+ 'theme_max_posts'=>5,
19
+ 'theme_read_more'=>'Read More',
20
+ 'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
21
+ 'theme_categories'=>array()
22
+ );
23
+
24
+ // Mandatory!
25
+ $controls->merge_defaults($theme_defaults);
26
+ ?>
27
+
28
+ <table class="form-table">
29
+ <tr valign="top">
30
+ <th>Max new posts to include</th>
31
+ <td>
32
+ <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
33
+ </td>
34
+ </tr>
35
+ <tr valign="top">
36
+ <th>Categories to include</th>
37
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
38
+ </tr>
39
+ <tr>
40
+ <th>Post types</th>
41
+ <td>
42
+ <?php $controls->post_types('theme_post_types'); ?>
43
+ <p class="description">Leave all uncheck for a default behavior.</p>
44
+ </td>
45
+ </tr>
46
+ <tr valign="top">
47
+ <th>Pre message</th>
48
+ <td>
49
+ <?php $controls->text('theme_pre_message', 70); ?>
50
+ </td>
51
+ </tr>
52
+ <tr valign="top">
53
+ <th>Read more label</th>
54
+ <td>
55
+ <?php $controls->text('theme_read_more'); ?>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+
60
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
trunk/emails/themes/vimeo-like/theme-text.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
+
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
trunk/emails/themes/vimeo-like/theme.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $newsletter; // Newsletter object
3
+ global $post; // Current post managed by WordPress
4
+
5
+ /*
6
+ * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
+ * for example the theme options used to build the email body as configured by blog
8
+ * owner.
9
+ *
10
+ * $theme_options - is an associative array with theme options: every option starts
11
+ * with "theme_" as required. See the theme-options.php file for details.
12
+ * Inside that array there are the autmated email options as well, if needed.
13
+ * A special value can be present in theme_options and is the "last_run" which indicates
14
+ * when th automated email has been composed last time. Is should be used to find if
15
+ * there are now posts or not.
16
+ *
17
+ * $is_test - if true it means we are composing an email for test purpose.
18
+ */
19
+
20
+
21
+ // This array will be passed to WordPress to extract the posts
22
+ $filters = array();
23
+
24
+ // Maximum number of post to retrieve
25
+ $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
26
+ if ($filters['posts_per_page'] == 0) {
27
+ $filters['posts_per_page'] = 10;
28
+ }
29
+
30
+
31
+ // Include only posts from specified categories. Do not filter per category is no
32
+ // one category has been selected.
33
+ if (is_array($theme_options['theme_categories'])) {
34
+ $filters['cat'] = implode(',', $theme_options['theme_categories']);
35
+ }
36
+
37
+ if (!empty($theme_options['theme_post_types'])) {
38
+ $filters['post_type'] = $theme_options['theme_post_types'];
39
+ }
40
+
41
+ // Retrieve the posts asking them to WordPress
42
+ $posts = get_posts($filters);
43
+
44
+ // Styles
45
+ $color = $theme_options['theme_color'];
46
+ if (empty($color))
47
+ $color = '#777';
48
+
49
+ $font = $theme_options['theme_font'];
50
+ $font_size = $theme_options['theme_font_size'];
51
+ ?>
52
+ <!DOCTYPE html>
53
+ <html>
54
+ <head>
55
+ <title></title>
56
+ <style>
57
+ * {
58
+ font-family: <?php echo $font; ?>;
59
+ font-size: <?php echo $font_size; ?>;
60
+ }
61
+ </style>
62
+ </head>
63
+ <body style="font:normal 11px helvetica,sans-serif;">
64
+
65
+ <table style="background:#ffffff" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
66
+
67
+ <tr>
68
+ <td style="color:#9ab;font:normal 11px helvetica,sans-serif;text-align:center;padding:10px 0 20px 0"><?php echo $theme_options['theme_pre_message']; ?></td>
69
+ </tr>
70
+
71
+ <tr>
72
+ <td><img src="<?php echo $theme_url; ?>/bg_header_email.gif" alt=""></td>
73
+ </tr>
74
+
75
+ <tr>
76
+
77
+ <td style="border:1px dotted #e1e2e3;border-top:none;border-bottom:3px solid #e1e2e3;background:#ffffff">
78
+
79
+
80
+
81
+ <table width="100%" align="center" border="0" cellpadding="20" cellspacing="0">
82
+
83
+ <tr>
84
+ <td style="background:#ffffff">
85
+
86
+
87
+
88
+ <p style="color:#456;font-family:arial,sans-serif;font-size:24px;line-height:1.2;margin:15px 0;padding:0"><a target="_tab" href="<?php echo get_option('home'); ?>" style="color:#28c;text-decoration:none" target="_blank"><?php echo get_option('blogname'); ?></a></p>
89
+
90
+
91
+ <?php
92
+ foreach ($posts as $post) {
93
+ setup_postdata($post);
94
+ $image = nt_post_image(get_the_ID(), 'thumbnail');
95
+ ?>
96
+
97
+
98
+ <table style="width:100%;color:#456;font:normal 12px/1.5em helvetica,sans-serif;margin:15px 0 0 0;padding:0 0 15px 0;border-bottom:1px dotted #e1e2e3">
99
+
100
+ <tbody><tr>
101
+
102
+ <td style="width:100%;padding:0 10px 0 0;vertical-align:top">
103
+
104
+ <p style="font-family:arial,sans-serif;color:#456;font-size:20px;line-height:22px;margin:0;padding:0"><strong><a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#456;text-decoration:none" target="_blank"><?php the_title(); ?></a></strong></p>
105
+
106
+ <p style="font-family:arial,sans-serif;line-height:1.5em;margin:15px 0;padding:0"><?php the_excerpt(); ?>. </p>
107
+
108
+ </td>
109
+
110
+ <td style="vertical-align:middle; width: 100px">
111
+
112
+ <a target="_tab" href="<?php echo get_permalink(); ?>" target="_blank"><img src="<?php echo $image; ?>" alt="" width="100" border="0" height="100"></a>
113
+
114
+ <p style="background:#2786c2;text-align:center;margin:10px 0 0 0;font-size:11px;line-height:14px;font-family:arial,sans-serif;padding:4px 2px;border-radius:4px"><a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#fff;text-decoration:none" target="_blank"><strong><?php echo $theme_options['theme_read_more']; ?></strong></a></p>
115
+
116
+ </td>
117
+
118
+ </tr>
119
+
120
+ </tbody></table>
121
+
122
+ <br>
123
+ <?php
124
+ }
125
+ ?>
126
+
127
+
128
+
129
+
130
+ <br><br>
131
+ <p style="color:#456;font-family:arial,sans-serif;font-size:12px;line-height:1.6em;font-style:italic;margin:0 0 15px 0;padding:0">
132
+ To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
133
+ </p>
134
+ </td>
135
+ </tr>
136
+
137
+ </table>
138
+ </td>
139
+ </tr>
140
+
141
+ <?php if (!isset($theme_options['theme_social_disable'])) { ?>
142
+ <tr>
143
+ <td style="font:normal 11px helvetica,sans-serif;">
144
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
145
+ </td>
146
+ </tr>
147
+ <?php } ?>
148
+ </table>
149
+
150
+ </body>
151
+ </html>
152
+
trunk/emails/themes/xmas-2014/images/footer.png ADDED
Binary file
trunk/emails/themes/xmas-2014/images/header.png ADDED
Binary file
trunk/emails/themes/xmas-2014/screenshot.png ADDED
Binary file
trunk/emails/themes/xmas-2014/theme.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title></title>
6
+
7
+ <style type="text/css">
8
+ .ExternalClass {width:100%;}
9
+
10
+ .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
11
+ line-height: 100%;
12
+ }
13
+
14
+ body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;}
15
+
16
+ body {margin:0; padding:0;}
17
+
18
+ table td {border-collapse:collapse;}
19
+
20
+ p {margin:0; padding:0; margin-bottom:1em;}
21
+
22
+ h1, h2, h3, h4, h5, h6 {
23
+ color: #666;
24
+ line-height: 100%;
25
+ }
26
+
27
+ a, a:link {
28
+ color:#2A5DB0;
29
+ text-decoration: underline;
30
+ }
31
+
32
+ body, #body_style {
33
+ background:#A52B00;
34
+ min-height:1000px;
35
+ xcolor:#000;
36
+ font-family:Arial, Helvetica, sans-serif;
37
+ font-size:14px;
38
+ }
39
+
40
+ span.yshortcuts { color:#000; background-color:none; border:none;}
41
+ span.yshortcuts:hover,
42
+ span.yshortcuts:active,
43
+ span.yshortcuts:focus {color:#000; background-color:none; border:none;}
44
+
45
+ a:visited { color: #3c96e2; text-decoration: none}
46
+ a:focus { color: #3c96e2; text-decoration: underline}
47
+ a:hover { color: #3c96e2; text-decoration: underline}
48
+
49
+ @media only screen and (max-device-width: 480px) {
50
+
51
+
52
+ body[yahoo] #container1 {display:block !important}
53
+ body[yahoo] p {font-size: 10px}
54
+
55
+ }
56
+
57
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
58
+
59
+
60
+ body[yahoo] #container1 {display:block !important}
61
+ body[yahoo] p {font-size: 14px}
62
+
63
+ }
64
+
65
+ </style>
66
+
67
+
68
+ </head>
69
+ <body style="margin-top: 0; background:#A52B00; min-height:1000px; color:#000;font-family:Arial, Helvetica, sans-serif; font-size:14px"
70
+ alink="#FF0000" link="#FF0000" bgcolor="#A52B00" text="#000000" yahoo="fix">
71
+
72
+ <div id="body_style" style="padding:0px">
73
+
74
+ <table cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff" width="600" align="center">
75
+ <tr>
76
+ <td width="600" colspan="3"><img src="<?php echo $theme_url; ?>/images/header.png"></td>
77
+ </tr>
78
+ <tr>
79
+ <td width="600" align="center" colspan="3">
80
+ <h1><?php echo get_option('blogname'); ?></h1>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td width="20">&nbsp;</td>
85
+ <td width="560">
86
+ <p>Hi {name},</p>
87
+
88
+ <p>The Newsletter Team wishes you merry Christmas and happy New Year. This time of year is special for us and we would like
89
+ to share this time with you, also.</p>
90
+
91
+ <p>We'll take a rest for few days with our families but we have a <strong>big surprise</strong> for YOU that will
92
+ be unvealed the first days of the New Year.</p>
93
+
94
+ <p>Curious? You can <a href="<?php echo get_option('blogname'); ?>">discover a little more right now</a>.</p>
95
+
96
+ <p>
97
+ See you soon, TNT.<br>
98
+ <a href="<?php echo get_option('blogname'); ?>">http://www.thenewsletterplugin.com</a>
99
+ </p>
100
+
101
+ </td>
102
+ <td width="20">&nbsp;</td>
103
+ </tr>
104
+ <td width="600" colspan="3">
105
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
106
+ </td>
107
+ <tr>
108
+ <td width="20">&nbsp;</td>
109
+ <td width="560" style="color:#666">
110
+ <p>To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
111
+ </td>
112
+ <td width="20">&nbsp;</td>
113
+ </tr>
114
+ <tr>
115
+ <td width="600" colspan="3" bgcolor="#A52B00"><img src="<?php echo $theme_url; ?>/images/footer.png"></td>
116
+ </tr>
117
+ </table>
118
+
119
+ </div>
120
+
121
+ </body>
122
+ </html>
trunk/emails/tnp-composer/_assets/background.png ADDED
Binary file
trunk/emails/tnp-composer/_css/Icomoon/icomoon.eot ADDED
Binary file
trunk/emails/tnp-composer/_css/Icomoon/icomoon.svg ADDED
@@ -0,0 +1,2334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+
7
+ </metadata>
8
+ <defs>
9
+ <font id="IcoMoon" horiz-adv-x="512" >
10
+ <font-face units-per-em="512" ascent="480" descent="-32" />
11
+ <missing-glyph horiz-adv-x="512" />
12
+ <glyph unicode="&#xe000;" d="M 256.00,448.00L0.00,192.00l 48.00-48.00l 48.00,48.00l 32.00-192.00l 128.00,0.00 l 128.00,0.00 l 32.00,192.00l 48.00-48.00l 48.00,48.00L 256.00,448.00z M 256.00,242.746c-24.994,0.00-45.256,20.26-45.256,45.254
13
+ s 20.262,45.255, 45.256,45.255c 24.992,0.00, 45.255-20.262, 45.255-45.255C 301.255,263.006, 280.992,242.746, 256.00,242.746z" />
14
+ <glyph unicode="&#xe001;" d="M 256.00,448.00L0.00,192.00l 48.00-48.00l 48.00,48.00l 32.00-192.00l 96.00,0.00 l0.00,96.00 l 64.00,0.00 l0.00-96.00 l 96.00,0.00 l 32.00,192.00l 48.00-48.00l 48.00,48.00L 256.00,448.00z M 256.00,242.746
15
+ c-24.994,0.00-45.256,20.26-45.256,45.254s 20.262,45.255, 45.256,45.255c 24.992,0.00, 45.255-20.262, 45.255-45.255
16
+ C 301.255,263.006, 280.992,242.746, 256.00,242.746z" />
17
+ <glyph unicode="&#xe002;" d="M 448.00,352.00L 448.00,416.00 L0.00,416.00 l0.00-352.00 c0.00-17.673, 14.327-32.00, 32.00-32.00l 432.00,0.00 c 26.511,0.00, 48.00,21.489, 48.00,48.00L 512.00,352.00 L 448.00,352.00 z M 416.00,64.00L 32.00,64.00 L 32.00,384.00 l 384.00,0.00 L 416.00,64.00 zM 64.00,320.00L 384.00,320.00L 384.00,288.00L 64.00,288.00zM 256.00,256.00L 384.00,256.00L 384.00,224.00L 256.00,224.00zM 256.00,192.00L 384.00,192.00L 384.00,160.00L 256.00,160.00zM 256.00,128.00L 352.00,128.00L 352.00,96.00L 256.00,96.00zM 64.00,256.00L 224.00,256.00L 224.00,96.00L 64.00,96.00z" />
18
+ <glyph unicode="&#xe003;" d="M 488.00,456.00c-32.00,32.00-64.00,32.00-96.00,0.00l-8.00-8.00l 96.00-96.00l 8.00,8.00C 520.00,392.00, 520.00,424.00, 488.00,456.00zM 32.00,96.00L0.00-32.00l 128.00,32.00l 320.00,320.00l-96.00,96.00L 32.00,96.00z M 128.00,64.00l-32.00,32.00l 256.00,256.00l 32.00-32.00L 128.00,64.00z" />
19
+ <glyph unicode="&#xe004;" d="M 192.00,160.00L 256.00,192.00L 480.00,416.00L 448.00,448.00L 224.00,224.00 zM 144.65,36.451c-15.816,33.364-42.833,60.381-76.198,76.198l 38.99,129.968L 192.00,288.00L 384.00,480.00l-96.00,0.00 L 96.00,288.00L0.00-32.00l 320.00,96.00l 192.00,192.00
20
+ l0.00,96.00 L 320.00,160.00l-45.383-84.559" />
21
+ <glyph unicode="&#xe005;" d="M0.00,416.00l0.00-384.00 l 512.00,0.00 L 512.00,416.00 L0.00,416.00 z M 480.00,64.00l-32.00,0.00 l-96.00,144.00l-64.00-48.00L 160.00,320.00L 64.00,64.00L 32.00,64.00 L 32.00,384.00 l 448.00,0.00 L 480.00,64.00 zM 352.00,304.00A48.00,48.00 4860.00 1,0 448.00,304A48.00,48.00 4860.00 1,0 352.00,304z" />
22
+ <glyph unicode="&#xe006;" d="M 416.00,192.113c-32.00,0.00-64.00-32.113-96.00-32.113s-32.00,128.00-96.00,128.00S 96.00,224.00, 64.00,96.00c0.00,0.00, 352.00,0.00, 384.00,0.00
23
+ C 448.00,95.999, 448.00,192.113, 416.00,192.113zM0.00,384.00l0.00-352.00 l 512.00,0.00 L 512.00,384.00 L0.00,384.00 z M 480.00,64.00L 32.00,64.00 L 32.00,352.00 l 448.00,0.00 L 480.00,64.00 zM 352.00,272.00A48.00,48.00 4860.00 1,0 448.00,272A48.00,48.00 4860.00 1,0 352.00,272z" />
24
+ <glyph unicode="&#xe007;" d="M 154.007,208.00A101.993,101.993 4860.00 1,0 357.993,208A101.993,101.993 4860.00 1,0 154.007,208zM 480.00,352.00L 368.00,352.00 c-8.00,32.00-16.00,64.00-48.00,64.00L 192.00,416.00 c-32.00,0.00-40.00-32.00-48.00-64.00L 32.00,352.00 c-17.60,0.00-32.00-14.40-32.00-32.00l0.00-256.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 448.00,0.00
25
+ c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,320.00 C 512.00,337.60, 497.60,352.00, 480.00,352.00z M 256.00,64.00c-79.529,0.00-144.00,64.471-144.00,144.00c0.00,79.529, 64.471,144.00, 144.00,144.00
26
+ c 79.529,0.00, 144.00-64.471, 144.00-144.00C 400.00,128.471, 335.53,64.00, 256.00,64.00z M 480.00,288.00l-64.00,0.00 l0.00,32.00 l 64.00,0.00 L 480.00,288.00 z" />
27
+ <glyph unicode="&#xe008;" d="M 155.755,448.451l-13.09-340.294c-17.465,8.962-39.377,12.84-62.368,9.578c-49.574-7.021-85.271-44.418-79.729-83.517
28
+ c 5.543-39.102, 50.223-65.101, 99.795-58.078c 43.996,6.235, 77.021,36.395, 80.022,70.43l 0.01-0.019c 0.006,0.077, 0.011,0.193, 0.018,0.28
29
+ c 0.073,0.865, 0.115,1.741, 0.147,2.611c 1.846,35.143, 13.148,302.082, 13.148,302.082l 278.355,28.679l-12.572-240.41
30
+ c-17.863,9.942-40.822,14.371-64.964,10.95c-49.574-7.028-85.268-44.417-79.726-83.521c 5.541-39.098, 50.221-65.102, 99.795-58.071
31
+ c 44.933,6.36, 78.41,37.682, 80.166,72.604l 0.021,0.021C 495.742,97.752, 512.00,473.005, 512.00,473.005L 155.755,448.451z" />
32
+ <glyph unicode="&#xe009;" d="M 490.594,399.946C 418.778,410.271, 339.428,416.00, 256.001,416.00c-83.43,0.00-162.778-5.729-234.597-16.054
33
+ C 7.639,346.083,0.00,286.571,0.00,224.00c0.00-62.57, 7.639-122.083, 21.404-175.945C 93.223,37.729, 172.572,32.00, 256.001,32.00
34
+ c 83.427,0.00, 162.776,5.729, 234.593,16.055C 504.36,101.917, 512.00,161.43, 512.00,224.00C 512.00,286.571, 504.36,346.083, 490.594,399.946z
35
+ M 192.001,128.00L 192.001,320.00 l 160.00-96.00L 192.001,128.00z" />
36
+ <glyph unicode="&#xe00a;" d="M0.00,416.00l0.00-384.00 l 512.00,0.00 L 512.00,416.00 L0.00,416.00 z M 96.00,64.00L 32.00,64.00 l0.00,64.00 l 64.00,0.00 L 96.00,64.00 z M 96.00,192.00L 32.00,192.00 l0.00,64.00 l 64.00,0.00 L 96.00,192.00 z M 96.00,320.00L 32.00,320.00 L 32.00,384.00 l 64.00,0.00 L 96.00,320.00 z M 384.00,64.00L 128.00,64.00 L 128.00,384.00 l 256.00,0.00 L 384.00,64.00 z
37
+ M 480.00,64.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 480.00,64.00 z M 480.00,192.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 480.00,192.00 z M 480.00,320.00l-64.00,0.00 L 416.00,384.00 l 64.00,0.00 L 480.00,320.00 zM 192.00,320.00L 192.00,128.00L 320.00,224.00 z" />
38
+ <glyph unicode="&#xe00b;" d="M 288.00,352.00L 64.00,352.00 c-17.601,0.00-32.00-14.399-32.00-32.00l0.00-192.00 c0.00-17.60, 14.399-32.00, 32.00-32.00l 224.00,0.00 c 17.601,0.00, 32.00,14.40, 32.00,32.00L 320.00,320.00
39
+ C 320.00,337.601, 305.601,352.00, 288.00,352.00zM 352.00,242.286L 352.00,205.715L 480.00,96.00L 480.00,352.00 z" />
40
+ <glyph unicode="&#xe00c;" d="M 408.785,305.925C 312.002,377.854, 278.652,435.434, 256.002,479.999l0.00,0.00C 256.00,479.999, 256.00,480.00, 256.00,480.00l0.00-0.001
41
+ c-22.648-44.565-56.00-102.146-152.783-174.074c-165.018-122.643-9.688-293.834, 126.879-199.612
42
+ c-8.898-58.465-39.265-101.086-70.104-119.441L 159.992-32.00 l 96.008,0.00 l 96.008,0.00 l0.00,18.87 c-30.841,18.354-61.205,60.977-70.106,119.442
43
+ C 418.47,12.089, 573.802,183.282, 408.785,305.925z" />
44
+ <glyph unicode="&#xe00d;" d="M 393.416,283.614c-29.516,0.00-56.043-12.298-74.926-32.347c-7.998-8.492-21.881-18.556-36.90-27.405
45
+ c 7.055,26.934, 29.338,60.85, 44.814,75.728c 19.82,19.085, 31.992,45.915, 31.992,75.75C 358.399,432.787, 312.658,479.388, 256.002,480.00
46
+ c-56.66-0.611-102.398-47.213-102.398-104.659c0.00-29.836, 12.172-56.665, 31.993-75.75c 15.477-14.878, 37.76-48.794, 44.814-75.728
47
+ c-15.021,8.85-28.903,18.913-36.90,27.405c-18.884,20.049-45.41,32.347-74.925,32.347c-57.193,0.00-103.54-46.832-103.54-104.664
48
+ c0.00-57.819, 46.346-104.669, 103.54-104.669c 29.521,0.00, 56.041,12.678, 74.925,32.726c 8.402,8.936, 23.222,20.069, 39.146,29.316
49
+ c-1.501-73.846-36.766-128.084-72.659-149.453L 159.998-32.00 l 96.005,0.00 l 96.002,0.00 l0.00,18.87 c-35.896,21.368-71.16,75.608-72.66,149.453
50
+ c 15.926-9.247, 30.744-20.384, 39.146-29.316c 18.883-20.047, 45.404-32.726, 74.926-32.726c 57.193,0.00, 103.539,46.85, 103.539,104.669
51
+ C 496.955,236.782, 450.61,283.614, 393.416,283.614z" />
52
+ <glyph unicode="&#xe00e;" d="M 256.00,480.00L 96.00,224.00L 256.00-32.00L 416.00,224.00 z" />
53
+ <glyph unicode="&#xe00f;" d="M 224.00,288.00L 96.00-32.00l 48.596,0.00 L 256.00,65.479L 367.406-32.00L 416.00-32.00 L 288.00,288.00L 224.00,288.00 z M 149.024,14.395l 42.871,107.179l 39.81-34.833
54
+ L 149.024,14.395z M 362.978,14.396l-82.68,72.344l 39.809,34.833L 362.978,14.396z M 256.00,108.00l-51.507,45.068L 245.665,256.00l 20.67,0.00
55
+ l 41.173-102.932L 256.00,108.00zM 366.871,415.999C 377.764,397.172, 384.00,375.314, 384.00,352.00s-6.236-45.172-17.129-63.999l 27.72-16.00
56
+ C 408.204,295.535, 416.00,322.856, 416.00,352.00s-7.796,56.465-21.409,79.999L 366.871,415.999zM 145.128,288.001C 134.238,306.828, 128.00,328.686, 128.00,352.00s 6.236,45.172, 17.128,63.999L 117.41,431.998
57
+ C 103.796,408.464, 96.00,381.144, 96.00,352.00s 7.796-56.464, 21.41-79.999L 145.128,288.001zM 34.252,480.00C 12.47,442.345,0.00,398.629,0.00,352.00s 12.47-90.345, 34.252-127.999l 27.719,16.00C 42.911,272.948, 32.00,311.199, 32.00,352.00
58
+ S 42.911,431.052, 61.971,464.00L 34.252,480.00zM 512.00,352.00c0.00,46.63-12.47,90.346-34.253,128.00l0.00,0.00L 450.03,464.00C 469.09,431.052, 480.00,392.801, 480.00,352.00s-10.91-79.053-29.971-112.00
59
+ l 27.718-16.00l0.00,0.00C 499.531,261.654, 512.00,305.37, 512.00,352.00zM 224.00,352.00A32.00,32.00 4860.00 1,0 288.00,352A32.00,32.00 4860.00 1,0 224.00,352z" />
60
+ <glyph unicode="&#xe010;" d="M 240.00,128.00c 44.183,0.00, 80.00,35.817, 80.00,80.00L 320.00,400.00 c0.00,44.183-35.817,80.00-80.00,80.00s-80.00-35.817-80.00-80.00l0.00-192.00 C 160.00,163.817, 195.818,128.00, 240.00,128.00zM 352.00,256.00l0.00-48.00 c0.00-61.855-50.145-112.00-112.00-112.00c-61.856,0.00-112.00,50.145-112.00,112.00l0.00,48.00 L 96.00,256.00 l0.00-48.00 c0.00-74.119, 56.002-135.15, 128.00-143.11L 224.00,0.00
61
+ l-64.00,0.00 l0.00-32.00 l 64.00,0.00 l 32.00,0.00 l 64.00,0.00 l0.00,32.00 l-64.00,0.00 l0.00,64.89 c 71.997,7.96, 128.00,68.991, 128.00,143.11l0.00,48.00 L 352.00,256.00 z" />
62
+ <glyph unicode="&#xe011;" d="M 384.00,416.00c-49.179,0.00-94.03-18.498-128.00-48.905C 222.031,397.502, 177.179,416.00, 128.00,416.00S 33.969,397.502,0.00,367.096l0.00-8.596 l0.00-38.49 l0.00-192.004
63
+ L0.00,87.50 l0.00-6.576 c 0.342-0.306, 0.676-0.62, 1.02-0.924c 8.209-7.244, 17.04-13.798, 26.406-19.569c 9.43,7.631, 19.739,14.216, 30.761,19.569
64
+ c 21.098,10.248, 44.783,16.00, 69.813,16.00s 48.716-5.752, 69.813-16.00c 11.021-5.354, 21.331-11.938, 30.761-19.569
65
+ c 1.842-1.491, 3.65-3.022, 5.424-4.592c 8.108-7.178, 15.488-15.159, 22.002-23.83c 6.515,8.671, 13.894,16.652, 22.002,23.83
66
+ c 1.773,1.569, 3.581,3.101, 5.424,4.592c 9.43,7.631, 19.739,14.216, 30.761,19.569c 21.098,10.248, 44.783,16.00, 69.813,16.00
67
+ s 48.716-5.752, 69.813-16.00c 11.021-5.354, 21.331-11.938, 30.761-19.569c 9.366,5.771, 18.196,12.325, 26.405,19.569
68
+ c 0.344,0.304, 0.679,0.618, 1.021,0.924L 512.00,87.50 l0.00,40.506 L 512.00,320.01 L 512.00,358.50 l0.00,8.596 C 478.031,397.502, 433.179,416.00, 384.00,416.00z M 128.00,128.00
69
+ c-34.976,0.00-67.758-9.365-96.00-25.705L 32.00,352.007 C 58.741,372.095, 91.98,384.00, 128.00,384.00c 36.025,0.00, 69.258-11.919, 96.00-32.013l0.00-249.692
70
+ C 195.758,118.635, 162.976,128.00, 128.00,128.00z M 384.00,128.00c-34.976,0.00-67.758-9.365-96.00-25.705L 288.00,351.987 C 314.742,372.081, 347.976,384.00, 384.00,384.00
71
+ c 36.021,0.00, 69.259-11.906, 96.00-31.994l0.00-249.712 C 451.758,118.635, 418.976,128.00, 384.00,128.00z" />
72
+ <glyph unicode="&#xe012;" d="M 449.735,374.562l-75.173,87.703C 365.751,472.542, 349.534,480.00, 336.00,480.00L 80.00,480.00 C 62.355,480.00, 48.00,465.645, 48.00,448.00l0.00-448.00 c0.00-17.645, 14.355-32.00, 32.00-32.00
73
+ l 352.00,0.00 c 17.645,0.00, 32.00,14.355, 32.00,32.00L 464.00,336.00 C 464.00,348.702, 458.00,364.92, 449.735,374.562z M 352.00,459.633c 4.142-2.112, 7.88-4.826, 10.413-7.781
74
+ l 75.174-87.704c 2.65-3.092, 5.07-7.469, 6.913-12.148L 352.00,352.00 L 352.00,459.633 z M 448.00,0.00c0.00-8.80-7.20-16.00-16.00-16.00L 80.00-16.00 c-8.80,0.00-16.00,7.20-16.00,16.00L 64.00,448.00
75
+ c0.00,8.80, 7.20,16.00, 16.00,16.00l 256.00,0.00 l0.00-128.00 l 112.00,0.00 L 448.00,0.00 z" />
76
+ <glyph unicode="&#xe013;" d="M 352.00,480.00L 32.00,480.00 l0.00-512.00 l 448.00,0.00 L 480.00,352.00 L 352.00,480.00z M 448.00,0.00L 64.00,0.00 L 64.00,448.00 l 288.00,0.00 l0.00-96.00 l 96.00,0.00 L 448.00,0.00 z" />
77
+ <glyph unicode="&#xe014;" d="M 256.00-32.00L 256.00,192.00L 32.00,192.00 zM 32.00,480.00L 32.00,224.00L 288.00,224.00L 288.00-32.00L 480.00-32.00L 480.00,480.00 z" />
78
+ <glyph unicode="&#xe015;" d="M 224.00,288.00L 416.00,288.00L 416.00,256.00L 224.00,256.00zM 224.00,224.00L 416.00,224.00L 416.00,192.00L 224.00,192.00zM 224.00,160.00L 416.00,160.00L 416.00,128.00L 224.00,128.00zM 224.00,96.00L 352.00,96.00L 352.00,64.00L 224.00,64.00zM 480.00,384.00l-96.00,0.00 L 384.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00L 32.00,480.00 C 14.40,480.00,0.00,465.60,0.00,448.00l0.00-352.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 96.00,0.00 l0.00-64.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 320.00,0.00
79
+ c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,352.00 C 512.00,369.60, 497.60,384.00, 480.00,384.00z M 128.00,352.00l0.00-240.00 L 48.00,112.00 L 48.00,432.00 l 288.00,0.00 l0.00-48.00 L 160.00,384.00 C 142.40,384.00, 128.00,369.60, 128.00,352.00z M 464.00,16.00L 176.00,16.00
80
+ L 176.00,336.00 l 288.00,0.00 L 464.00,16.00 z" />
81
+ <glyph unicode="&#xe016;" d="M 492.25,352.00L 19.75,352.00 c-13.20,0.00-21.882-10.59-19.293-23.534l 58.836-272.932C 61.882,42.59, 74.80,32.00, 88.00,32.00l 336.00,0.00
82
+ c 13.20,0.00, 26.118,10.59, 28.707,23.534l 58.836,272.932C 514.132,341.41, 505.45,352.00, 492.25,352.00zM 448.00,392.00c0.00,13.255-10.745,24.00-24.00,24.00L 208.00,416.00 l-16.00,32.00L 88.00,448.00 c-13.255,0.00-24.00-10.745-24.00-24.00l0.00-56.00 l 384.00,0.00 L 448.00,392.00 z" />
83
+ <glyph unicode="&#xe017;" d="M 492.25,352.00L 448.00,352.00 L 448.00,392.00 c0.00,13.255-10.745,24.00-24.00,24.00L 208.00,416.00 l-16.00,32.00L 88.00,448.00 c-13.255,0.00-24.00-10.745-24.00-24.00l0.00-72.00 L 19.75,352.00
84
+ c-13.20,0.00-21.882-10.59-19.293-23.534l 58.836-272.932C 61.882,42.59, 74.80,32.00, 88.00,32.00l 336.00,0.00 c 13.20,0.00, 26.118,10.59, 28.707,23.534
85
+ l 58.836,272.932C 514.132,341.41, 505.45,352.00, 492.25,352.00z M 96.00,416.00l 76.223,0.00 l 16.00-32.00L 416.00,384.00 l0.00-32.00 L 96.00,352.00 L 96.00,416.00 z M 421.797,64.00L 90.203,64.00 L 35.017,320.00l 441.966,0.00
86
+ L 421.797,64.00z" />
87
+ <glyph unicode="&#xe018;" d="M 288.00,480.00L0.00,192.00l 224.00-224.00l 288.00,288.00L 512.00,480.00 L 288.00,480.00 z M 416.00,337.60c-25.626,0.00-46.399,20.773-46.399,46.40S 390.374,430.40, 416.00,430.40
88
+ s 46.40-20.773, 46.40-46.40S 441.626,337.60, 416.00,337.60z" />
89
+ <glyph unicode="&#xe019;" d="M 64.00,16.00A48.00,48.00 3060.00 1,0 160.00,16A48.00,48.00 3060.00 1,0 64.00,16zM 384.00,16.00A48.00,48.00 3060.00 1,0 480.00,16A48.00,48.00 3060.00 1,0 384.00,16zM 480.00,224.00L 480.00,416.00 L 64.00,416.00 C 64.00,451.346, 35.347,480.00,0.00,480.00l0.00-32.00 c 17.645,0.00, 32.00-14.355, 32.00-32.00l 24.037-206.027C 41.39,198.244, 32.00,180.223, 32.00,160.00
90
+ c0.00-35.347, 28.654-64.00, 64.00-64.00l 384.00,0.00 l0.00,32.00 L 96.00,128.00 c-17.673,0.00-32.00,14.327-32.00,32.00c0.00,0.11, 0.007,0.218, 0.008,0.328L 480.00,224.00z" />
91
+ <glyph unicode="&#xe01a;" d="M 406.494,288.00L 317.573,403.765C 319.134,407.535, 320.00,411.666, 320.00,416.00c0.00,17.673-14.326,32.00-32.00,32.00c-17.673,0.00-32.00-14.327-32.00-32.00
92
+ s 14.327-32.00, 32.00-32.00c 1.421,0.00, 2.816,0.102, 4.188,0.282L 366.144,288.00L 145.857,288.00 l 73.956,96.282C 221.184,384.102, 222.58,384.00, 224.00,384.00
93
+ c 17.673,0.00, 32.00,14.327, 32.00,32.00s-14.327,32.00-32.00,32.00s-32.00-14.327-32.00-32.00c0.00-4.334, 0.866-8.465, 2.427-12.234L 105.506,288.00L0.00,288.00 l0.00-64.00 l 32.00,0.00 l 32.00-256.00l 384.00,0.00
94
+ l 32.00,256.00l 32.00,0.00 l0.00,64.00 L 406.494,288.00 z M 160.00,32.00L 96.00,32.00 l0.00,64.00 l 64.00,0.00 L 160.00,32.00 z M 160.00,160.00L 96.00,160.00 l0.00,64.00 l 64.00,0.00 L 160.00,160.00 z M 288.00,32.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 288.00,32.00 z M 288.00,160.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 288.00,160.00 z
95
+ M 416.00,32.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 416.00,32.00 z M 416.00,160.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 416.00,160.00 z" />
96
+ <glyph unicode="&#xe01b;" d="M 192.00,480.00L 32.00,480.00 C 14.40,480.00,0.00,465.60,0.00,448.00l0.00-160.00 c0.00-17.60, 14.398-32.00, 32.00-32.00l 160.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 224.00,448.00 C 224.00,465.60, 209.60,480.00, 192.00,480.00z M 192.00,352.00
97
+ L 32.00,352.00 L 32.00,384.00 l 160.00,0.00 L 192.00,352.00 zM 480.00,480.00L 320.00,480.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-448.00 c0.00-17.60, 14.398-32.00, 32.00-32.00l 160.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,448.00 C 512.00,465.60, 497.60,480.00, 480.00,480.00z
98
+ M 480.00,160.00L 320.00,160.00 l0.00,32.00 l 160.00,0.00 L 480.00,160.00 z M 480.00,256.00L 320.00,256.00 l0.00,32.00 l 160.00,0.00 L 480.00,256.00 zM 192.00,192.00L 32.00,192.00 C 14.40,192.00,0.00,177.60,0.00,160.00l0.00-160.00 c0.00-17.60, 14.398-32.00, 32.00-32.00l 160.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 224.00,160.00 C 224.00,177.60, 209.60,192.00, 192.00,192.00
99
+ z M 192.00,64.00l-64.00,0.00 l0.00-64.00 L 96.00,0.00 l0.00,64.00 L 32.00,64.00 l0.00,32.00 l 64.00,0.00 l0.00,64.00 l 32.00,0.00 l0.00-64.00 l 64.00,0.00 L 192.00,64.00 z" />
100
+ <glyph unicode="&#xe01c;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 160.00,224.00
101
+ c0.00,53.02, 42.98,96.00, 96.00,96.00s 96.00-42.98, 96.00-96.00s-42.98-96.00-96.00-96.00S 160.00,170.98, 160.00,224.00z M 462.99,138.262L 462.99,138.262l-88.71,36.745
102
+ C 380.539,190.099, 384.00,206.645, 384.00,224.00s-3.461,33.901-9.72,48.993l 61.063,25.293l 27.647,11.452C 473.944,283.327, 480.00,254.373, 480.00,224.00
103
+ C 480.00,193.627, 473.943,164.673, 462.99,138.262L 462.99,138.262z M 341.739,430.99L 341.739,430.99L 341.739,430.99l-36.745-88.71
104
+ C 289.902,348.539, 273.356,352.00, 256.00,352.00s-33.901-3.461-48.993-9.72l-17.23,41.599l-19.515,47.112C 196.673,441.943, 225.628,448.00, 256.00,448.00
105
+ C 286.373,448.00, 315.327,441.943, 341.739,430.99z M 49.01,309.738l 47.112-19.515l 41.599-17.23C 131.462,257.901, 128.00,241.355, 128.00,224.00
106
+ s 3.461-33.901, 9.72-48.993l-88.71-36.745C 38.057,164.673, 32.00,193.627, 32.00,224.00C 32.00,254.373, 38.057,283.327, 49.01,309.738z
107
+ M 170.262,17.01l 11.452,27.647l 25.293,61.063C 222.099,99.461, 238.645,96.00, 256.00,96.00s 33.901,3.461, 48.993,9.72l 36.745-88.71l0.00,0.00l0.00,0.00
108
+ C 315.327,6.058, 286.373,0.00, 256.00,0.00C 225.628,0.00, 196.673,6.057, 170.262,17.01z" />
109
+ <glyph unicode="&#xe01d;" d="M 321.788,108.854c-11.188-6.236-20.175-2.064-32.764,4.572c-11.46,8.748-45.402,35.438-81.226,71.188
110
+ c-26.156,33.084-46.162,64.288-55.375,79.293c-0.625,1.66-0.944,2.632-0.944,2.632c-5.397,13.476-8.771,22.92-1.324,33.521
111
+ c 6.854,9.727, 9.50,12.383, 18.24,20.108L 80.605,450.292c-10.604-7.728-27.018-25.106-40.509-44.378
112
+ c-12.538-18.317-23.154-38.587-26.049-53.055c 15.295-55.117, 52.258-157.896, 120.583-231.325l-0.021-0.308
113
+ C 200.339,40.198, 304.774-10.204, 360.18-32.00c 14.679,1.385, 35.938,9.844, 55.456,20.404c 20.598,11.415, 39.567,25.945, 48.329,35.685
114
+ L 343.677,124.918C 335.08,117.008, 332.179,114.664, 321.788,108.854zM 205.61,351.342c 7.241,5.302, 5.313,14.944, 1.926,20.245L 140.957,473.50c-4.344,5.291-13.396,8.064-21.252,5.579L 92.272,460.698
115
+ l 88.034-129.879L 205.61,351.342zM 492.949,82.154l-94.473,76.788c-4.93,3.918-14.313,6.838-20.325,0.188l-23.046-23.05l 120.047-101.015l 21.136,25.357
116
+ C 499.573,67.986, 497.755,77.279, 492.949,82.154z" />
117
+ <glyph unicode="&#xe01e;" d="M 325.608,214.818L 512.00,86.264L 512.00,382.211 zM0.00,382.211L0.00,86.264L 186.388,214.836 zM 256.00,152.309L 211.499,192.264L0.00,64.00L 512.00,64.00L 300.495,192.264 zM 496.64,384.00L 15.36,384.00L 256.00,203.074 z" />
118
+ <glyph unicode="&#xe01f;" d="M 256.00,480.00c-81.67,0.00-147.871-66.202-147.871-147.87c0.00-2.014, 0.061-4.101, 0.16-6.224c 0.05-1.234, 0.126-2.454, 0.209-3.682
119
+ c 0.051-0.779, 0.113-1.574, 0.18-2.371c 0.104-1.304, 0.21-2.61, 0.35-3.906C 121.292,196.493, 256.001-32.00, 256.001-32.00
120
+ s 134.705,228.492, 146.97,347.948c 0.143,1.295, 0.245,2.603, 0.351,3.905c 0.065,0.797, 0.131,1.592, 0.183,2.371
121
+ c 0.084,1.229, 0.158,2.447, 0.21,3.683c 0.097,2.124, 0.157,4.211, 0.157,6.224C 403.866,413.799, 337.666,480.00, 256.00,480.00z M 320.00,320.00
122
+ c0.00-35.347-28.654-64.00-64.00-64.00c-35.346,0.00-64.00,28.653-64.00,64.00s 28.654,64.00, 64.00,64.00C 291.346,384.00, 320.00,355.347, 320.00,320.00z" />
123
+ <glyph unicode="&#xe020;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,0.00
124
+ C 132.288,0.00, 32.00,100.288, 32.00,224.00S 132.288,448.00, 256.00,448.00s 224.00-100.288, 224.00-224.00S 379.712,0.00, 256.00,0.00zM 128.00,96.00l 169.373,79.17L 384.00,352.00l-173.255-82.745L 128.00,96.00z M 256.00,256.00c 17.673,0.00, 32.00-14.327, 32.00-32.00c0.00-17.673-14.327-32.00-32.00-32.00
125
+ c-17.673,0.00-32.00,14.327-32.00,32.00C 224.00,241.673, 238.327,256.00, 256.00,256.00z" />
126
+ <glyph unicode="&#xe021;" d="M 256.00,352.00L 256.00,192.00L 384.00,192.00L 384.00,224.00L 288.00,224.00L 288.00,352.00 zM 288.00,448.00C 164.288,448.00, 64.00,347.712, 64.00,224.00L0.00,224.00 l 80.00-96.00l 80.00,96.00L 96.00,224.00 c0.00,106.039, 85.961,192.00, 192.00,192.00c 106.039,0.00, 192.00-85.961, 192.00-192.00
127
+ c0.00-106.039-85.961-192.00-192.00-192.00c-10.904,0.00-21.592,0.923-32.00,2.67l0.00-32.385 c 10.453-1.495, 21.134-2.285, 32.00-2.285
128
+ c 123.712,0.00, 224.00,100.288, 224.00,224.00S 411.712,448.00, 288.00,448.00z" />
129
+ <glyph unicode="&#xe022;" d="M 240.00,448.00C 107.452,448.00,0.00,340.548,0.00,208.00c0.00-132.549, 107.452-240.00, 240.00-240.00c 132.549,0.00, 240.00,107.451, 240.00,240.00
130
+ C 480.00,340.548, 372.549,448.00, 240.00,448.00z M 240.00,0.00c-114.875,0.00-208.00,93.125-208.00,208.00S 125.125,416.00, 240.00,416.00s 208.00-93.125, 208.00-208.00
131
+ S 354.875,0.00, 240.00,0.00zM 256.00,253.258L 256.00,384.00 l-32.00,0.00 l0.00-130.742 c-18.641-6.59-32.00-24.36-32.00-45.258c0.00-26.51, 21.49-48.00, 48.00-48.00c 20.898,0.00, 38.667,13.359, 45.258,32.00
132
+ L 384.00,192.00 l0.00,32.00 l-98.742,0.00 C 280.438,237.635, 269.636,248.437, 256.00,253.258z" />
133
+ <glyph unicode="&#xe023;" d="M 512.00,64.00c-53.021,0.00-96.00,42.98-96.00,96.00L 416.00,302.545 c0.00,70.369-54.971,129.064-128.00,142.542L 288.00,480.00 l-64.00,0.00 l0.00-34.912
134
+ C 150.968,431.609, 96.00,372.915, 96.00,302.546L 96.00,160.00 c0.00-53.02-42.981-96.00-96.00-96.00l0.00-32.00 l 214.799,0.00 c-2.604-5.712-4.055-12.059-4.055-18.745
135
+ C 210.744-11.738, 231.006-32.00, 256.00-32.00c 24.992,0.00, 45.255,20.262, 45.255,45.255c0.00,6.688-1.451,13.033-4.056,18.745L 512.00,32.00 L 512.00,64.00 z" />
136
+ <glyph unicode="&#xe024;" d="M 512.00,64.00c-53.021,0.00-96.00,42.98-96.00,96.00L 416.00,302.545 c0.00,70.37-54.971,129.064-128.00,142.543L 288.00,480.00 l-64.00,0.00 l0.00-34.912
137
+ C 150.969,431.609, 96.00,372.915, 96.00,302.545L 96.00,160.00 c0.00-53.02-42.981-96.00-96.00-96.00l0.00-32.00 l 214.799,0.00 c-2.604-5.712-4.054-12.06-4.054-18.745
138
+ C 210.745-11.739, 231.006-32.00, 256.00-32.00c 24.993,0.00, 45.255,20.261, 45.255,45.255c0.00,6.687-1.452,13.033-4.055,18.745L 512.00,32.00 L 512.00,64.00 z M 352.00,160.00
139
+ l-32.00-32.00l-64.00,64.00l-64.00-64.00l-32.00,32.00l 64.00,64.00l-64.00,64.00l 32.00,32.00l 64.00-64.00l 64.00,64.00l 32.00-32.00l-64.00-64.00L 352.00,160.00z" />
140
+ <glyph unicode="&#xe025;" d="M 512.00,64.00c-53.02,0.00-96.00,42.98-96.00,96.00L 416.00,302.546 c0.00,70.369-54.97,129.064-128.00,142.542L 288.00,480.00 l-64.00,0.00 l0.00-34.912
141
+ C 150.97,431.61, 96.00,372.915, 96.00,302.546L 96.00,160.00 c0.00-53.02-42.98-96.00-96.00-96.00l0.00-32.00 l 214.80,0.00 c-2.604-5.712-4.055-12.059-4.055-18.745
142
+ C 210.745-11.738, 231.007-32.00, 256.00-32.00c 24.994,0.00, 45.255,20.262, 45.255,45.255c0.00,6.688-1.451,13.033-4.054,18.745L 512.00,32.00 L 512.00,64.00 z M 224.00,128.00
143
+ l-96.00,96.00l 32.00,32.00l 64.00-64.00l 128.00,128.00l 32.00-32.00L 224.00,128.00z" />
144
+ <glyph unicode="&#xe026;" d="M 160.00,288.00L 224.00,288.00L 224.00,224.00L 160.00,224.00zM 256.00,288.00L 320.00,288.00L 320.00,224.00L 256.00,224.00zM 352.00,288.00L 416.00,288.00L 416.00,224.00L 352.00,224.00zM 64.00,96.00L 128.00,96.00L 128.00,32.00L 64.00,32.00zM 160.00,96.00L 224.00,96.00L 224.00,32.00L 160.00,32.00zM 256.00,96.00L 320.00,96.00L 320.00,32.00L 256.00,32.00zM 160.00,192.00L 224.00,192.00L 224.00,128.00L 160.00,128.00zM 256.00,192.00L 320.00,192.00L 320.00,128.00L 256.00,128.00zM 352.00,192.00L 416.00,192.00L 416.00,128.00L 352.00,128.00zM 64.00,192.00L 128.00,192.00L 128.00,128.00L 64.00,128.00zM 416.00,480.00l0.00-32.00 l-64.00,0.00 L 352.00,480.00 L 128.00,480.00 l0.00-32.00 L 64.00,448.00 L 64.00,480.00 L0.00,480.00 l0.00-512.00 l 480.00,0.00 L 480.00,480.00 L 416.00,480.00 z M 448.00,0.00L 32.00,0.00 L 32.00,352.00 l 416.00,0.00 L 448.00,0.00 z" />
145
+ <glyph unicode="&#xe027;" d="M 320.00,440.571L 320.00,288.00 L 192.00,288.00 L 192.00,440.571 C 144.201,429.454, 96.00,403.976, 96.00,352.00l0.00-212.00 c0.00-77.318, 71.634-140.00, 160.00-140.00c 88.363,0.00, 160.00,62.682, 160.00,140.00
146
+ L 416.00,352.00 C 416.00,403.976, 367.799,429.454, 320.00,440.571zM 288.00,446.067C 276.277,447.421, 265.321,448.00, 256.00,448.00c-9.32,0.00-20.276-0.579-32.00-1.933L 224.00,320.00 l 64.00,0.00 L 288.00,446.067 z" />
147
+ <glyph unicode="&#xe028;" d="M 512.00,64.00L 512.00,448.00 L0.00,448.00 l0.00-384.00 l 224.00,0.00 l0.00-32.00 l-96.00,0.00 l0.00-32.00 l 256.00,0.00 l0.00,32.00 l-96.00,0.00 l0.00,32.00 L 512.00,64.00 z M 64.00,384.00l 384.00,0.00 l0.00-256.00 L 64.00,128.00 L 64.00,384.00 z" />
148
+ <glyph unicode="&#xe029;" d="M 448.00,128.00L 448.00,384.00 c0.00,17.60-14.40,32.00-32.00,32.00L 96.00,416.00 c-17.60,0.00-32.00-14.40-32.00-32.00l0.00-256.00 L0.00,128.00 l0.00-96.00 l 512.00,0.00 l0.00,96.00 L 448.00,128.00 z M 320.00,64.00L 192.00,64.00 l0.00,32.00 l 128.00,0.00 L 320.00,64.00 z M 416.00,128.00L 96.00,128.00
149
+ L 96.00,383.943 c 0.017,0.02, 0.038,0.041, 0.057,0.057l 319.885,0.00 c 0.02-0.017, 0.041-0.038, 0.058-0.058L 416.00,128.00 z" />
150
+ <glyph unicode="&#xe02a;" d="M 384.00,480.00L 96.00,480.00 C 78.40,480.00, 64.00,465.601, 64.00,448.00l0.00-448.00 c0.00-17.60, 14.399-32.00, 32.00-32.00l 288.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 416.00,448.00 C 416.00,465.601, 401.60,480.00, 384.00,480.00z
151
+ M 240.00-8.891c-13.746,0.00-24.891,11.145-24.891,24.891s 11.145,24.891, 24.891,24.891s 24.891-11.145, 24.891-24.891
152
+ S 253.746-8.891, 240.00-8.891z M 384.00,64.00L 96.00,64.00 L 96.00,416.00 l 288.00,0.00 L 384.00,64.00 z" />
153
+ <glyph unicode="&#xe02b;" d="M 416.00,480.00L 96.00,480.00 C 78.40,480.00, 64.00,465.60, 64.00,448.00l0.00-448.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 320.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 448.00,448.00 C 448.00,465.60, 433.60,480.00, 416.00,480.00z M 256.00-16.00
154
+ c-8.837,0.00-16.00,7.163-16.00,16.00s 7.163,16.00, 16.00,16.00s 16.00-7.163, 16.00-16.00S 264.837-16.00, 256.00-16.00z M 384.00,32.00L 128.00,32.00 L 128.00,416.00 l 256.00,0.00 L 384.00,32.00 z" />
155
+ <glyph unicode="&#xe02c;" d="M 336.00,480.00c-8.837,0.00-16.00-7.163-16.00-16.00l0.00-48.00 L 144.00,416.00 c-8.836,0.00-16.00-7.163-16.00-16.00l0.00-416.00 c0.00-8.836, 7.164-16.00, 16.00-16.00l 192.00,0.00 c 8.837,0.00, 16.00,7.164, 16.00,16.00L 352.00,464.00
156
+ C 352.00,472.837, 344.837,480.00, 336.00,480.00z M 192.00,0.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 192.00,0.00 z M 192.00,64.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 192.00,64.00 z M 192.00,128.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 192.00,128.00 z M 256.00,0.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 256.00,0.00 z
157
+ M 256.00,64.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 256.00,64.00 z M 256.00,128.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 256.00,128.00 z M 320.00,0.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 320.00,0.00 z M 320.00,64.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 320.00,64.00 z M 320.00,128.00l-32.00,0.00 l0.00,32.00 l 32.00,0.00 L 320.00,128.00 z
158
+ M 320.00,208.00c0.00-8.836-7.163-16.00-16.00-16.00L 176.00,192.00 c-8.836,0.00-16.00,7.164-16.00,16.00L 160.00,368.00 c0.00,8.837, 7.164,16.00, 16.00,16.00l 128.00,0.00 c 8.837,0.00, 16.00-7.163, 16.00-16.00L 320.00,208.00 z" />
159
+ <glyph unicode="&#xe02d;" d="M 352.00,384.00L 160.00,384.00 L0.00,192.00l0.00-80.00 l0.00-48.00 c0.00-17.673, 14.327-32.00, 32.00-32.00l 448.00,0.00 c 17.674,0.00, 32.00,14.327, 32.00,32.00l0.00,48.00 l0.00,80.00 L 352.00,384.00z M 384.00,192.00l-64.00-64.00L 192.00,128.00
160
+ l-64.00,64.00L 41.655,192.00 l 133.333,160.00l 162.024,0.00 l 133.333-160.00L 384.00,192.00 z" />
161
+ <glyph unicode="&#xe02e;" d="M 352.00,384.00L 160.00,384.00 L0.00,192.00l0.00-128.00 c0.00-17.673, 14.327-32.00, 32.00-32.00l 448.00,0.00 c 17.674,0.00, 32.00,14.327, 32.00,32.00L 512.00,192.00 L 352.00,384.00z M 320.00,128.00L 192.00,128.00 l-32.00,32.00l 192.00,0.00
162
+ L 320.00,128.00z M 41.655,192.00l 133.333,160.00l 162.024,0.00 l 133.333-160.00L 41.655,192.00 zM 142.482,288.00L 369.518,288.00L 342.851,320.00L 169.148,320.00 zM 89.149,224.00L 422.852,224.00L 396.185,256.00L 115.815,256.00 z" />
163
+ <glyph unicode="&#xe02f;" d="M 416.00,448.00L 96.00,448.00 L0.00,352.00l0.00-336.00 c0.00-8.837, 7.163-16.00, 16.00-16.00l 480.00,0.00 c 8.836,0.00, 16.00,7.163, 16.00,16.00L 512.00,352.00 L 416.00,448.00z M 256.00,64.00L 96.00,192.00l 96.00,0.00 l0.00,96.00 l 128.00,0.00 l0.00-96.00 l 96.00,0.00
164
+ L 256.00,64.00z M 77.255,384.00l 32.00,32.00l 293.489,0.00 l 32.00-32.00L 77.255,384.00 z" />
165
+ <glyph unicode="&#xe030;" d="M 416.00,448.00L 96.00,448.00 L0.00,352.00l0.00-336.00 c0.00-8.837, 7.163-16.00, 16.00-16.00l 480.00,0.00 c 8.836,0.00, 16.00,7.163, 16.00,16.00L 512.00,352.00 L 416.00,448.00z M 320.00,160.00l0.00-96.00 L 192.00,64.00 l0.00,96.00 L 96.00,160.00 l 160.00,128.00
166
+ l 160.00-128.00L 320.00,160.00 z M 77.255,384.00l 32.00,32.00l 293.488,0.00 l 32.00-32.00L 77.255,384.00 z" />
167
+ <glyph unicode="&#xe031;" d="M 256.00,480.00C 114.614,480.00,0.00,444.184,0.00,400.00l0.00-64.00 c0.00-44.183, 114.611-80.00, 256.00-80.00c 141.385,0.00, 256.00,35.817, 256.00,80.00L 512.00,400.00 C 512.00,444.184, 397.385,480.00, 256.00,480.00
168
+ zM 255.193,224.00C 140.566,224.00, 43.94,247.543, 11.32,280.00C 3.705,272.423,0.00,264.361,0.00,256.00l0.00-64.00 c0.00-44.184, 114.611-80.00, 256.00-80.00
169
+ c 141.385,0.00, 256.00,35.816, 256.00,80.00l0.00,64.00 c0.00,8.361-4.516,16.423-12.131,24.00C 467.25,247.543, 369.82,224.00, 255.193,224.00zM 255.193,80.00C 140.566,80.00, 43.94,103.544, 11.32,136.00C 3.705,128.424,0.00,120.361,0.00,112.00l0.00-64.00 c0.00-44.183, 114.611-80.00, 256.00-80.00
170
+ c 141.385,0.00, 256.00,35.817, 256.00,80.00l0.00,64.00 c0.00,8.361-4.516,16.424-12.131,24.00C 467.25,103.544, 369.82,80.00, 255.193,80.00z" />
171
+ <glyph unicode="&#xe032;" d="M 380.931-32.00C 437.794,71.016, 447.375,228.153, 224.00,222.912L 224.00,96.00 L 32.00,288.00L 224.00,480.00l0.00-124.186
172
+ C 491.481,362.785, 521.285,119.707, 380.931-32.00z" />
173
+ <glyph unicode="&#xe033;" d="M 288.00,355.814L 288.00,480.00 l 192.00-192.00L 288.00,96.00L 288.00,222.912 C 64.625,228.153, 74.206,71.016, 131.07-32.00
174
+ C-9.286,119.707, 20.52,362.785, 288.00,355.814z" />
175
+ <glyph unicode="&#xe034;" d="M 131.07,480.00C 74.206,376.984, 64.625,219.848, 288.00,225.088L 288.00,352.00 l 192.00-192.00L 288.00-32.00L 288.00,92.186 C 20.52,85.215-9.286,328.293, 131.07,480.00z" />
176
+ <glyph unicode="&#xe035;" d="M 224.00,92.186L 224.00-32.00 L 32.00,160.00l 192.00,192.00l0.00-126.912 C 447.375,219.848, 437.794,376.984, 380.931,480.00
177
+ C 521.286,328.293, 491.481,85.215, 224.00,92.186z" />
178
+ <glyph unicode="&#xe036;" d="M 429.406,480.00C 486.27,376.984, 511.375,219.848, 288.00,225.088L 288.00,352.00 L 96.00,160.00l 192.00-192.00L 288.00,92.186 C 512.00,92.186, 569.762,328.293, 429.406,480.00
179
+ zM 192.00,306.745L 192.00,352.00L0.00,160.00L 192.00-32.00L 192.00,13.255L 45.255,160.00 z" />
180
+ <glyph unicode="&#xe037;" d="M 255.993,471.963C 114.606,471.963, 0.001,385.424, 0.001,278.684c0.00-83.391, 69.951-154.469, 167.963-181.565
181
+ c 1.438-8.104, 3.25-19.646, 3.25-26.787c0.00-33.625-12.867-65.518-35.788-94.295c 35.444,14.928, 85.475,62.898, 116.473,109.432
182
+ c 1.367-0.016, 2.729-0.084, 4.095-0.084c 141.40,0.00, 256.007,86.539, 256.007,193.299C 512.002,385.424, 397.395,471.963, 255.993,471.963z" />
183
+ <glyph unicode="&#xe038;" d="M 512.00,176.00c0.00,31.984-26.282,59.581-64.259,72.383c-3.818-58.182-51.143-108.229-119.261-133.935
184
+ c 12.653-7.509, 27.651-13.072, 44.103-16.029c 11.884-27.769, 30.681-54.436, 53.733-71.93c-12.468,24.473-13.195,48.944-8.824,70.484
185
+ C 471.038,102.973, 512.00,136.068, 512.00,176.00zM 416.00,256.00c0.00,70.692-85.961,128.00-192.00,128.00C 117.962,384.00, 32.00,326.692, 32.00,256.00c0.00-52.637, 47.664-97.845, 115.781-117.509
186
+ c 10.66-26.364, 16.668-61.164-1.062-95.967c 26.945,20.448, 48.081,53.424, 59.146,86.048C 211.837,128.199, 217.883,128.00, 224.00,128.00
187
+ C 330.039,128.00, 416.00,185.308, 416.00,256.00z" />
188
+ <glyph unicode="&#xe039;" d="M 464.00,480.00L 48.00,480.00 C 21.60,480.00,0.00,458.40,0.00,432.00l0.00-320.00 c0.00-26.40, 21.60-48.00, 48.00-48.00l 112.00,0.00 l 96.00-96.00l 96.00,96.00l 112.00,0.00 c 26.40,0.00, 48.00,21.60, 48.00,48.00L 512.00,432.00
189
+ C 512.00,458.40, 490.401,480.00, 464.00,480.00z" />
190
+ <glyph unicode="&#xe03a;" d="M 464.00,352.00L 176.00,352.00 c-26.40,0.00-48.00-21.60-48.00-48.00l0.00-224.00 c0.00-26.40, 21.60-48.00, 48.00-48.00l 80.00,0.00 l 64.00-64.00l 64.00,64.00l 80.00,0.00 c 26.40,0.00, 48.00,21.60, 48.00,48.00L 512.00,304.00
191
+ C 512.00,330.40, 490.401,352.00, 464.00,352.00zM 384.00,432.00c0.00,26.40-21.60,48.00-48.00,48.00L 48.00,480.00 C 21.60,480.00,0.00,458.40,0.00,432.00l0.00-224.00 c0.00-26.40, 21.60-48.00, 48.00-48.00l 16.00,0.00 L 64.00,368.00 c0.00,26.51, 21.49,48.00, 48.00,48.00l 272.00,0.00 L 384.00,432.00 z" />
192
+ <glyph unicode="&#xe03b;" d="M 480.00,416.00L 32.00,416.00 C 14.40,416.00,0.00,401.60,0.00,384.00l0.00-224.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 64.00,0.00 l0.00-96.00 l 72.00,96.00l 312.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,384.00
193
+ C 512.00,401.60, 497.60,416.00, 480.00,416.00z" />
194
+ <glyph unicode="&#xe03c;" d="M 480.00,416.00L 32.00,416.00 C 14.40,416.00,0.00,401.60,0.00,384.00l0.00-224.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 64.00,0.00 l0.00-96.00 l 72.00,96.00l 312.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,384.00
195
+ C 512.00,401.60, 497.60,416.00, 480.00,416.00z M 160.00,224.00L 96.00,224.00 l0.00,64.00 l 64.00,0.00 L 160.00,224.00 z M 288.00,224.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 288.00,224.00 z M 416.00,224.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 416.00,224.00 z" />
196
+ <glyph unicode="&#xe03d;" d="M 128.00,320.00A128.00,128.00 4860.00 1,0 384.00,320A128.00,128.00 4860.00 1,0 128.00,320zM 384.00,160.00L 128.00,160.00 C 57.308,160.00,0.00,102.691,0.00,32.00l0.00-32.00 l 4.033,0.00 l 503.934,0.00 L 512.00,0.00 l0.00,32.00 C 512.00,102.691, 454.692,160.00, 384.00,160.00z" />
197
+ <glyph unicode="&#xe03e;" d="M 311.413,128.632c-11.055,1.759-11.307,32.157-11.307,32.157s 32.484,32.158, 39.564,75.401
198
+ c 19.045,0.00, 30.809,45.973, 11.761,62.148C 352.226,315.365, 375.911,432.00, 256.00,432.00c-119.911,0.00-96.225-116.635-95.432-133.662
199
+ c-19.047-16.175-7.285-62.148, 11.761-62.148c 7.079-43.243, 39.564-75.401, 39.564-75.401s-0.252-30.398-11.307-32.157
200
+ C 164.976,122.966, 32.00,64.315, 32.00,0.00l 224.00,0.00 l 224.00,0.00 C 480.00,64.315, 347.024,122.966, 311.413,128.632z" />
201
+ <glyph unicode="&#xe03f;" d="M 160.00,384.00A96.00,96.00 3060.00 1,0 352.00,384A96.00,96.00 3060.00 1,0 160.00,384zM 384.039,256.00l-0.078,0.00 l-17.634,0.00 l-99.552-202.122L 304.00,240.00l-48.00,48.00l-48.00-48.00l 37.225-186.122L 145.674,256.00l-17.635,0.00 l-0.077,0.00
202
+ C 64.00,256.00, 64.00,213.007, 64.00,160.00l0.00-160.00 l 384.00,0.00 L 448.00,160.00 C 448.00,213.007, 448.00,256.00, 384.039,256.00z" />
203
+ <glyph unicode="&#xe040;" d="M 364.496,224.00C 433.373,267.667, 480.00,351.604, 480.00,448.00c0.00,10.838-0.596,21.517-1.739,32.00L 33.74,480.00 C 32.595,469.516, 32.00,458.837, 32.00,448.00
204
+ c0.00-96.396, 46.627-180.333, 115.503-224.00C 78.627,180.333, 32.00,96.396, 32.00,0.00c0.00-10.838, 0.595-21.517, 1.739-32.00l 444.521,0.00
205
+ c 1.144,10.483, 1.739,21.162, 1.739,32.00C 480.00,96.396, 433.373,180.333, 364.496,224.00z M 80.00,0.00c0.00,93.456, 40.081,172.707, 112.00,198.854
206
+ l0.00,50.293 l0.00,0.00 C 120.081,275.292, 80.00,354.543, 80.00,448.00l0.00,0.00 l 352.00,0.00 l0.00,0.00 c0.00-93.457-40.081-172.708-112.00-198.853l0.00-50.293
207
+ C 391.919,172.707, 432.00,93.456, 432.00,0.00L 80.00,0.00 zM 309.813,145.203c-35.827,20.322-37.804,46.684-37.813,62.683L 272.00,240.00 c0.00,15.997, 1.902,42.457, 37.872,62.832
208
+ c 19.252,11.182, 35.904,28.174, 48.524,49.168L 153.605,352.00 c 12.633-21.016, 29.306-38.021, 48.583-49.203
209
+ c 35.827-20.322, 37.803-46.683, 37.813-62.683L 240.001,208.00 c0.00-15.996-1.902-42.457-37.872-62.832c-36.311-21.09-63.369-62.842-71.545-113.168
210
+ l 250.835,0.00 C 373.237,82.354, 346.154,124.124, 309.813,145.203z" />
211
+ <glyph unicode="&#xe041;" d="M 192.00,416.00A64.00,64.00 4860.00 1,0 320.00,416A64.00,64.00 4860.00 1,0 192.00,416zM 327.765,359.765A64.00,64.00 4860.00 1,0 455.765,359.765A64.00,64.00 4860.00 1,0 327.765,359.765zM 416.00,224.00A32.00,32.00 4860.00 1,0 480.00,224A32.00,32.00 4860.00 1,0 416.00,224zM 359.765,88.235A32.00,32.00 4860.00 1,0 423.765,88.23500000000001A32.00,32.00 4860.00 1,0 359.765,88.23500000000001zM 224.001,32.00A32.00,32.00 4860.00 1,0 288.001,32A32.00,32.00 4860.00 1,0 224.001,32zM 88.236,88.235A32.00,32.00 4860.00 1,0 152.236,88.23500000000001A32.00,32.00 4860.00 1,0 88.236,88.23500000000001zM 72.236,359.765A48.00,48.00 4860.00 1,0 168.236,359.765A48.00,48.00 4860.00 1,0 72.236,359.765zM 28.00,224.00A36.00,36.00 4860.00 1,0 100.00,224A36.00,36.00 4860.00 1,0 28.00,224z" />
212
+ <glyph unicode="&#xe042;" d="M 512.00,224.00c-0.639,33.431-7.892,66.758-21.288,97.231c-13.352,30.50-32.731,58.129-56.521,80.96
213
+ c-23.776,22.848-51.972,40.91-82.492,52.826C 321.197,466.979, 288.401,472.693, 256.00,472.00c-32.405-0.641-64.666-7.687-94.167-20.678
214
+ c-29.524-12.948-56.271-31.735-78.367-54.788c-22.112-23.041-39.58-50.354-51.093-79.899C 20.816,287.104, 15.309,255.375, 16.00,224.00
215
+ c 0.643-31.38, 7.482-62.574, 20.067-91.103c 12.544-28.55, 30.738-54.414, 53.055-75.774c 22.305-21.377, 48.736-38.252, 77.307-49.36
216
+ C 194.988-3.389, 225.652-8.688, 256.00-8.00c 30.354,0.645, 60.481,7.277, 88.038,19.457c 27.575,12.141, 52.558,29.74, 73.183,51.322
217
+ c 20.641,21.57, 36.922,47.118, 47.627,74.715c 6.517,16.729, 10.94,34.20, 13.271,51.899c 0.623-0.036, 1.249-0.06, 1.881-0.06
218
+ c 17.673,0.00, 32.00,14.326, 32.00,32.00c0.00,0.898-0.047,1.786-0.119,2.666L 512.00,223.999 z M 461.153,139.026c-11.736-26.601-28.742-50.70-49.589-70.59
219
+ c-20.835-19.905-45.50-35.593-72.122-45.895C 312.828,12.202, 284.297,7.315, 256.00,8.00c-28.302,0.649-56.298,6.868-81.91,18.237
220
+ c-25.625,11.333-48.842,27.745-67.997,47.856c-19.169,20.099-34.264,43.882-44.161,69.529C 51.997,169.264, 47.318,196.729, 48.00,224.00
221
+ c 0.651,27.276, 6.664,54.206, 17.627,78.845c 10.929,24.65, 26.749,46.985, 46.123,65.405c 19.365,18.434, 42.265,32.935, 66.937,42.428
222
+ C 203.356,420.208, 229.755,424.681, 256.00,424.00c 26.25-0.653, 52.114-6.459, 75.781-17.017c 23.676-10.525, 45.128-25.751, 62.812-44.391
223
+ c 17.698-18.629, 31.605-40.647, 40.695-64.344C 444.412,274.552, 448.679,249.219, 448.00,224.00l 0.119,0.00 c-0.072-0.88-0.119-1.768-0.119-2.666
224
+ c0.00-16.506, 12.496-30.087, 28.543-31.812C 473.431,172.111, 468.278,155.113, 461.153,139.026z" />
225
+ <glyph unicode="&#xe043;" d="M 440.698,8.064L 313.486,194.95c-3.336,4.914-10.234,6.433-15.325,3.379l-16.069-9.668
226
+ c-5.087-3.05-6.992-9.845-4.229-15.111l 105.281-200.064c 2.763-5.252, 9.177-7.056, 14.271-3.99l 40.101,24.093
227
+ C 442.608-3.356, 444.033,3.149, 440.698,8.064zM 296.322,213.939c 48.104,30.646, 50.188,110.532, 4.747,181.875c-38.64,60.653-97.389,92.75-143.688,82.201
228
+ c-10.647-2.086-24.247-7.761-37.93-16.475c-13.683-8.721-24.604-18.643-30.979-27.432C 59.346,396.604, 63.617,329.806, 102.25,269.17
229
+ c 45.45-71.346, 118.727-103.23, 166.844-72.58l 27.22,17.346L 296.322,213.939z M 278.977,241.169
230
+ c-31.746-20.215-87.728,8.487-122.253,62.704c-34.536,54.196-36.891,117.063-5.14,137.293c 31.722,20.217, 87.719-8.50, 122.243-62.708
231
+ C 308.357,324.269, 310.704,261.392, 278.977,241.169z" />
232
+ <glyph unicode="&#xe044;" d="M 449.077,10.754l-114.54,168.305c 65.459,51.835, 83.963,145.677, 39.835,219.126
233
+ C 326.445,477.959, 222.559,503.857, 142.793,455.94C 63.028,408.007, 37.131,304.124, 85.054,224.357
234
+ c 43.213-71.942, 131.962-100.047, 207.479-69.717l 95.143-180.783c 2.95-5.611, 9.802-7.523, 15.229-4.273l 42.784,25.72
235
+ C 451.126-1.433, 452.653,5.518, 449.077,10.754z M 288.781,212.968c-54.211-32.563-124.808-14.959-157.375,39.253
236
+ c-32.565,54.197-14.952,124.794, 39.253,157.36c 54.189,32.57, 124.787,14.961, 157.351-39.245
237
+ C 360.579,316.138, 342.978,245.525, 288.781,212.968z" />
238
+ <glyph unicode="&#xe045;" d="M 192.00,384.00L 160.00,384.00L 160.00,320.00L 96.00,320.00L 96.00,288.00L 160.00,288.00L 160.00,224.00L 192.00,224.00L 192.00,288.00L 256.00,288.00L 256.00,320.00L 192.00,320.00 zM 318.771,201.076C 339.674,230.021, 352.00,265.568, 352.00,304.00C 352.00,401.202, 273.202,480.00, 176.00,480.00S0.00,401.202,0.00,304.00s 78.798-176.00, 176.00-176.00
239
+ c 38.432,0.00, 73.979,12.326, 102.924,33.229L 448.00-32.00l 64.00,64.00L 318.771,201.076z M 176.00,176.00c-70.692,0.00-128.00,57.308-128.00,128.00S 105.308,432.00, 176.00,432.00
240
+ s 128.00-57.308, 128.00-128.00S 246.693,176.00, 176.00,176.00z" />
241
+ <glyph unicode="&#xe046;" d="M 96.00,320.00L 256.00,320.00L 256.00,288.00L 96.00,288.00zM 318.771,201.076C 339.674,230.021, 352.00,265.568, 352.00,304.00C 352.00,401.202, 273.202,480.00, 176.00,480.00S0.00,401.202,0.00,304.00s 78.798-176.00, 176.00-176.00
242
+ c 38.432,0.00, 73.979,12.326, 102.924,33.229L 448.00-32.00l 64.00,64.00L 318.771,201.076z M 176.00,176.00c-70.692,0.00-128.00,57.308-128.00,128.00S 105.308,432.00, 176.00,432.00
243
+ s 128.00-57.308, 128.00-128.00S 246.693,176.00, 176.00,176.00z" />
244
+ <glyph unicode="&#xe047;" d="M 352.00,480.00c-88.365,0.00-160.00-71.634-160.00-160.00c0.00-10.013, 0.929-19.808, 2.688-29.312L0.00,96.00l0.00-96.00 c0.00-17.673, 14.327-32.00, 32.00-32.00
245
+ l 32.00,0.00 l0.00,32.00 l 64.00,0.00 l0.00,64.00 l 64.00,0.00 l0.00,64.00 l 64.00,0.00 l 41.521,41.521C 314.526,163.363, 332.869,160.00, 352.00,160.00c 88.365,0.00, 160.00,71.634, 160.00,160.00S 440.365,480.00, 352.00,480.00z
246
+ M 399.937,319.937c-26.51,0.00-48.00,21.49-48.00,48.00s 21.49,48.00, 48.00,48.00s 48.00-21.49, 48.00-48.00S 426.447,319.937, 399.937,319.937z" />
247
+ <glyph unicode="&#xe048;" d="M 501.066,322.879l-50.553,50.552c-12.396,12.397-32.685,32.684-45.081,45.082l-50.553,50.552
248
+ c-12.396,12.397-34.477,14.583-49.065,4.858L 167.595,381.777c-14.588-9.726-20.109-30.514-12.268-46.195l 35.243-70.487
249
+ c 1.077-2.153, 2.323-4.448, 3.695-6.83L 16.00,80.00L0.00-32.00l 96.00,0.00 l0.00,32.00 l 64.00,0.00 l0.00,64.00 l 64.00,0.00 l0.00,64.00l 64.00,0.00 l0.00,35.593 c 3.198-1.906, 6.267-3.608, 9.096-5.022
250
+ l 70.485-35.244c 15.683-7.841, 36.47-2.319, 46.195,12.269l 92.147,138.22C 515.65,288.402, 513.462,310.481, 501.066,322.879z
251
+ M 75.314,52.687l-22.627,22.627l 155.786,155.785l 22.627-22.627L 75.314,52.687z M 458.51,268.118l-22.628-22.628
252
+ c-6.223-6.222-16.404-6.222-22.627,0.00L 277.49,381.255c-6.223,6.222-6.223,16.405,0.00,22.627l 22.628,22.628
253
+ c 6.223,6.222, 16.404,6.222, 22.627,0.00L 458.51,290.745C 464.733,284.523, 464.733,274.34, 458.51,268.118z" />
254
+ <glyph unicode="&#xe049;" d="M 304.00,256.00l-16.00,0.00 l0.00,64.00 c0.00,70.692-57.308,128.00-128.00,128.00S 32.00,390.692, 32.00,320.00l0.00-64.00 L 16.00,256.00 c-8.80,0.00-16.00-7.20-16.00-16.00l0.00-224.00 c0.00-8.80, 7.20-16.00, 16.00-16.00l 288.00,0.00
255
+ c 8.80,0.00, 16.00,7.20, 16.00,16.00L 320.00,240.00 C 320.00,248.80, 312.80,256.00, 304.00,256.00z M 186.465,135.959L 192.00,64.00l-64.00,0.00 l 5.535,71.959
256
+ C 120.561,144.551, 112.00,159.272, 112.00,176.00c0.00,26.51, 21.49,48.00, 48.00,48.00s 48.00-21.49, 48.00-48.00C 208.00,159.272, 199.439,144.551, 186.465,135.959z M 64.00,256.00
257
+ l0.00,64.00 c0.00,53.02, 42.98,96.00, 96.00,96.00s 96.00-42.98, 96.00-96.00l0.00-64.00 L 64.00,256.00 z" />
258
+ <glyph unicode="&#xe04a;" d="M 384.00,448.00c-70.692,0.00-128.00-57.308-128.00-128.00l0.00-64.00 L 16.00,256.00 c-8.80,0.00-16.00-7.20-16.00-16.00l0.00-224.00 c0.00-8.80, 7.20-16.00, 16.00-16.00l 288.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00L 320.00,240.00
259
+ c0.00,8.80-7.20,16.00-16.00,16.00l-16.00,0.00 l0.00,64.00 c0.00,53.02, 42.98,96.00, 96.00,96.00s 96.00-42.98, 96.00-96.00l0.00-64.00 l 32.00,0.00 l0.00,64.00 C 512.00,390.692, 454.693,448.00, 384.00,448.00z M 186.465,135.959
260
+ L 192.00,64.00l-64.00,0.00 l 5.535,71.959C 120.561,144.551, 112.00,159.272, 112.00,176.00c0.00,26.51, 21.49,48.00, 48.00,48.00s 48.00-21.49, 48.00-48.00
261
+ C 208.00,159.272, 199.439,144.551, 186.465,135.959z" />
262
+ <glyph unicode="&#xe04b;" d="M 507.882,411.883L 448.00,352.00l-64.00,64.00l 59.882,59.883C 435.057,478.557, 425.698,480.00, 416.00,480.00c-53.021,0.00-96.00-42.98-96.00-96.00
263
+ c0.00-9.697, 1.442-19.057, 4.116-27.882L 123.882,155.883C 115.057,158.557, 105.698,160.00, 96.00,160.00c-53.021,0.00-96.00-42.98-96.00-96.00
264
+ c0.00-9.697, 1.442-19.058, 4.117-27.882L 64.00,96.00l 64.00-64.00l-59.883-59.882C 76.943-30.556, 86.302-32.00, 96.00-32.00c 53.02,0.00, 96.00,42.981, 96.00,96.00
265
+ c0.00,9.698-1.444,19.059-4.118,27.883l 200.234,200.235C 396.943,289.444, 406.302,288.00, 416.00,288.00c 53.02,0.00, 96.00,42.981, 96.00,96.00
266
+ C 512.00,393.698, 510.556,403.058, 507.882,411.883z" />
267
+ <glyph unicode="&#xe04c;" d="M 144.00,320.00L 80.00,320.00 c-8.80,0.00-16.00-7.20-16.00-16.00l0.00-32.00 c0.00-8.80, 7.20-16.00, 16.00-16.00l 64.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00l0.00,32.00 C 160.00,312.80, 152.80,320.00, 144.00,320.00zM 96.00,416.00L 128.00,416.00L 128.00,336.00L 96.00,336.00zM 96.00,240.00L 128.00,240.00L 128.00,32.00L 96.00,32.00zM 272.00,192.00l-64.00,0.00 c-8.80,0.00-16.00-7.20-16.00-16.00l0.00-32.00 c0.00-8.80, 7.20-16.00, 16.00-16.00l 64.00,0.00 c 8.801,0.00, 16.00,7.20, 16.00,16.00l0.00,32.00 C 288.00,184.80, 280.801,192.00, 272.00,192.00zM 224.001,416.00L 256.001,416.00L 256.001,208.00L 224.001,208.00zM 224.001,112.00L 256.001,112.00L 256.001,32.00L 224.001,32.00zM 400.00,288.00l-64.00,0.00 c-8.799,0.00-16.00-7.20-16.00-16.00l0.00-32.00 c0.00-8.80, 7.201-16.00, 16.00-16.00l 64.00,0.00 c 8.801,0.00, 16.00,7.20, 16.00,16.00l0.00,32.00 C 416.00,280.80, 408.801,288.00, 400.00,288.00zM 352.00,416.00L 384.00,416.00L 384.00,304.00L 352.00,304.00zM 352.00,208.00L 384.00,208.00L 384.00,32.00L 352.00,32.00zM 440.00,480.00L 40.00,480.00 C 17.944,480.00,0.00,462.056,0.00,440.00l0.00-432.00 c0.00-22.056, 17.944-40.00, 40.00-40.00l 400.00,0.00 c 22.056,0.00, 40.00,17.944, 40.00,40.00L 480.00,440.00
268
+ C 480.00,462.056, 462.056,480.00, 440.00,480.00z M 448.00,8.00c0.00-4.40-3.60-8.00-8.00-8.00L 40.00,0.00 c-4.40,0.00-8.00,3.60-8.00,8.00L 32.00,440.00 c0.00,4.40, 3.60,8.00, 8.00,8.00l 400.00,0.00 c 4.40,0.00, 8.00-3.60, 8.00-8.00L 448.00,8.00 z" />
269
+ <glyph unicode="&#xe04d;" d="M 466.895,174.875c-26.863,46.527-10.708,106.152, 36.076,133.244l-50.313,87.146c-14.375-8.427-31.088-13.259-48.923-13.259
270
+ c-53.768,0.00-97.354,43.873-97.354,97.995L 205.752,480.001 c 0.133-16.705-4.037-33.641-12.979-49.126
271
+ c-26.862-46.528-86.578-62.351-133.431-35.379L 9.03,308.35c 14.485-8.236, 27.025-20.294, 35.943-35.739
272
+ c 26.819-46.454, 10.756-105.96-35.854-133.112l 50.313-87.146c 14.325,8.348, 30.958,13.127, 48.70,13.127
273
+ c 53.598,0.00, 97.072-43.596, 97.35-97.479l 100.627,0.00 c-0.043,16.537, 4.136,33.285, 12.983,48.609
274
+ c 26.818,46.453, 86.388,62.297, 133.207,35.506l 50.313,87.145C 488.222,147.494, 475.766,159.51, 466.895,174.875z M 256.00,120.334
275
+ c-57.254,0.00-103.668,46.412-103.668,103.667c0.00,57.254, 46.413,103.667, 103.668,103.667c 57.254,0.00, 103.666-46.413, 103.666-103.667
276
+ C 359.665,166.746, 313.254,120.334, 256.00,120.334z" />
277
+ <glyph unicode="&#xe04e;" d="M 224.00,192.00L 224.00,416.00 C 100.288,416.00,0.00,315.712,0.00,192.00s 100.288-224.00, 224.00-224.00s 224.00,100.288, 224.00,224.00c0.00,36.017-8.514,70.042-23.618,100.191
278
+ L 224.00,192.00zM 456.382,356.191C 419.606,429.599, 343.695,480.00, 256.00,480.00l0.00-224.00 L 456.382,356.191z" />
279
+ <glyph unicode="&#xe04f;" d="M0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00zM 64.00,192.00L 128.00,192.00L 128.00,96.00L 64.00,96.00zM 160.00,320.00L 224.00,320.00L 224.00,96.00L 160.00,96.00zM 256.00,224.00L 320.00,224.00L 320.00,96.00L 256.00,96.00zM 352.00,416.00L 416.00,416.00L 416.00,96.00L 352.00,96.00z" />
280
+ <glyph unicode="&#xe050;" d="M 32.00,128.00L 96.00,128.00L 96.00-32.00L 32.00-32.00zM 160.00,192.00L 224.00,192.00L 224.00-32.00L 160.00-32.00zM 288.00,224.00L 352.00,224.00L 352.00-32.00L 288.00-32.00zM 416.00,320.00L 480.00,320.00L 480.00-32.00L 416.00-32.00zM 384.00,480.00L 416.00,448.00L 288.00,320.00L 224.00,384.00L 32.00,192.00L 64.00,160.00L 224.00,320.00L 288.00,256.00L 448.00,416.00L 480.00,384.00L 480.00,480.00 z" />
281
+ <glyph unicode="&#xe051;" d="M 320.00,320.00l 96.00,64.00L 320.00,480.00l-60.00-140.00L 224.00,448.00l-96.00-64.00l 80.00-64.00L 32.00,320.00 l0.00-128.00 l 32.00,0.00 l0.00-224.00 l 384.00,0.00 L 448.00,192.00 l 32.00,0.00 L 480.00,320.00 L 320.00,320.00 z M 328.096,437.963l 50.233-50.233
282
+ l-100.467-66.978L 328.096,437.963z M 211.168,410.601l 28.364-85.092l-70.91,56.728L 211.168,410.601z M 224.00,0.00L 96.00,0.00 L 96.00,208.00 l 128.00,0.00 L 224.00,0.00 z M 224.00,224.00
283
+ L 64.00,224.00 l0.00,64.00 l 160.00,0.00 L 224.00,224.00 z M 416.00,0.00L 288.00,0.00 L 288.00,208.00 l 128.00,0.00 L 416.00,0.00 z M 448.00,224.00L 288.00,224.00 l0.00,64.00 l 160.00,0.00 L 448.00,224.00 z" />
284
+ <glyph unicode="&#xe052;" d="M 512.00,448.00c-32.00,0.00-160.00,0.00-160.00,0.00l0.00-64.00 L 160.00,384.00 L 160.00,448.00 c0.00,0.00-128.00,0.00-160.00,0.00c0.00-160.00, 128.00-347.188, 224.00-376.00l0.00-40.00 c-32.00,0.00-64.00-16.00-64.00-32.00l 192.00,0.00 c0.00,16.00-32.00,32.00-64.00,32.00
285
+ l0.00,40.00 C 384.00,100.812, 512.00,288.00, 512.00,448.00z M 383.85,366.773L 384.00,384.00L 384.00,416.00 l 94.227,0.00 c-2.787-25.839-8.855-53.128-18.14-81.495
286
+ c-12.272-37.499-30.058-75.91-51.433-111.082c-20.559-33.826-43.896-63.859-67.488-86.852c-2.266-2.208-4.521-4.336-6.765-6.391
287
+ C 376.819,215.238, 382.961,321.678, 383.85,366.773z M 170.834,136.572c-23.593,22.992-46.93,53.025-67.488,86.852
288
+ c-21.375,35.172-39.161,73.583-51.433,111.082C 42.629,362.872, 36.56,390.161, 33.773,416.00L 128.00,416.00 l0.00-32.00 l 0.15-17.227
289
+ c 0.889-45.096, 7.031-151.535, 49.448-236.592C 175.355,132.236, 173.099,134.364, 170.834,136.572z" />
290
+ <glyph unicode="&#xe053;" d="M 64.00,416.00L0.00,352.00L 128.00,352.00 zM 256.00,352.00L 192.00,416.00L 128.00,352.00 zM 256.001,352.00L 384.00,352.00L 320.00,416.00 zM 512.00,352.00L 448.00,416.00L 384.00,352.00 zM 320.00,416.00L 448.00,416.00L 416.00,448.00L 96.00,448.00L 64.00,416.00L 192.00,416.00 zM 256.00,0.00L 112.00,288.00L 198.40,288.00L 256.00,0.00L 313.60,288.00L 400.00,288.00L 256.00,0.00L 512.00,320.00L0.00,320.00 z" />
291
+ <glyph unicode="&#xe054;" d="M 423.555,258.812c 0.033,2.533, 0.049,5.076, 0.049,7.626c0.00,30.532-93.227,55.284-208.225,55.284
292
+ c-114.997,0.00-208.223-24.752-208.223-55.284C 7.156,101.615, 73.546-32.00, 215.379-32.00c 83.413,0.00, 140.723,46.225, 173.788,117.818
293
+ c 3.338-0.27, 6.699-0.457, 10.119-0.457c 58.297,0.00, 105.559,39.356, 105.559,87.904C 504.844,214.857, 470.153,249.679, 423.555,258.812z
294
+ M 349.141,244.028c-36.689-8.652-84.195-13.417-133.762-13.417c-49.565,0.00-97.07,4.765-133.76,13.417
295
+ c-35.822,8.448-50.376,18.136-54.252,22.411c 3.876,4.275, 18.431,13.961, 54.252,22.409c 36.688,8.653, 84.193,13.419, 133.76,13.419
296
+ c 49.565,0.00, 97.071-4.767, 133.762-13.419c 35.822-8.448, 50.377-18.134, 54.254-22.409C 399.518,262.164, 384.963,252.477, 349.141,244.028
297
+ z M 398.268,107.787c 12.537,33.865, 20.355,72.30, 23.60,113.514c 30.50-6.246, 48.42-28.615, 48.42-51.395
298
+ C 470.285,140.523, 448.723,111.186, 398.268,107.787zM 255.689,353.922C 283.881,396.539, 206.377,442.352, 259.908,480.00c-44.528-2.943-52.161-30.188-40.935-51.461
299
+ C 229.63,408.348, 255.649,394.268, 255.689,353.922zM 233.163,325.499c 12.646,35.708-59.269,64.515-19.554,105.806c-37.209-10.992-36.253-41.592-20.227-58.701
300
+ C 204.951,360.25, 225.905,354.518, 233.163,325.499z" />
301
+ <glyph unicode="&#xe055;" d="M 352.00,448.00L 192.00,288.00L 96.00,288.00 L0.00,160.00c0.00,0.00, 101.708,28.326, 161.033,15.042L0.00-32.00l 210.951,164.072C 240.37,64.745, 192.00-32.00, 192.00-32.00l 128.00,96.00
302
+ l0.00,96.00 l 160.00,160.00L 512.00,480.00L 352.00,448.00z" />
303
+ <glyph unicode="&#xe056;" d="M 256.00,352.00C 114.615,352.00,0.00,237.386,0.00,96.00l 32.00,0.00 c0.00,58.209, 25.903,110.363, 66.811,145.574l 108.423-135.527
304
+ c-0.665-3.245-1.014-6.604-1.014-10.047c0.00-27.492, 22.287-49.779, 49.779-49.779c 27.493,0.00, 49.779,22.287, 49.779,49.779
305
+ s-22.286,49.781-49.779,49.781c-3.441,0.00-6.802-0.351-10.046-1.016L 111.979,251.947c 31.528,22.688, 70.213,36.054, 112.021,36.054
306
+ c 106.038,0.00, 192.00-85.96, 192.00-191.999l 96.00,0.00 C 512.00,237.386, 397.385,352.00, 256.00,352.00z" />
307
+ <glyph unicode="&#xe057;" d="M 256.00,352.00C 114.615,352.00,0.00,237.386,0.00,96.00l 32.00,0.00 c0.00,106.039, 85.961,192.00, 192.00,192.00c 7.167,0.00, 14.241-0.396, 21.205-1.16l-16.586-149.264
308
+ c-13.494-8.904-22.399-24.199-22.399-41.576c0.00-27.492, 22.288-49.779, 49.78-49.779S 305.78,68.508, 305.78,96.00
309
+ c0.00,17.377-8.904,32.672-22.398,41.576l-16.172,145.542C 352.44,263.517, 416.00,187.182, 416.00,96.00l 96.00,0.00 C 512.00,237.386, 397.385,352.00, 256.00,352.00z" />
310
+ <glyph unicode="&#xe058;" d="M 416.00,96.00l 96.00,0.00 c0.00,141.386-114.615,256.00-256.00,256.00S0.00,237.386,0.00,96.00l 32.00,0.00 c0.00,106.039, 85.961,192.00, 192.00,192.00
311
+ c 56.409,0.00, 107.136-24.326, 142.263-63.061l-100.217-80.174c-3.245,0.665-6.604,1.016-10.046,1.016
312
+ c-27.493,0.00-49.78-22.289-49.78-49.781s 22.287-49.779, 49.78-49.779c 27.492,0.00, 49.778,22.287, 49.778,49.779
313
+ c0.00,3.44-0.349,6.802-1.014,10.047l 78.166,97.707C 403.803,173.031, 416.00,135.941, 416.00,96.00z" />
314
+ <glyph unicode="&#xe059;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,32.00
315
+ c-106.039,0.00-192.00,85.961-192.00,192.00c0.00,106.039, 85.961,192.00, 192.00,192.00c 106.039,0.00, 192.00-85.961, 192.00-192.00C 448.00,117.961, 362.039,32.00, 256.00,32.00zM 224.00,352.00A32.00,32.00 3060.00 1,0 288.00,352A32.00,32.00 3060.00 1,0 224.00,352zM 320.00,320.00A32.00,32.00 3060.00 1,0 384.00,320A32.00,32.00 3060.00 1,0 320.00,320zM 128.00,320.00A32.00,32.00 3060.00 1,0 192.00,320A32.00,32.00 3060.00 1,0 128.00,320zM 224.00,128.00L 224.00,96.00L 288.00,96.00L 288.00,128.00L 256.00,288.00 z" />
316
+ <glyph unicode="&#xe05a;" d="M 160.504-32.00C 51.878,29.221, 23.279,87.168, 39.63,166.311c 12.071,58.44, 56.647,105.986, 60.437,164.314
317
+ c 16.884-30.726, 18.888-52.882, 20.775-84.99C 174.542,311.428, 230.231,399.478, 218.19,480.00c0.00,0.00, 133.808-64.00, 142.986-188.138
318
+ c 12.041,25.587, 12.041,66.225,0.00,92.563c 36.122-26.339, 253.609-260.16-22.577-416.425c 51.926,101.105, 13.396,237.527-76.761,300.533
319
+ c 6.021-27.092-1.505-97.832-41.391-142.232c 9.031,45.904-13.546,75.254-13.546,75.254s-7.402-41.555-36.122-83.533
320
+ C 144.553,79.689, 126.381,39.004, 160.504-32.00z" />
321
+ <glyph unicode="&#xe05b;" d="M 478.145,77.759L 320.00,341.271L 320.00,448.00 l 16.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00s-7.20,16.00-16.00,16.00L 176.00,480.00 c-8.80,0.00-16.00-7.20-16.00-16.00s 7.20-16.00, 16.00-16.00l 16.00,0.00 l0.00-106.729
322
+ L 33.856,77.759C-2.365,17.392, 25.60-32.00, 96.00-32.00l 320.00,0.00 C 486.40-32.00, 514.365,17.392, 478.145,77.759z M 120.519,160.00L 224.00,332.469L 224.00,448.00 l 64.00,0.00
323
+ l0.00-115.531 L 391.482,160.00L 120.519,160.00 z" />
324
+ <glyph unicode="&#xe05c;" d="M 480.00,416.00L 320.00,416.00 L 320.00,464.00 c0.00,8.836-7.163,16.00-16.00,16.00l-96.00,0.00 c-8.836,0.00-16.00-7.164-16.00-16.00l0.00-48.00 L 32.00,416.00 L0.00,352.00l 64.00,0.00 l 32.00-384.00l 320.00,0.00 l 32.00,384.00l 64.00,0.00 L 480.00,416.00z M 224.00,32.00
325
+ l-64.00,0.00 L 160.00,320.00 l 64.00,0.00 L 224.00,32.00 z M 224.00,448.00l 64.00,0.00 l0.00-32.00 l-64.00,0.00 L 224.00,448.00 z M 352.00,32.00l-64.00,0.00 L 288.00,320.00 l 64.00,0.00 L 352.00,32.00 z" />
326
+ <glyph unicode="&#xe05d;" d="M 96.00-32.00L 416.00-32.00L 448.00,320.00L 64.00,320.00 zM 320.00,416.00L 320.00,480.00 L 192.00,480.00 l0.00-64.00 L 32.00,416.00 l0.00-96.00 l 32.00,32.00l 384.00,0.00 l 32.00-32.00L 480.00,416.00 L 320.00,416.00 z M 288.00,416.00l-64.00,0.00 L 224.00,448.00 l 64.00,0.00 L 288.00,416.00 z" />
327
+ <glyph unicode="&#xe05e;" d="M 144.00,48.00c 8.837,0.00, 16.00,7.163, 16.00,16.00c0.00,0.003,0.00,0.007,0.00,0.01L 160.00,287.991 c0.00,0.003,0.00,0.006,0.00,0.01c0.00,8.836-7.164,16.00-16.00,16.00
328
+ c-8.836,0.00-16.00-7.164-16.00-16.00l0.00,0.00 l0.00-224.00 C 128.00,55.163, 135.164,48.00, 144.00,48.00zM 240.00,48.00c 8.837,0.00, 16.00,7.163, 16.00,16.00c0.00,0.003,0.00,0.007,0.00,0.01L 256.00,287.991 c0.00,0.003,0.00,0.006,0.00,0.01c0.00,8.836-7.164,16.00-16.00,16.00
329
+ c-8.836,0.00-16.00-7.164-16.00-16.00l0.00,0.00 l0.00-224.00 C 224.00,55.163, 231.164,48.00, 240.00,48.00zM 336.00,48.00c 8.837,0.00, 16.00,7.163, 16.00,16.00c0.00,0.003,0.00,0.007,0.00,0.01L 352.00,287.991 c0.00,0.003,0.00,0.006,0.00,0.01c0.00,8.836-7.163,16.00-16.00,16.00
330
+ c-8.836,0.00-16.00-7.164-16.00-16.00l0.00,0.00 l0.00-224.00 C 320.00,55.163, 327.164,48.00, 336.00,48.00zM 351.987,415.46C 351.99,415.64, 352.00,415.819, 352.00,416.00L 352.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00L 160.00,480.00 c-17.60,0.00-32.00-14.40-32.00-32.00l0.00-32.00
331
+ c0.00-0.181, 0.011-0.36, 0.014-0.54L0.00,415.46 L0.00,384.00 l 32.00,0.00 l0.00-352.00 c0.00-35.20, 28.80-64.00, 64.00-64.00l 288.00,0.00 c 35.20,0.00, 64.00,28.80, 64.00,64.00L 448.00,384.00 l 32.00,0.00 L 480.00,415.46 L 351.987,415.46 z M 160.00,447.943
332
+ c 0.017,0.02, 0.038,0.041, 0.057,0.057l 159.885,0.00 c 0.02-0.017, 0.041-0.038, 0.058-0.058l0.00-31.885 c-0.017-0.02-0.038-0.041-0.058-0.057
333
+ L 160.057,416.00 c-0.02,0.017-0.041,0.038-0.057,0.057L 160.00,447.943 z M 416.00,32.00c0.00-8.477-3.348-16.493-9.428-22.572
334
+ C 400.493,3.348, 392.477,0.00, 384.00,0.00L 96.00,0.00 c-8.477,0.00-16.493,3.348-22.573,9.428C 67.348,15.507, 64.00,23.523, 64.00,32.00L 64.00,384.00 l 352.00,0.00 L 416.00,32.00 z" />
335
+ <glyph unicode="&#xe05f;" d="M 464.00,320.00L 352.00,320.00 L 352.00,384.00 c0.00,17.60-14.40,32.00-32.00,32.00L 192.00,416.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-64.00 L 48.00,320.00 c-26.40,0.00-48.00-21.60-48.00-48.00l0.00-224.00 c0.00-26.40, 21.60-48.00, 48.00-48.00
336
+ l 416.00,0.00 c 26.398,0.00, 48.00,21.60, 48.00,48.00L 512.00,272.00 C 512.00,298.40, 490.401,320.00, 464.00,320.00z M 192.00,383.943c 0.016,0.02, 0.037,0.041, 0.058,0.057l 127.887,0.00
337
+ c 0.021-0.018, 0.04-0.038, 0.058-0.057L 320.003,320.00 L 192.00,320.00 L 192.00,383.943 z" />
338
+ <glyph unicode="&#xe060;" d="M 480.00,352.00L 352.00,352.00 L 352.00,384.00 c0.00,17.60-14.40,32.00-32.00,32.00L 192.00,416.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-32.00 L 32.00,352.00 C 14.40,352.00,0.00,337.60,0.00,320.00l0.00-256.00
339
+ c0.00-17.601, 14.398-32.00, 32.00-32.00l 448.00,0.00 c 17.60,0.00, 32.00,14.399, 32.00,32.00L 512.00,320.00 C 512.00,337.60, 497.60,352.00, 480.00,352.00z M 192.00,383.942
340
+ c 0.017,0.02, 0.037,0.041, 0.057,0.058l 127.886,0.00 c 0.021-0.017, 0.041-0.038, 0.059-0.058L 320.002,352.00 L 192.00,352.00 L 192.00,383.942 z M 480.00,224.00l-64.00,0.00 l0.00-48.00
341
+ c0.00-8.801-7.20-16.00-16.00-16.00l-32.00,0.00 c-8.802,0.00-16.00,7.199-16.00,16.00l0.00,48.00 L 160.00,224.00 l0.00-48.00 c0.00-8.801-7.20-16.00-16.00-16.00l-32.00,0.00 c-8.801,0.00-16.00,7.199-16.00,16.00l0.00,48.00 L 32.00,224.00 l0.00,32.00 l 448.00,0.00
342
+ L 480.00,224.00 z" />
343
+ <glyph unicode="&#xe061;" d="M 436.304,320.00L 352.00,448.00L 160.00,448.00 L 75.695,320.00L0.00,320.00 l0.00-224.00 l 64.00,0.00 l0.00-80.00 c0.00-8.80, 7.199-16.00, 16.00-16.00l 64.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00l0.00,80.00 l 192.00,0.00 l0.00-80.00
344
+ c0.00-8.80, 7.198-16.00, 16.00-16.00l 64.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00l0.00,80.00 l 64.00,0.00 L 512.00,320.00 L 436.304,320.00 z M 177.24,416.00l 157.519,0.00 l 63.228-96.00L 114.012,320.00 L 177.24,416.00z M 128.00,146.745
345
+ c-24.994,0.00-45.256,20.261-45.256,45.255s 20.263,45.254, 45.256,45.254c 24.992,0.00, 45.254-20.261, 45.254-45.254
346
+ C 173.255,167.006, 152.993,146.745, 128.00,146.745z M 384.00,146.745c-24.993,0.00-45.257,20.261-45.257,45.255s 20.263,45.254, 45.257,45.254
347
+ c 24.991,0.00, 45.255-20.261, 45.255-45.254C 429.255,167.006, 408.991,146.745, 384.00,146.745z" />
348
+ <glyph unicode="&#xe062;" d="M 480.00,224.00c0.00,0.00-16.279,192.00-32.00,224.00S 320.00,480.00, 256.00,480.00S 79.72,480.00, 64.00,448.00S 32.00,224.00, 32.00,224.00l0.00-192.00 l 64.00,0.00 l0.00-32.00 c0.00-17.673, 14.327-32.00, 32.00-32.00
349
+ s 32.00,14.327, 32.00,32.00l0.00,32.00 l 192.00,0.00 l0.00-32.00 c0.00-17.673, 14.327-32.00, 32.00-32.00c 17.674,0.00, 32.00,14.327, 32.00,32.00l0.00,32.00 l 64.00,0.00 L 480.00,224.00 z M 160.00,448.00l 192.00,0.00 l0.00-32.00 L 160.00,416.00 L 160.00,448.00 z
350
+ M 105.058,279.23c 6.083,53.329, 10.847,81.788, 13.844,96.464c 8.586,2.002, 23.196,4.479, 46.867,6.145C 196.495,384.00, 229.49,384.00, 256.00,384.00
351
+ s 59.505,0.00, 90.231-2.161c 23.671-1.665, 38.281-4.142, 46.867-6.145c 2.996-14.676, 7.761-43.136, 13.844-96.465
352
+ c 0.903-7.917, 1.759-15.718, 2.559-23.23L 102.499,255.999 C 103.299,263.512, 104.155,271.313, 105.058,279.23z M 128.00,113.60
353
+ c-25.626,0.00-46.40,20.773-46.40,46.40c0.00,25.626, 20.773,46.40, 46.40,46.40s 46.40-20.774, 46.40-46.40C 174.40,134.373, 153.627,113.60, 128.00,113.60z
354
+ M 384.00,113.60c-25.627,0.00-46.399,20.773-46.399,46.40c0.00,25.626, 20.772,46.40, 46.399,46.40s 46.40-20.774, 46.40-46.40
355
+ C 430.401,134.373, 409.627,113.60, 384.00,113.60z" />
356
+ <glyph unicode="&#xe063;" d="M 256.00,448.00L 32.00,352.00L 256.00,256.00L 480.00,352.00 zM 32.00,64.00L 224.00-16.00L 224.00,208.00L 32.00,288.00 zM 288.00-16.00L 480.00,64.00L 480.00,288.00L 288.00,208.00 z" />
357
+ <glyph unicode="&#xe064;" d="M 240.00,448.00L0.00,352.00l0.00-224.00 l 240.00-128.00l 240.00,128.00L 480.00,352.00 L 240.00,448.00z M 224.00,44.80L 32.00,147.20L 32.00,302.933 l 192.00-102.40L 224.00,44.80 z M 41.498,334.134L 240.00,413.535
358
+ l 198.502-79.401L 240.00,228.267L 41.498,334.134z M 448.00,147.20L 256.00,44.80L 256.00,200.533 l 192.00,102.40L 448.00,147.20 z" />
359
+ <glyph unicode="&#xe065;" d="M 472.037,344.543l-77.289,0.00 c-21.704,0.033-43.327,8.772-22.241,45.979C 393.634,427.804, 408.548,480.00, 323.729,480.00
360
+ c-84.816,0.00-69.901-52.195-48.774-89.478c 21.086-37.207-0.537-45.945-22.243-45.979l-77.29,0.00 c-18.051,0.00-32.819-14.771-32.819-32.818
361
+ l0.00-94.87 c0.00-21.746-8.701-43.492-45.98-22.367c-37.28,21.127-89.478,36.04-89.478-48.778c0.00-84.814, 52.196-69.90, 89.478-48.775
362
+ c 37.279,21.127, 45.98-0.619, 45.98-22.369l0.00-73.747 c0.00-18.053, 14.77-32.818, 32.819-32.818l 77.163,0.00 c 21.749,0.00, 43.495,8.701, 22.37,45.981
363
+ c-21.126,37.277-36.042,89.475, 48.774,89.475c 84.817,0.00, 69.903-52.195, 48.776-89.475C 351.38-23.299, 373.128-32.00, 394.875-32.00l 77.16,0.00
364
+ c 18.053,0.00, 32.821,14.77, 32.821,32.818L 504.856,311.726 C 504.858,329.774, 490.09,344.543, 472.037,344.543z" />
365
+ <glyph unicode="&#xe066;" d="M0.00,352.00l0.00-256.00 l 160.00,0.00 l 96.00,96.00l 96.00-96.00l 160.00,0.00 L 512.00,352.00 L0.00,352.00 z M 224.00,224.00l-64.00-64.00L 32.00,160.00 L 32.00,288.00 l 192.00,0.00 L 224.00,224.00 z M 480.00,160.00L 352.00,160.00 l-64.00,64.00l0.00,64.00 l 192.00,0.00 L 480.00,160.00 z" />
366
+ <glyph unicode="&#xe067;" d="M 352.00,448.00l0.00-48.00 l 80.00-144.00L 80.00,256.00 l 80.00,144.00L 160.00,448.00 L0.00,256.00l0.00-256.00 l 160.00,0.00 l 96.00,96.00l 96.00-96.00l 160.00,0.00 L 512.00,256.00 L 352.00,448.00z M 224.00,128.00l-64.00-64.00L 32.00,64.00 L 32.00,192.00 l 192.00,0.00 L 224.00,128.00 z M 480.00,64.00L 352.00,64.00
367
+ l-64.00,64.00l0.00,64.00 l 192.00,0.00 L 480.00,64.00 z" />
368
+ <glyph unicode="&#xe068;" d="M 480.00,384.00L 480.00,416.00L 256.00,352.00L 32.00,416.00L 32.00,384.00L 192.00,320.00L 192.00,192.00L 128.00-32.00L 160.00-32.00L 256.00,192.00L 352.00-32.00L 384.00-32.00L 320.00,192.00L 320.00,320.00 zM 208.00,432.00A48.00,48.00 4860.00 1,0 304.00,432A48.00,48.00 4860.00 1,0 208.00,432z" />
369
+ <glyph unicode="&#xe069;" d="M 160.00,16.00c-61.856,0.00-112.00,50.145-112.00,112.00c0.00,43.848, 25.20,81.803, 61.903,100.19l-21.47,42.938C 36.001,244.86,0.00,190.639,0.00,128.00
370
+ c0.00-88.366, 71.634-160.00, 160.00-160.00s 160.00,71.634, 160.00,160.00l-48.00,0.00 C 272.00,66.145, 221.856,16.00, 160.00,16.00zM 480.00,128.00L 448.00,96.00L 338.743,205.255L 224.00,205.255L 224.00,256.00L 352.00,256.00L 352.00,288.00L 224.00,288.00L 224.00,352.00L 160.00,352.00L 160.00,160.00L 320.00,160.00L 448.00,32.00L 512.00,96.00 zM 144.00,432.00A48.00,48.00 4860.00 1,0 240.00,432A48.00,48.00 4860.00 1,0 144.00,432z" />
371
+ <glyph unicode="&#xe06a;" d="M 256.00,480.00C 114.844,480.00,0.00,365.162,0.00,223.999C0.00,82.838, 114.844-32.00, 256.00-32.00c 141.155,0.00, 256.00,114.838, 256.00,255.999
372
+ C 512.00,365.162, 397.156,480.00, 256.00,480.00z M 256.00,24.889c-109.789,0.00-199.11,89.323-199.11,199.11c0.00,109.79, 89.322,199.112, 199.11,199.112
373
+ s 199.11-89.322, 199.11-199.112C 455.113,114.212, 365.788,24.889, 256.00,24.889zM 256.00,366.223c-78.422,0.00-142.224-63.801-142.224-142.224c0.00-78.421, 63.801-142.224, 142.224-142.224
374
+ s 142.223,63.803, 142.223,142.224C 398.223,302.422, 334.423,366.223, 256.00,366.223z M 256.00,138.666
375
+ c-47.058,0.00-85.334,38.277-85.334,85.333c0.00,47.058, 38.276,85.335, 85.334,85.335c 47.056,0.00, 85.335-38.277, 85.335-85.335
376
+ C 341.335,176.943, 303.056,138.666, 256.00,138.666zM 224.00,224.00A32.00,32.00 4860.00 1,0 288.00,224A32.00,32.00 4860.00 1,0 224.00,224z" />
377
+ <glyph unicode="&#xe06b;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 391.765,88.235
378
+ C 363.16,59.631, 327.117,41.174, 288.00,34.648L 288.00,128.00 l-64.00,0.00 l0.00-93.352 c-39.117,6.525-75.16,24.982-103.765,53.587
379
+ C 91.632,116.84, 73.174,152.883, 66.649,192.00L 160.00,192.00 l0.00,64.00 L 66.649,256.00 c 6.525,39.117, 24.983,75.16, 53.587,103.765
380
+ C 148.84,388.369, 184.883,406.826, 224.00,413.352L 224.00,320.00 l 64.00,0.00 L 288.00,413.352 c 39.117-6.525, 75.16-24.983, 103.765-53.587
381
+ c 28.604-28.604, 47.062-64.647, 53.587-103.765L 352.00,256.00 l0.00-64.00 l 93.352,0.00 C 438.826,152.883, 420.369,116.84, 391.765,88.235z" />
382
+ <glyph unicode="&#xe06c;" d="M 192.00,480.00L0.00,224.00L 192.00,224.00L 64.00-32.00L 512.00,288.00L 256.00,288.00L 448.00,480.00 z" />
383
+ <glyph unicode="&#xe06d;" d="M 352.00,480.00L 64.00,192.00L 240.00,192.00L 160.00-32.00L 448.00,256.00L 272.00,256.00 z" />
384
+ <glyph unicode="&#xe06e;" d="M0.00,128.00L 160.00,384.00L 320.00,224.00L 512.00,352.00L 352.00,64.00L 192.00,224.00 z" />
385
+ <glyph unicode="&#xe06f;" d="M 384.00,416.00l-64.00,0.00 L 320.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00l-64.00,0.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-32.00 l-64.00,0.00 l0.00-64.00 l 256.00,0.00 L 384.00,416.00 z M 288.00,416.00l-64.00,0.00 L 224.00,447.943
386
+ c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0.00 c 0.021-0.018, 0.041-0.038, 0.059-0.057L 288.00,416.00 L 288.00,416.00zM 432.00,416.00l-32.00,0.00 l0.00-32.00 l 16.00,0.00 l0.00-384.00 L 96.00,0.00 L 96.00,384.00 l 16.00,0.00 L 112.00,416.00 L 80.00,416.00 c-8.801,0.00-16.00-7.20-16.00-16.00l0.00-416.00 c0.00-8.80, 7.199-16.00, 16.00-16.00l 352.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00L 448.00,400.00
387
+ C 448.00,408.80, 440.80,416.00, 432.00,416.00z" />
388
+ <glyph unicode="&#xe070;" d="M 384.00,416.00l-64.00,0.00 L 320.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00l-64.00,0.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-32.00 l-64.00,0.00 l0.00-64.00 l 256.00,0.00 L 384.00,416.00 z M 288.00,416.00l-64.00,0.00 L 224.00,447.943
389
+ c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0.00 c 0.021-0.018, 0.041-0.038, 0.059-0.057L 288.00,416.00 L 288.00,416.00zM 432.00,416.00l-32.00,0.00 l0.00-32.00 l 16.00,0.00 l0.00-384.00 L 96.00,0.00 L 96.00,384.00 l 16.00,0.00 L 112.00,416.00 L 80.00,416.00 c-8.801,0.00-16.00-7.20-16.00-16.00l0.00-416.00 c0.00-8.80, 7.199-16.00, 16.00-16.00l 352.00,0.00 c 8.80,0.00, 16.00,7.20, 16.00,16.00L 448.00,400.00
390
+ C 448.00,408.80, 440.80,416.00, 432.00,416.00zM 128.00,288.00L 384.00,288.00L 384.00,256.00L 128.00,256.00zM 128.00,192.00L 384.00,192.00L 384.00,160.00L 128.00,160.00zM 128.00,96.00L 384.00,96.00L 384.00,64.00L 128.00,64.00z" />
391
+ <glyph unicode="&#xe071;" d="M0.00,448.00L 320.00,448.00L 320.00,384.00L0.00,384.00zM0.00,320.00L 288.00,320.00L 288.00,256.00L0.00,256.00zM0.00,192.00L 224.00,192.00L 224.00,128.00L0.00,128.00zM0.00,64.00L 160.00,64.00L 160.00,0.00L0.00,0.00zM 416.00,480.00l-64.00,0.00 l0.00-356.559 c-10.01,2.949-20.778,4.559-32.00,4.559c-53.02,0.00-96.00-35.817-96.00-80.00s 42.98-80.00, 96.00-80.00s 96.00,35.817, 96.00,80.00L 416.00,384.00 l 96.00-32.00
392
+ L 512.00,416.00 L 416.00,480.00z" />
393
+ <glyph unicode="&#xe072;" d="M0.00,480.00L 224.00,480.00L 224.00,256.00L0.00,256.00zM 288.00,480.00L 512.00,480.00L 512.00,256.00L 288.00,256.00zM0.00,192.00L 224.00,192.00L 224.00-32.00L0.00-32.00zM 288.00,192.00L 512.00,192.00L 512.00-32.00L 288.00-32.00z" />
394
+ <glyph unicode="&#xe073;" d="M 480.00,128.00l-51.741,0.00 L 308.546,327.522C 315.536,333.404, 320.00,342.205, 320.00,352.00L 320.00,416.00 c0.00,17.60-14.40,32.00-32.00,32.00l-64.00,0.00 c-17.60,0.00-32.00-14.40-32.00-32.00
395
+ l0.00-64.00 c0.00-9.795, 4.464-18.596, 11.455-24.478L 83.741,128.00L 32.00,128.00 c-17.60,0.00-32.00-14.40-32.00-32.00l0.00-64.00 c0.00-17.60, 14.40-32.00, 32.00-32.00l 64.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00l0.00,64.00
396
+ c0.00,9.795-4.464,18.596-11.455,24.478L 236.26,320.00l 39.482,0.00 l 119.714-199.522C 388.465,114.596, 384.00,105.795, 384.00,96.00l0.00-64.00
397
+ c0.00-17.60, 14.40-32.00, 32.00-32.00l 64.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00l0.00,64.00 C 512.00,113.60, 497.60,128.00, 480.00,128.00z" />
398
+ <glyph unicode="&#xe074;" d="M 192.00,448.00L 320.00,448.00L 320.00,320.00L 192.00,320.00zM 192.00,288.00L 320.00,288.00L 320.00,160.00L 192.00,160.00zM 192.00,128.00L 320.00,128.00L 320.00,0.00L 192.00,0.00z" />
399
+ <glyph unicode="&#xe075;" d="M 192.00,384.00A64.00,64.00 1260.00 1,0 320.00,384A64.00,64.00 1260.00 1,0 192.00,384zM 192.00,224.00A64.00,64.00 1260.00 1,0 320.00,224A64.00,64.00 1260.00 1,0 192.00,224zM 192.00,64.00A64.00,64.00 1260.00 1,0 320.00,64A64.00,64.00 1260.00 1,0 192.00,64z" />
400
+ <glyph unicode="&#xe076;" d="M 512.00,151.229c0.00,41.045-28.339,75.45-66.498,84.74C 443.881,300.319, 391.273,352.00, 326.571,352.00
401
+ c-37.896,0.00-71.633-17.747-93.427-45.366c-12.221,15.799-31.345,25.98-52.854,25.98c-36.905,0.00-66.821-29.937-66.821-66.861
402
+ c0.00-3.218, 0.24-6.38, 0.682-9.477c-5.611,1.012-11.383,1.569-17.285,1.569C 43.367,257.846,0.00,214.452,0.00,160.924
403
+ C0.00,107.393, 43.367,64.00, 96.865,64.00l 328.131,0.00 l0.00,0.006 C 473.065,64.098, 512.00,103.112, 512.00,151.229z" />
404
+ <glyph unicode="&#xe077;" d="M 445.502,299.97C 443.881,364.319, 391.273,416.00, 326.571,416.00c-37.896,0.00-71.633-17.747-93.427-45.366
405
+ c-12.221,15.799-31.345,25.98-52.854,25.98c-36.905,0.00-66.821-29.937-66.821-66.861c0.00-3.218, 0.24-6.38, 0.682-9.477
406
+ c-5.611,1.012-11.383,1.569-17.285,1.569C 43.367,321.846,0.00,278.452,0.00,224.924C0.00,171.393, 43.367,128.00, 96.865,128.00l 49.88,0.00 L 256.00,18.745
407
+ L 365.255,128.00l 59.741,0.00 l0.00,0.006 C 473.065,128.098, 512.00,167.112, 512.00,215.229C 512.00,256.274, 483.661,290.679, 445.502,299.97z M 256.00,64.00l-96.00,96.00
408
+ l 64.00,0.00 l0.00,96.00 l 64.00,0.00 l0.00-96.00 l 64.00,0.00 L 256.00,64.00z" />
409
+ <glyph unicode="&#xe078;" d="M 448.00,128.00L 448.00,64.00L 64.00,64.00L 64.00,128.00L0.00,128.00L0.00,0.00L 512.00,0.00L 512.00,128.00 zM 384.00,288.00L 288.00,288.00L 288.00,448.00L 224.00,448.00L 224.00,288.00L 128.00,288.00L 256.00,96.00 z" />
410
+ <glyph unicode="&#xe079;" d="M 445.502,299.97C 443.881,364.319, 391.273,416.00, 326.571,416.00c-37.896,0.00-71.633-17.747-93.427-45.366
411
+ c-12.221,15.799-31.345,25.98-52.854,25.98c-36.905,0.00-66.821-29.937-66.821-66.861c0.00-3.218, 0.24-6.38, 0.682-9.477
412
+ c-5.611,1.012-11.383,1.569-17.285,1.569C 43.367,321.846,0.00,278.452,0.00,224.924C0.00,171.393, 43.367,128.00, 96.865,128.00L 192.00,128.00 l0.00-96.00 l 128.00,0.00 l0.00,96.00
413
+ l 104.996,0.00 l0.00,0.006 C 473.065,128.098, 512.00,167.112, 512.00,215.229C 512.00,256.274, 483.661,290.679, 445.502,299.97z M 288.00,160.00l0.00-96.00 l-64.00,0.00 l0.00,96.00 l-64.00,0.00
414
+ l 96.00,96.00l 96.00-96.00L 288.00,160.00 z" />
415
+ <glyph unicode="&#xe07a;" d="M 448.00,128.00L 448.00,64.00L 64.00,64.00L 64.00,128.00L0.00,128.00L0.00,0.00L 512.00,0.00L 512.00,128.00 zM 128.00,256.00L 224.00,256.00L 224.00,96.00L 288.00,96.00L 288.00,256.00L 384.00,256.00L 256.00,448.00 z" />
416
+ <glyph unicode="&#xe07b;" d="M 160.00,128.00c 8.80-8.80, 23.637-8.363, 32.971,0.971L 351.03,287.029C 360.364,296.363, 360.80,311.20, 352.00,320.00
417
+ s-23.637,8.363-32.971-0.971L 160.971,160.971C 151.637,151.637, 151.20,136.80, 160.00,128.00zM 238.444,142.444c 2.28-4.525, 3.495-9.58, 3.495-14.848c0.00-8.808-3.372-17.03-9.496-23.154l-81.691-81.691
418
+ c-6.124-6.124-14.347-9.496-23.154-9.496s-17.03,3.372-23.154,9.496l-49.691,49.691c-6.124,6.124-9.496,14.347-9.496,23.154
419
+ s 3.372,17.03, 9.496,23.154l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497c 5.268,0.00, 10.322-1.215, 14.848-3.495l 32.669,32.669
420
+ c-13.935,10.705-30.72,16.08-47.517,16.08c-19.993,0.00-39.986-7.583-55.154-22.751l-81.691-81.691
421
+ c-30.335-30.335-30.335-79.974,0.00-110.309l 49.691-49.691C 87.611-24.416, 107.604-32.00, 127.597-32.00
422
+ c 19.994,0.00, 39.987,7.584, 55.154,22.751l 81.691,81.691c 27.91,27.91, 30.119,72.149, 6.672,102.672L 238.444,142.444zM 489.249,407.558l-49.691,49.691C 424.391,472.417, 404.398,480.00, 384.404,480.00c-19.993,0.00-39.986-7.583-55.154-22.751l-81.691-81.691
423
+ c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0.00,8.808, 3.372,17.03, 9.496,23.154
424
+ l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497s 17.03-3.373, 23.154-9.497l 49.691-49.691
425
+ c 6.124-6.124, 9.496-14.347, 9.496-23.154s-3.372-17.03-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
426
+ c-5.268,0.00-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.08, 47.517-16.08c 19.994,0.00, 39.987,7.584, 55.154,22.751
427
+ l 81.691,81.691C 519.584,327.584, 519.584,377.223, 489.249,407.558z" />
428
+ <glyph unicode="&#xe07c;" d="M 238.444,142.443c 2.28-4.524, 3.495-9.579, 3.495-14.848c0.00-8.808-3.372-17.029-9.496-23.154l-81.69-81.69
429
+ c-6.124-6.124-14.348-9.496-23.154-9.496s-17.03,3.372-23.154,9.496l-49.69,49.69c-6.124,6.125-9.496,14.348-9.496,23.154
430
+ s 3.372,17.03, 9.496,23.154l 81.69,81.691c 6.124,6.123, 14.348,9.496, 23.154,9.496c 5.269,0.00, 10.322-1.215, 14.848-3.494l 32.669,32.668
431
+ c-13.935,10.705-30.72,16.08-47.517,16.08c-19.993,0.00-39.986-7.583-55.154-22.751l-81.69-81.691
432
+ c-30.335-30.335-30.335-79.975,0.00-110.309l 49.69-49.691c 15.167-15.166, 35.16-22.75, 55.153-22.75
433
+ c 19.994,0.00, 39.987,7.584, 55.154,22.751l 81.69,81.69c 27.91,27.91, 30.119,72.149, 6.672,102.673L 238.444,142.443zM 489.248,407.558l-49.69,49.691C 424.391,472.417, 404.398,480.00, 384.404,480.00c-19.993,0.00-39.985-7.583-55.153-22.751l-81.691-81.691
434
+ c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0.00,8.808, 3.372,17.03, 9.496,23.154
435
+ l 81.691,81.691c 6.123,6.124, 14.347,9.497, 23.153,9.497c 8.808,0.00, 17.03-3.373, 23.154-9.497l 49.69-49.691
436
+ c 6.124-6.124, 9.496-14.347, 9.496-23.154c0.00-8.807-3.372-17.03-9.496-23.154l-81.69-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
437
+ c-5.268,0.00-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.08, 47.517-16.08c 19.994,0.00, 39.987,7.584, 55.154,22.752
438
+ l 81.69,81.69C 519.584,327.584, 519.584,377.223, 489.248,407.558zM 116.684,340.688L 20.687,436.685L 43.315,459.313L 139.312,363.316zM 192.00,480.00L 224.00,480.00L 224.00,384.00L 192.00,384.00zM0.00,288.00L 96.00,288.00L 96.00,256.00L0.00,256.00zM 395.316,107.312L 491.314,11.314L 468.686-11.314L 372.688,84.684zM 288.00,64.00L 320.00,64.00L 320.00-32.00L 288.00-32.00zM 416.00,192.00L 512.00,192.00L 512.00,160.00L 416.00,160.00z" />
439
+ <glyph unicode="&#xe07d;" d="M 432.311,476.862L 303.69,451.138C 295.061,449.412, 288.00,455.20, 288.00,464.00S 280.94,478.588, 272.311,476.862L 128.00,448.00L 128.00,480.00 L 64.00,480.00 l0.00-512.00 l 64.00,0.00 L 128.00,224.00
440
+ l 144.311,28.862C 280.94,254.588, 288.00,248.80, 288.00,240.00s 7.061-14.588, 15.689-12.862l 128.621,25.725C 440.94,254.588, 448.00,263.20, 448.00,272.00L 448.00,464.00
441
+ C 448.00,472.80, 440.94,478.588, 432.311,476.862z" />
442
+ <glyph unicode="&#xe07e;" d="M 254.059,418.977C 205.881,476.227, 169.369,480.00, 96.00,480.00l0.00-256.00 c 128.267,64.00, 142.636-8.335, 223.506-1.023
443
+ C 399.234,230.197, 467.031,291.564, 512.00,352.00C 384.644,322.547, 320.54,339.977, 254.059,418.977zM0.00,480.00L 64.00,480.00L 64.00-32.00L0.00-32.00z" />
444
+ <glyph unicode="&#xe07f;" d="M 348.916,316.476l-32.476,32.461L 154.035,186.566c-26.907-26.896-26.907-70.524,0.00-97.422
445
+ c 26.902-26.896, 70.53-26.896, 97.437,0.00l 194.886,194.854c 44.857,44.831, 44.857,117.531,0.00,162.363
446
+ c-44.833,44.852-117.556,44.852-162.391,0.00L 79.335,241.788l 0.017-0.016c-0.145-0.152-0.306-0.288-0.438-0.423
447
+ c-62.551-62.548-62.551-163.928,0.00-226.453c 62.527-62.528, 163.934-62.528, 226.494,0.00c 0.137,0.137, 0.258,0.284, 0.41,0.438l 0.016-0.017
448
+ l 139.666,139.646l-32.493,32.46L 273.35,47.792l-0.008,0.00 c-0.148-0.134-0.282-0.285-0.423-0.422
449
+ c-44.537-44.529-116.99-44.529-161.538,0.00c-44.531,44.521-44.531,116.961,0.00,161.489c 0.152,0.152, 0.302,0.291, 0.444,0.423l-0.023,0.03
450
+ l 204.64,204.583c 26.856,26.869, 70.572,26.869, 97.443,0.00c 26.856-26.867, 26.856-70.574,0.00-97.42L 218.999,121.625
451
+ c-8.968-8.961-23.527-8.961-32.486,0.00c-8.947,8.943-8.947,23.516,0.00,32.46L 348.916,316.476z" />
452
+ <glyph unicode="&#xe080;" d="M 256.00,368.00C 128.00,368.00, 0.001,256.001,0.00,224.00l0.00,0.00c 0.001-32.001, 128.00-144.00, 256.00-144.00s 255.997,111.999, 256.00,144.00l0.00,0.00
453
+ C 511.997,256.001, 384.00,368.00, 256.00,368.00z M 256.00,128.00c-53.021,0.00-96.00,42.98-96.00,96.00c0.00,53.02, 42.979,96.00, 96.00,96.00c 53.02,0.00, 96.00-42.98, 96.00-96.00
454
+ C 352.00,170.98, 309.02,128.00, 256.00,128.00zM 224.00,224.00A32.00,32.00 4860.00 1,0 288.00,224A32.00,32.00 4860.00 1,0 224.00,224z" />
455
+ <glyph unicode="&#xe081;" d="M 256.00,384.00C 144.341,384.00, 47.559,318.979,0.00,224.00c 47.559-94.979, 144.341-160.00, 256.00-160.00c 111.657,0.00, 208.439,65.021, 256.00,160.00
456
+ C 464.442,318.979, 367.657,384.00, 256.00,384.00z M 256.00,177.811c-25.51,0.00-46.189,20.682-46.189,46.189s 20.681,46.189, 46.189,46.189
457
+ s 46.188-20.681, 46.188-46.189C 302.19,198.49, 281.509,177.811, 256.00,177.811z M 121.171,135.361
458
+ C 86.304,157.602, 57.231,188.037, 36.35,224.00c 20.88,35.963, 49.953,66.397, 84.821,88.639c 19.81,12.635, 41.182,22.406, 63.521,29.043
459
+ c 11.229,3.334, 22.684,5.862, 34.281,7.586C 164.881,333.302, 125.40,283.266, 125.40,224.00c0.00-59.266, 39.481-109.303, 93.575-125.268
460
+ c-11.60,1.723-23.052,4.25-34.282,7.586C 162.353,112.955, 140.981,122.727, 121.171,135.361z M 390.827,135.361
461
+ c-19.811-12.637-41.183-22.406-63.521-29.043c-11.229-3.336-22.685-5.862-34.28-7.586C 347.117,114.697, 386.60,164.734, 386.60,224.00
462
+ c0.00,59.266-39.481,109.303-93.574,125.268c 11.598-1.724, 23.051-4.252, 34.28-7.586c 22.341-6.637, 43.713-16.408, 63.521-29.043
463
+ c 34.868-22.24, 63.94-52.676, 84.822-88.639C 454.769,188.037, 425.697,157.604, 390.827,135.361z" />
464
+ <glyph unicode="&#xe082;" d="M 96.00,480.00L 96.00-32.00L 256.00,128.00L 416.00-32.00L 416.00,480.00 z" />
465
+ <glyph unicode="&#xe083;" d="M 96.00,480.00l0.00-512.00 l 160.00,160.00l 160.00-160.00L 416.00,480.00 L 96.00,480.00 z M 384.00,45.255l-128.00,128.00l-128.00-128.00L 128.00,448.00 l 256.00,0.00 L 384.00,45.255 z" />
466
+ <glyph unicode="&#xe084;" d="M 512.00,281.476L 316.434,281.476 L 256.00,467.471l-60.434-185.995L0.00,281.476 l 158.217-114.953L 97.783-19.471L 256.00,95.48l 158.216-114.951
467
+ l-60.434,185.994L 512.00,281.476z M 368.565,43.362L 256.00,125.146l-112.566-81.784L 186.43,175.69L 73.864,257.476l 139.14,0.00 L 256.00,389.806
468
+ l 42.997-132.33l 139.139,0.00 L 325.569,175.69L 368.565,43.362z" />
469
+ <glyph unicode="&#xe085;" d="M 512.00,287.996L 316.434,287.996 L 256.00,473.991l-60.435-185.995L0.00,287.996 l 158.217-114.952L 97.783-12.951L 256.00,102.00l 158.216-114.95l-60.434,185.994
470
+ L 512.00,287.996z M 368.566,49.882L 256.00,131.666L 256.00,396.325 l 42.996-132.33l 139.14,0.00 L 325.57,182.211L 368.566,49.882z" />
471
+ <glyph unicode="&#xe086;" d="M 512.00,287.996L 316.434,287.996L 256.00,473.991L 195.567,287.996L0.00,287.996L 158.217,173.044L 97.783-12.951L 256.00,102.00L 414.216-12.95L 353.783,173.044 z" />
472
+ <glyph unicode="&#xe087;" d="M 377.594,448.00c-53.815,0.00-100.129-43.777-121.582-89.50C 234.543,404.222, 188.223,448.00, 134.404,448.00C 60.213,448.00,0.00,387.78,0.00,313.584
473
+ c0.00-150.923, 152.25-190.497, 256.011-339.709C 354.088,122.163, 512.00,167.478, 512.00,313.584C 512.00,387.78, 451.785,448.00, 377.594,448.00z" />
474
+ <glyph unicode="&#xe088;" d="M 377.594,416.00C 434.061,416.00, 480.00,370.056, 480.00,313.584c0.00-17.689-2.709-33.877-8.28-49.492
475
+ c-5.107-14.312-12.658-28.205-23.085-42.472c-20.959-28.684-51.409-55.677-83.647-84.255
476
+ c-35.333-31.323-74.42-65.975-109.504-109.938c-35.252,42.688-73.336,76.052-107.772,106.221
477
+ c-33.969,29.76-63.305,55.46-84.255,84.381c-10.427,14.395-17.981,28.573-23.096,43.348C 34.735,277.63, 32.00,294.707, 32.00,313.584
478
+ C 32.00,370.056, 77.938,416.00, 134.404,416.00c 40.713,0.00, 76.563-36.856, 92.643-71.101l 28.977-61.711l 28.959,61.72
479
+ C 301.047,379.148, 336.881,416.00, 377.594,416.00 M 377.594,448.00c-53.815,0.00-100.129-43.777-121.582-89.50C 234.543,404.222, 188.223,448.00, 134.404,448.00
480
+ C 60.213,448.00,0.00,387.78,0.00,313.584c0.00-150.923, 152.25-190.497, 256.011-339.709C 354.088,122.163, 512.00,167.478, 512.00,313.584
481
+ C 512.00,387.78, 451.785,448.00, 377.594,448.00L 377.594,448.00z" />
482
+ <glyph unicode="&#xe089;" d="M 446.141,117.407c 0.852,10.12, 21.951,23.983, 21.934,34.12c-0.049,10.643-18.482,28.455-17.086,39.007
483
+ c 1.104,8.37, 16.555,20.793, 17.059,29.245c 0.898,15.353-19.852,45.40-34.119,51.174c-22.643,9.168-137.705,4.883-137.705,4.883
484
+ c-11.246,19.653, 20.035,68.201, 28.639,89.162c 12.631,30.719, 10.504,71.466-5.471,92.399C 299.879,482.98, 264.063,484.68, 263.325,473.238
485
+ c-5.336-83.01-21.229-106.053-42.505-122.455c-12.786-9.863-23.954-18.497-29.854-33.528
486
+ c-36.261-92.354-65.52-122.037-79.528-125.254L 64.00,192.001 l0.00-198.885 l 145.721-19.501c0.00,0.00, 133.455-12.632, 175.482,0.00
487
+ c 13.223,3.966, 36.039,23.818, 41.432,36.556c 3.074,7.315-1.197,24.622, 2.443,31.677c 5.371,10.458, 28.051,23.559, 28.027,37.771
488
+ C 457.082,89.754, 445.276,107.298, 446.141,117.407z" />
489
+ <glyph unicode="&#xe08a;" d="M 468.051,228.233c-0.50,8.447-15.959,20.854-17.063,29.237c-1.398,10.544, 17.047,28.369, 17.076,39.00
490
+ c 0.023,10.137-21.072,24.002-21.93,34.127c-0.861,10.104, 10.953,27.644, 10.969,37.781c 0.025,14.216-22.658,27.314-28.033,37.771
491
+ c-3.631,7.059, 0.643,24.368-2.443,31.681c-5.385,12.739-28.203,32.595-41.414,36.556c-42.035,12.629-175.483,0.00-175.483,0.00L 64.00,454.89
492
+ L 64.00,256.00 l 47.445,0.00 c 13.993-7.782, 43.261-32.282, 79.526-124.636c 5.90-15.034, 17.073-24.288, 29.854-34.143
493
+ c 21.282-16.406, 37.157-39.442, 42.493-122.459c 0.743-11.443, 36.557-9.74, 56.064,15.837c 15.975,20.931, 18.109,61.682, 5.484,92.402
494
+ c-8.604,20.962-39.895,69.511-28.643,89.171c0.00,0.00, 115.066-4.285, 137.701,4.871C 448.192,182.817, 468.942,212.873, 468.051,228.233z" />
495
+ <glyph unicode="&#xe08b;" d="M 256.001,480.00C 114.615,480.00,0.00,365.386,0.00,224.00c0.00-141.385, 114.614-256.00, 256.001-256.00C 397.386-32.00, 512.00,82.615, 512.00,224.00
496
+ C 512.00,365.386, 397.386,480.00, 256.001,480.00z M 336.001,365.256c 12.495,0.00, 22.627-20.262, 22.627-45.256c0.00-24.993-10.132-45.255-22.627-45.255
497
+ c-12.498,0.00-22.629,20.262-22.629,45.255C 313.372,344.994, 323.503,365.256, 336.001,365.256z M 176.001,365.256
498
+ c 12.496,0.00, 22.627-20.262, 22.627-45.256c0.00-24.993-10.131-45.255-22.627-45.255c-12.498,0.00-22.628,20.262-22.628,45.255
499
+ C 153.373,344.994, 163.503,365.256, 176.001,365.256z M 256.001,64.00C 172.566,64.00, 103.289,133.936, 96.00,223.152
500
+ c 46.885-27.057, 102.025-42.532, 160.001-42.532c 57.974,0.00, 113.114,15.403, 160.00,42.46C 408.712,133.861, 339.435,64.00, 256.001,64.00z" />
501
+ <glyph unicode="&#xe08c;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.612-256.00, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 344.00,368.00
502
+ c 17.674,0.00, 32.00-14.327, 32.00-32.00s-14.326-32.00-32.00-32.00c-17.673,0.00-32.00,14.327-32.00,32.00S 326.327,368.00, 344.00,368.00z M 168.00,368.00c 17.673,0.00, 32.00-14.327, 32.00-32.00
503
+ s-14.327-32.00-32.00-32.00s-32.00,14.327-32.00,32.00S 150.327,368.00, 168.00,368.00z M 400.069,137.549c-14.676-24.406-35.46-44.84-60.104-59.089
504
+ C 314.551,63.768, 285.517,56.00, 256.00,56.00c-29.518,0.00-58.551,7.768-83.964,22.46c-24.646,14.249-45.431,34.683-60.105,59.09l-4.126,6.862
505
+ l 41.161,24.699l 4.119-6.852C 175.019,125.779, 213.492,104.00, 256.00,104.00c 42.507,0.00, 80.979,21.779, 102.913,58.261l 4.119,6.851l 41.162-24.698
506
+ L 400.069,137.549z" />
507
+ <glyph unicode="&#xe08d;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.613-256.00, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 320.00,96.00L 192.00,96.00 l0.00,32.00
508
+ l 128.00,0.00 L 320.00,96.00 z M 344.00,368.00c 17.674,0.00, 32.00-14.327, 32.00-32.00s-14.326-32.00-32.00-32.00c-17.673,0.00-32.00,14.327-32.00,32.00S 326.327,368.00, 344.00,368.00z M 168.00,368.00
509
+ c 17.673,0.00, 32.00-14.327, 32.00-32.00s-14.327-32.00-32.00-32.00s-32.00,14.327-32.00,32.00S 150.327,368.00, 168.00,368.00z" />
510
+ <glyph unicode="&#xe08e;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 288.00,192.00l0.00-160.00 l-64.00,0.00 L 224.00,192.00 L 64.00,192.00 l0.00,64.00
511
+ l 160.00,0.00 L 224.00,416.00 l 64.00,0.00 l0.00-160.00 l 160.00,0.00 l0.00-64.00 L 288.00,192.00 z" />
512
+ <glyph unicode="&#xe08f;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 64.00,192.00l0.00,64.00 l 384.00,0.00 l0.00-64.00 L 64.00,192.00 z" />
513
+ <glyph unicode="&#xe090;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,32.00
514
+ c-26.51,0.00-48.00,21.49-48.00,48.00s 21.49,48.00, 48.00,48.00s 48.00-21.49, 48.00-48.00S 282.51,32.00, 256.00,32.00z M 368.064,302.971
515
+ c-2.495-8.446-5.956-16.459-10.406-24.007c-4.445-7.567-9.79-14.732-16.019-21.476c-6.229-6.771-13.061-13.267-20.541-19.486
516
+ c-8.363-6.936-15.08-13.076-20.146-18.418c-5.057-5.328-8.488-9.967-10.269-13.867c-3.339-7.174-5.853-24.363-2.691-45.717l-63.959,0.00
517
+ c-0.525,37.938, 5.058,56.501, 11.688,70.258c 6.764,13.884, 19.377,28.554, 37.888,44.031c 8.011,6.567, 14.236,12.408, 18.675,17.479
518
+ c 4.449,5.067, 7.841,9.599, 10.143,13.604c 2.307,4.00, 3.729,7.734, 4.271,11.211c 0.53,3.461, 0.793,7.056, 0.793,10.799
519
+ c0.00,6.938-1.199,13.337-3.603,19.205c-2.396,5.883-5.824,10.938-10.264,15.197c-4.457,4.281-9.696,7.617-15.744,10.021
520
+ c-6.048,2.399-12.804,3.61-20.279,3.61c-29.164,0.00-46.955-20.371-53.365-61.104l-64.027,0.00 c 1.598,17.44, 5.56,33.211, 11.876,47.353
521
+ c 6.313,14.15, 14.576,26.151, 24.813,36.028c 10.231,9.876, 22.146,17.47, 35.754,22.796c 13.60,5.34, 28.409,8.012, 44.419,8.012
522
+ c 17.08,0.00, 32.642-2.441, 46.696-7.332c 14.057-4.899, 26.104-11.709, 36.146-20.42c 10.057-8.713, 17.872-19.119, 23.482-31.211
523
+ c 5.591-12.104, 8.411-25.261, 8.411-39.484C 371.804,320.454, 370.546,311.424, 368.064,302.971z" />
524
+ <glyph unicode="&#xe091;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.613-256.00, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,0.00
525
+ C 132.288,0.00, 32.00,100.288, 32.00,224.00S 132.288,448.00, 256.00,448.00s 224.00-100.288, 224.00-224.00S 379.712,0.00, 256.00,0.00zM 224.00,128.00L 288.00,128.00L 288.00,64.00L 224.00,64.00zM 352.00,352.00L 160.00,352.00 l0.00-64.00 l 160.00,0.00 l0.00-32.00 l-96.00-64.00l0.00-32.00 l 64.00,0.00 l 96.00,64.00l0.00,96.00 C 384.00,337.673, 369.673,352.00, 352.00,352.00z" />
526
+ <glyph unicode="&#xe092;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.614-256.00, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,416.00
527
+ c 35.347,0.00, 64.00-28.654, 64.00-64.00s-28.653-64.00-64.00-64.00s-64.00,28.654-64.00,64.00S 220.654,416.00, 256.00,416.00z M 352.00,32.00L 160.00,32.00 l0.00,32.00 l 32.00,0.00 L 192.00,224.00 l-32.00,0.00 l0.00,32.00 l 160.00,0.00 l0.00-192.00 l 32.00,0.00 L 352.00,32.00 z
528
+ " />
529
+ <glyph unicode="&#xe093;" d="M0.00,224.00c0.00-141.385, 114.615-256.00, 256.00-256.00c 141.386,0.00, 256.00,114.615, 256.00,256.00S 397.386,480.00, 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00z M 448.00,224.00
530
+ c0.00-36.618-10.256-70.84-28.044-99.956L 156.045,387.956C 185.16,405.745, 219.382,416.00, 256.00,416.00C 362.038,416.00, 448.00,330.039, 448.00,224.00z M 64.00,224.00
531
+ c0.00,36.618, 10.256,70.839, 28.045,99.956l 263.911-263.912C 326.839,42.255, 292.618,32.00, 256.00,32.00C 149.962,32.00, 64.00,117.961, 64.00,224.00z" />
532
+ <glyph unicode="&#xe094;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 416.00,128.00l-64.00-64.00l-96.00,96.00l-96.00-96.00
533
+ l-64.00,64.00l 96.00,96.00l-96.00,96.00l 64.00,64.00l 96.00-96.00l 96.00,96.00l 64.00-64.00l-96.00-96.00L 416.00,128.00z" />
534
+ <glyph unicode="&#xe095;" d="M 507.331,68.67c-0.002,0.002-0.004,0.004-0.006,0.005L 352.003,224.00l 155.322,155.325c 0.002,0.002, 0.004,0.003, 0.006,0.005
535
+ c 1.672,1.673, 2.881,3.627, 3.656,5.708c 2.123,5.688, 0.912,12.341-3.662,16.915L 433.952,475.326c-4.574,4.573-11.225,5.783-16.914,3.66
536
+ c-2.08-0.775-4.035-1.984-5.709-3.655c0.00-0.002-0.002-0.003-0.004-0.005L 256.001,320.00L 100.677,475.325
537
+ c-0.002,0.002-0.003,0.003-0.005,0.005c-1.673,1.671-3.627,2.88-5.707,3.655c-5.69,2.124-12.341,0.913-16.915-3.66L 4.676,401.951
538
+ c-4.574-4.574-5.784-11.226-3.661-16.914c 0.776-2.08, 1.985-4.036, 3.656-5.708c 0.002-0.001, 0.003-0.003, 0.005-0.005L 160.001,224.00
539
+ L 4.676,68.674c-0.001-0.002-0.003-0.003-0.004-0.005c-1.671-1.673-2.88-3.627-3.657-5.707c-2.124-5.688-0.913-12.341, 3.661-16.915
540
+ l 73.374-73.373c 4.575-4.574, 11.226-5.784, 16.915-3.661c 2.08,0.776, 4.035,1.985, 5.708,3.656c 0.001,0.002, 0.003,0.003, 0.005,0.005
541
+ l 155.324,155.325l 155.324-155.325c 0.002-0.001, 0.004-0.003, 0.006-0.004c 1.674-1.672, 3.627-2.881, 5.707-3.657
542
+ c 5.689-2.123, 12.342-0.913, 16.914,3.661l 73.373,73.374c 4.574,4.574, 5.785,11.227, 3.662,16.915
543
+ C 510.212,65.043, 509.003,66.997, 507.331,68.67z" />
544
+ <glyph unicode="&#xe096;" d="M 512.00,352.00L 384.00,480.00L 256.00,352.00L 128.00,480.00L0.00,352.00L 128.00,224.00L0.00,96.00L 128.00-32.00L 256.00,96.00L 384.00-32.00L 512.00,96.00L 384.00,224.00 z" />
545
+ <glyph unicode="&#xe097;" d="M 432.00,432.00L 192.00,192.00L 80.00,304.00L0.00,224.00L 192.00,32.00L 512.00,352.00 z" />
546
+ <glyph unicode="&#xe098;" d="M0.00,272.00l0.00-96.00 c0.00-8.836, 7.164-16.00, 16.00-16.00l 480.00,0.00 c 8.836,0.00, 16.00,7.164, 16.00,16.00l0.00,96.00 c0.00,8.836-7.164,16.00-16.00,16.00L 16.00,288.00 C 7.164,288.00,0.00,280.836,0.00,272.00z" />
547
+ <glyph unicode="&#xe099;" d="M 496.00,288.00L 320.00,288.00 L 320.00,464.00 c0.00,8.836-7.164,16.00-16.00,16.00l-96.00,0.00 c-8.836,0.00-16.00-7.164-16.00-16.00l0.00-176.00 L 16.00,288.00 c-8.836,0.00-16.00-7.164-16.00-16.00l0.00-96.00
548
+ c0.00-8.836, 7.164-16.00, 16.00-16.00l 176.00,0.00 l0.00-176.00 c0.00-8.836, 7.164-16.00, 16.00-16.00l 96.00,0.00 c 8.836,0.00, 16.00,7.164, 16.00,16.00L 320.00,160.00 l 176.00,0.00 c 8.836,0.00, 16.00,7.164, 16.00,16.00l0.00,96.00
549
+ C 512.00,280.836, 504.836,288.00, 496.00,288.00z" />
550
+ <glyph unicode="&#xe09a;" d="M 448.00,448.00L 96.00,448.00 C 78.40,448.00, 64.00,433.60, 64.00,416.00l0.00-128.00 l 64.00,0.00 L 128.00,384.00 l 352.00,0.00 L 480.00,416.00 C 480.00,433.60, 465.60,448.00, 448.00,448.00zM 336.00,208.00L 192.00,352.00L 192.00,256.00L0.00,256.00L0.00,160.00L 192.00,160.00L 192.00,64.00 zM 128.00,128.00L 64.00,128.00 l0.00-128.00 c0.00-17.60, 14.399-32.00, 32.00-32.00l 352.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00l0.00,32.00 L 128.00,32.00 L 128.00,128.00 z" />
551
+ <glyph unicode="&#xe09b;" d="M 496.00,208.00L 352.00,352.00L 352.00,256.00L 160.00,256.00L 160.00,160.00L 352.00,160.00L 352.00,64.00 zM 416.00,384.00L 416.00,416.00 c0.00,17.60-14.40,32.00-32.00,32.00L 32.00,448.00 C 14.40,448.00,0.00,433.60,0.00,416.00l0.00-416.00 c0.00-17.60, 14.399-32.00, 32.00-32.00l 352.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00l0.00,32.00 L 64.00,32.00 L 64.00,384.00
552
+ L 416.00,384.00 z" />
553
+ <glyph unicode="&#xe09c;" d="M 160.00,160.00L 160.00,256.00L 256.00,256.00L 128.00,384.00L0.00,256.00L 96.00,256.00L 96.00,96.00L 288.00,96.00L 224.00,160.00 zM 416.00,192.00L 416.00,352.00L 224.00,352.00L 288.00,288.00L 352.00,288.00L 352.00,192.00L 256.00,192.00L 384.00,64.00L 512.00,192.00 z" />
554
+ <glyph unicode="&#xe09d;" d="M 384.00,160.00L 256.00,288.00L 128.00,160.00 z" />
555
+ <glyph unicode="&#xe09e;" d="M 192.001,96.00L 320.001,224.00L 192.001,352.00 z" />
556
+ <glyph unicode="&#xe09f;" d="M 128.00,288.00L 256.00,160.00L 384.00,288.00 z" />
557
+ <glyph unicode="&#xe0a0;" d="M 320.001,352.00L 192.001,224.00L 320.001,95.999 z" />
558
+ <glyph unicode="&#xe0a1;" d="M0.00,96.00L 128.00,224.00L 384.00-32.00L 512.00,96.00L 256.00,352.00L 383.999,480.00L0.00,480.00 z" />
559
+ <glyph unicode="&#xe0a2;" d="M 256.001,480.00L0.00,224.00L 160.00,224.00L 160.00-31.999L 352.00-32.00L 352.00,224.00L 512.00,224.00 z" />
560
+ <glyph unicode="&#xe0a3;" d="M 128.00,480.00L 256.001,352.00L0.00,96.00L 128.00-32.00L 384.00,224.00L 512.00,96.001L 512.00,480.00 z" />
561
+ <glyph unicode="&#xe0a4;" d="M 512.00,224.00L 256.00,480.00L 256.00,320.00L 0.001,320.00L0.00,128.00L 256.00,128.00L 256.00-32.00 z" />
562
+ <glyph unicode="&#xe0a5;" d="M 512.00,352.00L 384.00,224.00L 128.00,480.00L0.00,352.00L 256.001,96.00L 128.001-32.00L 512.00-32.00 z" />
563
+ <glyph unicode="&#xe0a6;" d="M 256.00-32.00L 512.00,224.00L 352.00,224.00L 352.00,479.999L 160.00,480.00L 160.00,224.00L0.00,224.00 z" />
564
+ <glyph unicode="&#xe0a7;" d="M 384.00-32.00L 256.00,96.00L 512.00,352.00L 384.00,480.00L 128.00,223.999L0.00,351.999L0.00-32.00 z" />
565
+ <glyph unicode="&#xe0a8;" d="M0.00,224.00L 256.00-32.00L 256.00,128.00L 511.999,128.00L 512.00,320.00L 256.00,320.00L 256.00,480.00 z" />
566
+ <glyph unicode="&#xe0a9;" d="M0.00,480.00L0.00,192.00L 96.00,288.00L 512.00-32.00L 192.00,384.00L 285.309,480.00 z" />
567
+ <glyph unicode="&#xe0aa;" d="M 256.002-32.00L 200.00,352.00L 96.00,352.00L 255.999,480.00L 416.00,352.00L 311.999,352.00 z" />
568
+ <glyph unicode="&#xe0ab;" d="M 512.00,480.00L 224.00,480.00L 320.00,384.00L0.00-32.00L 416.00,288.00L 512.00,194.691 z" />
569
+ <glyph unicode="&#xe0ac;" d="M0.00,223.998L 384.00,280.00L 384.00,384.00L 512.00,224.001L 384.00,64.00L 384.00,168.001 z" />
570
+ <glyph unicode="&#xe0ad;" d="M 512.00-32.00L 512.00,256.00L 416.001,160.00L0.00,480.00L 320.00,64.00L 226.692-32.00 z" />
571
+ <glyph unicode="&#xe0ae;" d="M 255.998,480.00L 312.00,96.00L 416.00,96.00L 256.001-32.00L 96.00,96.00L 200.001,96.00 z" />
572
+ <glyph unicode="&#xe0af;" d="M0.00-32.00L 288.00-32.00L 192.00,64.00L 512.00,480.00L 96.00,160.00L0.00,253.308 z" />
573
+ <glyph unicode="&#xe0b0;" d="M 512.00,224.002L 128.00,168.00L 128.00,64.00L0.00,223.999L 128.00,384.00L 128.00,279.999 z" />
574
+ <glyph unicode="&#xe0b1;" d="M 32.00,448.00L 32.00,128.00L 128.00,32.00L 128.00,256.00L 384.00,0.00L 480.00,96.00L 224.00,352.00L 448.00,352.00L 352.00,448.00 z" />
575
+ <glyph unicode="&#xe0b2;" d="M 32.00,256.00L 32.00,128.00L 192.00,288.00L 192.00-32.00L 320.00-32.00L 320.00,288.00L 480.00,128.00L 480.00,256.00L 256.00,480.00 z" />
576
+ <glyph unicode="&#xe0b3;" d="M 480.00,448.00L 160.00,448.00L 64.00,352.00L 288.00,352.00L 32.00,96.00L 128.00,0.00L 384.00,256.00L 384.00,32.00L 480.00,128.00 z" />
577
+ <glyph unicode="&#xe0b4;" d="M 288.00,448.00L 160.00,448.00L 320.00,288.00L0.00,288.00L0.00,160.00L 320.00,160.00L 160.00,0.00L 288.00,0.00L 512.00,224.00 z" />
578
+ <glyph unicode="&#xe0b5;" d="M 480.00,0.00L 480.00,320.00L 384.00,416.00L 384.00,192.00L 128.00,448.00L 32.00,352.00L 288.00,96.00L 64.001,96.00L 160.001,0.00 z" />
579
+ <glyph unicode="&#xe0b6;" d="M 480.00,192.00L 480.00,320.00L 320.00,160.00L 320.00,480.00L 192.00,480.00L 192.001,159.999L 32.00,320.00L 32.00,191.999L 256.001-32.00 z" />
580
+ <glyph unicode="&#xe0b7;" d="M 32.00,0.00L 352.00,0.00L 448.00,96.00L 224.00,96.00L 480.00,352.00L 384.00,448.00L 128.00,192.00L 128.00,416.00L 32.00,320.00 z" />
581
+ <glyph unicode="&#xe0b8;" d="M 224.00,0.00L 352.00,0.00L 192.00,160.00L 512.00,160.00L 512.00,288.00L 192.00,288.00L 352.00,448.00L 224.00,448.00L0.00,224.00 z" />
582
+ <glyph unicode="&#xe0b9;" d="M 512.00,256.00L 256.00,480.00L0.00,256.00l 186.225,0.00 L 128.00-32.00l 256.00,0.00 l-58.226,288.00L 512.00,256.00 z M 346.226,0.00L 165.775,0.00 L 224.00,288.00L 85.167,288.00 L 256.00,437.479L 426.834,288.00
583
+ L 288.00,288.00 L 346.226,0.00z" />
584
+ <glyph unicode="&#xe0ba;" d="M 288.00-32.00l 224.00,256.00L 288.00,480.00l0.00-186.225 L0.00,352.00l0.00-256.00 l 288.00,58.227L 288.00-32.00 z M 32.00,133.774L 32.00,314.226 L 320.00,256.00L 320.00,394.833 L 469.479,224.00L 320.00,53.166L 320.00,192.00
585
+ L 32.00,133.774z" />
586
+ <glyph unicode="&#xe0bb;" d="M0.00,192.00l 256.00-224.00l 256.00,224.00L 325.776,192.00 L 384.00,480.00L 128.00,480.00 l 58.227-288.00L0.00,192.00 z M 165.775,448.00l 180.451,0.00 L 288.00,160.00l 138.833,0.00 L 256.00,10.521L 85.166,160.00L 224.00,160.00
587
+ L 165.775,448.00z" />
588
+ <glyph unicode="&#xe0bc;" d="M 224.00,480.00L0.00,224.00l 224.00-256.00L 224.00,154.226 l 288.00-58.225L 512.00,352.00 l-288.00-58.227L 224.00,480.00 z M 480.00,314.226l0.00-180.45 l-288.00,58.226l0.00-138.833 L 42.522,224.00
589
+ L 192.00,394.834L 192.00,256.00 L 480.00,314.226z" />
590
+ <glyph unicode="&#xe0bd;" d="M 256.00,480.00L 32.00-32.00L 256.00,64.00L 480.00-32.00 z" />
591
+ <glyph unicode="&#xe0be;" d="M 512.00,224.00L0.00,448.00L 96.00,224.00L0.00,0.00 z" />
592
+ <glyph unicode="&#xe0bf;" d="M 256.00-32.00L 480.00,480.00L 256.00,384.00L 32.00,480.00 z" />
593
+ <glyph unicode="&#xe0c0;" d="M0.00,224.00L 512.00,0.00L 416.00,224.00L 512.00,448.00 z" />
594
+ <glyph unicode="&#xe0c1;" d="M 128.00,256.00L 128.00,192.001L 224.00,288.00L 224.00,96.001L 288.00,96.00L 288.001,288.00L 384.001,192.00L 384.001,256.00L 256.001,384.00 zM0.00,224.00c0.00-141.384, 114.615-255.999, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00c 0.001,141.385-114.614,256.00-256.00,256.00
595
+ S0.00,365.385,0.00,224.00z M 480.001,224.00C 480.00,100.288, 379.712,0.00, 256.00,0.00C 132.288,0.001, 32.00,100.289, 32.00,224.00c0.00,123.712, 100.288,224.00, 224.00,224.00
596
+ S 480.001,347.712, 480.001,224.00z" />
597
+ <glyph unicode="&#xe0c2;" d="M 288.00,352.00L 224.00,352.00L 320.00,256.00L 128.00,256.00L 128.00,192.00L 320.00,192.00L 224.00,96.00L 288.00,96.00L 416.00,224.00 zM 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,0.00
598
+ C 132.288,0.00, 32.00,100.288, 32.00,224.00S 132.288,448.00, 256.00,448.00s 224.00-100.288, 224.00-224.00S 379.712,0.00, 256.00,0.00z" />
599
+ <glyph unicode="&#xe0c3;" d="M 384.00,192.00L 384.00,256.00L 288.00,160.00L 288.00,352.00L 224.00,352.00L 224.00,160.00L 128.00,256.00L 128.00,192.00L 256.00,64.00 zM 512.00,224.00C 512.00,365.385, 397.385,480.00, 256.00,480.00S0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00S 512.00,82.615, 512.00,224.00z M 32.00,224.00
600
+ C 32.00,347.712, 132.288,448.00, 256.00,448.00s 224.00-100.288, 224.00-224.00S 379.712,0.00, 256.00,0.00S 32.00,100.288, 32.00,224.00z" />
601
+ <glyph unicode="&#xe0c4;" d="M 224.00,96.00L 288.00,96.00L 192.00,192.00L 384.00,192.00L 384.00,256.00L 192.00,256.00L 288.00,352.00L 224.00,352.00L 96.00,224.00 zM 256.00-32.00c 141.385,0.00, 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00C0.00,82.615, 114.615-32.00, 256.00-32.00z
602
+ M 256.00,448.00c 123.712,0.00, 224.00-100.289, 224.00-224.00S 379.712,0.00, 256.00,0.00S 32.00,100.288, 32.00,224.00C 32.00,347.712, 132.288,448.00, 256.00,448.00z" />
603
+ <glyph unicode="&#xe0c5;" d="M 384.00,256.00L 256.00,384.00L 128.00,256.00 zM 128.00,160.00L 256.00,32.00L 384.00,160.00 z" />
604
+ <glyph unicode="&#xe0c6;" d="M 512.00,448.00L 416.00,448.00L 416.00,224.00L 176.00,224.00L 256.00,304.00L 192.00,368.00L0.00,176.00L 192.00-16.00L 256.00,48.00L 176.00,128.00L 512.00,128.00 z" />
605
+ <glyph unicode="&#xe0c7;" d="M 160.00,384.00L0.00,224.00l 160.00-160.00l 352.00,0.00 L 512.00,384.00 L 160.00,384.00 z M 480.00,96.00L 173.255,96.00 l-128.00,128.00l 128.00,128.00L 480.00,352.00 L 480.00,96.00 zM 288.00,128.00L 352.00,192.00L 416.00,128.00L 448.00,160.00L 384.00,224.00L 448.00,288.00L 416.00,320.00L 352.00,256.00L 288.00,320.00L 256.00,288.00L 320.00,224.00L 256.00,160.00 z" />
606
+ <glyph unicode="&#xe0c8;" d="M 160.00,384.00L0.00,224.00l 160.00-160.00l 352.00,0.00 L 512.00,384.00 L 160.00,384.00 z M 469.12,145.92l-39.04-39.04L 352.00,184.96l-78.08-78.08l-39.04,39.04L 312.96,224.00
607
+ l-78.08,78.08l 39.04,39.04L 352.00,263.04l 78.08,78.08l 39.04-39.04L 391.04,224.00L 469.12,145.92z" />
608
+ <glyph unicode="&#xe0c9;" d="M 352.00,192.00L 480.00,320.00L 352.00,448.00L 352.00,352.00L0.00,352.00L0.00,288.00L 352.00,288.00 zM 160.00,160.00L 160.00,256.00L 32.00,128.00L 160.00,0.00L 160.00,96.00L 512.00,96.00L 512.00,160.00 z" />
609
+ <glyph unicode="&#xe0ca;" d="M 352.00,384.00L0.00,384.00L0.00,320.00L 352.00,320.00L 352.00,224.00L 480.00,352.00L 352.00,480.00 zM 480.00,480.00L 480.00,352.00L 480.00,224.00L 512.00,224.00L 512.00,480.00 zM 160.00,224.00L 32.00,96.00L 160.00-32.00L 160.00,64.00L 512.00,64.00L 512.00,128.00L 160.00,128.00 zM0.00,224.00L0.00-32.00L 32.00-32.00L 32.00,96.00L 32.00,224.00 z" />
610
+ <glyph unicode="&#xe0cb;" d="M0.00,480.00l0.00-512.00 l 512.00,0.00 L 512.00,480.00 L0.00,480.00 z M 480.00,0.00L 32.00,0.00 L 32.00,448.00 l 448.00,0.00 L 480.00,0.00 zM 384.00,352.00L 224.00,192.00L 128.00,288.00L 64.00,224.00L 224.00,64.00L 448.00,288.00 z" />
611
+ <glyph unicode="&#xe0cc;" d="M0.00,480.00l0.00-512.00 l 512.00,0.00 L 512.00,480.00 L0.00,480.00 z M 480.00,0.00L 32.00,0.00 L 32.00,448.00 l 448.00,0.00 L 480.00,0.00 z" />
612
+ <glyph unicode="&#xe0cd;" d="M0.00,480.00l0.00-512.00 l 512.00,0.00 L 512.00,480.00 L0.00,480.00 z M 480.00,0.00L 32.00,0.00 L 32.00,448.00 l 448.00,0.00 L 480.00,0.00 zM 128.00,352.00L 384.00,352.00L 384.00,96.00L 128.00,96.00z" />
613
+ <glyph unicode="&#xe0ce;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,32.00
614
+ c-106.039,0.00-192.00,85.961-192.00,192.00c0.00,106.039, 85.961,192.00, 192.00,192.00c 106.039,0.00, 192.00-85.961, 192.00-192.00C 448.00,117.961, 362.039,32.00, 256.00,32.00zM 160.00,224.00A96.00,96.00 4860.00 1,0 352.00,224A96.00,96.00 4860.00 1,0 160.00,224z" />
615
+ <glyph unicode="&#xe0cf;" d="M 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,32.00
616
+ c-106.039,0.00-192.00,85.961-192.00,192.00c0.00,106.039, 85.961,192.00, 192.00,192.00c 106.039,0.00, 192.00-85.961, 192.00-192.00C 448.00,117.961, 362.039,32.00, 256.00,32.00z" />
617
+ <glyph unicode="&#xe0d0;" d="M 399.798,471.896C 354.535,471.896, 325.488,480.00, 278.874,480.00C 128.232,480.00, 57.978,394.208, 57.978,307.064
618
+ c0.00-51.339, 24.32-68.229, 72.282-68.229c-3.379,7.432-9.457,15.54-9.457,52.017c0.00,102.005, 38.503,131.729, 87.818,133.755
619
+ c0.00,0.00-40.459-396.687-157.889-444.271L 50.732-32.00 l 84.359,0.00 l 73.938,0.00 l 54.013,256.00l 98.922,0.00 L 384.00,288.00L 276.546,288.00 l 25.972,123.095
620
+ c 29.723-6.078, 58.771-12.158, 83.766-12.158c 31.074,0.00, 59.447,9.457, 74.984,81.063C 442.355,473.92, 422.087,471.896, 399.798,471.896z" />
621
+ <glyph unicode="&#xe0d1;" d="M0.00,384.00L 512.00,384.00L 512.00,352.00L0.00,352.00zM0.00,320.00L 352.00,320.00L 352.00,288.00L0.00,288.00zM0.00,256.00L 512.00,256.00L 512.00,224.00L0.00,224.00zM0.00,192.00L 352.00,192.00L 352.00,160.00L0.00,160.00zM0.00,128.00L 512.00,128.00L 512.00,96.00L0.00,96.00zM0.00,64.00L 352.00,64.00L 352.00,32.00L0.00,32.00z" />
622
+ <glyph unicode="&#xe0d2;" d="M0.00,384.00L 512.00,384.00L 512.00,352.00L0.00,352.00zM 96.00,320.00L 416.00,320.00L 416.00,288.00L 96.00,288.00zM 96.00,192.00L 416.00,192.00L 416.00,160.00L 96.00,160.00zM 96.00,64.00L 416.00,64.00L 416.00,32.00L 96.00,32.00zM0.00,256.00L 512.00,256.00L 512.00,224.00L0.00,224.00zM0.00,128.00L 512.00,128.00L 512.00,96.00L0.00,96.00z" />
623
+ <glyph unicode="&#xe0d3;" d="M0.00,384.00L 512.00,384.00L 512.00,352.00L0.00,352.00zM 160.00,320.00L 512.00,320.00L 512.00,288.00L 160.00,288.00zM0.00,256.00L 512.00,256.00L 512.00,224.00L0.00,224.00zM 160.00,192.00L 512.00,192.00L 512.00,160.00L 160.00,160.00zM0.00,128.00L 512.00,128.00L 512.00,96.00L0.00,96.00zM 160.00,64.00L 512.00,64.00L 512.00,32.00L 160.00,32.00z" />
624
+ <glyph unicode="&#xe0d4;" d="M 256.00,480.00c-70.692,0.00-128.00-57.308-128.00-128.00s 57.308-128.00, 128.00-128.00l0.00-256.00 l 64.00,0.00 L 320.00,416.00 l 64.00,0.00 l0.00-448.00 l 64.00,0.00 L 448.00,416.00 l 64.00,0.00 L 512.00,480.00 L 256.00,480.00 zM0.00,128.00L 128.00,256.00L0.00,384.00 z" />
625
+ <glyph unicode="&#xe0d5;" d="M 128.00,480.00C 57.308,480.00,0.00,422.692,0.00,352.00s 57.308-128.00, 128.00-128.00l0.00-256.00 l 64.00,0.00 L 192.00,416.00 l 64.00,0.00 l0.00-448.00 l 64.00,0.00 L 320.00,416.00 l 64.00,0.00 L 384.00,480.00 L 128.00,480.00 zM 512.00,384.00L 384.00,256.00L 512.00,128.00 z" />
626
+ <glyph unicode="&#xe0d6;" d="M 128.00,160.00c0.00,0.00, 29.412,96.00, 192.00,96.00l0.00-96.00 l 192.00,128.00L 320.00,416.00l0.00-96.00 C 192.00,320.00, 128.00,240.164, 128.00,160.00zM 352.00,96.00L 64.00,96.00 L 64.00,288.00 l 62.938,0.00 c 5.047,5.959, 10.456,11.667, 16.244,17.09c 21.982,20.595, 48.281,36.326, 78.057,46.91L0.00,352.00 l0.00-320.00 l 416.00,0.00
627
+ L 416.00,166.312 l-64.00-42.667L 352.00,96.00 z" />
628
+ <glyph unicode="&#xe0d7;" d="M 320.00,448.00L 384.00,384.00L 160.00,160.00L 192.00,128.00L 416.00,352.00L 480.00,288.00L 480.00,448.00 zM 352.00,64.00L 96.00,64.00L 96.00,320.00L 224.00,320.00L 288.00,384.00L 32.00,384.00L 32.00,0.00L 416.00,0.00L 416.00,256.00L 352.00,192.00 z" />
629
+ <glyph unicode="&#xe0d8;" d="M 160.00,352.00L 32.00,224.00L 160.00,96.00L 224.00,96.00L 96.00,224.00L 224.00,352.00 zM 352.00,352.00L 288.00,352.00L 416.00,224.00L 288.00,96.00L 352.00,96.00L 480.00,224.00 z" />
630
+ <glyph unicode="&#xe0d9;" d="M 352.00,416.00L 384.00,448.00L 352.00,480.00L 160.00,480.00L 128.00,448.00L 160.00,416.00 zM 384.00,432.00L 352.00,400.00L 352.00,272.00L 384.00,240.00L 416.00,272.00L 416.00,400.00 zM 160.00,271.999L 160.00,400.00L 128.00,432.00L 96.00,400.00L 96.00,271.999L 128.00,239.999 zM 352.00,176.00L 352.00,48.00L 384.00,16.00L 416.00,48.00L 416.00,176.00L 384.00,208.00 zM 160.00,48.00L 160.00,176.00L 128.00,208.00L 96.00,176.00L 96.00,48.00L 128.00,16.00 zM 160.00,32.00L 128.00,0.00L 160.00-32.00L 352.00-32.00L 384.00,0.00L 352.00,32.00 z" />
631
+ <glyph unicode="&#xe0da;" d="M 384.00,432.00L 352.00,400.00L 352.00,272.00L 384.00,240.00L 416.00,272.00L 416.00,400.00 zM 352.00,176.00L 352.00,48.00L 384.00,16.00L 416.00,48.00L 416.00,176.00L 384.00,208.00 z" />
632
+ <glyph unicode="&#xe0db;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 384.00,240.00L 352.00,272.00L 352.00,400.00L 384.00,432.00L 416.00,400.00L 416.00,272.00 zM 128.00,16.00L 96.00,48.00L 96.00,176.00L 128.00,208.00L 160.00,176.00L 160.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 zM 128.00,0.00L 160.00,32.00L 352.00,32.00L 384.00,0.00L 352.00-32.00L 160.00-32.00 z" />
633
+ <glyph unicode="&#xe0dc;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 384.00,240.00L 352.00,272.00L 352.00,400.00L 384.00,432.00L 416.00,400.00L 416.00,272.00 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 zM 128.00,0.00L 160.00,32.00L 352.00,32.00L 384.00,0.00L 352.00-32.00L 160.00-32.00 z" />
634
+ <glyph unicode="&#xe0dd;" d="M 384.00,240.00L 352.00,272.00L 352.00,400.00L 384.00,432.00L 416.00,400.00L 416.00,272.00 zM 128.00,239.999L 96.00,271.999L 96.00,400.00L 128.00,432.00L 160.00,400.00L 160.00,271.999 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 z" />
635
+ <glyph unicode="&#xe0de;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 128.00,239.999L 96.00,271.999L 96.00,400.00L 128.00,432.00L 160.00,400.00L 160.00,271.999 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 zM 128.00,0.00L 160.00,32.00L 352.00,32.00L 384.00,0.00L 352.00-32.00L 160.00-32.00 z" />
636
+ <glyph unicode="&#xe0df;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 128.00,239.999L 96.00,271.999L 96.00,400.00L 128.00,432.00L 160.00,400.00L 160.00,271.999 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 zM 128.00,16.00L 96.00,48.00L 96.00,176.00L 128.00,208.00L 160.00,176.00L 160.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 zM 128.00,0.00L 160.00,32.00L 352.00,32.00L 384.00,0.00L 352.00-32.00L 160.00-32.00 z" />
637
+ <glyph unicode="&#xe0e0;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 384.00,240.00L 352.00,272.00L 352.00,400.00L 384.00,432.00L 416.00,400.00L 416.00,272.00 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 z" />
638
+ <glyph unicode="&#xe0e1;" d="M 352.00,416.00L 384.00,448.00L 352.00,480.00L 160.00,480.00L 128.00,448.00L 160.00,416.00 zM 384.00,432.00L 352.00,400.00L 352.00,272.00L 384.00,240.00L 416.00,272.00L 416.00,400.00 zM 160.00,271.999L 160.00,400.00L 128.00,432.00L 96.00,400.00L 96.00,271.999L 128.00,239.999 zM 352.00,176.00L 352.00,48.00L 384.00,16.00L 416.00,48.00L 416.00,176.00L 384.00,208.00 zM 160.00,48.00L 160.00,176.00L 128.00,208.00L 96.00,176.00L 96.00,48.00L 128.00,16.00 zM 128.00,224.00L 160.00,192.00L 352.00,192.00L 384.00,224.00L 352.00,256.00L 160.00,256.00 zM 160.00,32.00L 128.00,0.00L 160.00-32.00L 352.00-32.00L 384.00,0.00L 352.00,32.00 z" />
639
+ <glyph unicode="&#xe0e2;" d="M 128.00,448.00L 160.00,480.00L 352.00,480.00L 384.00,448.00L 352.00,416.00L 160.00,416.00 zM 384.00,240.00L 352.00,272.00L 352.00,400.00L 384.00,432.00L 416.00,400.00L 416.00,272.00 zM 128.00,239.999L 96.00,271.999L 96.00,400.00L 128.00,432.00L 160.00,400.00L 160.00,271.999 zM 384.00,16.00L 352.00,48.00L 352.00,176.00L 384.00,208.00L 416.00,176.00L 416.00,48.00 zM 128.00,224.00L 160.00,256.00L 352.00,256.00L 384.00,224.00L 352.00,192.00L 160.00,192.00 zM 128.00,0.00L 160.00,32.00L 352.00,32.00L 384.00,0.00L 352.00-32.00L 160.00-32.00 z" />
640
+ <glyph unicode="&#xe0e3;" d="M 390.628,320.00L 256.00,455.553l0.00-192.925 L 155.314,363.314l-22.628-22.628L 249.372,224.00L 132.686,107.313l 22.628-22.627L 256.00,185.372
641
+ l0.00-192.924 L 390.628,128.00l-96.00,96.00L 390.628,320.00z M 288.00,377.819L 345.372,320.00L 288.00,262.628L 288.00,377.819 z M 345.372,128.00L 288.00,70.181L 288.00,185.372
642
+ L 345.372,128.00z" />
643
+ <glyph unicode="&#xe0e4;" d="M 432.00,128.00c-22.58,0.00-42.96-9.369-57.506-24.415L 158.992,211.336C 159.649,215.462, 160.00,219.689, 160.00,224.00
644
+ s-0.351,8.538-1.008,12.663l 215.502,107.751C 389.04,329.369, 409.42,320.00, 432.00,320.00c 44.183,0.00, 80.00,35.817, 80.00,80.00S 476.183,480.00, 432.00,480.00
645
+ s-80.00-35.817-80.00-80.00c0.00-4.311, 0.352-8.538, 1.008-12.663L 137.506,279.585C 122.96,294.63, 102.58,304.00, 80.00,304.00c-44.183,0.00-80.00-35.818-80.00-80.00
646
+ c0.00-44.184, 35.817-80.00, 80.00-80.00c 22.58,0.00, 42.96,9.369, 57.506,24.414l 215.502-107.751C 352.352,56.538, 352.00,52.311, 352.00,48.00
647
+ c0.00-44.184, 35.817-80.00, 80.00-80.00s 80.00,35.816, 80.00,80.00C 512.00,92.182, 476.183,128.00, 432.00,128.00z" />
648
+ <glyph unicode="&#xe0e5;" d="M 192.00,224.00A64.00,64.00 4860.00 1,0 320.00,224A64.00,64.00 4860.00 1,0 192.00,224zM 256.00,352.00c 35.346,0.00, 67.346-14.327, 90.51-37.49l 45.255,45.255C 357.02,394.51, 309.02,416.00, 256.00,416.00
649
+ c-83.596,0.00-154.70-53.431-181.06-128.00L0.00,288.00 l0.00-64.00 l 128.00,0.00 C 128.00,294.692, 185.308,352.00, 256.00,352.00zM 384.00,224.00c0.00-70.692-57.308-128.00-128.00-128.00c-35.346,0.00-67.346,14.327-90.51,37.49l-45.255-45.255
650
+ C 154.981,53.49, 202.981,32.00, 256.00,32.00c 83.596,0.00, 154.70,53.431, 181.06,128.00L 512.00,160.00 l0.00,64.00 L 384.00,224.00 z" />
651
+ <glyph unicode="&#xe0e6;" d="M 426.655,480.00L 85.345,480.00 C 38.405,480.00,0.00,441.608,0.00,394.671l0.00-341.328 C0.00,6.405, 38.405-32.00, 85.345-32.00l 341.311,0.00
652
+ C 473.625-32.00, 512.00,6.405, 512.00,53.343L 512.00,394.671 C 512.00,441.608, 473.625,480.00, 426.655,480.00z M 128.00,352.00l 256.00,0.00 c 4.569,0.00, 9.002-0.981, 13.072-2.831
653
+ L 256.00,184.585L 114.928,349.17C 118.998,351.018, 123.431,352.00, 128.00,352.00z M 96.00,128.00L 96.00,320.00 c0.00,0.67, 0.028,1.336, 0.07,2.00l 93.832-109.47
654
+ L 97.103,119.73C 96.381,122.399, 96.00,125.173, 96.00,128.00z M 384.00,96.00L 128.00,96.00 c-2.827,0.00-5.601,0.381-8.27,1.103l 91.059,91.059L 256.00,135.414
655
+ l 45.212,52.747l 91.058-91.059C 389.60,96.381, 386.827,96.00, 384.00,96.00z M 416.00,128.00c0.00-2.827-0.381-5.60-1.103-8.27l-92.799,92.799L 415.93,322.00
656
+ c 0.042-0.664, 0.07-1.33, 0.07-2.00L 416.00,128.00 z" />
657
+ <glyph unicode="&#xe0e7;" d="M 279.533,448.00c0.00,0.00-100.478,0.00-133.97,0.00C 85.503,448.00, 28.978,402.497, 28.978,349.789c0.00-53.863, 40.941-97.333, 102.044-97.333
658
+ c 4.249,0.00, 8.378,0.085, 12.421,0.376c-3.965-7.593-6.801-16.144-6.801-25.021c0.00-14.969, 8.052-27.105, 18.234-37.012
659
+ c-7.693,0.00-15.121-0.224-23.226-0.224C 57.259,190.576,0.00,143.196,0.00,94.065c0.00-48.389, 62.771-78.657, 137.167-78.657
660
+ c 84.812,0.00, 131.653,48.122, 131.653,96.514c0.00,38.80-11.448,62.036-46.843,87.067c-12.108,8.572-35.265,29.418-35.265,41.672
661
+ c0.00,14.36, 4.098,21.434, 25.714,38.323c 22.156,17.312, 37.836,41.651, 37.836,69.958c0.00,33.703-15.01,66.549-43.186,77.386l 42.477,0.00
662
+ L 279.533,448.00z M 232.74,120.271c 1.063-4.486, 1.642-9.103, 1.642-13.814c0.00-39.10-25.196-69.655-97.487-69.655
663
+ c-51.421,0.00-88.558,32.552-88.558,71.65c0.00,38.321, 46.063,70.222, 97.482,69.666c 12.00-0.127, 23.184-2.058, 33.335-5.345
664
+ C 207.067,153.36, 227.092,142.392, 232.74,120.271z M 150.409,266.112c-34.519,1.032-67.318,38.613-73.276,83.93
665
+ c-5.958,45.333, 17.185,80.021, 51.694,78.995c 34.505-1.037, 67.319-37.407, 73.279-82.729
666
+ C 208.059,300.978, 184.911,265.079, 150.409,266.112zM 416.00,352.00L 416.00,448.00L 384.00,448.00L 384.00,352.00L 288.00,352.00L 288.00,320.00L 384.00,320.00L 384.00,224.00L 416.00,224.00L 416.00,320.00L 512.00,320.00L 512.00,352.00 z" />
667
+ <glyph unicode="&#xe0e8;" d="M 426.756,480.00L 84.621,480.00 C 37.571,480.00,0.00,441.107,0.00,394.061l0.00-340.176 C0.00,5.674, 37.571-32.00, 84.621-32.00l 342.134,0.00
668
+ C 473.803-32.00, 512.00,5.674, 512.00,53.885L 512.00,394.061 C 512.00,441.107, 473.803,480.00, 426.756,480.00z M 352.00,464.00l0.00-80.00 l-80.00,0.00 L 272.00,464.00 L 352.00,464.00 z M 240.00,464.00l0.00-80.00 l-80.00,0.00 L 160.00,464.00 L 240.00,464.00 z
669
+ M 16.00,384.00L 16.00,394.061 C 16.00,432.625, 46.783,464.00, 84.621,464.00L 128.00,464.00 l0.00-80.00 L 16.00,384.00 z M 384.00,160.00l-96.00,0.00 l0.00-96.00 l-64.00,0.00 l0.00,96.00 l-96.00,0.00 l0.00,64.00 l 96.00,0.00 l0.00,96.00 l 64.00,0.00 l0.00-96.00 l 96.00,0.00 L 384.00,160.00 z M 496.00,384.00L 384.00,384.00 L 384.00,464.00
670
+ l 42.756,0.00 C 464.938,464.00, 496.00,432.625, 496.00,394.061L 496.00,384.00 z" />
671
+ <glyph unicode="&#xe0e9;" d="M 156.281,73.361c-13.536,4.367-28.447,6.937-44.447,7.104c-45.917,0.494-88.626-18.364-111.831-46.178L 0.003,0.00
672
+ c0.00-17.60, 14.398-32.00, 32.00-32.00l 196.562,0.00 c 0.908,5.564, 1.348,11.316, 1.348,17.216c0.00,6.267-0.767,12.396-2.188,18.361
673
+ C 220.196,32.98, 193.498,47.56, 156.281,73.361zM 186.885,304.025c-7.947,60.24-51.698,108.584-97.704,109.961c-46.013,1.365-76.87-44.741-68.926-105.00
674
+ c 7.941-60.234, 51.676-110.187, 97.699-111.56C 163.959,196.057, 194.821,243.775, 186.885,304.025zM 0.003,76.721c 26.72,12.687, 58.444,20.311, 92.94,20.311c 10.807,0.00, 20.711,0.295, 30.968,0.295
675
+ c-13.573,13.167-24.313,29.30-24.313,49.191c0.00,11.803, 3.782,23.168, 9.067,33.26c-5.391-0.385-10.895-0.498-16.563-0.498
676
+ c-37.178,0.00-68.754,12.039-92.103,31.928L 0.003,76.721L 0.003,76.721zM 512.00,352.00L 512.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00L 32.002,480.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-51.014 c 29.184,25.722, 69.693,42.209, 111.495,42.209
677
+ c 44.652,0.00, 178.622,0.00, 178.622,0.00l-39.974-28.809l-56.634,0.00 c 37.565-14.402, 57.578-58.062, 57.578-102.861
678
+ c0.00-37.624-20.905-69.977-50.444-92.984c-28.822-22.451-34.286-31.854-34.286-50.939c0.00-16.289, 30.873-44.00, 47.016-55.394
679
+ c 47.192-33.269, 62.458-64.156, 62.458-115.728c0.00-8.213-1.021-16.415-3.033-24.48L 480.00-32.00 c 17.60,0.00, 32.00,14.399, 32.00,31.999l0.00,320.00 l-96.00,0.00 L 416.00,224.00 l-32.00,0.00
680
+ l0.00,96.00 l-95.999,0.00 l0.00,32.00 L 384.00,352.00 L 384.00,448.00 l 32.00,0.00 l0.00-96.00 L 512.00,352.00 z" />
681
+ <glyph unicode="&#xe0ea;" d="M 309.159,382.463l 78.766,0.00 L 387.925,480.00 l-78.766,0.00 C 244.006,480.00, 191.00,422.579, 191.00,352.00l0.00-49.229 l-78.768,0.00 l0.00-97.847 L 191.00,204.924 L 191.00-32.00 l 98.468,0.00 L 289.468,204.924 l 98.457,0.00
682
+ l0.00,97.847 l-98.457,0.00 l0.00,50.154 C 289.468,369.829, 299.865,382.463, 309.159,382.463z" />
683
+ <glyph unicode="&#xe0eb;" d="M 426.672,480.00L 85.342,480.00 C 38.406,480.00,0.00,441.593,0.00,394.656l0.00-341.313 C0.00,6.374, 38.406-32.00, 85.342-32.00l 170.654,0.00 L 255.996,160.50 l-64.00,0.00 L 191.996,240.00 l 64.00,0.00 l0.00,40.00
684
+ c0.00,57.344, 43.063,104.001, 96.004,104.001l 64.00,0.00 l0.00-79.25 l-64.00,0.00 c-7.551,0.00-16.00-10.266-16.00-24.00L 336.00,240.00 l 80.00,0.00 l0.00-79.50 l-80.00,0.00 l0.00-192.499 l 90.672,0.00
685
+ c 46.937,0.00, 85.328,38.373, 85.328,85.344L 512.00,394.656 C 512.00,441.593, 473.609,480.00, 426.672,480.00z" />
686
+ <glyph unicode="&#xe0ec;" d="M 512.00,237.684c-18.021-3.075-44.153,0.124-58.001,5.884c 28.776,2.382, 48.259,15.461, 55.762,33.213
687
+ c-10.366-6.385-42.581-13.336-60.343-6.712c-0.888,4.181-1.849,8.155-2.826,11.752c-13.529,49.793-59.93,89.916-108.513,85.066
688
+ c 3.914,1.589, 7.892,3.065, 11.906,4.413c 5.319,1.917, 36.72,7.038, 31.784,18.108c-4.186,9.766-42.543-7.341-49.761-9.59
689
+ c 9.534,3.573, 25.303,9.737, 26.982,20.714c-14.602-2.003-28.938-8.917-40.013-18.968c 4.005,4.304, 7.037,9.553, 7.678,15.209
690
+ c-38.962-24.923-61.724-75.125-80.128-123.863c-14.457,14.041-27.306,25.088-38.789,31.243
691
+ c-32.25,17.288-70.825,35.354-131.355,57.859c-1.86-20.048, 9.901-46.725, 43.77-64.437c-7.332,0.991-20.751-1.23-31.467-3.779
692
+ c 4.363-22.99, 18.642-41.913, 57.325-51.052c-17.674-1.163-26.824-5.213-35.092-13.867c 8.048-15.981, 27.715-34.778, 63.026-30.913
693
+ c-39.299-16.963-16.025-48.363, 15.959-43.675C 135.374,97.884, 49.38,102.064,0.00,149.206
694
+ c 128.911-175.847, 409.165-103.979, 450.908,65.389C 482.226,214.341, 500.595,225.436, 512.00,237.684z" />
695
+ <glyph unicode="&#xe0ed;" d="M 426.671,480.00L 85.343,480.00 C 38.406,480.00,0.00,441.595,0.00,394.655l0.00-341.311 C0.00,6.375, 38.406-32.00, 85.343-32.00l 341.328,0.00
696
+ C 473.609-32.00, 512.00,6.375, 512.00,53.345L 512.00,394.655 C 512.00,441.595, 473.609,480.00, 426.671,480.00z M 402.181,216.946
697
+ C 370.874,89.92, 160.683,36.02, 64.00,167.904c 37.035-35.355, 101.53-38.491, 142.428,3.813c-23.988-3.517-41.443,20.033-11.97,32.756
698
+ c-26.482-2.899-41.233,11.199-47.269,23.185c 6.201,6.491, 13.063,9.528, 26.319,10.40c-29.012,6.854-39.722,21.046-42.994,38.289
699
+ c 8.036,1.911, 18.101,3.577, 23.60,2.834c-25.401,13.284-34.222,33.292-32.827,48.328c 45.398-16.879, 74.33-30.429, 98.517-43.395
700
+ c 8.612-4.616, 18.249-12.901, 29.091-23.432c 13.805,36.553, 30.875,74.205, 60.097,92.897c-0.48-4.243-2.754-8.179-5.759-11.407
701
+ c 8.308,7.538, 19.059,12.724, 30.01,14.226c-1.26-8.233-13.086-12.855-20.236-15.536c 5.413,1.687, 34.181,14.518, 37.32,7.193
702
+ c 3.701-8.303-19.849-12.144-23.838-13.582c-3.011-1.011-5.994-2.118-8.931-3.31c 36.438,3.637, 71.238-26.455, 81.385-63.80
703
+ c 0.734-2.697, 1.454-5.678, 2.12-8.814c 13.321-4.967, 37.482,0.246, 45.258,5.035c-5.628-13.314-20.24-23.124-41.822-24.91
704
+ c 10.386-4.321, 29.985-6.719, 43.501-4.413C 439.447,225.077, 425.669,216.756, 402.181,216.946z" />
705
+ <glyph unicode="&#xe0ee;" d="M 412.149,95.625L 271.362,95.625 c-41.494,0.00-80.083,43.219-80.083,92.439l0.00,35.713 l 219.24,0.00 c 35.479,0.00, 64.232,28.671, 64.232,64.038
706
+ c0.00,35.382-28.756,64.061-64.232,64.061l-219.24,0.00 L 191.279,415.14 c0.00,35.81-26.826,64.86-62.312,64.86C 93.512,480.00, 64.756,450.95, 64.756,415.14
707
+ l0.00-227.078 C 64.756,66.447, 156.189-32.00, 269.225-32.00l 140.77,0.00 c 35.479,0.00, 64.758,28.553, 64.758,64.361
708
+ C 474.75,68.197, 447.625,95.625, 412.149,95.625z" />
709
+ <glyph unicode="&#xe0ef;" d="M 426.671,480.00L 85.343,480.00 C 38.406,480.00,0.00,441.595,0.00,394.655l0.00-341.311 C0.00,6.375, 38.406-32.00, 85.343-32.00l 341.328,0.00
710
+ C 473.609-32.00, 512.00,6.375, 512.00,53.345L 512.00,394.655 C 512.00,441.595, 473.609,480.00, 426.671,480.00z M 257.00,144.00l 87.903,0.00
711
+ c 22.155,0.00, 39.094-17.124, 39.094-39.499c0.00-22.36-18.279-40.188-40.438-40.188l-87.89,0.00 c-70.577,0.00-127.67,61.47-127.67,137.403L 127.999,343.501
712
+ c0.00,22.359, 17.952,40.50, 40.094,40.50c 22.156,0.00, 38.907-18.141, 38.907-40.50L 207.00,304.00 L 343.89,304.00 c 22.156,0.00, 40.107-17.907, 40.107-39.999
713
+ c0.00-22.079-17.951-39.985-40.107-39.985L 207.001,224.016 l0.00-22.297 C 207.001,170.982, 231.094,144.00, 257.00,144.00z" />
714
+ <glyph unicode="&#xe0f0;" d="M 68.147,104.535c-37.598,0.00-68.146-30.667-68.146-68.038c0.00-37.577, 30.55-67.901, 68.146-67.901
715
+ c 37.733,0.00, 68.247,30.324, 68.247,67.901C 136.393,73.868, 105.882,104.535, 68.147,104.535zM 0.078,306.035l0.00-98.129 c 63.892,0.00, 123.979-24.986, 169.229-70.256c 45.192-45.159, 70.141-105.518, 70.141-169.65l 98.561,0.00
716
+ C 338.008,154.41, 186.368,306.035, 0.078,306.035zM 0.194,480.00l0.00-98.178 c 227.891,0.00, 413.378-185.667, 413.378-413.822L 512.00-32.00 C 512.00,250.235, 282.373,480.00, 0.194,480.00z" />
717
+ <glyph unicode="&#xe0f1;" d="M 426.67,480.00L 85.343,480.00 C 38.405,480.00,0.00,441.594,0.00,394.656l0.00-341.314 C0.00,6.375, 38.406-32.00, 85.344-32.00L 426.67-32.00
718
+ c 46.938,0.00, 85.33,38.374, 85.33,85.342L 512.00,394.656 C 512.00,441.594, 473.608,480.00, 426.67,480.00z M 139.472,64.376C 115.487,64.376, 96.00,83.722, 96.00,107.69
719
+ c0.00,23.842, 19.486,43.406, 43.472,43.406c 24.079,0.00, 43.53-19.564, 43.53-43.406C 183.001,83.722, 163.55,64.376, 139.472,64.376z
720
+ M 248.734,64.002c0.00,40.905-15.904,79.409-44.73,108.222c-28.857,28.875-67.188,44.813-107.952,44.813L 96.052,279.63
721
+ c 118.826,0.00, 215.563-96.721, 215.563-215.627L 248.734,64.002L 248.734,64.002z M 359.814,64.002
722
+ c0.00,145.531-118.329,263.97-263.688,263.97L 96.126,390.596 c 180.001,0.00, 326.473-146.562, 326.473-326.596L 359.814,64.002L 359.814,64.002z" />
723
+ <glyph unicode="&#xe0f2;" d="M 416.00,416.00L 96.00,416.00 c-52.80,0.00-96.00-43.20-96.00-96.00l0.00-192.00 c0.00-52.80, 43.20-96.00, 96.00-96.00l 320.00,0.00 c 52.80,0.00, 96.00,43.20, 96.00,96.00L 512.00,320.00 C 512.00,372.80, 468.80,416.00, 416.00,416.00z
724
+ M 192.00,96.00L 192.00,352.00 l 160.00-128.00L 192.00,96.00z" />
725
+ <glyph unicode="&#xe0f3;" d="M 416.00,416.00L 96.00,416.00 c-52.80,0.00-96.00-43.20-96.00-96.00l0.00-192.00 c0.00-52.80, 43.20-96.00, 96.00-96.00l 320.00,0.00 c 52.80,0.00, 96.00,43.20, 96.00,96.00L 512.00,320.00 C 512.00,372.80, 468.80,416.00, 416.00,416.00z
726
+ M 480.00,128.00c0.00-16.989-6.687-33.031-18.827-45.173C 449.031,70.687, 432.99,64.00, 416.00,64.00L 96.00,64.00 c-16.989,0.00-33.031,6.687-45.172,18.827
727
+ C 38.687,94.969, 32.00,111.011, 32.00,128.00L 32.00,320.00 c0.00,16.989, 6.687,33.031, 18.828,45.172S 79.011,384.00, 96.00,384.00l 320.00,0.00
728
+ c 16.989,0.00, 33.031-6.687, 45.173-18.828C 473.314,353.031, 480.00,336.989, 480.00,320.00L 480.00,128.00 zM 192.00,96.00L 352.00,224.00L 192.00,352.00 z" />
729
+ <glyph unicode="&#xe0f4;" d="M0.00,325.815l 20.797-27.272c0.00,0.00, 42.885,33.804, 57.18,16.901c 14.294-16.901, 68.868-220.978, 87.085-258.623
730
+ c 15.90-33.015, 59.759-76.66, 107.857-45.491c 48.068,31.17, 207.92,167.643, 236.533,328.808
731
+ c 28.59,161.113-192.36,127.363-215.765-13.005c 58.495,35.118, 89.718-14.269, 59.785-70.186
732
+ c-29.879-55.862-57.18-92.296-71.476-92.296c-14.269,0.00-25.245,37.384-41.594,102.723c-16.899,67.551-16.796,189.23-87.058,175.435
733
+ C 87.085,429.803,0.00,325.815,0.00,325.815z" />
734
+ <glyph unicode="&#xe0f5;" d="M 426.655,480.00L 85.345,480.00 C 38.406,480.00,0.00,441.592,0.00,394.654l0.00-341.31 C0.00,6.375, 38.406-32.00, 85.345-32.00l 341.31,0.00
735
+ C 473.594-32.00, 512.00,6.375, 512.00,53.345L 512.00,394.654 C 512.00,441.592, 473.594,480.00, 426.655,480.00z M 406.434,292.937
736
+ c-16.979-95.648-111.854-176.648-140.39-195.155c-28.544-18.503-54.577,7.411-64.019,26.997
737
+ c-10.808,22.354-43.205,143.47-51.684,153.51c-8.482,10.019-33.938-10.04-33.938-10.04l-12.346,16.188
738
+ c0.00,0.00, 51.691,61.724, 91.02,69.439c 41.702,8.183, 41.64-64.033, 51.67-104.121c 9.70-38.782, 16.22-60.976, 24.688-60.976
739
+ c 8.486,0.00, 24.692,21.631, 42.426,54.786c 17.768,33.188-0.768,62.505-35.486,41.646C 292.267,368.536, 423.406,388.57, 406.434,292.937z" />
740
+ <glyph unicode="&#xe0f6;" d="M0.00,224.00A112.00,112.00 4860.00 1,0 224.00,224A112.00,112.00 4860.00 1,0 0.00,224zM 288.00,224.00A112.00,112.00 4860.00 1,0 512.00,224A112.00,112.00 4860.00 1,0 288.00,224z" />
741
+ <glyph unicode="&#xe0f7;" d="M 426.687,480.00L 85.344,480.00 C 38.406,480.00,0.00,441.594,0.00,394.659l0.00-341.313 C0.00,6.375, 38.406-32.00, 85.344-32.00l 341.342,0.00
742
+ C 473.622-32.00, 512.00,6.377, 512.00,53.348L 512.00,394.659 C 512.00,441.594, 473.622,480.00, 426.687,480.00z M 160.00,144.00c-44.183,0.00-80.00,35.816-80.00,80.00
743
+ c0.00,44.183, 35.817,80.00, 80.00,80.00s 80.00-35.817, 80.00-80.00C 240.00,179.816, 204.183,144.00, 160.00,144.00z M 352.00,144.00c-44.182,0.00-80.00,35.816-80.00,80.00
744
+ c0.00,44.183, 35.818,80.00, 80.00,80.00c 44.184,0.00, 80.00-35.817, 80.00-80.00C 432.00,179.816, 396.184,144.00, 352.00,144.00z" />
745
+ <glyph unicode="&#xe0f8;" d="M 361.51,457.045C 328.055,472.176, 292.647,480.00, 255.961,480.00c-30.521,0.00-60.527-5.865-89.381-16.779l 194.93-176.84L 361.51,457.045 zM 124.222,5.364L 124.222,225.441 L 18.468,129.299C 38.963,77.934, 76.409,34.285, 124.222,5.364zM 139.312,451.59C 53.362,407.432, 0.001,320.553, 0.001,224.00c0.00-22.029, 3.313-44.368, 9.294-66.499l 226.91,206.181L 139.312,451.59zM 151.109-9.355C 184.386-24.385, 219.612-32.00, 255.961-32.00c 97.624,0.00, 187.28,56.817, 229.895,144.727L 151.109,112.727 L 151.109-9.355 zM 388.479,442.325l0.00-302.63 l 108.904,0.00 c 9.57,27.277, 14.617,55.586, 14.617,84.304C 512.002,312.937, 464.651,396.004, 388.479,442.325z" />
746
+ <glyph unicode="&#xe0f9;" d="M 512.00,394.659C 512.00,441.791, 473.793,480.00, 426.66,480.00L 85.338,480.00 C 38.207,480.00,0.00,441.791,0.00,394.659l0.00-341.318 C0.00,6.208, 38.207-32.00, 85.338-32.00
747
+ l 341.323,0.00 C 473.793-32.00, 512.00,6.208, 512.00,53.341L 512.00,394.659 z M 255.877,400.865c 25.346,0.00, 49.785-5.406, 72.825-15.859l0.00-117.908 L 194.078,389.271
748
+ C 214.012,396.812, 234.79,400.865, 255.877,400.865z M 79.134,224.00c0.00,66.707, 36.867,126.73, 96.249,157.236l 66.939-60.732L 85.556,178.057
749
+ C 81.424,193.348, 79.134,208.779, 79.134,224.00z M 164.864,72.949c-32.768,19.979-58.905,50.138-73.063,85.623l 73.063,66.423L 164.864,72.949 z
750
+ M 255.854,47.174c-25.11,0.00-49.518,5.226-72.558,15.605L 183.296,147.20 l 231.507,0.00 C 385.361,86.271, 323.30,47.174, 255.854,47.174z
751
+ M 422.767,165.632l-75.118,0.00 L 347.649,374.836 c 52.735-32.002, 85.278-89.452, 85.278-150.898C 432.927,204.096, 429.382,184.576, 422.767,165.632z" />
752
+ <glyph unicode="&#xe0fa;" d="M 256.00-32.00C 114.614-32.00,0.00,82.609,0.00,223.99C0.00,365.37, 114.615,480.00, 256.00,480.00c 141.375,0.00, 256.00-114.631, 256.00-256.01S 397.375-32.00, 256.00-32.00z
753
+ M 465.581,197.137c-50.24,6.594-94.794,7.071-134.495,0.938c 16.435-46.862, 30.188-97.346, 41.018-150.532
754
+ C 422.346,80.675, 457.642,134.609, 465.581,197.137z M 331.781,26.927c-10.141,59.365-24.095,112.72-42.061,161.953
755
+ c-67.229-20.177-119.50-63.339-163.374-131.501c 35.816-27.915, 80.724-44.679, 129.641-44.679
756
+ C 282.74,12.70, 308.221,17.858, 331.781,26.927z M 44.687,223.99c0.00-52.272, 19.091-100.029, 50.543-136.932
757
+ c 53.639,78.629, 114.009,119.584, 179.935,138.636c-5.431,12.771-11.058,25.377-17.11,37.648
758
+ c-58.881-17.743-128.601-27.041-212.938-30.931C 45.00,229.606, 44.687,226.839, 44.687,223.99z M 49.46,268.461
759
+ c 66.551,2.933, 131.525,10.337, 191.075,28.33c-22.678,40.52-49.305,78.583-79.691,115.691
760
+ C 104.744,384.111, 62.996,331.59, 49.46,268.461z M 255.99,435.30c-18.52,0.00-36.382-2.62-53.505-7.093
761
+ c 29.358-32.323, 56.089-71.637, 79.734-116.73c 41.102,16.973, 78.827,40.332, 111.747,72.344C 356.941,415.811, 308.782,435.30, 255.99,435.30z
762
+ M 419.551,357.736c-34.483-34.944-73.847-60.965-120.584-80.061c 6.377-13.77, 12.399-28.102, 18.227-42.724
763
+ c 47.438,7.343, 97.428,5.721, 149.608,0.374C 464.343,281.648, 447.138,324.04, 419.551,357.736z" />
764
+ <glyph unicode="&#xe0fb;" d="M 152.278,90.703c 28.653-22.332, 64.579-35.743, 103.712-35.743c 21.402,0.00, 41.787,4.127, 60.635,11.382
765
+ c-8.112,47.492-19.275,90.176-33.648,129.563C 229.194,179.763, 187.377,145.232, 152.278,90.703zM 271.331,225.356c-4.345,10.217-8.846,20.301-13.688,30.118c-47.104-14.194-102.88-21.633-170.351-24.745
766
+ c-0.092-2.245-0.343-4.458-0.343-6.737c0.00-41.818, 15.272-80.023, 40.435-109.545C 170.295,177.35, 218.591,210.114, 271.331,225.356zM 366.373,351.856c-29.621,25.592-68.147,41.184-110.381,41.184c-14.815,0.00-29.105-2.096-42.804-5.674
767
+ c 23.486-25.859, 44.871-57.31, 63.787-93.384C 309.858,307.56, 340.037,326.247, 366.373,351.856zM 179.875,374.786c-44.88-22.697-78.278-64.714-89.107-115.217c 53.241,2.346, 105.22,8.27, 152.86,22.664
768
+ C 225.486,314.649, 204.185,345.099, 179.875,374.786zM 316.069,203.26c 13.148-37.49, 24.151-77.877, 32.814-120.426c 40.193,26.506, 68.431,69.653, 74.782,119.676
769
+ C 383.473,207.784, 347.83,208.166, 316.069,203.26zM 426.672,480.00L 85.343,480.00 C 38.406,480.00,0.00,441.595,0.00,394.655l0.00-341.311 C0.00,6.375, 38.406-32.00, 85.343-32.00l 341.33,0.00
770
+ C 473.612-32.00, 512.00,6.374, 512.00,53.345L 512.00,394.655 C 512.002,441.595, 473.612,480.00, 426.672,480.00z M 256.00,19.20
771
+ c-113.109,0.00-204.80,91.688-204.80,204.792C 51.20,337.096, 142.892,428.80, 256.00,428.80c 113.10,0.00, 204.80-91.705, 204.80-204.808
772
+ C 460.80,110.889, 369.10,19.20, 256.00,19.20zM 290.373,266.94c 5.102-11.016, 9.92-22.481, 14.582-34.179c 37.95,5.875, 77.941,4.577, 119.687,0.299
773
+ c-1.968,37.058-15.731,70.972-37.801,97.929C 359.254,303.034, 327.764,282.217, 290.373,266.94z" />
774
+ <glyph unicode="&#xe0fc;" d="M 217.984-32.00L 217.984,83.744L 142.464,126.432L 157.723,149.02L 217.984,116.917L 217.984,211.712L 262.528,211.712L 262.528,151.223L 315.485,175.775L 328.834,151.136L 262.528,119.426L 262.528,85.557L 359.153,130.71L 371.084,106.419L 262.528,55.155L 262.528-32.00L 463.434-32.00L 240.31,480.00L 16.567-32.00 z" />
775
+ <glyph unicode="&#xe0fd;" d="M 512.00,394.658C 512.00,441.791, 473.804,480.00, 426.688,480.00L 85.313,480.00 C 38.196,480.00,0.00,441.791,0.00,394.658l0.00-341.316 C0.00,6.209, 38.196-32.00, 85.313-32.00
776
+ l 341.375,0.00 C 473.804-32.00, 512.00,6.209, 512.00,53.342L 512.00,394.658 z M 414.05,44.288L 272.384,44.288 l0.00,60.739 l 76.841,36.324l-8.453,17.234l-68.388-32.023
777
+ l0.00,24.023 l 46.889,22.48l-9.458,17.48l-37.431-17.42l0.00,42.678 L 240.64,215.803 l0.00-66.998 l-42.799,22.741l-10.763-15.996l 53.562-30.262l0.00-81.006
778
+ L 98.168,44.282 L 256.332,406.221L 414.05,44.288z" />
779
+ <glyph unicode="&#xe0fe;" d="M 280.928,276.50c-19.521,1.141-42.041-0.024-68.125-4.475l 60.167-108.444L 512.00,229.214
780
+ c-2.577,6.13-6.343,12.113-11.331,17.899c-24.737,28.639-78.37,54.187-136.802,65.709l 0.001,0.013
781
+ c-57.322,13.437-119.401,12.872-182.98,3.274c-2.292-0.344-4.572-0.711-6.84-1.092l-21.136,39.146
782
+ c-20.571-2.746-39.904-7.025-57.803-12.737l 20.13-42.099c-32.88-12.738-59.861-30.88-79.329-52.716
783
+ C 3.804,210.079-8.885,164.157, 6.537,119.435c 3.102-9.021, 7.294-17.58, 12.468-25.598l 239.034,65.649l-66.375,122.924
784
+ c 2.279,0.44, 4.598,0.884, 6.964,1.312c 107.341,19.149, 166.051-10.432, 198.208-41.915l-81.779-19.824L 280.928,276.50z M 87.361,166.805
785
+ c-7.379,33.676-1.506,71.263, 45.202,96.297l 36.569-76.474L 87.361,166.805z" />
786
+ <glyph unicode="&#xe0ff;" d="M 117.552,177.044l 67.131,16.274l-30.021,62.783C 116.316,235.549, 111.494,204.691, 117.552,177.044zM 426.678,480.00L 85.322,480.00 C 38.20,480.00,0.00,441.791,0.00,394.659l0.00-341.318 C0.00,6.208, 38.20-32.00, 85.322-32.00l 341.356,0.00
787
+ C 473.80-32.00, 512.00,6.208, 512.00,53.341L 512.00,394.659 C 512.00,441.791, 473.80,480.00, 426.678,480.00z M 269.932,174.398l-49.396,89.029
788
+ c 21.415,3.654, 39.902,4.611, 55.929,3.674l 28.02-44.756l 67.138,16.275c-26.40,25.846-74.60,50.131-162.723,34.41
789
+ c-1.943-0.351-3.846-0.715-5.717-1.077l 54.492-100.917L 61.434,117.14c-4.248,6.582-7.689,13.609-10.236,21.016
790
+ c-12.661,36.716-2.244,74.416, 24.115,104.408c 15.982,17.926, 38.133,32.82, 65.126,43.278l-16.526,34.563
791
+ c 14.695,4.689, 30.567,8.203, 47.455,10.457l 17.352-32.138c 1.861,0.313, 3.733,0.614, 5.615,0.896
792
+ c 52.196,7.88, 103.162,8.343, 150.221-2.688l-0.001-0.011c 47.971-9.46, 92.002-30.434, 112.311-53.945
793
+ c 4.095-4.75, 7.187-9.662, 9.303-14.695L 269.932,174.398z" />
794
+ <glyph unicode="&#xe100;" d="M 424.598,402.047c 3.946,12.739, 9.222,41.029-5.26,77.244c0.00,0.00-25.548,8.113-83.339-30.565
795
+ c-22.645,5.656-46.731,8.453-70.859,8.453c-26.547,0.00-53.372-3.383-78.393-10.244c-59.63,40.683-85.956,32.348-85.956,32.348
796
+ C 83.604,436.31, 94.228,404.492, 97.46,396.589c-20.196-21.797-32.528-49.623-32.528-83.738c0.00-25.757, 2.933-48.86, 10.097-68.943
797
+ l 7.532-17.061c 20.129-37.527, 59.824-61.766, 130.437-69.377c-10.022-6.729-20.245-18.18-24.389-37.556
798
+ c-13.66-6.533-56.891-22.479-82.833,22.14c0.00,0.00-14.521,26.551-42.312,28.627c0.00,0.00-26.96,0.414-1.863-16.801
799
+ c0.00,0.00, 18.04-8.501, 30.488-40.443c0.00,0.00, 16.236-54.492, 94.59-37.008l0.00-56.28 c0.00,0.00-1.655-19.907-19.906-26.54
800
+ c0.00,0.00-10.781-7.473, 0.835-11.609c0.00,0.00, 50.589-4.149, 50.589,37.318l0.00,61.371 c0.00,0.00-2.007,24.338, 9.952,32.802l0.00-100.806
801
+ c0.00,0.00-0.827-24.056-13.267-33.176c0.00,0.00-8.301-14.923, 9.947-10.785c0.00,0.00, 34.833,4.979, 36.493,45.615l 0.789,102.014l 8.373,0.00
802
+ l 0.796-102.014c 1.658-40.636, 36.491-45.615, 36.491-45.615c 18.24-4.138, 9.949,10.785, 9.949,10.785
803
+ c-12.441,9.125-13.268,33.176-13.268,33.176L 304.452,112.62 c 11.948-9.312, 9.949-31.933, 9.949-31.933l0.00-61.369
804
+ c0.00-41.471, 50.592-37.316, 50.592-37.316c 11.605,4.139, 0.832,11.604, 0.832,11.604c-18.249,6.634-19.905,26.542-19.905,26.542
805
+ l0.00,80.442 c0.00,31.371-13.209,47.989-26.131,56.755c 75.307,7.469, 111.444,31.782, 128.094,69.564l 5.946,16.865
806
+ c 5.583,20.118, 7.262,43.271, 7.262,69.088C 461.092,349.886, 447.181,379.507, 424.598,402.047z M 264.535,171.357
807
+ c-82.092,0.00-148.627,12.355-148.627,91.684c0.00,18.991, 9.354,36.625, 25.371,51.259c 26.725,24.389, 71.947,11.475, 123.253,11.475
808
+ c 51.078,0.008, 96.148,13.053, 122.906-11.168l 0.01-0.008c 16.219-14.696, 25.706-32.441, 25.706-51.559
809
+ C 413.156,173.771, 346.615,171.357, 264.535,171.357zM 184.177,303.006c-17.079,0.00-30.924-19.924-30.924-44.506c0.00-24.589, 13.846-44.52, 30.924-44.52s 30.922,19.931, 30.922,44.52
810
+ C 215.099,283.082, 201.254,302.988, 184.177,303.006zM 350.095,303.006c-17.078,0.00-30.921-19.924-30.921-44.506c0.00-24.589, 13.843-44.52, 30.921-44.52
811
+ c 17.079,0.00, 30.922,19.931, 30.922,44.52C 381.018,283.082, 367.175,302.988, 350.095,303.006z" />
812
+ <glyph unicode="&#xe101;" d="M 117.639,355.64c-25.396,0.00-47.242-8.403-65.542-25.208c-19.043-17.926-28.57-40.33-28.57-67.218
813
+ c0.00-17.926, 5.188-34.731, 15.647-50.416c 9.337-14.563, 19.09-23.903, 31.889-28.012l0.00-1.121 c-12.799-5.224-18.483-18.295-18.483-39.209
814
+ c0.00-16.062, 5.686-28.011, 18.483-35.854l0.00-1.121 c-35.327-11.573-51.496-33.047-51.496-64.415c0.00-27.267, 11.874-47.244, 35.033-59.939
815
+ C 72.895-26.959, 96.389-32.00, 124.773-32.00c 69.085,0.00, 103.703,28.941, 103.703,86.832c0.00,36.223-26.661,58.441-80.064,66.658
816
+ c-12.323,1.863-21.643,6.348-27.991,13.445c-4.854,4.854-7.271,9.709-7.271,14.563c0.00,13.816, 7.479,21.848, 22.41,24.088
817
+ c 22.779,3.357, 41.364,13.912, 55.743,31.648c 14.375,17.74, 21.565,38.559, 21.565,62.458c0.00,7.469-2.259,15.498-5.244,24.086
818
+ c 9.709,2.244, 16.525,4.297, 21.646,6.166L 229.27,355.64 c-22.527-8.964-43.495-13.442-61.421-13.442
819
+ C 152.162,351.159, 135.937,355.64, 117.639,355.64z M 123.801,76.115c 31.372,0.00, 47.052-9.521, 47.052-28.57
820
+ c0.00-20.168-14.377-30.246-43.132-30.246c-32.862,0.00-49.293,9.711-49.293,29.127C 78.427,66.221, 93.55,76.115, 123.801,76.115z
821
+ M 119.88,224.00c-23.527,0.00-35.293,12.882-35.293,38.654c0.00,27.631, 11.766,41.453, 35.293,41.453c 11.201,0.00, 19.979-4.298, 26.326-12.884
822
+ c 5.229-7.845, 7.845-17.18, 7.845-28.011C 154.051,237.073, 142.658,224.00, 119.88,224.00zM 290.192,480.00c-10.828,0.00-20.07-4.107-27.727-12.324c-7.657-8.218-11.485-18.108-11.485-29.688
823
+ c0.00-11.205, 3.829-20.91, 11.485-29.129c 7.654-8.217, 16.896-12.32, 27.727-12.32c 10.455,0.00, 19.514,4.104, 27.17,12.32
824
+ c 7.656,8.219, 11.48,17.924, 11.48,29.129c0.00,11.58-3.824,21.472-11.48,29.688C 309.703,475.893, 300.647,480.00, 290.192,480.00zM 321.565,352.001l-63.303,0.00 c 0.748-7.168-0.32-18.021-0.32-35.57l0.00-174.216 c0.00-17.928, 1.068-32.387, 0.32-38.018l 63.303,0.00
825
+ c-0.75,8.188-2.697,22.334-2.697,41.379L 318.868,317.549 C 318.865,333.981, 320.815,344.833, 321.565,352.001zM 461.168,157.90c-16.436,0.00-24.541,12.514-24.541,37.533l0.00,103.32 l 24.932,0.00 c 4.48,0.00, 8.516,0.246, 13.559-0.123
826
+ c 5.043-0.374, 7.076-0.125, 9.639-0.125l0.00,53.495 l-48.129,0.00 l0.00,23.808 c0.00,8.961, 1.408,17.151, 2.527,22.271l-64.979,0.00
827
+ c 1.121-5.12, 1.014-12.938, 1.014-23.395L 375.19,352.00 l-28.16,0.00 l0.00-53.494 c 7.682,1.12, 14.545,1.678, 19.398,1.678l 8.762-0.559l0.00-0.292 l0.00,0.00l0.00-101.101
828
+ c0.00-31.371, 3.979-54.336, 11.818-68.90c 10.461-19.42, 28.811-29.129, 56.068-29.129c 19.424,0.00, 36.559,3.732, 49.357,11.205l0.00,56.016
829
+ C 482.196,161.074, 472.742,157.90, 461.168,157.90z" />
830
+ <glyph unicode="&#xe102;" d="M 131.736,100.316c0.00-13.526, 11.447-20.291, 34.334-20.291c 20.032,0.00, 30.044,7.021, 30.044,21.067
831
+ c0.00,13.269-10.923,19.898-32.772,19.898C 142.269,120.992, 131.736,114.102, 131.736,100.316zM 426.674,480.00L 85.344,480.00 C 38.406,480.00,0.00,441.595,0.00,394.656l0.00-341.313 C0.00,6.375, 38.406-32.00, 85.344-32.00l 341.33,0.00
832
+ C 473.608-32.00, 512.00,6.375, 512.00,53.344L 512.00,394.656 C 512.00,441.595, 473.609,480.00, 426.674,480.00z M 237.864,275.506
833
+ c-3.642-1.302-8.844-2.729-15.606-4.293c 2.08-5.983, 3.123-11.576, 3.123-16.777c0.00-16.646-5.009-31.149-15.022-43.506
834
+ c-10.015-12.354-22.956-19.703-38.823-22.043c-10.402-1.563-15.604-7.156-15.604-16.779c0.00-3.381, 1.689-6.765, 5.072-10.145
835
+ c 4.422-4.943, 10.924-8.066, 19.509-9.367c 37.195-5.721, 55.793-21.197, 55.793-46.427c0.00-40.321-24.062-60.481-72.181-60.481
836
+ c-19.771,0.00-36.028,3.513-48.772,10.535c-16.129,8.844-24.188,22.76-24.188,41.75c0.00,21.852, 12.096,36.808, 36.282,44.869l0.00,0.78
837
+ c-8.842,5.462-13.263,13.785-13.263,24.972c0.00,14.566, 4.162,23.672, 12.484,27.311l0.00,0.781 c-8.323,2.862-15.737,9.366-22.24,19.512
838
+ c-7.282,10.926-10.925,22.63-10.925,35.115c0.00,18.729, 6.635,34.335, 19.896,46.82c 12.748,11.707, 27.964,17.558, 45.653,17.558
839
+ c 12.747,0.00, 24.579-3.119, 35.505-9.361c 12.485,0.00, 26.921,3.12, 43.313,9.361L 237.864,275.506L 237.864,275.506z M 301.089,140.503
840
+ l-44.093,0.00 c 0.521,5.201, 0.779,14.042, 0.779,26.532L 257.775,288.381 c0.00,12.227-0.261,20.682-0.779,25.359l 44.093,0.00
841
+ c-0.521-4.942-0.781-13.135-0.781-24.582l0.00-119.782 C 300.308,156.109, 300.569,146.484, 301.089,140.503z M 298.159,352.759
842
+ c-5.332-5.722-11.641-8.581-18.923-8.581c-7.543,0.00-13.979,2.859-19.313,8.581c-5.333,5.726-8.001,12.486-8.001,20.289
843
+ c0.00,8.067, 2.668,14.956, 8.001,20.683c 5.333,5.721, 11.77,8.584, 19.313,8.584c 7.282,0.00, 13.592-2.863, 18.923-8.584
844
+ c 5.333-5.728, 7.999-12.615, 7.999-20.683C 306.158,365.245, 303.492,358.484, 298.159,352.759z M 420.845,145.576
845
+ c-9.627-5.205-21.203-7.803-34.729-7.803c-18.985,0.00-32.124,6.76-39.405,20.287c-5.465,10.145-8.193,26.14-8.193,47.99l0.00,69.842
846
+ l 0.389,0.00 l0.00,0.781 l-5.853,0.391c-3.382,0.00-7.806-0.391-13.267-1.171L 319.787,313.74 l 19.117,0.00 l0.00,15.216 c0.00,7.285-0.389,13.14-1.17,17.56l 45.259,0.00
847
+ c-0.775-4.94-1.168-10.533-1.168-16.776l0.00-15.999 l 33.943,0.00 l0.00-37.846 c-1.299,0.00-3.705,0.129-7.218,0.389
848
+ c-3.512,0.261-6.828,0.393-9.949,0.393l-16.777,0.00 l0.00-72.572 c0.00-17.432, 5.725-26.145, 17.167-26.145c 8.063,0.00, 15.348,2.209, 21.854,6.632
849
+ L 420.845,145.576 L 420.845,145.576zM 160.608,279.797c-16.388,0.00-24.582-9.627-24.582-28.873c0.00-17.951, 8.194-26.924, 24.582-26.924
850
+ c 15.868,0.00, 23.801,9.104, 23.801,27.313c0.00,7.545-1.82,14.047-5.461,19.511C 174.525,276.805, 168.411,279.797, 160.608,279.797z" />
851
+ <glyph unicode="&#xe103;" d="M 192.00,160.00c0.00,18.718, 1.099,19.844, 13.203,31.948L 352.00,338.746c 29.157,29.157, 31.843,44.204, 31.992,74.019L 384.00,412.765 L 384.00,480.00 l-64.00,0.00 l0.00-64.00
852
+ c0.00-18.718-1.099-19.843-13.202-31.948L 160.00,237.255c-29.156-29.157-31.842-44.204-31.991-74.019L 128.00,163.236 L 128.00,96.00 L 80.00,96.00 l 80.00-128.00l 79.282,128.00L 192.00,96.00
853
+ L 192.00,160.00 zM 384.00,96.00l0.00,67.236 l-0.008,0.00 c-0.149,29.813-2.835,44.861-31.992,74.019l-17.15,17.151l-45.255-45.253l 17.203-17.203
854
+ C 318.902,179.845, 320.00,178.719, 320.00,160.001l0.00-64.00 l-47.281,0.00 l 79.281-128.00l 80.00,128.00L 384.00,96.00L 384.00,96.00z" />
855
+ <glyph unicode="&#xe104;" d="M 64.00,224.004c0.00-74.013, 44.161-137.984, 108.215-168.289L 80.626,300.107C 69.972,276.853, 64.00,251.116, 64.00,224.004zM 385.614,233.436c0.00,23.117-8.527,39.118-15.827,51.571c-9.729,15.41-18.86,28.447-18.86,43.858
856
+ c0.00,17.187, 13.383,33.188, 32.243,33.188c 0.852,0.00, 1.66-0.102, 2.488-0.151C 351.50,392.387, 305.988,411.00, 256.004,411.00
857
+ c-67.08,0.00-126.093-33.523-160.422-84.284c 4.505-0.141, 8.753-0.227, 12.356-0.227c 20.077,0.00, 51.17,2.376, 51.17,2.376
858
+ c 10.345,0.591, 11.566-14.217, 1.229-15.411c0.00,0.00-10.405-1.184-21.976-1.775l 69.917-202.553l 42.022,122.728l-29.911,79.825
859
+ c-10.344,0.592-20.139,1.775-20.139,1.775c-10.351,0.596-9.136,16.001, 1.219,15.411c0.00,0.00, 31.70-2.376, 50.567-2.376
860
+ c 20.073,0.00, 51.175,2.376, 51.175,2.376c 10.351,0.591, 11.57-14.217, 1.223-15.411c0.00,0.00-10.417-1.186-21.974-1.775L 351.85,110.67
861
+ l 19.156,62.316C 379.296,198.861, 385.614,217.436, 385.614,233.436zM 259.371,207.648l-57.613-163.029c 17.208-4.929, 35.397-7.619, 54.244-7.619c 22.358,0.00, 43.802,3.759, 63.759,10.60
862
+ c-0.509,0.801-0.987,1.652-1.375,2.577L 259.371,207.648zM 424.481,313.714c 0.826-5.955, 1.294-12.343, 1.294-19.229c0.00-18.965-3.646-40.298-14.601-66.975l-58.643-165.136
863
+ C 409.612,94.788, 448.00,155.018, 448.00,224.003C 448.00,256.518, 439.47,287.083, 424.481,313.714zM 256.00,480.00C 114.615,480.00,0.00,365.385,0.00,224.00s 114.615-256.00, 256.00-256.00s 256.00,114.615, 256.00,256.00S 397.385,480.00, 256.00,480.00z M 256.00,0.00
864
+ C 132.288,0.00, 32.00,100.288, 32.00,224.00S 132.288,448.00, 256.00,448.00s 224.00-100.288, 224.00-224.00S 379.712,0.00, 256.00,0.00z" />
865
+ <glyph unicode="&#xe105;" d="M 259.555,206.271l-60.828-176.742c 18.164-5.343, 37.372-8.262, 57.269-8.262c 23.608,0.00, 46.251,4.077, 67.321,11.492
866
+ c-0.539,0.868-1.039,1.793-1.45,2.795L 259.555,206.271zM 392.852,234.232c0.00,25.062-9.006,42.405-16.718,55.905c-10.273,16.708-19.912,30.843-19.912,47.55
867
+ c0.00,18.631, 14.13,35.979, 34.045,35.979c 0.896,0.00, 1.753-0.108, 2.624-0.165c-36.064,33.048-84.119,53.225-136.896,53.225
868
+ c-70.82,0.00-133.129-36.34-169.376-91.371c 4.757-0.153, 9.242-0.244, 13.044-0.244c 21.197,0.00, 54.028,2.576, 54.028,2.576
869
+ c 10.928,0.639, 12.213-15.416, 1.299-16.707c0.00,0.00-10.985-1.282-23.198-1.928l 73.816-219.589l 44.371,133.05l-31.584,86.541
870
+ c-10.92,0.645-21.262,1.926-21.262,1.926c-10.927,0.646-9.645,17.347, 1.288,16.707c0.00,0.00, 33.47-2.576, 53.391-2.576
871
+ c 21.199,0.00, 54.03,2.576, 54.03,2.576c 10.931,0.64, 12.218-15.414, 1.297-16.707c0.00,0.00-10.999-1.281-23.202-1.926l 73.262-217.916
872
+ l 20.229,67.559C 386.179,196.748, 392.852,216.882, 392.852,234.232zM 357.915,48.781c 60.269,35.14, 100.803,100.438, 100.803,175.227c0.00,35.246-9.005,68.381-24.831,97.254
873
+ c 0.871-6.455, 1.366-13.382, 1.366-20.847c0.00-20.564-3.854-43.688-15.416-72.609L 357.915,48.781zM 53.277,224.008c0.00-80.24, 46.624-149.592, 114.258-182.448L 70.83,306.51C 59.577,281.299, 53.277,253.399, 53.277,224.008zM 426.688,480.00L 85.346,480.00 C 38.406,480.00,0.00,441.594,0.00,394.659l0.00-341.313 C0.00,6.376, 38.406-32.00, 85.346-32.00l 341.342,0.00
874
+ C 473.622-32.00, 512.00,6.376, 512.00,53.346L 512.00,394.659 C 512.00,441.594, 473.622,480.00, 426.688,480.00z M 255.993-1.48
875
+ c-124.327,0.00-225.476,101.156-225.476,225.488c0.00,124.324, 101.147,225.475, 225.476,225.475
876
+ c 124.327,0.00, 225.484-101.149, 225.484-225.475C 481.48,99.676, 380.322-1.48, 255.993-1.48z" />
877
+ <glyph unicode="&#xe106;" d="M 478.898,288.00l-28.103,0.00 l-0.60,0.00 c-17.583,0.00-32.994,14.871-34.195,32.00l0.00,0.00C 416.002,411.334, 342.371,480.00, 250.405,480.00l-83.912,0.00
878
+ C 74.587,480.00, 0.065,406.00,0.00,314.667l0.00-181.399 C0.00,41.941, 74.587-32.00, 166.492-32.00l 179.21,0.00 C 437.676-32.00, 512.00,41.941, 512.00,133.268L 512.00,250.459
879
+ C 512.00,268.71, 497.28,288.00, 478.898,288.00z M 160.00,352.00l 96.00,0.00 c 17.60,0.00, 32.00-14.40, 32.00-32.00s-14.40-32.00-32.00-32.00l-96.00,0.00 c-17.60,0.00-32.00,14.40-32.00,32.00S 142.40,352.00, 160.00,352.00
880
+ z M 352.00,96.00L 160.00,96.00 c-17.60,0.00-32.00,14.40-32.00,32.00s 14.40,32.00, 32.00,32.00l 192.00,0.00 c 17.60,0.00, 32.00-14.40, 32.00-32.00S 369.60,96.00, 352.00,96.00z" />
881
+ <glyph unicode="&#xe107;" d="M 184.00,272.00l 72.00,0.00 c 13.199,0.00, 24.00,10.80, 24.00,24.00s-10.801,24.00-24.00,24.00l-72.00,0.00 c-13.20,0.00-24.00-10.80-24.00-24.00S 170.801,272.00, 184.00,272.00zM 328.00,176.00L 184.00,176.00 c-13.20,0.00-24.00-10.80-24.00-24.00c0.00-13.199, 10.80-24.00, 24.00-24.00l 144.00,0.00 c 13.199,0.00, 24.00,10.801, 24.00,24.00C 352.00,165.20, 341.199,176.00, 328.00,176.00zM 426.674,480.00L 85.325,480.00 C 38.202,480.00,0.00,441.791,0.00,394.659l0.00-341.318 C0.00,6.208, 38.202-32.00, 85.325-32.00l 341.348,0.00
882
+ c 47.125,0.00, 85.324,38.208, 85.324,85.341L 512.00,394.659C 512.00,441.791, 473.798,480.00, 426.674,480.00z M 448.00,155.951
883
+ C 448.00,87.456, 392.257,32.00, 323.278,32.00L 188.869,32.00 C 119.941,32.00, 64.00,87.456, 64.00,155.951L 64.00,292.00 c 0.048,68.50, 55.94,124.00, 124.869,124.00l 62.934,0.00
884
+ C 320.779,416.00, 376.002,364.50, 376.00,296.00c 0.901-12.847, 12.461-24.00, 25.646-24.00l 0.449,0.00 l 21.078,0.00 C 436.959,272.00, 448.00,257.533, 448.00,243.844L 448.00,155.951 z" />
885
+ <glyph unicode="&#xe108;" d="M 416.751-4.105c-21.85-10.277-41.685-17.525-59.414-21.689c-17.75-4.121-36.931-6.203-57.533-6.203
886
+ c-23.413,0.00-37.227,2.943-55.204,8.828c-17.979,5.934-33.33,14.402-46.01,25.27c-12.725,10.961-21.511,22.604-26.424,34.916
887
+ c-4.913,12.318-7.358,30.207-7.358,53.621L 164.808,270.189 L 95.249,270.189 l0.00,72.503 c 20.104,6.521, 43.428,15.894, 57.736,28.076
888
+ c 14.377,12.225, 25.883,26.853, 34.553,43.972c 8.696,17.073, 14.674,38.856, 17.936,65.258l 72.818,0.00 l0.00-118.423 L 396.67,361.575 l0.00-91.387 L 278.29,270.188 l0.00-131.28
889
+ c0.00-29.709-0.385-46.828, 2.765-55.25c 3.125-8.377, 10.959-17.072, 19.495-22.10c 11.343-6.795, 24.271-10.189, 38.854-10.189
890
+ c 25.927,0.00, 51.716,8.424, 77.348,25.27L 416.752-4.105 L 416.751-4.105z" />
891
+ <glyph unicode="&#xe109;" d="M 426.69,480.00L 85.344,480.00 C 38.405,480.00, 0.001,441.593, 0.001,394.657l0.00-341.313 C 0.001,6.375, 38.405-32.00, 85.344-32.00L 426.69-32.00
892
+ C 473.625-32.00, 512.00,6.375, 512.00,53.344L 512.00,394.658 C 511.996,441.593, 473.621,480.00, 426.69,480.00z M 365.858,67.656
893
+ c-15.076-7.094-28.764-12.094-41.00-14.969c-12.248-2.845-25.48-4.279-39.701-4.279c-16.156,0.00-25.688,2.029-38.094,6.094
894
+ c-12.404,4.094-23.00,9.936-31.75,17.436c-8.779,7.564-14.843,15.599-18.233,24.097c-3.392,8.502-5.078,20.846-5.078,37.002L 192.002,256.938
895
+ l-47.998,0.00 l0.00,50.033 c 13.872,4.50, 29.968,10.967, 39.842,19.375c 9.92,8.436, 17.859,18.529, 23.842,30.342
896
+ c 6.002,11.783, 10.125,26.813, 12.376,45.033l 50.25,0.00 L 270.314,320.00 L 352.00,320.00 l0.00-63.063 l-81.689,0.00 l0.00-90.594 c0.00-20.50-0.264-32.313, 1.908-38.125
897
+ c 2.156-5.78, 7.563-11.78, 13.451-15.25c 7.828-4.688, 16.752-7.03, 26.813-7.03c 17.893,0.00, 35.689,5.813, 53.375,17.438L 365.858,67.656
898
+ L 365.858,67.656z" />
899
+ <glyph unicode="&#xe10a;" d="M 482.459,335.562L 282.333,335.562 l 7.708-31.23l 54.623,0.00 l-91.913-83.016c-18.752,25.917-62.711,79.942-93.377,124.485l 68.461,0.00 l0.00,31.23 L0.00,377.031
900
+ l0.00-31.23 l 67.666,0.00 c 26.25-20.479, 126.708-146.104, 130.875-158.604c 1.667-11.709, 3.21-80.947-1.708-86.156
901
+ c-9.875-10.459-54.916-7.706-65.793-8.496l-3.748-21.435c 19.832-0.584, 84.415,1.613, 104.50,1.613
902
+ c 39.541,0.00, 108.833,0.164, 118.624-0.586l 1.21,22.498c-10.003,1.668-64.542,0.205-72.084,1.87
903
+ c-1.667,10.919-3.502,83.709-1.833,91.211c 7.541,21.749, 122.168,110.494, 134.71,113.868c 2.831,0.584, 7.04,1.719, 11.831,2.742
904
+ l 36.916,0.00 L 482.459,335.562zM 440.334,107.218L 440.501,73.552L 456.043,72.218L 472.79,70.968L 477.707,103.927L 460.04,104.802 zM 445.625,129.342l 30.669-2.458L 512.00,264.844c-5.957,0.206-60.166,5.331-67.211,6.706L 445.625,129.342z" />
905
+ <glyph unicode="&#xe10b;" d="M 426.656,480.00L 85.343,480.00 C 38.406,480.00,0.00,441.594,0.00,394.657l0.00-341.314 C0.00,6.376, 38.406-32.00, 85.343-32.00l 341.313,0.00
906
+ C 473.594-32.00, 512.00,6.376, 512.00,53.343L 512.00,394.657 C 512.00,441.594, 473.594,480.00, 426.656,480.00z M 373.315,282.031
907
+ c-9.407-2.531-95.377-68.938-101.032-85.25c-1.252-5.627, 0.125-60.221, 1.375-68.408c 5.655-1.248, 46.563-0.154, 54.063-1.402
908
+ l-0.906-16.877c-7.344,0.563-59.313,0.438-88.969,0.438c-15.064,0.00-63.50-1.654-78.374-1.218l 2.81,16.062
909
+ c 8.159,0.594, 41.939-1.499, 49.346,6.345c 3.688,3.905, 2.531,55.781, 1.281,64.564c-3.125,9.374-78.47,103.436-98.156,118.842L 64.00,315.127
910
+ l0.00,23.626 l 171.125,0.00 l0.00-23.626 L 183.53,315.127 c 22.999-33.499, 55.971-73.97, 70.033-93.406l 68.938,62.218L 281.53,283.939 l-5.779,23.627l 150.095,0.00
911
+ l-15.97-23.627l-27.688,0.00 C 378.594,283.156, 375.437,282.469, 373.315,282.031z M 418.593,109.219l-12.563,0.938l-11.654,1.001
912
+ l-0.125,25.248l 14.778-1.813l 13.25-0.655L 418.593,109.219z M 421.22,151.156L 398.218,153.00l-0.625,106.655
913
+ c 5.279-1.031, 45.938-4.874, 50.404-5.028L 421.22,151.156z" />
914
+ <glyph unicode="&#xe10c;" d="M 454.655,127.238c-62.828-26.668-131.154-39.521-193.27-39.521c-92.10,0.00-181.261,25.24-253.37,67.197
915
+ c-6.297,3.692-11.00-2.772-5.753-7.521c 66.818-60.353, 155.136-96.638, 253.243-96.638c 69.969,0.00, 151.233,22.052, 207.298,63.375
916
+ C 472.084,121.023, 464.147,131.27, 454.655,127.238zM 510.049,159.031c-6.129,7.559-58.711,14.068-90.756-8.484c-4.956-3.443-4.113-8.23, 1.387-7.561
917
+ c 18.059,2.145, 58.291,6.973, 65.431-2.185c 7.187-9.196-7.978-47.034-14.738-63.918c-2.059-5.122, 2.352-7.182, 6.972-3.317
918
+ C 508.451,98.723, 516.182,151.428, 510.049,159.031zM 269.739,305.544c-24.436-2.787-56.404-4.565-79.298-14.646c-26.394-11.39-44.96-34.698-44.96-68.923
919
+ c0.00-43.832, 27.64-65.717, 63.109-65.717c 30.011,0.00, 46.381,7.061, 69.511,30.666c 7.71-11.094, 10.203-16.492, 24.197-28.115
920
+ c 3.146-1.658, 7.179-1.479, 9.965,1.01l 0.119-0.118c 8.423,7.475, 23.726,20.815, 32.321,27.996c 3.442,2.848, 2.85,7.409, 0.119,11.209
921
+ c-7.709,10.678-15.895,19.334-15.895,39.086l0.00,65.715 c0.00,27.818, 1.959,53.383-18.566,72.54
922
+ c-16.189,15.537-42.998,20.997-63.519,20.997c-40.095,0.00-84.874-14.948-94.307-64.533c-0.948-5.276, 2.847-8.063, 6.287-8.837
923
+ l 40.927-4.39c 3.795,0.18, 6.583,3.916, 7.296,7.711c 3.499,17.082, 17.853,25.326, 33.925,25.326c 8.66,0.00, 18.502-3.203, 23.667-10.975
924
+ c 5.869-8.658, 5.10-20.521, 5.10-30.546L 269.739,305.544L 269.739,305.544z M 261.851,217.883c-6.702-11.863-17.322-19.158-29.18-19.158
925
+ c-16.192,0.00-25.622,12.338-25.622,30.548c0.00,35.938, 32.204,42.464, 62.69,42.464l0.00-9.133
926
+ C 269.739,246.173, 270.156,232.473, 261.851,217.883z" />
927
+ <glyph unicode="&#xe10d;" d="M 291.765,274.281c-10.922,0.00-21.844-0.718-31.312-2.906c-17.469-5.094-31.313-16.031-31.313-39.313
928
+ c0.00-18.219, 9.485-30.594, 25.50-30.594c 2.188,0.00, 4.36,0.751, 5.813,0.751c 9.468,2.188, 18.201,8.749, 23.297,18.938
929
+ c 8.72,14.533, 8.016,27.626, 8.016,44.377L 291.765,274.281L 291.765,274.281zM 426.671,480.00L 85.344,480.00 C 38.406,480.00,0.00,441.596,0.00,394.656l0.00-341.313 C0.00,6.375, 38.407-32.00, 85.344-32.00l 341.328,0.00
930
+ C 473.61-32.00, 512.00,6.374, 512.00,53.344L 512.00,394.656 C 512.00,441.596, 473.61,480.00, 426.671,480.00z M 286.671,344.187
931
+ c-5.109,7.25-14.577,10.905-23.296,10.905c-1.452,0.00-2.188,0.00-2.922,0.00c-14.563-1.469-27.656-9.468-31.313-25.468
932
+ c-0.718-3.656-2.891-7.282-7.266-8.033l-40.766,5.096c-2.906,0.748-7.28,2.938-5.844,8.75
933
+ c 8.749,45.875, 48.062,61.875, 85.188,64.063c 2.922,0.00, 5.827,0.00, 8.748,0.00c 20.377,0.00, 46.597-5.813, 63.329-21.126
934
+ c 20.375-18.907, 18.204-44.375, 18.204-72.063l0.00-65.529 c0.00-19.626, 8.00-28.375, 16.016-38.563c 2.172-3.658, 2.906-8.00-0.72-10.938
935
+ c-8.031-7.282-23.313-20.375-32.047-27.656c-2.906-2.188-6.546-2.188-10.188-0.718c-13.845,11.625-16.017,16.718-24.032,27.655
936
+ c-13.826-14.563-25.468-22.563-39.312-26.938c-8.721-2.188-18.188-3.625-29.846-3.625c-34.937,0.00-62.606,21.813-62.606,64.782
937
+ c0.00,34.218, 18.204,57.50, 45.141,68.438c 13.827,6.53, 30.579,9.469, 47.313,11.625c 10.922,1.467, 21.844,2.188, 31.312,2.938l0.00,5.812
938
+ C 291.765,323.782, 292.469,335.437, 286.671,344.187z M 413.985,92.406c-5.14-3.938-10.656-7.499-16.203-10.688
939
+ c-41.531-