Version Description
- 2014-08-14 =
- Improved protection against CSRF attacks thanks to Yoshinori Matsumoto.
- Fixed bug on scheduled newsletters edited back and forth and becoming uneditable.
- Fixed when duplicating an email through the stats page of a newsletter, then deleting the duplicate would also delete the original.
- Old code Spring cleaning part 2, getting rid of the junk.
Download this release
Release Info
Developer | bordoni |
Plugin | MailPoet Newsletters (Previous) |
Version | 2.6.11 |
Comparing to | |
See all releases |
Code changes from version 2.6.10 to 2.6.11
- classes/WJ_Export.php +30 -29
- controllers/ajax/campaigns.php +185 -223
- controllers/ajax/config.php +23 -10
- controllers/back/campaigns.php +150 -218
- controllers/back/config.php +4 -3
- controllers/back/subscribers.php +234 -286
- core/base.php +2 -2
- core/controller.php +41 -23
- core/view.php +2 -2
- helpers/back.php +123 -1
- helpers/file.php +8 -56
- helpers/install.php +3 -3
- helpers/licence.php +2 -2
- helpers/queue.php +1 -1
- helpers/toolbox.php +5 -70
- helpers/update.php +2 -2
- index.php +1 -1
- js/admin-ajax-proto.js +1 -1
- js/admin-ajax.js +1 -1
- js/admin-campaigns-articles.js +1 -1
- js/admin-campaigns-bookmarks.js +1 -1
- js/admin-campaigns-dividers.js +1 -1
- js/admin-campaigns-editDetails.js +1 -1
- js/admin-campaigns-editTemplate.js +1 -1
- js/admin-campaigns-medias.js +1 -1
- js/admin-campaigns-themes.js +1 -1
- js/admin-campaigns-viewstats.js +1 -1
- js/admin-campaigns-welcome_new.js +1 -1
- js/admin-config-form_widget_settings.js +1 -1
- js/admin-config-settings.js +1 -1
- js/admin-listing.js +199 -1
- js/admin-wysija.js +1 -1
- languages/wysija-newsletters-de_DE.mo +0 -0
- languages/wysija-newsletters-hu_HU.mo +0 -0
- languages/wysija-newsletters-it_IT.mo +0 -0
- languages/wysija-newsletters-ja.mo +0 -0
- languages/wysija-newsletters-pt_BR.mo +0 -0
- languages/wysija-newsletters-ru_RU.mo +0 -0
- models/wp_posts.php +2 -2
- modules/stats_newsletter_std/stats_newsletter_std_view.php +4 -6
- readme.txt +11 -5
- views/back/campaigns.php +45 -68
- views/back/config.php +6 -3
- views/back/subscribers.php +10 -9
- widgets/wysija_nl.php +2 -1
classes/WJ_Export.php
CHANGED
@@ -45,35 +45,8 @@ class WJ_Export extends WYSIJA_object {
|
|
45 |
}
|
46 |
}
|
47 |
|
48 |
-
/**
|
49 |
-
* export the subscribers
|
50 |
-
* @return type
|
51 |
-
*/
|
52 |
-
public function export_subscribers() {
|
53 |
-
|
54 |
-
//generate temp file
|
55 |
-
$helper_file = WYSIJA::get( 'file', 'helper' );
|
56 |
-
$this->_prepare_headers();
|
57 |
-
$result_file = $helper_file->temp( $this->_file_header, 'export', '.csv' );
|
58 |
|
59 |
-
|
60 |
-
$this->_file_handle = fopen( $result_file['path'], 'a' );
|
61 |
-
|
62 |
-
//get a list of user_ids to export
|
63 |
-
if ( ! empty( $this->_user_ids ) && empty( $this->batch_select ) ) {
|
64 |
-
|
65 |
-
$this->_user_ids_rows = count( $this->_user_ids );
|
66 |
-
$this->_push_data_to_export_file();
|
67 |
-
} else {
|
68 |
-
|
69 |
-
$this->_get_chunks_user_ids();
|
70 |
-
}
|
71 |
-
|
72 |
-
fclose( $this->_file_handle );
|
73 |
-
return $result_file['path'];
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
* get the number of rows exported
|
78 |
* @return type
|
79 |
*/
|
@@ -164,7 +137,7 @@ class WJ_Export extends WYSIJA_object {
|
|
164 |
* split the user_ids array into chunks, load the fields of all the concerned
|
165 |
* users and push the data to the file
|
166 |
*/
|
167 |
-
function _push_data_to_export_file() {
|
168 |
$user_ids_chunks = array(); // chunk rows into separated batchs, limit by $this->_export_batch
|
169 |
$user_ids_chunks = array_chunk( $this->_user_ids, 200 );
|
170 |
$this->_user_ids = null; // free memory
|
@@ -213,4 +186,32 @@ class WJ_Export extends WYSIJA_object {
|
|
213 |
$this->_file_header = $encoded_string;
|
214 |
}
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
}
|
45 |
}
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
* get the number of rows exported
|
51 |
* @return type
|
52 |
*/
|
137 |
* split the user_ids array into chunks, load the fields of all the concerned
|
138 |
* users and push the data to the file
|
139 |
*/
|
140 |
+
private function _push_data_to_export_file() {
|
141 |
$user_ids_chunks = array(); // chunk rows into separated batchs, limit by $this->_export_batch
|
142 |
$user_ids_chunks = array_chunk( $this->_user_ids, 200 );
|
143 |
$this->_user_ids = null; // free memory
|
186 |
$this->_file_header = $encoded_string;
|
187 |
}
|
188 |
|
189 |
+
/**
|
190 |
+
* export the subscribers
|
191 |
+
* @return type
|
192 |
+
*/
|
193 |
+
public function export_subscribers() {
|
194 |
+
|
195 |
+
//generate temp file
|
196 |
+
$helper_file = WYSIJA::get( 'file', 'helper' );
|
197 |
+
$this->_prepare_headers();
|
198 |
+
$result_file = $helper_file->temp( $this->_file_header, 'export', '.csv' );
|
199 |
+
|
200 |
+
//open the created file in append mode
|
201 |
+
$this->_file_handle = fopen( $result_file['path'], 'a' );
|
202 |
+
|
203 |
+
//get a list of user_ids to export
|
204 |
+
if ( ! empty( $this->_user_ids ) && empty( $this->batch_select ) ) {
|
205 |
+
|
206 |
+
$this->_user_ids_rows = count( $this->_user_ids );
|
207 |
+
$this->_push_data_to_export_file();
|
208 |
+
} else {
|
209 |
+
|
210 |
+
$this->_get_chunks_user_ids();
|
211 |
+
}
|
212 |
+
|
213 |
+
fclose( $this->_file_handle );
|
214 |
+
return $result_file;
|
215 |
+
}
|
216 |
+
|
217 |
}
|
controllers/ajax/campaigns.php
CHANGED
@@ -8,7 +8,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
8 |
}
|
9 |
|
10 |
function save_poll(){
|
11 |
-
$
|
|
|
12 |
$model_config->save(array('poll_origin' => $_REQUEST['how'] , 'poll_origin_url' => $_REQUEST['where']));
|
13 |
|
14 |
$res['result'] = true;
|
@@ -16,68 +17,9 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
16 |
return $res;
|
17 |
}
|
18 |
|
19 |
-
function search_terms( $request = null ){
|
20 |
-
$response = (object) array(
|
21 |
-
'status' => false,
|
22 |
-
'message' => __( 'Your request has failed', WYSIJA ),
|
23 |
-
'results' => array(),
|
24 |
-
'more' => true,
|
25 |
-
);
|
26 |
-
|
27 |
-
if ( ( ! defined( 'DOING_AJAX' ) && is_null( $request ) ) || ! is_user_logged_in() ){
|
28 |
-
return $response;
|
29 |
-
}
|
30 |
-
|
31 |
-
$request = (object) wp_parse_args(
|
32 |
-
$request,
|
33 |
-
array(
|
34 |
-
'search' => isset( $_GET['search'] ) ? $_GET['search'] : '',
|
35 |
-
'post_type' => isset( $_GET['post_type'] ) ? $_GET['post_type'] : null,
|
36 |
-
'page' => absint( isset( $_GET['page'] ) ? $_GET['page'] : 0 ),
|
37 |
-
'page_limit' => absint( isset( $_GET['page_limit'] ) ? $_GET['page_limit'] : 10 ),
|
38 |
-
)
|
39 |
-
);
|
40 |
-
|
41 |
-
if ( is_null( $request->post_type ) ){
|
42 |
-
return $response;
|
43 |
-
}
|
44 |
-
|
45 |
-
$response->status = true;
|
46 |
-
$response->message = __( 'Request successful', WYSIJA );
|
47 |
-
|
48 |
-
$response->post_type = get_post_types( array( 'name' => $request->post_type ) );
|
49 |
-
$response->post_type = reset( $response->post_type );
|
50 |
-
|
51 |
-
preg_match( '/@(\w+)/i', $request->search, $response->regex );
|
52 |
-
|
53 |
-
if ( ! empty( $response->regex ) ){
|
54 |
-
$request->search = array_filter( array_map( 'trim', explode( '|', str_replace( $response->regex[0], '|', $request->search ) ) ) );
|
55 |
-
$request->search = reset( $request->search );
|
56 |
-
$taxonomies = $response->regex[1];
|
57 |
-
} else {
|
58 |
-
$taxonomies = get_object_taxonomies( $response->post_type );
|
59 |
-
}
|
60 |
-
$response->taxonomies = get_object_taxonomies( $response->post_type, 'objects' );
|
61 |
-
|
62 |
-
$response->results = get_terms(
|
63 |
-
(array) $taxonomies,
|
64 |
-
array(
|
65 |
-
'hide_empty' => false,
|
66 |
-
'search' => $request->search,
|
67 |
-
'number' => $request->page_limit,
|
68 |
-
'offset' => $request->page_limit * ( $request->page - 1 ),
|
69 |
-
)
|
70 |
-
);
|
71 |
-
|
72 |
-
if ( empty( $response->results ) || count( $response->results ) < $request->page_limit ){
|
73 |
-
$response->more = false;
|
74 |
-
}
|
75 |
-
|
76 |
-
return $response;
|
77 |
-
}
|
78 |
-
|
79 |
function switch_theme() {
|
80 |
-
|
|
|
81 |
$rawData = $_POST['wysijaData'];
|
82 |
// avoid using stripslashes as it's not reliable depending on the magic quotes settings
|
83 |
$rawData = str_replace('\"', '"', $rawData);
|
@@ -111,7 +53,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
111 |
}
|
112 |
|
113 |
function save_editor() {
|
114 |
-
|
|
|
115 |
$rawData = '';
|
116 |
if(isset($_POST['wysijaData'])) {
|
117 |
$rawData = $_POST['wysijaData'];
|
@@ -162,7 +105,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
162 |
}
|
163 |
|
164 |
function save_styles() {
|
165 |
-
|
|
|
166 |
$rawData = '';
|
167 |
if(isset($_POST['wysijaStyles'])) {
|
168 |
$rawData = $_POST['wysijaStyles'];
|
@@ -209,7 +153,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
209 |
}
|
210 |
|
211 |
function deleteimg(){
|
212 |
-
|
213 |
if(isset($_REQUEST['imgid']) && $_REQUEST['imgid']>0){
|
214 |
/* delete the image with id imgid */
|
215 |
$result=wp_delete_attachment($_REQUEST['imgid'],true);
|
@@ -224,7 +168,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
224 |
}
|
225 |
|
226 |
function deleteTheme(){
|
227 |
-
|
|
|
228 |
/* delete the image with id imgid */
|
229 |
$helperTheme=WYSIJA::get('themes','helper');
|
230 |
$result=$helperTheme->delete($_REQUEST['themekey']);
|
@@ -237,7 +182,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
237 |
|
238 |
// set newsletter default theme
|
239 |
function setDefaultTheme() {
|
240 |
-
|
|
|
241 |
// check that the theme exists
|
242 |
// TODO
|
243 |
$theme_exists = true;
|
@@ -256,7 +202,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
256 |
}
|
257 |
|
258 |
function save_IQS() {
|
259 |
-
|
|
|
260 |
$wysijaIMG = '';
|
261 |
if(isset($_POST['wysijaIMG'])) {
|
262 |
$wysijaIMG = json_decode(stripslashes($_POST['wysijaIMG']), TRUE);
|
@@ -284,148 +231,9 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
284 |
return array('result' => $result);
|
285 |
}
|
286 |
|
287 |
-
|
288 |
-
function view_NL() {
|
289 |
-
// get campaign id
|
290 |
-
$email_id = (int)$_REQUEST['id'];
|
291 |
-
|
292 |
-
// update data in DB
|
293 |
-
$model_email = WYSIJA::get('email', 'model');
|
294 |
-
$result = $model_email->getOne(false,array('email_id' => $email_id));
|
295 |
-
|
296 |
-
echo $result['body'];
|
297 |
-
exit;
|
298 |
-
}
|
299 |
-
|
300 |
-
function display_NL() {
|
301 |
-
// get email id
|
302 |
-
$email_id = (int)$_REQUEST['id'];
|
303 |
-
|
304 |
-
// update data in DB
|
305 |
-
$model_email = WYSIJA::get('email', 'model');
|
306 |
-
$email= $model_email->getOne(false,array('email_id' => $email_id));
|
307 |
-
|
308 |
-
$helper_wj_engine = WYSIJA::get('wj_engine', 'helper');
|
309 |
-
$helper_wj_engine->setStyles($result['wj_styles'], true);
|
310 |
-
$helper_wj_engine->setData($result['wj_data'], true);
|
311 |
-
$html = $helper_wj_engine->renderEmail($email);
|
312 |
-
print $html;
|
313 |
-
exit;
|
314 |
-
}
|
315 |
-
|
316 |
-
/**
|
317 |
-
* returns the images attached to displayed posts
|
318 |
-
*/
|
319 |
-
function get_post_images() {
|
320 |
-
// get parameters
|
321 |
-
$params = array(
|
322 |
-
|
323 |
-
);
|
324 |
-
|
325 |
-
$result = true;
|
326 |
-
|
327 |
-
if($params['post_id'] === null) {
|
328 |
-
|
329 |
-
}
|
330 |
-
|
331 |
-
return array(
|
332 |
-
'result' => $result,
|
333 |
-
'images' => $images
|
334 |
-
);
|
335 |
-
}
|
336 |
-
|
337 |
-
/**
|
338 |
-
* returns a list of articles to the popup in the visual editor
|
339 |
-
* @global type $wpdb
|
340 |
-
* @return boolean
|
341 |
-
*/
|
342 |
-
function get_articles(){
|
343 |
-
// fixes issue with pcre functions
|
344 |
-
@ini_set('pcre.backtrack_limit', 1000000);
|
345 |
-
|
346 |
-
// get parameters
|
347 |
-
$raw_data = $_REQUEST['data'];
|
348 |
-
$params = array();
|
349 |
-
foreach ($raw_data as $value) {
|
350 |
-
$params[$value['name']] = $value['value'];
|
351 |
-
}
|
352 |
-
|
353 |
-
// get options
|
354 |
-
$model_config = WYSIJA::get('config', 'model');
|
355 |
-
$interpret_shortcode = (bool)$model_config->getValue('interp_shortcode');
|
356 |
-
|
357 |
-
// post statuses
|
358 |
-
$helper_wp_tools = WYSIJA::get('wp_tools', 'helper');
|
359 |
-
$post_statuses = $helper_wp_tools->get_post_statuses();
|
360 |
-
$post_types = $helper_wp_tools->get_post_types();
|
361 |
-
|
362 |
-
// filter by post_type
|
363 |
-
if(isset($params['post_type'])) {
|
364 |
-
$post_types_filter = array();
|
365 |
-
if(strlen(trim($params['post_type'])) === 0) {
|
366 |
-
$post_types_filter = array_keys($post_types);
|
367 |
-
$post_types_filter[] = 'post';
|
368 |
-
$post_types_filter[] = 'page';
|
369 |
-
} else {
|
370 |
-
$post_types_filter = trim($params['post_type']);
|
371 |
-
}
|
372 |
-
// set condition on post type
|
373 |
-
$params['post_type'] = $post_types_filter;
|
374 |
-
}
|
375 |
-
|
376 |
-
// query offset when doing incremental loading
|
377 |
-
$query_offset = (isset($_REQUEST['query_offset']) && (int)$_REQUEST['query_offset'] >= 0) ? (int)$_REQUEST['query_offset'] : 0;
|
378 |
-
$params['query_offset'] = $query_offset;
|
379 |
-
|
380 |
-
// fetch posts
|
381 |
-
$helper_articles = WYSIJA::get('articles', 'helper');
|
382 |
-
|
383 |
-
// set is_search_query (true) to get a count in addition to the results
|
384 |
-
$params['is_search_query'] = true;
|
385 |
-
|
386 |
-
$model_wp_posts = WYSIJA::get('wp_posts','model');
|
387 |
-
$data = $model_wp_posts->get_posts($params);
|
388 |
-
|
389 |
-
// extract data
|
390 |
-
$posts = $data['rows'];
|
391 |
-
// contains the total number of rows available
|
392 |
-
$count = $data['count'];
|
393 |
-
|
394 |
-
// return results
|
395 |
-
$result = array(
|
396 |
-
'result' => true,
|
397 |
-
'append' => ($query_offset > 0)
|
398 |
-
);
|
399 |
-
|
400 |
-
if(empty($posts) === false) {
|
401 |
-
foreach($posts as $key => $post) {
|
402 |
-
// interpret shortcodes
|
403 |
-
if($interpret_shortcode === true) {
|
404 |
-
$posts[$key]['post_content'] = apply_filters('the_content', $posts[$key]['post_content']);
|
405 |
-
}
|
406 |
-
|
407 |
-
// get thumbnail
|
408 |
-
$posts[$key]['post_image'] = $helper_articles->getImage($post);
|
409 |
-
|
410 |
-
// set post status
|
411 |
-
$post_status_label = '';
|
412 |
-
if(isset($post_statuses[$posts[$key]['post_status']])) {
|
413 |
-
$post_status_label = $post_statuses[$posts[$key]['post_status']];
|
414 |
-
}
|
415 |
-
$posts[$key]['post_status'] = $post_status_label;
|
416 |
-
}
|
417 |
-
$result['posts'] = $posts;
|
418 |
-
$result['total'] = (int)$count['total'];
|
419 |
-
}else {
|
420 |
-
$result['msg'] = __('There are no posts corresponding to that search.', WYSIJA);
|
421 |
-
$result['result'] = false;
|
422 |
-
}
|
423 |
-
|
424 |
-
return $result;
|
425 |
-
}
|
426 |
-
|
427 |
function insert_articles() {
|
428 |
-
|
|
|
429 |
$raw_params = $_REQUEST['data'];
|
430 |
|
431 |
// format params
|
@@ -501,7 +309,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
501 |
}
|
502 |
|
503 |
function send_preview($spamtest=false){
|
504 |
-
$
|
|
|
505 |
$email_id = $_REQUEST['id'];
|
506 |
$resultarray=array();
|
507 |
|
@@ -651,12 +460,14 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
651 |
* send spam test function step 2 of the newsletter edition process
|
652 |
*/
|
653 |
function send_spamtest(){
|
654 |
-
|
|
|
655 |
}
|
656 |
|
657 |
function set_divider()
|
658 |
{
|
659 |
-
$
|
|
|
660 |
$width = isset($_POST['wysijaData']['width']) ? (int)$_POST['wysijaData']['width'] : NULL;
|
661 |
$height = isset($_POST['wysijaData']['height']) ? (int)$_POST['wysijaData']['height'] : NULL;
|
662 |
|
@@ -685,17 +496,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
685 |
return base64_encode($helper_wj_engine->renderEditorBlock($block));
|
686 |
}
|
687 |
|
688 |
-
function get_social_bookmarks() {
|
689 |
-
$size = isset($_POST['wysijaData']['size']) ? $_POST['wysijaData']['size'] : NULL;
|
690 |
-
$theme = isset($_POST['wysijaData']['theme']) ? $_POST['wysijaData']['theme'] : NULL;
|
691 |
-
|
692 |
-
$bookmarksHelper = WYSIJA::get('bookmarks', 'helper');
|
693 |
-
$bookmarks = $bookmarksHelper->getAll($size, $theme);
|
694 |
-
return json_encode(array('icons' => $bookmarks));
|
695 |
-
}
|
696 |
-
|
697 |
function generate_social_bookmarks() {
|
698 |
-
|
699 |
$size = 'medium';
|
700 |
$iconset = '01';
|
701 |
|
@@ -787,7 +589,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
787 |
}
|
788 |
|
789 |
function install_theme() {
|
790 |
-
|
|
|
791 |
global $wp_version;
|
792 |
//check if theme is premium if you have the premium licence
|
793 |
if(isset($_REQUEST['premium']) && $_REQUEST['premium']){
|
@@ -841,6 +644,15 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
841 |
return array('result' => $result, 'themes' => $themes);
|
842 |
}
|
843 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
844 |
function refresh_themes() {
|
845 |
// refresh themes list
|
846 |
$helper_wj_engine = WYSIJA::get('wj_engine', 'helper');
|
@@ -1001,4 +813,154 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control{
|
|
1001 |
return base64_encode($helper_wj_engine->renderEditorAutoPost($posts, $params));
|
1002 |
}
|
1003 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1004 |
}
|
8 |
}
|
9 |
|
10 |
function save_poll(){
|
11 |
+
$this->requireSecurity();
|
12 |
+
$model_config = WYSIJA::get('config','model');
|
13 |
$model_config->save(array('poll_origin' => $_REQUEST['how'] , 'poll_origin_url' => $_REQUEST['where']));
|
14 |
|
15 |
$res['result'] = true;
|
17 |
return $res;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
function switch_theme() {
|
21 |
+
$this->requireSecurity();
|
22 |
+
if(isset($_POST['wysijaData'])) {
|
23 |
$rawData = $_POST['wysijaData'];
|
24 |
// avoid using stripslashes as it's not reliable depending on the magic quotes settings
|
25 |
$rawData = str_replace('\"', '"', $rawData);
|
53 |
}
|
54 |
|
55 |
function save_editor() {
|
56 |
+
$this->requireSecurity();
|
57 |
+
// decode json data and convert to array
|
58 |
$rawData = '';
|
59 |
if(isset($_POST['wysijaData'])) {
|
60 |
$rawData = $_POST['wysijaData'];
|
105 |
}
|
106 |
|
107 |
function save_styles() {
|
108 |
+
$this->requireSecurity();
|
109 |
+
// decode json data and convert to array
|
110 |
$rawData = '';
|
111 |
if(isset($_POST['wysijaStyles'])) {
|
112 |
$rawData = $_POST['wysijaStyles'];
|
153 |
}
|
154 |
|
155 |
function deleteimg(){
|
156 |
+
$this->requireSecurity();
|
157 |
if(isset($_REQUEST['imgid']) && $_REQUEST['imgid']>0){
|
158 |
/* delete the image with id imgid */
|
159 |
$result=wp_delete_attachment($_REQUEST['imgid'],true);
|
168 |
}
|
169 |
|
170 |
function deleteTheme(){
|
171 |
+
$this->requireSecurity();
|
172 |
+
if(isset($_REQUEST['themekey']) && $_REQUEST['themekey']){
|
173 |
/* delete the image with id imgid */
|
174 |
$helperTheme=WYSIJA::get('themes','helper');
|
175 |
$result=$helperTheme->delete($_REQUEST['themekey']);
|
182 |
|
183 |
// set newsletter default theme
|
184 |
function setDefaultTheme() {
|
185 |
+
$this->requireSecurity();
|
186 |
+
if(isset($_REQUEST['theme']) && $_REQUEST['theme']) {
|
187 |
// check that the theme exists
|
188 |
// TODO
|
189 |
$theme_exists = true;
|
202 |
}
|
203 |
|
204 |
function save_IQS() {
|
205 |
+
$this->requireSecurity();
|
206 |
+
// decode json data and convert to array
|
207 |
$wysijaIMG = '';
|
208 |
if(isset($_POST['wysijaIMG'])) {
|
209 |
$wysijaIMG = json_decode(stripslashes($_POST['wysijaIMG']), TRUE);
|
231 |
return array('result' => $result);
|
232 |
}
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
function insert_articles() {
|
235 |
+
$this->requireSecurity();
|
236 |
+
// get raw params
|
237 |
$raw_params = $_REQUEST['data'];
|
238 |
|
239 |
// format params
|
309 |
}
|
310 |
|
311 |
function send_preview($spamtest=false){
|
312 |
+
$this->requireSecurity();
|
313 |
+
$mailer=WYSIJA::get('mailer','helper');
|
314 |
$email_id = $_REQUEST['id'];
|
315 |
$resultarray=array();
|
316 |
|
460 |
* send spam test function step 2 of the newsletter edition process
|
461 |
*/
|
462 |
function send_spamtest(){
|
463 |
+
$this->requireSecurity();
|
464 |
+
return apply_filters('wysija_send_spam_test','',$this);
|
465 |
}
|
466 |
|
467 |
function set_divider()
|
468 |
{
|
469 |
+
$this->requireSecurity();
|
470 |
+
$src = isset($_POST['wysijaData']['src']) ? $_POST['wysijaData']['src'] : NULL;
|
471 |
$width = isset($_POST['wysijaData']['width']) ? (int)$_POST['wysijaData']['width'] : NULL;
|
472 |
$height = isset($_POST['wysijaData']['height']) ? (int)$_POST['wysijaData']['height'] : NULL;
|
473 |
|
496 |
return base64_encode($helper_wj_engine->renderEditorBlock($block));
|
497 |
}
|
498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
function generate_social_bookmarks() {
|
500 |
+
$this->requireSecurity();
|
501 |
$size = 'medium';
|
502 |
$iconset = '01';
|
503 |
|
589 |
}
|
590 |
|
591 |
function install_theme() {
|
592 |
+
$this->requireSecurity();
|
593 |
+
if( isset($_REQUEST['theme_id'])){
|
594 |
global $wp_version;
|
595 |
//check if theme is premium if you have the premium licence
|
596 |
if(isset($_REQUEST['premium']) && $_REQUEST['premium']){
|
644 |
return array('result' => $result, 'themes' => $themes);
|
645 |
}
|
646 |
|
647 |
+
function get_social_bookmarks() {
|
648 |
+
$size = isset($_POST['wysijaData']['size']) ? $_POST['wysijaData']['size'] : NULL;
|
649 |
+
$theme = isset($_POST['wysijaData']['theme']) ? $_POST['wysijaData']['theme'] : NULL;
|
650 |
+
|
651 |
+
$bookmarksHelper = WYSIJA::get('bookmarks', 'helper');
|
652 |
+
$bookmarks = $bookmarksHelper->getAll($size, $theme);
|
653 |
+
return json_encode(array('icons' => $bookmarks));
|
654 |
+
}
|
655 |
+
|
656 |
function refresh_themes() {
|
657 |
// refresh themes list
|
658 |
$helper_wj_engine = WYSIJA::get('wj_engine', 'helper');
|
813 |
return base64_encode($helper_wj_engine->renderEditorAutoPost($posts, $params));
|
814 |
}
|
815 |
}
|
816 |
+
|
817 |
+
function search_terms( $request = null ){
|
818 |
+
$response = (object) array(
|
819 |
+
'status' => false,
|
820 |
+
'message' => __( 'Your request has failed', WYSIJA ),
|
821 |
+
'results' => array(),
|
822 |
+
'more' => true,
|
823 |
+
);
|
824 |
+
|
825 |
+
if ( ( ! defined( 'DOING_AJAX' ) && is_null( $request ) ) || ! is_user_logged_in() ){
|
826 |
+
return $response;
|
827 |
+
}
|
828 |
+
|
829 |
+
$request = (object) wp_parse_args(
|
830 |
+
$request,
|
831 |
+
array(
|
832 |
+
'search' => isset( $_GET['search'] ) ? $_GET['search'] : '',
|
833 |
+
'post_type' => isset( $_GET['post_type'] ) ? $_GET['post_type'] : null,
|
834 |
+
'page' => absint( isset( $_GET['page'] ) ? $_GET['page'] : 0 ),
|
835 |
+
'page_limit' => absint( isset( $_GET['page_limit'] ) ? $_GET['page_limit'] : 10 ),
|
836 |
+
)
|
837 |
+
);
|
838 |
+
|
839 |
+
if ( is_null( $request->post_type ) ){
|
840 |
+
return $response;
|
841 |
+
}
|
842 |
+
|
843 |
+
$response->status = true;
|
844 |
+
$response->message = __( 'Request successful', WYSIJA );
|
845 |
+
|
846 |
+
$response->post_type = get_post_types( array( 'name' => $request->post_type ) );
|
847 |
+
$response->post_type = reset( $response->post_type );
|
848 |
+
|
849 |
+
preg_match( '/@(\w+)/i', $request->search, $response->regex );
|
850 |
+
|
851 |
+
if ( ! empty( $response->regex ) ){
|
852 |
+
$request->search = array_filter( array_map( 'trim', explode( '|', str_replace( $response->regex[0], '|', $request->search ) ) ) );
|
853 |
+
$request->search = reset( $request->search );
|
854 |
+
$taxonomies = $response->regex[1];
|
855 |
+
} else {
|
856 |
+
$taxonomies = get_object_taxonomies( $response->post_type );
|
857 |
+
}
|
858 |
+
$response->taxonomies = get_object_taxonomies( $response->post_type, 'objects' );
|
859 |
+
|
860 |
+
$response->results = get_terms(
|
861 |
+
(array) $taxonomies,
|
862 |
+
array(
|
863 |
+
'hide_empty' => false,
|
864 |
+
'search' => $request->search,
|
865 |
+
'number' => $request->page_limit,
|
866 |
+
'offset' => $request->page_limit * ( $request->page - 1 ),
|
867 |
+
)
|
868 |
+
);
|
869 |
+
|
870 |
+
if ( empty( $response->results ) || count( $response->results ) < $request->page_limit ){
|
871 |
+
$response->more = false;
|
872 |
+
}
|
873 |
+
|
874 |
+
return $response;
|
875 |
+
}
|
876 |
+
|
877 |
+
/**
|
878 |
+
* returns a list of articles to the popup in the visual editor
|
879 |
+
* @global type $wpdb
|
880 |
+
* @return boolean
|
881 |
+
*/
|
882 |
+
function get_articles(){
|
883 |
+
// fixes issue with pcre functions
|
884 |
+
@ini_set('pcre.backtrack_limit', 1000000);
|
885 |
+
|
886 |
+
// get parameters
|
887 |
+
$raw_data = $_REQUEST['data'];
|
888 |
+
$params = array();
|
889 |
+
foreach ($raw_data as $value) {
|
890 |
+
$params[$value['name']] = $value['value'];
|
891 |
+
}
|
892 |
+
|
893 |
+
// get options
|
894 |
+
$model_config = WYSIJA::get('config', 'model');
|
895 |
+
$interpret_shortcode = (bool)$model_config->getValue('interp_shortcode');
|
896 |
+
|
897 |
+
// post statuses
|
898 |
+
$helper_wp_tools = WYSIJA::get('wp_tools', 'helper');
|
899 |
+
$post_statuses = $helper_wp_tools->get_post_statuses();
|
900 |
+
$post_types = $helper_wp_tools->get_post_types();
|
901 |
+
|
902 |
+
// filter by post_type
|
903 |
+
if(isset($params['post_type'])) {
|
904 |
+
$post_types_filter = array();
|
905 |
+
if(strlen(trim($params['post_type'])) === 0) {
|
906 |
+
$post_types_filter = array_keys($post_types);
|
907 |
+
$post_types_filter[] = 'post';
|
908 |
+
$post_types_filter[] = 'page';
|
909 |
+
} else {
|
910 |
+
$post_types_filter = trim($params['post_type']);
|
911 |
+
}
|
912 |
+
// set condition on post type
|
913 |
+
$params['post_type'] = $post_types_filter;
|
914 |
+
}
|
915 |
+
|
916 |
+
// query offset when doing incremental loading
|
917 |
+
$query_offset = (isset($_REQUEST['query_offset']) && (int)$_REQUEST['query_offset'] >= 0) ? (int)$_REQUEST['query_offset'] : 0;
|
918 |
+
$params['query_offset'] = $query_offset;
|
919 |
+
|
920 |
+
// fetch posts
|
921 |
+
$helper_articles = WYSIJA::get('articles', 'helper');
|
922 |
+
|
923 |
+
// set is_search_query (true) to get a count in addition to the results
|
924 |
+
$params['is_search_query'] = true;
|
925 |
+
|
926 |
+
$model_wp_posts = WYSIJA::get('wp_posts','model');
|
927 |
+
$data = $model_wp_posts->get_posts($params);
|
928 |
+
|
929 |
+
// extract data
|
930 |
+
$posts = $data['rows'];
|
931 |
+
// contains the total number of rows available
|
932 |
+
$count = $data['count'];
|
933 |
+
|
934 |
+
// return results
|
935 |
+
$result = array(
|
936 |
+
'result' => true,
|
937 |
+
'append' => ($query_offset > 0)
|
938 |
+
);
|
939 |
+
|
940 |
+
if(empty($posts) === false) {
|
941 |
+
foreach($posts as $key => $post) {
|
942 |
+
// interpret shortcodes
|
943 |
+
if($interpret_shortcode === true) {
|
944 |
+
$posts[$key]['post_content'] = apply_filters('the_content', $posts[$key]['post_content']);
|
945 |
+
}
|
946 |
+
|
947 |
+
// get thumbnail
|
948 |
+
$posts[$key]['post_image'] = $helper_articles->getImage($post);
|
949 |
+
|
950 |
+
// set post status
|
951 |
+
$post_status_label = '';
|
952 |
+
if(isset($post_statuses[$posts[$key]['post_status']])) {
|
953 |
+
$post_status_label = $post_statuses[$posts[$key]['post_status']];
|
954 |
+
}
|
955 |
+
$posts[$key]['post_status'] = $post_status_label;
|
956 |
+
}
|
957 |
+
$result['posts'] = $posts;
|
958 |
+
$result['total'] = (int)$count['total'];
|
959 |
+
}else {
|
960 |
+
$result['msg'] = __('There are no posts corresponding to that search.', WYSIJA);
|
961 |
+
$result['result'] = false;
|
962 |
+
}
|
963 |
+
|
964 |
+
return $result;
|
965 |
+
}
|
966 |
}
|
controllers/ajax/config.php
CHANGED
@@ -23,6 +23,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
23 |
}
|
24 |
|
25 |
function send_test_mail(){
|
|
|
26 |
$this->_displayErrors();
|
27 |
/*switch the send method*/
|
28 |
$configVal=$this->_convertPostedInarray();
|
@@ -40,6 +41,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
40 |
}
|
41 |
|
42 |
function send_test_mail_ms(){
|
|
|
43 |
$this->_displayErrors();
|
44 |
/*switch the send method*/
|
45 |
$configVal=$this->_convertPostedInarray();
|
@@ -97,6 +99,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
97 |
* @return type
|
98 |
*/
|
99 |
function bounce_process(){
|
|
|
100 |
// bounce handling
|
101 |
$helper_bounce = WYSIJA::get('bounce','helper');
|
102 |
|
@@ -112,6 +115,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
112 |
}
|
113 |
|
114 |
function linkignore(){
|
|
|
115 |
$this->_displayErrors();
|
116 |
|
117 |
$modelConf=WYSIJA::get('config','model');
|
@@ -129,6 +133,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
129 |
|
130 |
// Ajax called function to enable analytics sharing from welcome page.
|
131 |
function share_analytics() {
|
|
|
132 |
$this->_displayErrors();
|
133 |
|
134 |
$model_config = WYSIJA::get('config','model');
|
@@ -140,24 +145,28 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
140 |
}
|
141 |
|
142 |
function validate(){
|
143 |
-
$
|
144 |
-
$
|
|
|
145 |
|
146 |
-
if(!isset($
|
147 |
-
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
function _convertPostedInarray(){
|
151 |
$_POST = stripslashes_deep($_POST);
|
152 |
-
$
|
153 |
$_POST['data']=array();
|
154 |
-
foreach($
|
155 |
-
$
|
156 |
foreach($_POST['data'] as $k =>$v){
|
157 |
-
$
|
158 |
-
$
|
159 |
}
|
160 |
-
return $
|
161 |
}
|
162 |
|
163 |
// WYSIJA Form Editor
|
@@ -169,6 +178,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
169 |
}
|
170 |
|
171 |
function wysija_form_manage_field() {
|
|
|
172 |
$response = array('result' => true, 'error' => null);
|
173 |
|
174 |
// get data
|
@@ -265,6 +275,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
265 |
|
266 |
// remove a custom field
|
267 |
function form_field_delete() {
|
|
|
268 |
$data = $this->_wysija_form_get_data();
|
269 |
|
270 |
// check for field_id parameter
|
@@ -314,6 +325,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
314 |
}
|
315 |
|
316 |
function form_name_save() {
|
|
|
317 |
// get name from post and stripslashes it
|
318 |
$form_name = trim(stripslashes($_POST['name']));
|
319 |
// get form_id from post
|
@@ -328,6 +340,7 @@ class WYSIJA_control_back_config extends WYSIJA_control{
|
|
328 |
}
|
329 |
|
330 |
function form_save() {
|
|
|
331 |
// get form id
|
332 |
$form_id = null;
|
333 |
if(isset($_POST['form_id']) && (int)$_POST['form_id'] > 0) {
|
23 |
}
|
24 |
|
25 |
function send_test_mail(){
|
26 |
+
$this->requireSecurity();
|
27 |
$this->_displayErrors();
|
28 |
/*switch the send method*/
|
29 |
$configVal=$this->_convertPostedInarray();
|
41 |
}
|
42 |
|
43 |
function send_test_mail_ms(){
|
44 |
+
$this->requireSecurity();
|
45 |
$this->_displayErrors();
|
46 |
/*switch the send method*/
|
47 |
$configVal=$this->_convertPostedInarray();
|
99 |
* @return type
|
100 |
*/
|
101 |
function bounce_process(){
|
102 |
+
$this->requireSecurity();
|
103 |
// bounce handling
|
104 |
$helper_bounce = WYSIJA::get('bounce','helper');
|
105 |
|
115 |
}
|
116 |
|
117 |
function linkignore(){
|
118 |
+
$this->requireSecurity();
|
119 |
$this->_displayErrors();
|
120 |
|
121 |
$modelConf=WYSIJA::get('config','model');
|
133 |
|
134 |
// Ajax called function to enable analytics sharing from welcome page.
|
135 |
function share_analytics() {
|
136 |
+
$this->requireSecurity();
|
137 |
$this->_displayErrors();
|
138 |
|
139 |
$model_config = WYSIJA::get('config','model');
|
145 |
}
|
146 |
|
147 |
function validate(){
|
148 |
+
$this->requireSecurity();
|
149 |
+
$helper_licence = WYSIJA::get('licence','helper');
|
150 |
+
$result = $helper_licence->check();
|
151 |
|
152 |
+
if(!isset($result['result'])){
|
153 |
+
$result['result']=false;
|
154 |
+
}
|
155 |
+
|
156 |
+
return $result;
|
157 |
}
|
158 |
|
159 |
function _convertPostedInarray(){
|
160 |
$_POST = stripslashes_deep($_POST);
|
161 |
+
$data_temp = $_POST['data'];
|
162 |
$_POST['data']=array();
|
163 |
+
foreach($data_temp as $val) $_POST['data'][$val['name']]=$val['value'];
|
164 |
+
$data_temp = null;
|
165 |
foreach($_POST['data'] as $k =>$v){
|
166 |
+
$new_key = str_replace(array('wysija[config][',']'),'',$k);
|
167 |
+
$config_val[$new_key] = $v;
|
168 |
}
|
169 |
+
return $config_val;
|
170 |
}
|
171 |
|
172 |
// WYSIJA Form Editor
|
178 |
}
|
179 |
|
180 |
function wysija_form_manage_field() {
|
181 |
+
$this->requireSecurity();
|
182 |
$response = array('result' => true, 'error' => null);
|
183 |
|
184 |
// get data
|
275 |
|
276 |
// remove a custom field
|
277 |
function form_field_delete() {
|
278 |
+
$this->requireSecurity();
|
279 |
$data = $this->_wysija_form_get_data();
|
280 |
|
281 |
// check for field_id parameter
|
325 |
}
|
326 |
|
327 |
function form_name_save() {
|
328 |
+
$this->requireSecurity();
|
329 |
// get name from post and stripslashes it
|
330 |
$form_name = trim(stripslashes($_POST['name']));
|
331 |
// get form_id from post
|
340 |
}
|
341 |
|
342 |
function form_save() {
|
343 |
+
$this->requireSecurity();
|
344 |
// get form id
|
345 |
$form_id = null;
|
346 |
if(isset($_POST['form_id']) && (int)$_POST['form_id'] > 0) {
|
controllers/back/campaigns.php
CHANGED
@@ -16,68 +16,70 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
16 |
|
17 |
}
|
18 |
|
19 |
-
function installation(){
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
@ignore_user_abort( true );
|
33 |
-
|
34 |
-
$reset_max_execution_time = ini_get( 'max_execution_time' );
|
35 |
-
|
36 |
-
// FAILURE some servers the "max execution time" returned is Array we make sure our value is numeric
|
37 |
-
if( !is_numeric( $ini_max_execution_time ) ){
|
38 |
-
WYSIJA::update_option( 'mpoet_check_max_execution_time' , $ini_max_execution_time-1 );
|
39 |
-
return;
|
40 |
-
}
|
41 |
-
|
42 |
-
// FAILURE this server doesn't allow us to set the max_execution_time
|
43 |
-
if( $reset_max_execution_time == $ini_max_execution_time ){
|
44 |
-
WYSIJA::update_option( 'mpoet_check_max_execution_time' , $ini_max_execution_time-1 );
|
45 |
-
return;
|
46 |
}
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
$total_time_to_run_script = $total_time_to_run_script - $sleeping_intervals;
|
63 |
-
sleep( $sleeping_intervals );
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
WYSIJA::update_option( 'mpoet_check_max_execution_time' , $duration_so_far );
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
echo 'max_execution_time('.$ini_max_execution_time.') cannot be extended( max value : '.$check_max_execution_time.')';
|
78 |
}
|
79 |
}
|
80 |
-
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
/**
|
@@ -103,11 +105,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
103 |
|
104 |
//add a new language code with a new video
|
105 |
$video_language=array();
|
106 |
-
//$video_language['en_EN'] = '<iframe width="853" height="480" src="http://www.youtube.com/embed/pYzaHDTg5Jk" frameborder="0" allowfullscreen></iframe>';
|
107 |
$video_language['en_EN'] = '<iframe src="//player.vimeo.com/video/81479899" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
108 |
-
//$video_language['fr_FR'] = '<iframe width="853" height="480" src="http://www.youtube.com/embed/W5EyW5w7aWQ" frameborder="0" allowfullscreen></iframe>';
|
109 |
-
// $video_language['sv_SE']='<iframe width="853" height="480" src="http://www.youtube.com/embed/O8_t_dekx74" frameborder="0" allowfullscreen></iframe>';
|
110 |
-
//$video_language['ar']='<iframe width="853" height="480" src="http://www.youtube.com/embed/cyDHlX_qgOo" frameborder="0" allowfullscreen></iframe>';
|
111 |
|
112 |
$wp_lang = get_locale();
|
113 |
if (!empty($wp_lang) && isset($video_language[$wp_lang])) {
|
@@ -243,7 +241,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
243 |
* @param type $dataPost
|
244 |
*/
|
245 |
function manual_send($dataPost = false) {
|
246 |
-
$
|
|
|
247 |
$config = WYSIJA::get('config', 'model');
|
248 |
if ((int) $config->getValue('total_subscribers') < 2000) {
|
249 |
if ($modelQ->count() > 0) {
|
@@ -302,7 +301,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
302 |
$this->data['campaign'] = array('name' => '', 'description' => '');
|
303 |
$modelConfig = WYSIJA::get('config', 'model');
|
304 |
$this->data['email'] = array('subject' => '', 'from_email' => $modelConfig->getValue('from_email'), 'from_name' => $modelConfig->getValue('from_name'));
|
305 |
-
$this->data['lists'] = $this->
|
306 |
|
307 |
$this->dataAutoNl();
|
308 |
$this->jsLoc['admin-campaigns-edit']['autofields'] = $this->data['autonl']['fields'];
|
@@ -435,42 +434,6 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
435 |
}
|
436 |
}
|
437 |
|
438 |
-
function __getLists($enabled = true, $count = false, $notgetalllistid = false) {
|
439 |
-
$modelList = WYSIJA::get('list', 'model');
|
440 |
-
//get lists which have users and are enabled */
|
441 |
-
if ($enabled)
|
442 |
-
$enabledstrg = ' is_enabled>0 and';
|
443 |
-
else
|
444 |
-
$enabledstrg = '';
|
445 |
-
|
446 |
-
$extrasql = '';
|
447 |
-
if (!$notgetalllistid)
|
448 |
-
$extrasql = 'WHERE list_id in (SELECT distinct(list_id) from [wysija]user_list )';
|
449 |
-
$query = 'SELECT * FROM [wysija]list ' . $extrasql;
|
450 |
-
$listres = $modelList->query('get_res', $query);
|
451 |
-
|
452 |
-
if ($count) {
|
453 |
-
$mConfig = WYSIJA::get('config', 'model');
|
454 |
-
$condit = '>=';
|
455 |
-
if ($mConfig->getValue('confirm_dbleoptin'))
|
456 |
-
$condit = '>';
|
457 |
-
$qry1 = "SELECT count(distinct A.user_id) as nbsub,A.list_id FROM `[wysija]user_list` as A LEFT JOIN `[wysija]user` as B on A.user_id=B.user_id WHERE B.status $condit 0 and A.sub_date>0 and A.unsub_date=0 GROUP BY list_id";
|
458 |
-
|
459 |
-
$total = $modelList->getResults($qry1);
|
460 |
-
|
461 |
-
foreach ($total as $tot) {
|
462 |
-
foreach ($listres as $key => $res) {
|
463 |
-
if ($tot['list_id'] == $res['list_id'])
|
464 |
-
$listres[$key]['count'] = $tot['nbsub'];
|
465 |
-
}
|
466 |
-
}
|
467 |
-
}
|
468 |
-
foreach ($listres as $key => $res) {
|
469 |
-
if (!isset($res['count']))
|
470 |
-
$listres[$key]['count'] = 0;
|
471 |
-
}
|
472 |
-
return $listres;
|
473 |
-
}
|
474 |
|
475 |
function edit($dataPost = false) {
|
476 |
if (!$this->_checkEmailExists($_REQUEST['id']))
|
@@ -544,6 +507,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
544 |
|
545 |
function pause() {
|
546 |
/* pause the campaign entry */
|
|
|
547 |
if (isset($_REQUEST['id']) && $_REQUEST['id']) {
|
548 |
$modelEmail = WYSIJA::get('email', 'model');
|
549 |
$myemail = $modelEmail->getOne(false, array('email_id' => $_REQUEST['id']));
|
@@ -563,6 +527,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
563 |
|
564 |
function resume() {
|
565 |
/* pause the campaign entry */
|
|
|
566 |
if (isset($_REQUEST['id']) && $_REQUEST['id']) {
|
567 |
$modelEmail = WYSIJA::get('email', 'model');
|
568 |
$modelEmail->columns['modified_at']['autoup'] = 1;
|
@@ -575,6 +540,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
575 |
|
576 |
function duplicate() {
|
577 |
/* 1 - copy the campaign entry */
|
|
|
578 |
$model = WYSIJA::get( 'campaign', 'model' );
|
579 |
$query = 'INSERT INTO `[wysija]campaign` (`name`,`description`)
|
580 |
SELECT concat("' . stripslashes( __( 'Copy of ', WYSIJA ) ) . '",`name`),`description` FROM [wysija]campaign
|
@@ -638,22 +604,6 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
638 |
$this->redirect( 'admin.php?page=wysija_campaigns&id=' . $emailid . '&action=edit' );
|
639 |
}
|
640 |
|
641 |
-
function duplicateEmail() {
|
642 |
-
if (!$this->_checkEmailExists($_REQUEST['id']))
|
643 |
-
return;
|
644 |
-
|
645 |
-
$model = WYSIJA::get('campaign', 'model');
|
646 |
-
/* 2 - copy the email entry */
|
647 |
-
$query = 'INSERT INTO `[wysija]email` (`campaign_id`,`subject`,`body`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`,`created_at`,`modified_at`)
|
648 |
-
SELECT `campaign_id`, concat("' . stripslashes(__("Copy of ", WYSIJA)) . '",`subject`),`body`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,0,' . time() . ',' . time() . ' FROM [wysija]email
|
649 |
-
WHERE email_id=' . (int) $_REQUEST['id'];
|
650 |
-
$emailid = $model->query($query);
|
651 |
-
|
652 |
-
$this->notice(__('The newsletter has been duplicated.', WYSIJA));
|
653 |
-
|
654 |
-
$this->redirect('admin.php?page=wysija_campaigns&id=' . $emailid . '&action=edit');
|
655 |
-
}
|
656 |
-
|
657 |
function immediateWarning() {
|
658 |
$model_config = WYSIJA::get('config', 'model');
|
659 |
$is_multisite = is_multisite();
|
@@ -670,10 +620,10 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
670 |
$formsHelp = WYSIJA::get('forms', 'helper');
|
671 |
|
672 |
$timespan = $formsHelp->eachValuesSec[$sending_emails_each];
|
673 |
-
$
|
674 |
|
675 |
$this->immediatewarning = str_replace(
|
676 |
-
array('[link]', '[/link]', '[settings]'), array('<a href="#">', '</a>', sprintf(__('%1$s emails every %2$s', WYSIJA), $number, trim($
|
677 |
$this->viewObj->immediatewarning = '<span class="warning-msg" id="immediatewarning">' . $this->immediatewarning . '</span>';
|
678 |
|
679 |
$this->jsTrans['immediatewarning'] = $this->immediatewarning;
|
@@ -715,7 +665,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
715 |
$model_list = WYSIJA::get('list', 'model');
|
716 |
$model_list->limitON = false;
|
717 |
$this->data = array();
|
718 |
-
$this->data['lists'] = $this->
|
719 |
|
720 |
$model_email = WYSIJA::get('email', 'model');
|
721 |
$this->data['email'] = $model_email->getOne(false, array('email_id' => $_REQUEST['id']));
|
@@ -828,7 +778,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
828 |
|
829 |
function savecamp() {
|
830 |
$this->redirectAfterSave = false;
|
831 |
-
|
832 |
/* update email */
|
833 |
$data = array();
|
834 |
|
@@ -1231,7 +1181,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1231 |
|
1232 |
function saveemail() {
|
1233 |
$this->redirectAfterSave = false;
|
1234 |
-
|
1235 |
$modelEmail = WYSIJA::get("email", "model");
|
1236 |
$modelEmail->fieldValid = false;
|
1237 |
$emaildataarr = $modelEmail->getOne(array('email_id' => $_REQUEST['id']));
|
@@ -1289,6 +1239,17 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1289 |
$this->notice(__('Newsletter has been scheduled.', WYSIJA));
|
1290 |
else
|
1291 |
$this->notice(__('Newsletter has been saved as a draft.', WYSIJA));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1292 |
}else {
|
1293 |
// we update the param attribute with what's has been posted
|
1294 |
foreach ($update_email as $ki => $vi) {
|
@@ -1686,24 +1647,24 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1686 |
$campaign_ids_sent = $campaign_ids = array();
|
1687 |
foreach ($this->data['campaigns'] as &$campaign) {
|
1688 |
$campaign_ids[] = $campaign['campaign_id'];
|
1689 |
-
$
|
1690 |
-
$
|
1691 |
if (in_array((int) $campaign['status'], array(-1, 1, 2, 3, 99)))
|
1692 |
$campaign_ids_sent[] = $campaign['campaign_id'];
|
1693 |
}
|
1694 |
|
1695 |
// 3 - campaign_list request & count request for queue */
|
1696 |
if ($campaign_ids) {
|
1697 |
-
$
|
1698 |
-
$userlists = $
|
1699 |
|
1700 |
if ($campaign_ids_sent) {
|
1701 |
-
$
|
1702 |
-
$statstotal = $
|
1703 |
JOIN `[wysija]email` as B on A.email_id=B.email_id
|
1704 |
WHERE B.campaign_id IN (" . implode(",", $campaign_ids_sent) . ") group by B.email_id");
|
1705 |
|
1706 |
-
$senttotalgroupedby = $
|
1707 |
JOIN `[wysija]email` as B on A.email_id=B.email_id
|
1708 |
WHERE B.campaign_id IN (" . implode(",", $campaign_ids_sent) . ") group by A.status,B.email_id"); //,A.status
|
1709 |
|
@@ -1721,7 +1682,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1721 |
}
|
1722 |
}
|
1723 |
|
1724 |
-
$
|
1725 |
|
1726 |
foreach ($updateEmail as $emailid => $update) {
|
1727 |
|
@@ -1730,25 +1691,23 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1730 |
$update[$v] = 0;
|
1731 |
}
|
1732 |
|
1733 |
-
$
|
1734 |
-
$
|
1735 |
}
|
1736 |
|
1737 |
|
1738 |
-
|
1739 |
-
$modelC = WYSIJA::get('config', 'model');
|
1740 |
$running = false;
|
1741 |
|
1742 |
$is_multisite = is_multisite();
|
1743 |
|
1744 |
-
|
1745 |
-
|
1746 |
-
$sending_emails_each = $modelC->getValue('ms_sending_emails_each');
|
1747 |
} else {
|
1748 |
-
$sending_emails_each = $
|
1749 |
}
|
1750 |
|
1751 |
-
if ($
|
1752 |
$formsHelp = WYSIJA::get('forms', 'helper');
|
1753 |
$queue_frequency = $formsHelp->eachValuesSec[$sending_emails_each];
|
1754 |
$queue_scheduled = WYSIJA::get_cron_schedule('queue');
|
@@ -1757,9 +1716,9 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1757 |
$running = $queue_scheduled['running'];
|
1758 |
|
1759 |
if ($running) {
|
1760 |
-
$
|
1761 |
$running = time() - $running;
|
1762 |
-
$running = $
|
1763 |
}
|
1764 |
} else {
|
1765 |
$schedules = wp_get_schedules();
|
@@ -1793,11 +1752,10 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1793 |
$this->data['sent'][$sentot['email_id']]['left'] = (int) $this->data['sent'][$sentot['email_id']]['total'] - (int) $this->data['sent'][$sentot['email_id']]['to'];
|
1794 |
}
|
1795 |
|
1796 |
-
|
1797 |
-
|
1798 |
-
$sending_emails_number = $modelC->getValue('ms_sending_emails_number');
|
1799 |
} else {
|
1800 |
-
$sending_emails_number = $
|
1801 |
}
|
1802 |
|
1803 |
if (isset($this->data['sent'])) {
|
@@ -1818,19 +1776,19 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1818 |
|
1819 |
// status update to sent for the one that are sent
|
1820 |
if (count($status_sent_complete) > 0) {
|
1821 |
-
$
|
1822 |
-
$
|
1823 |
-
$
|
1824 |
-
$
|
1825 |
}
|
1826 |
}
|
1827 |
}
|
1828 |
|
1829 |
$this->data['counts'] = array_reverse($counts);
|
1830 |
|
1831 |
-
|
1832 |
foreach ($this->data['campaigns'] as &$campaign) {
|
1833 |
-
|
1834 |
//TODO add data for stats about emails opened clicked etc
|
1835 |
$campaign["emails"] = 0;
|
1836 |
$campaign["opened"] = 0;
|
@@ -1866,7 +1824,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1866 |
}
|
1867 |
|
1868 |
function setviewStatsfilter() {
|
1869 |
-
|
1870 |
$this->searchable = array("email", "firstname", "lastname");
|
1871 |
$this->filters = array();
|
1872 |
if (isset($_REQUEST['search']) && $_REQUEST['search']) {
|
@@ -1936,16 +1894,16 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1936 |
$this->modelObj->reset();
|
1937 |
$this->modelObj->noCheck = true;
|
1938 |
|
1939 |
-
|
1940 |
$queryCmmonStart = 'SELECT count(distinct B.user_id) as users FROM `[wysija]user` as A';
|
1941 |
$queryCmmonStart.=' LEFT JOIN `[wysija]' . $this->tableQuery . '` as B on A.user_id=B.user_id';
|
1942 |
|
1943 |
-
|
1944 |
$query = "SELECT count(user_id) as users, status FROM `[wysija]email_user_stat` as A
|
1945 |
WHERE A.email_id=" . $email_object['email_id'] . " GROUP BY status";
|
1946 |
$countss = $this->modelObj->query("get_res", $query, ARRAY_A);
|
1947 |
|
1948 |
-
|
1949 |
$query = "SELECT count(user_id) as users FROM `[wysija]queue` as A
|
1950 |
WHERE A.email_id=" . $email_object['email_id'];
|
1951 |
$countss[-2]['status'] = -3;
|
@@ -1991,17 +1949,17 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
1991 |
$this->filters['equal']["B.email_id"] = $email_object['email_id'];
|
1992 |
|
1993 |
$this->modelObj->noCheck = true;
|
1994 |
-
if ($this->filters)
|
1995 |
-
|
|
|
1996 |
|
1997 |
-
//$this->modelObj->setConditions(array("equal"=>array("B.email_id"=>$emailObj['email_id'])));
|
1998 |
|
1999 |
-
|
2000 |
$query = 'SELECT A.user_id, A.firstname, A.lastname,A.status as ustatus,' . $this->statusemail . ' , A.email, B.* FROM `[wysija]user` as A';
|
2001 |
$query.=' LEFT JOIN `[wysija]' . $this->tableQuery . '` as B on A.user_id=B.user_id';
|
2002 |
$queryFinal = $this->modelObj->makeWhere();
|
2003 |
|
2004 |
-
|
2005 |
if ($this->filters)
|
2006 |
$this->modelObj->countRows = $this->modelObj->count($queryCmmonStart . $queryFinal, 'users');
|
2007 |
else
|
@@ -2049,15 +2007,16 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2049 |
$hook_params = array(
|
2050 |
'email_id' => $email_object['email_id'],
|
2051 |
'url_id' => isset($_REQUEST['url_id']) && $_REQUEST['url_id'] ? $_REQUEST['url_id'] : false,
|
2052 |
-
'subscribers' => &$subscribers
|
|
|
2053 |
);
|
2054 |
$this->data['subscribers'] = $this->modelObj->getResults($query . $queryFinal . " GROUP BY A.user_id" . $orderby . $this->modelObj->setLimit(0, (int)$limit_pp));
|
2055 |
$this->modelObj->reset();
|
2056 |
|
2057 |
-
|
2058 |
$modelList = WYSIJA::get("list", "model");
|
2059 |
|
2060 |
-
|
2061 |
$query = "SELECT A.list_id, A.name,A.is_enabled, count( B.user_id ) AS users FROM `[wysija]" . $modelList->table_name . "` as A";
|
2062 |
$query.=" LEFT JOIN `[wysija]user_list` as B on A.list_id = B.list_id";
|
2063 |
$query.=" GROUP BY A.list_id";
|
@@ -2075,7 +2034,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2075 |
$user_ids[] = $subscriber['user_id'];
|
2076 |
}
|
2077 |
|
2078 |
-
|
2079 |
if ($user_ids) {
|
2080 |
$modeluList = WYSIJA::get("user_list", "model");
|
2081 |
$userlists = $modeluList->get(array("list_id", "user_id"), array("user_id" => $user_ids));
|
@@ -2085,9 +2044,9 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2085 |
$this->data['lists'] = $lists;
|
2086 |
$this->data['counts'] = array_reverse($counts);
|
2087 |
|
2088 |
-
|
2089 |
foreach ($this->data['subscribers'] as $keysus => $subscriber) {
|
2090 |
-
|
2091 |
//TODO add data for stats about emails opened clicked etc
|
2092 |
$this->data['subscribers'][$keysus]["emails"] = 0;
|
2093 |
$this->data['subscribers'][$keysus]["opened"] = 0;
|
@@ -2115,7 +2074,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2115 |
$hook_params = array(
|
2116 |
'email_id' => $_REQUEST['id'],
|
2117 |
'email_object' => $email_object,
|
2118 |
-
'url_id' => !empty($_REQUEST['url_id']) ? (int)$_REQUEST['url_id'] : null
|
|
|
2119 |
);
|
2120 |
|
2121 |
$this->data['hooks']['hook_newsletter_top'] = apply_filters('hook_newsletter_top', WYSIJA_module::execute_hook('hook_newsletter_top', $hook_params), $hook_params);
|
@@ -2126,7 +2086,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2126 |
$this->modelObj = WYSIJA::get("email", "model");
|
2127 |
$this->emailObj = $this->modelObj->getOne(false, array('email_id' => $_REQUEST['id']));
|
2128 |
|
2129 |
-
|
2130 |
$this->setviewStatsfilter();
|
2131 |
|
2132 |
if ($selectcolumns == "B.user_id") {
|
@@ -2138,7 +2098,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2138 |
if ($this->filters)
|
2139 |
$this->modelObj->setConditions($this->filters);
|
2140 |
|
2141 |
-
|
2142 |
if ($selectcolumns == "B.user_id") {
|
2143 |
$query = "SELECT $selectcolumns FROM `[wysija]" . $this->tableQuery . "` as B";
|
2144 |
$query.=$this->modelObj->makeWhere();
|
@@ -2152,23 +2112,25 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2152 |
}
|
2153 |
|
2154 |
function createnewlist() {
|
2155 |
-
|
|
|
|
|
2156 |
$emailModel = WYSIJA::get('email', 'model');
|
2157 |
$email = $emailModel->getOne(array('subject'), array('email_id' => $_REQUEST['id']));
|
2158 |
|
2159 |
$this->modelObj->reset();
|
2160 |
|
2161 |
-
|
2162 |
$prefix = "";
|
2163 |
if (isset($_REQUEST['link_filter']))
|
2164 |
$prefix = ' (' . $this->viewObj->getTransStatusEmail($_REQUEST['link_filter']) . ')';
|
2165 |
$listname = sprintf(__('Segment of %1$s', WYSIJA), $email['subject'] . $prefix);
|
2166 |
|
2167 |
-
|
2168 |
$modelL = WYSIJA::get('list', 'model');
|
2169 |
$listid = $modelL->insert(array('is_enabled' => 1, 'name' => $listname, 'description' => __('List created based on a newsletter segment.', WYSIJA)));
|
2170 |
|
2171 |
-
|
2172 |
$query = $this->getListSubscriberQry($listid . ', A.user_id, ' . time() . ', 0');
|
2173 |
|
2174 |
$query2 = 'INSERT INTO `[wysija]user_list` (`list_id`,`user_id`,`sub_date`,`unsub_date`) ' . $query;
|
@@ -2201,24 +2163,9 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2201 |
$this->redirect('admin.php?page=wysija_campaigns&action=viewstats&id=' . $_REQUEST['id']);
|
2202 |
}
|
2203 |
|
2204 |
-
function sendconfirmation() {
|
2205 |
-
//delete from user_lists where select from email_user_stat
|
2206 |
-
$query = $this->getListSubscriberQry('B.user_id ');
|
2207 |
-
|
2208 |
-
$user_ids = $this->modelObj->query('get_res', $query);
|
2209 |
-
|
2210 |
-
$uids = array();
|
2211 |
-
foreach ($user_ids as $data) {
|
2212 |
-
$uids[] = $data['user_id'];
|
2213 |
-
}
|
2214 |
-
|
2215 |
-
$helperUser = WYSIJA::get('user', 'helper');
|
2216 |
-
$helperUser->sendConfirmationEmail($uids);
|
2217 |
-
$this->redirect('admin.php?page=wysija_campaigns&action=viewstats&id=' . $_REQUEST['id']);
|
2218 |
-
}
|
2219 |
-
|
2220 |
function removequeue() {
|
2221 |
-
|
|
|
2222 |
$query = $this->getListSubscriberQry('B.user_id');
|
2223 |
$query2 = "DELETE FROM `[wysija]queue` where user_id IN ($query) AND email_id=" . $this->emailObj['email_id'];
|
2224 |
$this->modelObj->query($query2);
|
@@ -2228,22 +2175,25 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2228 |
}
|
2229 |
|
2230 |
function export() {
|
2231 |
-
|
|
|
2232 |
$query = $this->getListSubscriberQry('B.user_id');
|
2233 |
$result = $this->modelObj->query('get_res', $query);
|
2234 |
$user_ids = array();
|
2235 |
-
foreach ($result as $user)
|
2236 |
-
|
|
|
2237 |
|
2238 |
-
$
|
2239 |
-
$tempfilename = $
|
2240 |
|
2241 |
-
|
2242 |
-
|
|
|
2243 |
}
|
2244 |
|
2245 |
function unsubscribelist($data) {
|
2246 |
-
|
2247 |
$modelL = WYSIJA::get('list', 'model');
|
2248 |
$list = $modelL->getOne(false, array('list_id' => $data['listid']));
|
2249 |
if ($list['is_enabled']) {
|
@@ -2360,7 +2310,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2360 |
}
|
2361 |
|
2362 |
function themeupload() {
|
2363 |
-
$
|
|
|
2364 |
$bytes = $helperNumbers->get_max_file_upload();
|
2365 |
|
2366 |
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $bytes['maxbytes']) {
|
@@ -2647,25 +2598,8 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2647 |
return wp_iframe(array($this->viewObj, 'popup_wp_browse'), array());
|
2648 |
}
|
2649 |
|
2650 |
-
function _wysija_subaction() {
|
2651 |
-
|
2652 |
-
if (isset($_REQUEST['subaction'])) {
|
2653 |
-
if ($_REQUEST['subaction'] === 'delete') {
|
2654 |
-
if (isset($_REQUEST['imgid']) && (int) $_REQUEST['imgid'] > 0) {
|
2655 |
-
/* delete the image with id imgid */
|
2656 |
-
$res = wp_delete_attachment((int) $_REQUEST['imgid'], true);
|
2657 |
-
if ($res) {
|
2658 |
-
$this->notice(__('Image has been deleted.', WYSIJA));
|
2659 |
-
}
|
2660 |
-
}
|
2661 |
-
}
|
2662 |
-
}
|
2663 |
-
return true;
|
2664 |
-
}
|
2665 |
-
|
2666 |
function special_new_wordp_upload() {
|
2667 |
|
2668 |
-
//wp_enqueue_script('plupload-all');
|
2669 |
wp_enqueue_script('wysija-plupload-handlers', WYSIJA_URL . 'js/jquery/pluploadHandler.js', array('plupload-all', 'jquery'));
|
2670 |
$uploader_l10n = array(
|
2671 |
'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
|
@@ -2699,10 +2633,6 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2699 |
wp_enqueue_style('imgareaselect');
|
2700 |
wp_enqueue_script('media-gallery');
|
2701 |
|
2702 |
-
/* wp_register_style('myplupload', '/adjust-this-url/myplupload.css');
|
2703 |
-
wp_enqueue_style('myplupload'); */
|
2704 |
-
|
2705 |
-
|
2706 |
$errors = array();
|
2707 |
return wp_iframe(array($this->viewObj, 'popup_new_wp_upload'), $errors);
|
2708 |
}
|
@@ -2764,17 +2694,19 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
|
|
2764 |
|
2765 |
function _checkEmailExists($emailId) {
|
2766 |
$result = false;
|
2767 |
-
$
|
2768 |
|
2769 |
-
if ($
|
2770 |
-
|
|
|
2771 |
|
2772 |
if (!$result) {
|
2773 |
$this->error(__("The newsletter doesn't exist.", WYSIJA), 1);
|
2774 |
$this->redirect('admin.php?page=wysija_campaigns');
|
2775 |
-
}
|
2776 |
-
|
2777 |
-
|
|
|
2778 |
}
|
2779 |
|
2780 |
}
|
16 |
|
17 |
}
|
18 |
|
|
|
19 |
|
20 |
+
private function _wysija_subaction() {
|
21 |
+
if (isset($_REQUEST['subaction'])) {
|
22 |
+
if ($_REQUEST['subaction'] === 'delete') {
|
23 |
+
$this->_verify_nonce_subaction();
|
24 |
+
if (isset($_REQUEST['imgid']) && (int) $_REQUEST['imgid'] > 0) {
|
25 |
+
// delete the image with id imgid
|
26 |
+
$res = wp_delete_attachment((int) $_REQUEST['imgid'], true);
|
27 |
+
if ($res) {
|
28 |
+
$this->notice(__('Image has been deleted.', WYSIJA));
|
29 |
+
}
|
30 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
+
}
|
33 |
+
return true;
|
34 |
+
}
|
35 |
|
36 |
+
private function _verify_nonce_subaction(){
|
37 |
+
if(!wp_verify_nonce($_REQUEST['_wpnonce'], $_REQUEST['page'].'-action_sub_delete_image') ){
|
38 |
+
wp_die("<h2>" . __('Security failure during request') . "</h2>", __("Security Problem"), array(
|
39 |
+
'response' => 403,
|
40 |
+
'back_link' => false
|
41 |
+
));
|
42 |
+
}
|
43 |
+
}
|
44 |
|
45 |
+
private function _getLists($enabled = true, $count = false, $simple_query = false) {
|
46 |
+
$model_list = WYSIJA::get('list', 'model');
|
47 |
+
//get lists which have users and are enabled */
|
48 |
+
if ($enabled){
|
49 |
+
$sql_enabled_condition = ' is_enabled>0 and';
|
50 |
+
}else{
|
51 |
+
$sql_enabled_condition = '';
|
52 |
+
}
|
53 |
|
54 |
+
$extra_sql = '';
|
55 |
+
if (!$simple_query){
|
56 |
+
$extra_sql = 'WHERE list_id in (SELECT distinct(list_id) from [wysija]user_list )';
|
57 |
+
}
|
58 |
|
59 |
+
$query = 'SELECT * FROM [wysija]list ' . $extra_sql;
|
60 |
+
$listres = $model_list->query('get_res', $query);
|
|
|
|
|
61 |
|
62 |
+
if ($count) {
|
63 |
+
$model_config = WYSIJA::get('config', 'model');
|
64 |
+
$condition = '>=';
|
65 |
+
if ($model_config->getValue('confirm_dbleoptin'))
|
66 |
+
$condition = '>';
|
67 |
+
$qry1 = "SELECT count(distinct A.user_id) as nbsub,A.list_id FROM `[wysija]user_list` as A LEFT JOIN `[wysija]user` as B on A.user_id=B.user_id WHERE B.status $condition 0 and A.sub_date>0 and A.unsub_date=0 GROUP BY list_id";
|
68 |
|
69 |
+
$total = $model_list->getResults($qry1);
|
|
|
70 |
|
71 |
+
foreach ($total as $tot) {
|
72 |
+
foreach ($listres as $key => $res) {
|
73 |
+
if ($tot['list_id'] == $res['list_id'])
|
74 |
+
$listres[$key]['count'] = $tot['nbsub'];
|
75 |
+
}
|
|
|
76 |
}
|
77 |
}
|
78 |
+
foreach ($listres as $key => $res) {
|
79 |
+
if (!isset($res['count']))
|
80 |
+
$listres[$key]['count'] = 0;
|
81 |
+
}
|
82 |
+
return $listres;
|
83 |
}
|
84 |
|
85 |
/**
|
105 |
|
106 |
//add a new language code with a new video
|
107 |
$video_language=array();
|
|
|
108 |
$video_language['en_EN'] = '<iframe src="//player.vimeo.com/video/81479899" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
|
|
|
|
|
|
109 |
|
110 |
$wp_lang = get_locale();
|
111 |
if (!empty($wp_lang) && isset($video_language[$wp_lang])) {
|
241 |
* @param type $dataPost
|
242 |
*/
|
243 |
function manual_send($dataPost = false) {
|
244 |
+
$this->requireSecurity();
|
245 |
+
$modelQ = WYSIJA::get('queue', 'model');
|
246 |
$config = WYSIJA::get('config', 'model');
|
247 |
if ((int) $config->getValue('total_subscribers') < 2000) {
|
248 |
if ($modelQ->count() > 0) {
|
301 |
$this->data['campaign'] = array('name' => '', 'description' => '');
|
302 |
$modelConfig = WYSIJA::get('config', 'model');
|
303 |
$this->data['email'] = array('subject' => '', 'from_email' => $modelConfig->getValue('from_email'), 'from_name' => $modelConfig->getValue('from_name'));
|
304 |
+
$this->data['lists'] = $this->_getLists(false, true, true);
|
305 |
|
306 |
$this->dataAutoNl();
|
307 |
$this->jsLoc['admin-campaigns-edit']['autofields'] = $this->data['autonl']['fields'];
|
434 |
}
|
435 |
}
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
|
438 |
function edit($dataPost = false) {
|
439 |
if (!$this->_checkEmailExists($_REQUEST['id']))
|
507 |
|
508 |
function pause() {
|
509 |
/* pause the campaign entry */
|
510 |
+
$this->requireSecurity();
|
511 |
if (isset($_REQUEST['id']) && $_REQUEST['id']) {
|
512 |
$modelEmail = WYSIJA::get('email', 'model');
|
513 |
$myemail = $modelEmail->getOne(false, array('email_id' => $_REQUEST['id']));
|
527 |
|
528 |
function resume() {
|
529 |
/* pause the campaign entry */
|
530 |
+
$this->requireSecurity();
|
531 |
if (isset($_REQUEST['id']) && $_REQUEST['id']) {
|
532 |
$modelEmail = WYSIJA::get('email', 'model');
|
533 |
$modelEmail->columns['modified_at']['autoup'] = 1;
|
540 |
|
541 |
function duplicate() {
|
542 |
/* 1 - copy the campaign entry */
|
543 |
+
$this->requireSecurity();
|
544 |
$model = WYSIJA::get( 'campaign', 'model' );
|
545 |
$query = 'INSERT INTO `[wysija]campaign` (`name`,`description`)
|
546 |
SELECT concat("' . stripslashes( __( 'Copy of ', WYSIJA ) ) . '",`name`),`description` FROM [wysija]campaign
|
604 |
$this->redirect( 'admin.php?page=wysija_campaigns&id=' . $emailid . '&action=edit' );
|
605 |
}
|
606 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
function immediateWarning() {
|
608 |
$model_config = WYSIJA::get('config', 'model');
|
609 |
$is_multisite = is_multisite();
|
620 |
$formsHelp = WYSIJA::get('forms', 'helper');
|
621 |
|
622 |
$timespan = $formsHelp->eachValuesSec[$sending_emails_each];
|
623 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
624 |
|
625 |
$this->immediatewarning = str_replace(
|
626 |
+
array('[link]', '[/link]', '[settings]'), array('<a href="#">', '</a>', sprintf(__('%1$s emails every %2$s', WYSIJA), $number, trim($helper_toolbox->duration_string($timespan, true)))), __('Your sending settings ([settings]) can\'t send that quickly to [number] subscribers. Expect delivery delays. [link]Read more[/link]', WYSIJA));
|
627 |
$this->viewObj->immediatewarning = '<span class="warning-msg" id="immediatewarning">' . $this->immediatewarning . '</span>';
|
628 |
|
629 |
$this->jsTrans['immediatewarning'] = $this->immediatewarning;
|
665 |
$model_list = WYSIJA::get('list', 'model');
|
666 |
$model_list->limitON = false;
|
667 |
$this->data = array();
|
668 |
+
$this->data['lists'] = $this->_getLists(false, true, true);
|
669 |
|
670 |
$model_email = WYSIJA::get('email', 'model');
|
671 |
$this->data['email'] = $model_email->getOne(false, array('email_id' => $_REQUEST['id']));
|
778 |
|
779 |
function savecamp() {
|
780 |
$this->redirectAfterSave = false;
|
781 |
+
$this->requireSecurity();
|
782 |
/* update email */
|
783 |
$data = array();
|
784 |
|
1181 |
|
1182 |
function saveemail() {
|
1183 |
$this->redirectAfterSave = false;
|
1184 |
+
$this->requireSecurity();
|
1185 |
$modelEmail = WYSIJA::get("email", "model");
|
1186 |
$modelEmail->fieldValid = false;
|
1187 |
$emaildataarr = $modelEmail->getOne(array('email_id' => $_REQUEST['id']));
|
1239 |
$this->notice(__('Newsletter has been scheduled.', WYSIJA));
|
1240 |
else
|
1241 |
$this->notice(__('Newsletter has been saved as a draft.', WYSIJA));
|
1242 |
+
|
1243 |
+
if (isset($_POST['submit-draft'])) {
|
1244 |
+
// Email is being stored as draft
|
1245 |
+
$STATE_DRAFT_EMAIL = 0;
|
1246 |
+
$update_email['state'] = $STATE_DRAFT_EMAIL;
|
1247 |
+
|
1248 |
+
if (isset($update_email['params']['schedule']['isscheduled'])) {
|
1249 |
+
// draft emails should not be scheduled, clear any schedules
|
1250 |
+
unset($update_email['params']['schedule']['isscheduled']);
|
1251 |
+
}
|
1252 |
+
}
|
1253 |
}else {
|
1254 |
// we update the param attribute with what's has been posted
|
1255 |
foreach ($update_email as $ki => $vi) {
|
1647 |
$campaign_ids_sent = $campaign_ids = array();
|
1648 |
foreach ($this->data['campaigns'] as &$campaign) {
|
1649 |
$campaign_ids[] = $campaign['campaign_id'];
|
1650 |
+
$model_email = WYSIJA::get('email', 'model');
|
1651 |
+
$model_email->getParams($campaign);
|
1652 |
if (in_array((int) $campaign['status'], array(-1, 1, 2, 3, 99)))
|
1653 |
$campaign_ids_sent[] = $campaign['campaign_id'];
|
1654 |
}
|
1655 |
|
1656 |
// 3 - campaign_list request & count request for queue */
|
1657 |
if ($campaign_ids) {
|
1658 |
+
$model_campaign_list = WYSIJA::get('campaign_list', 'model');
|
1659 |
+
$userlists = $model_campaign_list->get(array('list_id', 'campaign_id'), array('campaign_id' => $campaign_ids));
|
1660 |
|
1661 |
if ($campaign_ids_sent) {
|
1662 |
+
$model_campaign_list = WYSIJA::get("email_user_stat", "model");
|
1663 |
+
$statstotal = $model_campaign_list->getResults("SELECT COUNT(A.user_id) as count,B.email_id FROM `[wysija]queue` as A
|
1664 |
JOIN `[wysija]email` as B on A.email_id=B.email_id
|
1665 |
WHERE B.campaign_id IN (" . implode(",", $campaign_ids_sent) . ") group by B.email_id");
|
1666 |
|
1667 |
+
$senttotalgroupedby = $model_campaign_list->getResults("SELECT COUNT(A.user_id) as count,B.campaign_id,B.email_id,B.type,B.status,A.status as statususer FROM `[wysija]" . $model_campaign_list->table_name . "` as A
|
1668 |
JOIN `[wysija]email` as B on A.email_id=B.email_id
|
1669 |
WHERE B.campaign_id IN (" . implode(",", $campaign_ids_sent) . ") group by A.status,B.email_id"); //,A.status
|
1670 |
|
1682 |
}
|
1683 |
}
|
1684 |
|
1685 |
+
$model_email = WYSIJA::get('email', 'model');
|
1686 |
|
1687 |
foreach ($updateEmail as $emailid => $update) {
|
1688 |
|
1691 |
$update[$v] = 0;
|
1692 |
}
|
1693 |
|
1694 |
+
$model_email->update($update, array('email_id' => $emailid));
|
1695 |
+
$model_email->reset();
|
1696 |
}
|
1697 |
|
1698 |
|
1699 |
+
$model_config = WYSIJA::get('config', 'model');
|
|
|
1700 |
$running = false;
|
1701 |
|
1702 |
$is_multisite = is_multisite();
|
1703 |
|
1704 |
+
if ($is_multisite && $model_config->getValue('sending_method') == 'network') {
|
1705 |
+
$sending_emails_each = $model_config->getValue('ms_sending_emails_each');
|
|
|
1706 |
} else {
|
1707 |
+
$sending_emails_each = $model_config->getValue('sending_emails_each');
|
1708 |
}
|
1709 |
|
1710 |
+
if ($model_config->getValue('cron_manual')) {
|
1711 |
$formsHelp = WYSIJA::get('forms', 'helper');
|
1712 |
$queue_frequency = $formsHelp->eachValuesSec[$sending_emails_each];
|
1713 |
$queue_scheduled = WYSIJA::get_cron_schedule('queue');
|
1716 |
$running = $queue_scheduled['running'];
|
1717 |
|
1718 |
if ($running) {
|
1719 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
1720 |
$running = time() - $running;
|
1721 |
+
$running = $helper_toolbox->duration_string($running, true, 4);
|
1722 |
}
|
1723 |
} else {
|
1724 |
$schedules = wp_get_schedules();
|
1752 |
$this->data['sent'][$sentot['email_id']]['left'] = (int) $this->data['sent'][$sentot['email_id']]['total'] - (int) $this->data['sent'][$sentot['email_id']]['to'];
|
1753 |
}
|
1754 |
|
1755 |
+
if ($is_multisite && $model_config->getValue('sending_method') == 'network') {
|
1756 |
+
$sending_emails_number = $model_config->getValue('ms_sending_emails_number');
|
|
|
1757 |
} else {
|
1758 |
+
$sending_emails_number = $model_config->getValue('sending_emails_number');
|
1759 |
}
|
1760 |
|
1761 |
if (isset($this->data['sent'])) {
|
1776 |
|
1777 |
// status update to sent for the one that are sent
|
1778 |
if (count($status_sent_complete) > 0) {
|
1779 |
+
$model_email = WYSIJA::get('email', 'model');
|
1780 |
+
$model_email->noCheck = true;
|
1781 |
+
$model_email->reset();
|
1782 |
+
$model_email->update(array('status' => 2), array('equal' => array('email_id' => $status_sent_complete)));
|
1783 |
}
|
1784 |
}
|
1785 |
}
|
1786 |
|
1787 |
$this->data['counts'] = array_reverse($counts);
|
1788 |
|
1789 |
+
// regrouping all the data in the same array
|
1790 |
foreach ($this->data['campaigns'] as &$campaign) {
|
1791 |
+
// default key while we don't have the data
|
1792 |
//TODO add data for stats about emails opened clicked etc
|
1793 |
$campaign["emails"] = 0;
|
1794 |
$campaign["opened"] = 0;
|
1824 |
}
|
1825 |
|
1826 |
function setviewStatsfilter() {
|
1827 |
+
// get the filters
|
1828 |
$this->searchable = array("email", "firstname", "lastname");
|
1829 |
$this->filters = array();
|
1830 |
if (isset($_REQUEST['search']) && $_REQUEST['search']) {
|
1894 |
$this->modelObj->reset();
|
1895 |
$this->modelObj->noCheck = true;
|
1896 |
|
1897 |
+
// 0 - counting request
|
1898 |
$queryCmmonStart = 'SELECT count(distinct B.user_id) as users FROM `[wysija]user` as A';
|
1899 |
$queryCmmonStart.=' LEFT JOIN `[wysija]' . $this->tableQuery . '` as B on A.user_id=B.user_id';
|
1900 |
|
1901 |
+
// all the counts query
|
1902 |
$query = "SELECT count(user_id) as users, status FROM `[wysija]email_user_stat` as A
|
1903 |
WHERE A.email_id=" . $email_object['email_id'] . " GROUP BY status";
|
1904 |
$countss = $this->modelObj->query("get_res", $query, ARRAY_A);
|
1905 |
|
1906 |
+
// we also count what is in the queue
|
1907 |
$query = "SELECT count(user_id) as users FROM `[wysija]queue` as A
|
1908 |
WHERE A.email_id=" . $email_object['email_id'];
|
1909 |
$countss[-2]['status'] = -3;
|
1949 |
$this->filters['equal']["B.email_id"] = $email_object['email_id'];
|
1950 |
|
1951 |
$this->modelObj->noCheck = true;
|
1952 |
+
if ($this->filters){
|
1953 |
+
$this->modelObj->setConditions($this->filters);
|
1954 |
+
}
|
1955 |
|
|
|
1956 |
|
1957 |
+
// 1 - subscriber request
|
1958 |
$query = 'SELECT A.user_id, A.firstname, A.lastname,A.status as ustatus,' . $this->statusemail . ' , A.email, B.* FROM `[wysija]user` as A';
|
1959 |
$query.=' LEFT JOIN `[wysija]' . $this->tableQuery . '` as B on A.user_id=B.user_id';
|
1960 |
$queryFinal = $this->modelObj->makeWhere();
|
1961 |
|
1962 |
+
// without filter we already have the total number of subscribers
|
1963 |
if ($this->filters)
|
1964 |
$this->modelObj->countRows = $this->modelObj->count($queryCmmonStart . $queryFinal, 'users');
|
1965 |
else
|
2007 |
$hook_params = array(
|
2008 |
'email_id' => $email_object['email_id'],
|
2009 |
'url_id' => isset($_REQUEST['url_id']) && $_REQUEST['url_id'] ? $_REQUEST['url_id'] : false,
|
2010 |
+
'subscribers' => &$subscribers,
|
2011 |
+
'id' => $email_object['campaign_id']
|
2012 |
);
|
2013 |
$this->data['subscribers'] = $this->modelObj->getResults($query . $queryFinal . " GROUP BY A.user_id" . $orderby . $this->modelObj->setLimit(0, (int)$limit_pp));
|
2014 |
$this->modelObj->reset();
|
2015 |
|
2016 |
+
// make the data object for the listing view
|
2017 |
$modelList = WYSIJA::get("list", "model");
|
2018 |
|
2019 |
+
// 2 - list request
|
2020 |
$query = "SELECT A.list_id, A.name,A.is_enabled, count( B.user_id ) AS users FROM `[wysija]" . $modelList->table_name . "` as A";
|
2021 |
$query.=" LEFT JOIN `[wysija]user_list` as B on A.list_id = B.list_id";
|
2022 |
$query.=" GROUP BY A.list_id";
|
2034 |
$user_ids[] = $subscriber['user_id'];
|
2035 |
}
|
2036 |
|
2037 |
+
// 3 - user_list request
|
2038 |
if ($user_ids) {
|
2039 |
$modeluList = WYSIJA::get("user_list", "model");
|
2040 |
$userlists = $modeluList->get(array("list_id", "user_id"), array("user_id" => $user_ids));
|
2044 |
$this->data['lists'] = $lists;
|
2045 |
$this->data['counts'] = array_reverse($counts);
|
2046 |
|
2047 |
+
// regrouping all the data in the same array
|
2048 |
foreach ($this->data['subscribers'] as $keysus => $subscriber) {
|
2049 |
+
// default key while we don't have the data
|
2050 |
//TODO add data for stats about emails opened clicked etc
|
2051 |
$this->data['subscribers'][$keysus]["emails"] = 0;
|
2052 |
$this->data['subscribers'][$keysus]["opened"] = 0;
|
2074 |
$hook_params = array(
|
2075 |
'email_id' => $_REQUEST['id'],
|
2076 |
'email_object' => $email_object,
|
2077 |
+
'url_id' => !empty($_REQUEST['url_id']) ? (int)$_REQUEST['url_id'] : null,
|
2078 |
+
'id' => $email_object['campaign_id']
|
2079 |
);
|
2080 |
|
2081 |
$this->data['hooks']['hook_newsletter_top'] = apply_filters('hook_newsletter_top', WYSIJA_module::execute_hook('hook_newsletter_top', $hook_params), $hook_params);
|
2086 |
$this->modelObj = WYSIJA::get("email", "model");
|
2087 |
$this->emailObj = $this->modelObj->getOne(false, array('email_id' => $_REQUEST['id']));
|
2088 |
|
2089 |
+
// use the filter if there is
|
2090 |
$this->setviewStatsfilter();
|
2091 |
|
2092 |
if ($selectcolumns == "B.user_id") {
|
2098 |
if ($this->filters)
|
2099 |
$this->modelObj->setConditions($this->filters);
|
2100 |
|
2101 |
+
// select insert all the subscribers from that campaign into user_list
|
2102 |
if ($selectcolumns == "B.user_id") {
|
2103 |
$query = "SELECT $selectcolumns FROM `[wysija]" . $this->tableQuery . "` as B";
|
2104 |
$query.=$this->modelObj->makeWhere();
|
2112 |
}
|
2113 |
|
2114 |
function createnewlist() {
|
2115 |
+
|
2116 |
+
$this->requireSecurity();
|
2117 |
+
// get the email subject
|
2118 |
$emailModel = WYSIJA::get('email', 'model');
|
2119 |
$email = $emailModel->getOne(array('subject'), array('email_id' => $_REQUEST['id']));
|
2120 |
|
2121 |
$this->modelObj->reset();
|
2122 |
|
2123 |
+
// set the name of the new list
|
2124 |
$prefix = "";
|
2125 |
if (isset($_REQUEST['link_filter']))
|
2126 |
$prefix = ' (' . $this->viewObj->getTransStatusEmail($_REQUEST['link_filter']) . ')';
|
2127 |
$listname = sprintf(__('Segment of %1$s', WYSIJA), $email['subject'] . $prefix);
|
2128 |
|
2129 |
+
// insert new list
|
2130 |
$modelL = WYSIJA::get('list', 'model');
|
2131 |
$listid = $modelL->insert(array('is_enabled' => 1, 'name' => $listname, 'description' => __('List created based on a newsletter segment.', WYSIJA)));
|
2132 |
|
2133 |
+
// get list of subscribers filtered or not
|
2134 |
$query = $this->getListSubscriberQry($listid . ', A.user_id, ' . time() . ', 0');
|
2135 |
|
2136 |
$query2 = 'INSERT INTO `[wysija]user_list` (`list_id`,`user_id`,`sub_date`,`unsub_date`) ' . $query;
|
2163 |
$this->redirect('admin.php?page=wysija_campaigns&action=viewstats&id=' . $_REQUEST['id']);
|
2164 |
}
|
2165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2166 |
function removequeue() {
|
2167 |
+
$this->requireSecurity();
|
2168 |
+
// delete from queue where select from email_user_stat
|
2169 |
$query = $this->getListSubscriberQry('B.user_id');
|
2170 |
$query2 = "DELETE FROM `[wysija]queue` where user_id IN ($query) AND email_id=" . $this->emailObj['email_id'];
|
2171 |
$this->modelObj->query($query2);
|
2175 |
}
|
2176 |
|
2177 |
function export() {
|
2178 |
+
$this->requireSecurity();
|
2179 |
+
// select from email_user_stat left join user
|
2180 |
$query = $this->getListSubscriberQry('B.user_id');
|
2181 |
$result = $this->modelObj->query('get_res', $query);
|
2182 |
$user_ids = array();
|
2183 |
+
foreach ($result as $user){
|
2184 |
+
$user_ids[] = $user['user_id'];
|
2185 |
+
}
|
2186 |
|
2187 |
+
$helper_file = WYSIJA::get('file', 'helper');
|
2188 |
+
$tempfilename = $helper_file->temp(implode(',', $user_ids), 'export_userids', '.txt');
|
2189 |
|
2190 |
+
$wpnonce = '&_wpnonce='.WYSIJA_view::secure(array('controller' => 'wysija_subscribers' , 'action' => 'exportcampaign' ), true);
|
2191 |
+
|
2192 |
+
$this->redirect('admin.php?page=wysija_subscribers&action=exportcampaign&camp_id=' . $_REQUEST['id'] .$wpnonce .'&file_name=' . base64_encode($tempfilename['url']));
|
2193 |
}
|
2194 |
|
2195 |
function unsubscribelist($data) {
|
2196 |
+
$this->requireSecurity();
|
2197 |
$modelL = WYSIJA::get('list', 'model');
|
2198 |
$list = $modelL->getOne(false, array('list_id' => $data['listid']));
|
2199 |
if ($list['is_enabled']) {
|
2310 |
}
|
2311 |
|
2312 |
function themeupload() {
|
2313 |
+
$this->requireSecurity();
|
2314 |
+
$helperNumbers = WYSIJA::get('numbers', 'helper');
|
2315 |
$bytes = $helperNumbers->get_max_file_upload();
|
2316 |
|
2317 |
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $bytes['maxbytes']) {
|
2598 |
return wp_iframe(array($this->viewObj, 'popup_wp_browse'), array());
|
2599 |
}
|
2600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2601 |
function special_new_wordp_upload() {
|
2602 |
|
|
|
2603 |
wp_enqueue_script('wysija-plupload-handlers', WYSIJA_URL . 'js/jquery/pluploadHandler.js', array('plupload-all', 'jquery'));
|
2604 |
$uploader_l10n = array(
|
2605 |
'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
|
2633 |
wp_enqueue_style('imgareaselect');
|
2634 |
wp_enqueue_script('media-gallery');
|
2635 |
|
|
|
|
|
|
|
|
|
2636 |
$errors = array();
|
2637 |
return wp_iframe(array($this->viewObj, 'popup_new_wp_upload'), $errors);
|
2638 |
}
|
2694 |
|
2695 |
function _checkEmailExists($emailId) {
|
2696 |
$result = false;
|
2697 |
+
$model_email = WYSIJA::get('email', 'model');
|
2698 |
|
2699 |
+
if ($model_email->exists(array('email_id' => $emailId))){
|
2700 |
+
$result = true;
|
2701 |
+
}
|
2702 |
|
2703 |
if (!$result) {
|
2704 |
$this->error(__("The newsletter doesn't exist.", WYSIJA), 1);
|
2705 |
$this->redirect('admin.php?page=wysija_campaigns');
|
2706 |
+
}else{
|
2707 |
+
return true;
|
2708 |
+
}
|
2709 |
+
|
2710 |
}
|
2711 |
|
2712 |
}
|
controllers/back/config.php
CHANGED
@@ -85,7 +85,6 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
|
|
85 |
}
|
86 |
|
87 |
function dkimcheck(){
|
88 |
-
|
89 |
if(isset($_POST['xtz'])){
|
90 |
|
91 |
$dataconf=json_decode(base64_decode($_POST['xtz']));
|
@@ -126,7 +125,7 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
|
|
126 |
}
|
127 |
|
128 |
function doreinstall(){
|
129 |
-
|
130 |
if(isset($_REQUEST['postedfrom']) && $_REQUEST['postedfrom'] === 'reinstall') {
|
131 |
$uninstaller=WYSIJA::get('uninstall','helper');
|
132 |
$uninstaller->reinstall();
|
@@ -147,6 +146,7 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
|
|
147 |
}
|
148 |
|
149 |
function clearlog(){
|
|
|
150 |
update_option('wysija_log', array());
|
151 |
$this->redirect('admin.php?page=wysija_config&action=log');
|
152 |
return true;
|
@@ -154,6 +154,7 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
|
|
154 |
|
155 |
// WYSIJA Form Editor
|
156 |
function form_add() {
|
|
|
157 |
$helper_form_engine = WYSIJA::get('form_engine', 'helper');
|
158 |
// set default form data
|
159 |
$helper_form_engine->set_data();
|
@@ -182,7 +183,7 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
|
|
182 |
}
|
183 |
|
184 |
function form_duplicate() {
|
185 |
-
|
186 |
if(isset($_GET['id']) && (int)$_GET['id'] > 0) {
|
187 |
$form_id = (int)$_GET['id'];
|
188 |
|
85 |
}
|
86 |
|
87 |
function dkimcheck(){
|
|
|
88 |
if(isset($_POST['xtz'])){
|
89 |
|
90 |
$dataconf=json_decode(base64_decode($_POST['xtz']));
|
125 |
}
|
126 |
|
127 |
function doreinstall(){
|
128 |
+
$this->requireSecurity();
|
129 |
if(isset($_REQUEST['postedfrom']) && $_REQUEST['postedfrom'] === 'reinstall') {
|
130 |
$uninstaller=WYSIJA::get('uninstall','helper');
|
131 |
$uninstaller->reinstall();
|
146 |
}
|
147 |
|
148 |
function clearlog(){
|
149 |
+
$this->requireSecurity();
|
150 |
update_option('wysija_log', array());
|
151 |
$this->redirect('admin.php?page=wysija_config&action=log');
|
152 |
return true;
|
154 |
|
155 |
// WYSIJA Form Editor
|
156 |
function form_add() {
|
157 |
+
$this->requireSecurity();
|
158 |
$helper_form_engine = WYSIJA::get('form_engine', 'helper');
|
159 |
// set default form data
|
160 |
$helper_form_engine->set_data();
|
183 |
}
|
184 |
|
185 |
function form_duplicate() {
|
186 |
+
$this->requireSecurity();
|
187 |
if(isset($_GET['id']) && (int)$_GET['id'] > 0) {
|
188 |
$form_id = (int)$_GET['id'];
|
189 |
|
controllers/back/subscribers.php
CHANGED
@@ -31,56 +31,131 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
31 |
}
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
function save(){
|
35 |
$this->redirectAfterSave=false;
|
36 |
-
$
|
37 |
-
|
38 |
-
|
|
|
39 |
parent::save();
|
40 |
|
41 |
//run the unsubscribe process if needed
|
42 |
if((int)$_REQUEST['wysija']['user']['status']==-1){
|
43 |
-
$
|
44 |
}
|
45 |
|
46 |
/* update subscriptions */
|
47 |
-
$
|
48 |
-
$
|
49 |
/* list of core list */
|
50 |
-
$
|
51 |
-
$results
|
52 |
-
$core_listids=array();
|
53 |
foreach($results as $res){
|
54 |
$core_listids[]=$res['list_id'];
|
55 |
}
|
56 |
|
57 |
//0 - get current lists of the user
|
58 |
-
$userlists
|
59 |
|
60 |
$oldlistids=$newlistids=array();
|
61 |
foreach($userlists as $listdata) $oldlistids[$listdata['list_id']]=$listdata['unsub_date'];
|
62 |
|
63 |
-
$
|
64 |
-
$dbloptin
|
65 |
//1 - insert new user_list
|
66 |
if(isset($_POST['wysija']['user_list']) && $_POST['wysija']['user_list']){
|
67 |
-
$
|
68 |
-
$
|
69 |
if(!empty($_POST['wysija']['user_list']['list_id'])){
|
70 |
foreach($_POST['wysija']['user_list']['list_id'] as $list_id){
|
71 |
//if the list is not already recorded for the user then we will need to insert it
|
72 |
if(!isset($oldlistids[$list_id])){
|
73 |
-
$
|
74 |
$newlistids[]=$list_id;
|
75 |
$dataul=array('user_id'=>$id,'list_id'=>$list_id,'sub_date'=>time());
|
76 |
//if double optin is on and user is unconfirmed or unsubscribed, then we need to set it as unconfirmed subscription
|
77 |
if($dbloptin && (int)$_POST['wysija']['user']['status']<1) unset($dataul['sub_date']);
|
78 |
-
$
|
79 |
//if the list is recorded already then let's check the status, if it is an unsubed one then we update it
|
80 |
}else{
|
81 |
if($oldlistids[$list_id]>0){
|
82 |
-
$
|
83 |
-
$
|
84 |
}
|
85 |
}
|
86 |
}
|
@@ -88,19 +163,19 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
88 |
|
89 |
}else{
|
90 |
// if no list is selected we unsubscribe them all
|
91 |
-
$
|
92 |
-
$
|
93 |
}
|
94 |
|
95 |
//if a confirmation email needs to be sent then we send it
|
96 |
if($dbloptin && (int)$_POST['wysija']['user']['status']==0 && !empty($newlistids)){
|
97 |
-
$
|
98 |
-
$
|
99 |
}
|
100 |
|
101 |
if((int)$_POST['wysija']['user']['status']==0 || (int)$_POST['wysija']['user']['status']==1){
|
102 |
-
$
|
103 |
-
$
|
104 |
}
|
105 |
|
106 |
$arrayLists=array();
|
@@ -111,10 +186,10 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
111 |
$unsubsribe_list = array_diff(array_keys($oldlistids), $arrayLists);
|
112 |
if(!empty($unsubsribe_list))
|
113 |
{
|
114 |
-
$
|
115 |
-
$
|
116 |
}
|
117 |
-
$
|
118 |
|
119 |
/*
|
120 |
Custom Fields.
|
@@ -132,7 +207,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
132 |
$data['user_list']['list_ids'] = !empty($data['user_list']['list_id']) ? $data['user_list']['list_id'] : array();
|
133 |
unset($data['user_list']['list_id']);
|
134 |
$data['message_success']=__('Subscriber has been saved.',WYSIJA);
|
135 |
-
$id=$
|
136 |
//$id= parent::save();
|
137 |
if(!$id) {
|
138 |
$this->viewShow=$this->action='add';
|
@@ -145,23 +220,6 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
145 |
}
|
146 |
|
147 |
|
148 |
-
/**
|
149 |
-
* Get selected lists
|
150 |
-
* @return array
|
151 |
-
*/
|
152 |
-
protected function get_selected_lists() {
|
153 |
-
$result = array();
|
154 |
-
if (isset($_REQUEST['wysija']['filter']['filter_list'])) {
|
155 |
-
$result[] = $_REQUEST['wysija']['filter']['filter_list'];
|
156 |
-
} elseif (!empty($_REQUEST['filter-list'])) {
|
157 |
-
$lists = explode(',', trim($_REQUEST['filter-list']));// currently, only single list is allowed.
|
158 |
-
if (!empty($lists)) {
|
159 |
-
$result = array_merge ($result, $lists);
|
160 |
-
}
|
161 |
-
}
|
162 |
-
return $result;
|
163 |
-
}
|
164 |
-
|
165 |
function defaultDisplay(){
|
166 |
$this->viewShow=$this->action='main';
|
167 |
$this->js[]='wysija-admin-list';
|
@@ -221,7 +279,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
221 |
|
222 |
$this->data['current_counts'] = $this->modelObj->countRows;
|
223 |
$this->data['show_batch_select'] = ($this->modelObj->limit >= $this->modelObj->countRows) ? false : true;
|
224 |
-
$this->data['selected_lists'] = $this->
|
225 |
$this->modelObj->reset();
|
226 |
|
227 |
|
@@ -242,8 +300,8 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
242 |
|
243 |
// 3 - user_list request
|
244 |
if($user_ids){
|
245 |
-
$
|
246 |
-
$userlists=$
|
247 |
}
|
248 |
|
249 |
$this->data['lists']=$lists;
|
@@ -290,7 +348,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
290 |
$this->messages['insert'][false]=__('Subscriber has not been saved.',WYSIJA);
|
291 |
$this->messages['update'][true]=__('Subscriber has been modified. [link]Edit again[/link].',WYSIJA);
|
292 |
$this->messages['update'][false]=__('Subscriber has not been modified.',WYSIJA);
|
293 |
-
$this->
|
294 |
parent::WYSIJA_control_back();
|
295 |
|
296 |
//we change the default model of the controller based on the action
|
@@ -313,35 +371,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
313 |
} else {
|
314 |
$this->_tryAction($_REQUEST['action']);
|
315 |
}
|
316 |
-
if ( isset($_REQUEST['method']) && !empty($_REQUEST['method'])){
|
317 |
-
$this->_tryAction($_REQUEST['method']);
|
318 |
-
}
|
319 |
-
}
|
320 |
|
321 |
-
/**
|
322 |
-
* We are using the same form for different purposes:
|
323 |
-
* - Bulk actions
|
324 |
-
* - Filter by list
|
325 |
-
* We need to remove all un-necessary values from interface
|
326 |
-
*/
|
327 |
-
protected function cleanup_form() {
|
328 |
-
if (!empty($_REQUEST['doaction'])) {
|
329 |
-
$action_type = strtolower(trim($_REQUEST['doaction']));
|
330 |
-
switch ($action_type)
|
331 |
-
{
|
332 |
-
// Filter by list
|
333 |
-
case 'filter':
|
334 |
-
if (!empty($_REQUEST['wysija']['user']))
|
335 |
-
unset($_REQUEST['wysija']['user']);
|
336 |
-
if (!empty($_REQUEST['action']))
|
337 |
-
unset($_REQUEST['action']);
|
338 |
-
break;
|
339 |
-
// Bulk action. Nothing to do, because we will invoke _tryAction() directly right after this step
|
340 |
-
case 'apply':
|
341 |
-
default:
|
342 |
-
break;
|
343 |
-
}
|
344 |
-
}
|
345 |
}
|
346 |
|
347 |
/**
|
@@ -350,14 +380,15 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
350 |
* @param type $data
|
351 |
*/
|
352 |
function copytolist($data){
|
353 |
-
$
|
|
|
354 |
if(empty($this->_batch_select))
|
355 |
-
$
|
356 |
else
|
357 |
-
$
|
358 |
|
359 |
-
$
|
360 |
-
$result
|
361 |
|
362 |
if($this->_affected_rows > 1)
|
363 |
$this->notice(sprintf(__('%1$s subscribers have been added to "%2$s".',WYSIJA),$this->_affected_rows,$result['name']));
|
@@ -372,6 +403,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
372 |
* @param array $data List id to move, $data = array('listid' => 1);
|
373 |
*/
|
374 |
function movetolist($data) {
|
|
|
375 |
$helper_user = WYSIJA::get('user', 'helper');
|
376 |
|
377 |
if (!empty($this->_batch_select)) {
|
@@ -411,11 +443,12 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
411 |
* @param type $data = array('list_id'=>?)
|
412 |
*/
|
413 |
function removefromalllists($data){
|
414 |
-
$
|
|
|
415 |
if(!empty($this->_batch_select))
|
416 |
-
$
|
417 |
else
|
418 |
-
$
|
419 |
|
420 |
if($this->_affected_rows > 1)
|
421 |
$this->notice(sprintf(__('%1$s subscribers have been removed from all existing lists.',WYSIJA),$this->_affected_rows));
|
@@ -429,52 +462,47 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
429 |
* @param type $data = array('list_id'=>?)
|
430 |
*/
|
431 |
function removefromlist($data = array()){
|
432 |
-
$
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
|
440 |
-
|
|
|
|
|
|
|
441 |
$this->notice(sprintf(__('%1$s subscribers have been removed from "%2$s".',WYSIJA),$this->_affected_rows, $result['name']));
|
442 |
-
else
|
443 |
$this->notice(sprintf(__('%1$s subscriber have been removed from "%2$s".',WYSIJA),$this->_affected_rows, $result['name']));
|
|
|
444 |
|
445 |
-
|
446 |
}
|
447 |
|
448 |
/**
|
449 |
* Bulk confirm users
|
450 |
*/
|
451 |
function confirmusers(){
|
452 |
-
$
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
|
|
|
|
457 |
|
458 |
-
if($this->_affected_rows > 1)
|
459 |
$this->notice(sprintf(__('%1$s subscribers have been confirmed.',WYSIJA),$this->_affected_rows));
|
460 |
-
else
|
461 |
-
|
|
|
|
|
462 |
$this->redirect_after_bulk_action();
|
463 |
}
|
464 |
|
465 |
-
/**
|
466 |
-
* bulk action copy to list
|
467 |
-
* @global type $wpdb
|
468 |
-
* @param type $data
|
469 |
-
*/
|
470 |
-
/*function unsubscribemany(){
|
471 |
-
$helperUser=WYSIJA::get('user','helper');
|
472 |
-
foreach($_POST['wysija']['user']['user_id'] as $uid) $helperUser->unsubscribe($uid,true);
|
473 |
-
$count=count($_POST['wysija']['user']['user_id']);
|
474 |
-
$this->notice(sprintf(__('%1$d Subscribers have been unsubscribed.',WYSIJA),$count));
|
475 |
-
$this->redirect();
|
476 |
-
}*/
|
477 |
-
|
478 |
function lists(){
|
479 |
$this->js[]='wysija-admin-list';
|
480 |
$this->_commonlists();
|
@@ -501,38 +529,38 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
501 |
}
|
502 |
|
503 |
function duplicatelist(){
|
504 |
-
|
505 |
/* get the list's email id
|
506 |
* 0 duplicate the list's welcome email
|
507 |
* 1 duplicate the list
|
508 |
* 2 duplicate the list's subscribers
|
509 |
*/
|
510 |
-
$
|
511 |
-
$data=$
|
512 |
|
513 |
$query='INSERT INTO `[wysija]email` (`created_at`,`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`)
|
514 |
SELECT '.time().',`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status` FROM [wysija]email
|
515 |
WHERE email_id='.(int)$data['welcome_mail_id'];
|
516 |
-
$
|
517 |
|
518 |
|
519 |
$query='INSERT INTO `[wysija]email` (`created_at`,`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`)
|
520 |
SELECT '.time().',`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status` FROM [wysija]email
|
521 |
WHERE email_id='.(int)$data['unsub_mail_id'];
|
522 |
-
$
|
523 |
|
524 |
|
525 |
$query='INSERT INTO `[wysija]list` (`created_at`,`name`,`namekey`,`description`,`welcome_mail_id`,`unsub_mail_id`,`is_enabled`,`ordering`)
|
526 |
-
SELECT '.time().',"'.stripslashes(__('Copy of ',WYSIJA)).$data['name'].'" ,"copy_'.$data['namekey'].time().'" ,`description`,'.$
|
527 |
WHERE list_id='.(int)$_REQUEST['id'];
|
528 |
|
529 |
-
$
|
530 |
|
531 |
$query='INSERT INTO `[wysija]user_list` (`list_id`,`user_id`,`sub_date`,`unsub_date`)
|
532 |
-
SELECT '.$
|
533 |
WHERE list_id='.(int)$_REQUEST['id'];
|
534 |
|
535 |
-
$
|
536 |
|
537 |
$this->notice(sprintf(__('List "%1$s" has been duplicated.',WYSIJA),$data['name']));
|
538 |
$this->redirect('admin.php?page=wysija_subscribers&action=lists');
|
@@ -548,9 +576,9 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
548 |
$this->data=array();
|
549 |
$this->data['user']=false;
|
550 |
if($data)$this->data['user']=$data;
|
551 |
-
$
|
552 |
-
$
|
553 |
-
$this->data['list']
|
554 |
|
555 |
}
|
556 |
|
@@ -656,18 +684,22 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
656 |
|
657 |
|
658 |
function savelist(){
|
|
|
659 |
$this->_resetGlobMsg();
|
660 |
$update=false;
|
661 |
|
662 |
-
if($_REQUEST['wysija']['list']['list_id'])
|
|
|
|
|
663 |
/* save the result */
|
664 |
/* 1-save the welcome email*/
|
665 |
/* 2-save the list*/
|
666 |
if(isset($_REQUEST['wysija']['list']['is_public'])){
|
667 |
-
if($_REQUEST['wysija']['list']['is_public']=='on')
|
668 |
-
|
669 |
-
|
670 |
-
|
|
|
671 |
}
|
672 |
|
673 |
if($update){
|
@@ -690,8 +722,8 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
690 |
function importpluginsave($id=false){
|
691 |
$this->requireSecurity();
|
692 |
$this->_resetGlobMsg();
|
693 |
-
$model_config=WYSIJA::get('config','model');
|
694 |
-
$helper_import=WYSIJA::get('plugins_import','helper');
|
695 |
$plugins_importable=$model_config->getValue('pluginsImportableEgg');
|
696 |
$plugins_imported=array();
|
697 |
foreach($_REQUEST['wysija']['import'] as $table_name =>$result){
|
@@ -747,7 +779,8 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
747 |
}
|
748 |
|
749 |
function importmatch(){
|
750 |
-
$this->
|
|
|
751 |
$this->jsTrans['subscribers_import_match_confirmation_2'] = __('Can you confirm that this column is corresponding to that field?', WYSIJA);
|
752 |
$this->js[] = 'wysija-validator';
|
753 |
$helper_numbers = WYSIJA::get('numbers','helper');
|
@@ -768,73 +801,22 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
768 |
$import = new WJ_Import();
|
769 |
$this->data = $import->scan_csv_file();
|
770 |
|
771 |
-
if($this->data === false)
|
|
|
|
|
772 |
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
$this->viewObj->title=__('Import Subscribers',WYSIJA);
|
781 |
$this->viewShow='importmatch';
|
782 |
|
783 |
}
|
784 |
|
785 |
-
/**
|
786 |
-
*
|
787 |
-
* @param type $input
|
788 |
-
* @param type $rowstoread
|
789 |
-
* @param type $delimiter
|
790 |
-
* @param type $enclosure
|
791 |
-
* @param type $linedelimiter
|
792 |
-
* @return array
|
793 |
-
*/
|
794 |
-
function _csvToArray($input,$rowstoread=0 , $delimiter=',',$enclosure='',$linedelimiter="\n"){
|
795 |
-
$header = null;
|
796 |
-
$data = array();
|
797 |
-
|
798 |
-
$csvData = explode($linedelimiter,$input);
|
799 |
-
$i=1;
|
800 |
-
foreach($csvData as $csvLine){
|
801 |
-
if($rowstoread!=0 && $i>$rowstoread) return $data;
|
802 |
-
|
803 |
-
/* str_getcsv only exists in php5 ...*/
|
804 |
-
if(!function_exists("str_getcsv")){
|
805 |
-
$data[]= $this->csv_explode($csvLine, $delimiter,$enclosure);
|
806 |
-
}else{
|
807 |
-
$data[] = str_getcsv($csvLine, $delimiter,$enclosure);
|
808 |
-
}
|
809 |
-
|
810 |
-
$i++;
|
811 |
-
}
|
812 |
-
|
813 |
-
return $data;
|
814 |
-
}
|
815 |
-
|
816 |
-
function csv_explode($str,$delim, $enclose, $preserve=false){
|
817 |
-
$resArr = array();
|
818 |
-
$n = 0;
|
819 |
-
if(empty($enclose)){
|
820 |
-
$resArr = explode($delim, $str);
|
821 |
-
}else{
|
822 |
-
$expEncArr = explode($enclose, $str);
|
823 |
-
foreach($expEncArr as $EncItem){
|
824 |
-
if($n++%2){
|
825 |
-
array_push($resArr, array_pop($resArr) . ($preserve?$enclose:'') . $EncItem.($preserve?$enclose:''));
|
826 |
-
}else{
|
827 |
-
$expDelArr = explode($delim, $EncItem);
|
828 |
-
array_push($resArr, array_pop($resArr) . array_shift($expDelArr));
|
829 |
-
$resArr = array_merge($resArr, $expDelArr);
|
830 |
-
}
|
831 |
-
}
|
832 |
-
}
|
833 |
-
|
834 |
-
return $resArr;
|
835 |
-
}
|
836 |
-
|
837 |
-
|
838 |
function import_save(){
|
839 |
@ini_set('max_execution_time',0);
|
840 |
|
@@ -865,11 +847,13 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
865 |
}
|
866 |
|
867 |
//get a list of list name
|
868 |
-
$
|
869 |
-
$results = $
|
870 |
|
871 |
$list_names=array();
|
872 |
-
foreach($results as $k =>$v)
|
|
|
|
|
873 |
|
874 |
$this->notice( sprintf(__('%1$s subscribers added to %2$s.', WYSIJA),
|
875 |
$data_numbers['list_user_ids'],
|
@@ -903,13 +887,13 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
903 |
$this->viewObj->title=__('Export Subscribers',WYSIJA);
|
904 |
$this->data=array();
|
905 |
//$this->data['lists']=$this->_getLists();
|
906 |
-
$this->data['lists']
|
907 |
-
$
|
908 |
|
909 |
$lists=array();
|
910 |
|
911 |
-
foreach($
|
912 |
-
$lists[$
|
913 |
}
|
914 |
$this->data['lists']=$lists;
|
915 |
|
@@ -917,66 +901,41 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
917 |
}
|
918 |
|
919 |
function exportcampaign(){
|
920 |
-
|
921 |
-
$content=file_get_contents(base64_decode($_REQUEST['file_name']));
|
922 |
-
$user_ids=explode(",",$content);
|
923 |
-
}
|
924 |
-
$_REQUEST['wysija']['user']['user_id']=$user_ids;
|
925 |
-
|
926 |
-
$this->exportlist();
|
927 |
-
}
|
928 |
-
|
929 |
-
function exportlist(){
|
930 |
|
931 |
-
if(
|
|
|
932 |
|
933 |
-
$
|
934 |
-
|
935 |
-
$select[] = '[wysija]user_list.list_id';
|
936 |
}
|
937 |
|
938 |
-
|
939 |
-
$
|
940 |
-
|
941 |
-
$count = $this->modelObj->get_subscribers( $select, $filters );
|
942 |
-
$number = $count['total_users'];
|
943 |
-
} else {
|
944 |
-
$number = count($_REQUEST['wysija']['user']['user_id']);
|
945 |
}
|
|
|
946 |
|
947 |
-
$this->
|
948 |
-
$this->data=array();
|
949 |
-
|
950 |
-
$this->data['subscribers'] = $_REQUEST['wysija']['user']['user_id'];
|
951 |
-
$this->data['user'] = $_REQUEST['wysija']['user'];//for batch-selecting
|
952 |
-
|
953 |
-
if(!empty($_REQUEST['search'])) $_REQUEST['wysija']['filter']['search'] = $_REQUEST['search'];
|
954 |
-
|
955 |
-
$this->data['filter'] = $_REQUEST['wysija']['filter'];//for batch-selecting
|
956 |
-
$this->viewShow = 'export';
|
957 |
}
|
958 |
|
959 |
|
960 |
-
|
961 |
-
function sendconfirmation(){
|
962 |
-
$helperUser=WYSIJA::get('user','helper');
|
963 |
-
$helperUser->sendConfirmationEmail($_POST['wysija']['user']['user_id']);
|
964 |
-
$this->redirect();
|
965 |
-
}
|
966 |
-
|
967 |
/**
|
968 |
* bulk delete option
|
969 |
*/
|
970 |
function deleteusers(){
|
|
|
971 |
$helper_user=WYSIJA::get('user','helper');
|
972 |
-
if(!empty($this->_batch_select))
|
973 |
$helper_user->delete($this->_batch_select, false, true);
|
974 |
-
else
|
975 |
$helper_user->delete($_POST['wysija']['user']['user_id']);
|
976 |
-
|
|
|
|
|
977 |
$this->notice(sprintf(__(' %1$s subscribers have been deleted.',WYSIJA),$this->_affected_rows));
|
978 |
-
else
|
979 |
$this->notice(sprintf(__(' %1$s subscriber have been deleted.',WYSIJA),$this->_affected_rows));
|
|
|
980 |
|
981 |
// make sure the total count of subscribers is updated
|
982 |
$helper_user->refreshUsers();
|
@@ -988,17 +947,18 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
988 |
*/
|
989 |
function export_get(){
|
990 |
@ini_set('max_execution_time',0);
|
991 |
-
|
992 |
$export = new WJ_Export();
|
993 |
|
994 |
-
if(!empty($this->_batch_select))
|
|
|
|
|
995 |
|
996 |
$file_path_result = $export->export_subscribers();
|
997 |
|
998 |
-
$url=get_bloginfo('wpurl').'/wp-admin/admin.php?page=wysija_subscribers&action=exportedFileGet&file='.base64_encode($file_path_result);
|
999 |
$this->notice(str_replace(
|
1000 |
array('[link]','[/link]'),
|
1001 |
-
array('<a href="'.$url.'" target="_blank" class="exported-file" >','</a>'),
|
1002 |
sprintf(__('%1$s subscribers were exported. Get the exported file [link]here[/link].',WYSIJA),$export->get_user_ids_rows())));
|
1003 |
|
1004 |
if(isset($_REQUEST['camp_id'])){
|
@@ -1008,50 +968,38 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
|
|
1008 |
}
|
1009 |
}
|
1010 |
|
1011 |
-
function
|
1012 |
-
|
1013 |
-
|
1014 |
-
$helper->send(base64_decode($_REQUEST['file']));
|
1015 |
-
}
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
function bulk_action(){
|
1021 |
-
return true;
|
1022 |
-
}
|
1023 |
-
|
1024 |
|
|
|
|
|
|
|
|
|
1025 |
|
|
|
|
|
1026 |
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
|
|
|
1033 |
$this->data=array();
|
1034 |
-
$this->data['list']=$this->_getLists(10);
|
1035 |
-
|
1036 |
-
}
|
1037 |
-
|
1038 |
-
function _getLists($limit=false){
|
1039 |
|
1040 |
-
$
|
1041 |
-
$
|
1042 |
-
$modelList->_limitison=$limit;
|
1043 |
-
return $modelList->getLists();
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
function _getForm($id=false){
|
1047 |
-
if($id){
|
1048 |
-
$model_list=WYSIJA::get('list','model');
|
1049 |
|
1050 |
-
|
1051 |
-
|
1052 |
-
$array=array('name'=>'','list_id'=>'','description'=>'','is_public'=>true,'is_enabled'=>true);
|
1053 |
-
return $array;
|
1054 |
}
|
1055 |
|
|
|
|
|
|
|
|
|
1056 |
}
|
|
|
1057 |
}
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
/*
|
35 |
+
* common task to all the list actions
|
36 |
+
*/
|
37 |
+
private function _commonlists(){
|
38 |
+
$this->js[]='wysija-validator';
|
39 |
+
|
40 |
+
$this->data=array();
|
41 |
+
$this->data['list']=$this->_getLists(10);
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* We are using the same form for different purposes:
|
47 |
+
* - Bulk actions
|
48 |
+
* - Filter by list
|
49 |
+
* We need to remove all un-necessary values from interface
|
50 |
+
*/
|
51 |
+
private function _cleanup_form() {
|
52 |
+
if (!empty($_REQUEST['doaction'])) {
|
53 |
+
$action_type = strtolower(trim($_REQUEST['doaction']));
|
54 |
+
switch ($action_type)
|
55 |
+
{
|
56 |
+
// Filter by list
|
57 |
+
case 'filter':
|
58 |
+
if (!empty($_REQUEST['wysija']['user']))
|
59 |
+
unset($_REQUEST['wysija']['user']);
|
60 |
+
if (!empty($_REQUEST['action']))
|
61 |
+
unset($_REQUEST['action']);
|
62 |
+
break;
|
63 |
+
// Bulk action. Nothing to do, because we will invoke _tryAction() directly right after this step
|
64 |
+
case 'apply':
|
65 |
+
default:
|
66 |
+
break;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
private function _getLists($limit=false){
|
72 |
+
|
73 |
+
$model_list = WYSIJA::get('list','model');
|
74 |
+
$model_list->escapingOn=true;
|
75 |
+
$model_list->_limitison=$limit;
|
76 |
+
return $model_list->getLists();
|
77 |
+
}
|
78 |
+
|
79 |
+
private function _getForm($id=false){
|
80 |
+
if($id){
|
81 |
+
$model_list = WYSIJA::get('list','model');
|
82 |
+
|
83 |
+
return $model_list->get_one_list($id);
|
84 |
+
}else{
|
85 |
+
$array=array('name'=>'','list_id'=>'','description'=>'','is_public'=>true,'is_enabled'=>true);
|
86 |
+
return $array;
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get selected lists
|
93 |
+
* @return array
|
94 |
+
*/
|
95 |
+
private function _get_selected_lists() {
|
96 |
+
$result = array();
|
97 |
+
if (isset($_REQUEST['wysija']['filter']['filter_list'])) {
|
98 |
+
$result[] = $_REQUEST['wysija']['filter']['filter_list'];
|
99 |
+
} elseif (!empty($_REQUEST['filter-list'])) {
|
100 |
+
$lists = explode(',', trim($_REQUEST['filter-list']));// currently, only single list is allowed.
|
101 |
+
if (!empty($lists)) {
|
102 |
+
$result = array_merge ($result, $lists);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
return $result;
|
106 |
+
}
|
107 |
+
|
108 |
function save(){
|
109 |
$this->redirectAfterSave=false;
|
110 |
+
$this->requireSecurity();
|
111 |
+
$helper_user = WYSIJA::get('user','helper');
|
112 |
+
if( isset( $_REQUEST['id'] ) ){
|
113 |
+
$id = $_REQUEST['id'];
|
114 |
parent::save();
|
115 |
|
116 |
//run the unsubscribe process if needed
|
117 |
if((int)$_REQUEST['wysija']['user']['status']==-1){
|
118 |
+
$helper_user->unsubscribe($id);
|
119 |
}
|
120 |
|
121 |
/* update subscriptions */
|
122 |
+
$model_user_list = WYSIJA::get('user_list','model');
|
123 |
+
$model_user_list->backSave=true;
|
124 |
/* list of core list */
|
125 |
+
$model_list = WYSIJA::get('list','model');
|
126 |
+
$results = $model_list->get(array('list_id'),array('is_enabled'=>'0'));
|
127 |
+
$core_listids = array();
|
128 |
foreach($results as $res){
|
129 |
$core_listids[]=$res['list_id'];
|
130 |
}
|
131 |
|
132 |
//0 - get current lists of the user
|
133 |
+
$userlists = $model_user_list->get(array('list_id','unsub_date'),array('user_id'=>$id));
|
134 |
|
135 |
$oldlistids=$newlistids=array();
|
136 |
foreach($userlists as $listdata) $oldlistids[$listdata['list_id']]=$listdata['unsub_date'];
|
137 |
|
138 |
+
$model_config = WYSIJA::get('config','model');
|
139 |
+
$dbloptin = $model_config->getValue('confirm_dbleoptin');
|
140 |
//1 - insert new user_list
|
141 |
if(isset($_POST['wysija']['user_list']) && $_POST['wysija']['user_list']){
|
142 |
+
$model_user_list->reset();
|
143 |
+
$model_user_list->update(array('sub_date'=>time()),array('user_id'=>$id));
|
144 |
if(!empty($_POST['wysija']['user_list']['list_id'])){
|
145 |
foreach($_POST['wysija']['user_list']['list_id'] as $list_id){
|
146 |
//if the list is not already recorded for the user then we will need to insert it
|
147 |
if(!isset($oldlistids[$list_id])){
|
148 |
+
$model_user_list->reset();
|
149 |
$newlistids[]=$list_id;
|
150 |
$dataul=array('user_id'=>$id,'list_id'=>$list_id,'sub_date'=>time());
|
151 |
//if double optin is on and user is unconfirmed or unsubscribed, then we need to set it as unconfirmed subscription
|
152 |
if($dbloptin && (int)$_POST['wysija']['user']['status']<1) unset($dataul['sub_date']);
|
153 |
+
$model_user_list->insert($dataul);
|
154 |
//if the list is recorded already then let's check the status, if it is an unsubed one then we update it
|
155 |
}else{
|
156 |
if($oldlistids[$list_id]>0){
|
157 |
+
$model_user_list->reset();
|
158 |
+
$model_user_list->update(array('unsub_date'=>0,'sub_date'=>time()),array('user_id'=>$id,'list_id'=>$list_id));
|
159 |
}
|
160 |
}
|
161 |
}
|
163 |
|
164 |
}else{
|
165 |
// if no list is selected we unsubscribe them all
|
166 |
+
$model_user_list->reset();
|
167 |
+
$model_user_list->update(array('unsub_date'=>time(),'sub_date'=>0),array('user_id'=>$id));
|
168 |
}
|
169 |
|
170 |
//if a confirmation email needs to be sent then we send it
|
171 |
if($dbloptin && (int)$_POST['wysija']['user']['status']==0 && !empty($newlistids)){
|
172 |
+
$helper_user = WYSIJA::get('user','helper');
|
173 |
+
$helper_user->sendConfirmationEmail($id,true,$newlistids);
|
174 |
}
|
175 |
|
176 |
if((int)$_POST['wysija']['user']['status']==0 || (int)$_POST['wysija']['user']['status']==1){
|
177 |
+
$model_user_list->reset();
|
178 |
+
$model_user_list->update(array('unsub_date'=>0,'sub_date'=>time()),array('user_id'=>$id,'list_id'=>$core_listids));
|
179 |
}
|
180 |
|
181 |
$arrayLists=array();
|
186 |
$unsubsribe_list = array_diff(array_keys($oldlistids), $arrayLists);
|
187 |
if(!empty($unsubsribe_list))
|
188 |
{
|
189 |
+
$model_user_list->reset();
|
190 |
+
$model_user_list->update(array('unsub_date'=>time()),array('user_id'=>$id,'list_id'=>$unsubsribe_list));
|
191 |
}
|
192 |
+
$model_user_list->reset();
|
193 |
|
194 |
/*
|
195 |
Custom Fields.
|
207 |
$data['user_list']['list_ids'] = !empty($data['user_list']['list_id']) ? $data['user_list']['list_id'] : array();
|
208 |
unset($data['user_list']['list_id']);
|
209 |
$data['message_success']=__('Subscriber has been saved.',WYSIJA);
|
210 |
+
$id=$helper_user->addSubscriber($data,true);
|
211 |
//$id= parent::save();
|
212 |
if(!$id) {
|
213 |
$this->viewShow=$this->action='add';
|
220 |
}
|
221 |
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
function defaultDisplay(){
|
224 |
$this->viewShow=$this->action='main';
|
225 |
$this->js[]='wysija-admin-list';
|
279 |
|
280 |
$this->data['current_counts'] = $this->modelObj->countRows;
|
281 |
$this->data['show_batch_select'] = ($this->modelObj->limit >= $this->modelObj->countRows) ? false : true;
|
282 |
+
$this->data['selected_lists'] = $this->_get_selected_lists();
|
283 |
$this->modelObj->reset();
|
284 |
|
285 |
|
300 |
|
301 |
// 3 - user_list request
|
302 |
if($user_ids){
|
303 |
+
$model_user_list = WYSIJA::get('user_list','model');
|
304 |
+
$userlists=$model_user_list->get(array('list_id','user_id','unsub_date'),array('user_id'=>$user_ids));
|
305 |
}
|
306 |
|
307 |
$this->data['lists']=$lists;
|
348 |
$this->messages['insert'][false]=__('Subscriber has not been saved.',WYSIJA);
|
349 |
$this->messages['update'][true]=__('Subscriber has been modified. [link]Edit again[/link].',WYSIJA);
|
350 |
$this->messages['update'][false]=__('Subscriber has not been modified.',WYSIJA);
|
351 |
+
$this->_cleanup_form();
|
352 |
parent::WYSIJA_control_back();
|
353 |
|
354 |
//we change the default model of the controller based on the action
|
371 |
} else {
|
372 |
$this->_tryAction($_REQUEST['action']);
|
373 |
}
|
|
|
|
|
|
|
|
|
374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
}
|
376 |
|
377 |
/**
|
380 |
* @param type $data
|
381 |
*/
|
382 |
function copytolist($data){
|
383 |
+
$this->requireSecurity();
|
384 |
+
$helper_user = WYSIJA::get('user','helper');
|
385 |
if(empty($this->_batch_select))
|
386 |
+
$helper_user ->addToList($data['listid'],$_POST['wysija']['user']['user_id']);
|
387 |
else
|
388 |
+
$helper_user ->addToList($data['listid'],$this->_batch_select, true);
|
389 |
|
390 |
+
$model_list = WYSIJA::get('list','model');
|
391 |
+
$result = $model_list->getOne(array('name'),array('list_id'=>$data['listid']));
|
392 |
|
393 |
if($this->_affected_rows > 1)
|
394 |
$this->notice(sprintf(__('%1$s subscribers have been added to "%2$s".',WYSIJA),$this->_affected_rows,$result['name']));
|
403 |
* @param array $data List id to move, $data = array('listid' => 1);
|
404 |
*/
|
405 |
function movetolist($data) {
|
406 |
+
$this->requireSecurity();
|
407 |
$helper_user = WYSIJA::get('user', 'helper');
|
408 |
|
409 |
if (!empty($this->_batch_select)) {
|
443 |
* @param type $data = array('list_id'=>?)
|
444 |
*/
|
445 |
function removefromalllists($data){
|
446 |
+
$this->requireSecurity();
|
447 |
+
$helper_user = WYSIJA::get('user','helper');
|
448 |
if(!empty($this->_batch_select))
|
449 |
+
$helper_user->removeFromLists(array(),$this->_batch_select, true);
|
450 |
else
|
451 |
+
$helper_user->removeFromLists(array(),$_POST['wysija']['user']['user_id']);
|
452 |
|
453 |
if($this->_affected_rows > 1)
|
454 |
$this->notice(sprintf(__('%1$s subscribers have been removed from all existing lists.',WYSIJA),$this->_affected_rows));
|
462 |
* @param type $data = array('list_id'=>?)
|
463 |
*/
|
464 |
function removefromlist($data = array()){
|
465 |
+
$this->requireSecurity();
|
466 |
+
$helper_user = WYSIJA::get('user','helper');
|
467 |
+
if(!empty($this->_batch_select)){
|
468 |
+
$helper_user->removeFromLists(array($data['listid']),$this->_batch_select, true);
|
469 |
+
}else{
|
470 |
+
$helper_user->removeFromLists(array($data['listid']),$_POST['wysija']['user']['user_id']);
|
471 |
+
}
|
472 |
|
473 |
+
$model_list = WYSIJA::get('list','model');
|
474 |
+
$result = $model_list->getOne(array('name'),array('list_id'=>$data['listid']));
|
475 |
+
|
476 |
+
if($this->_affected_rows > 1){
|
477 |
$this->notice(sprintf(__('%1$s subscribers have been removed from "%2$s".',WYSIJA),$this->_affected_rows, $result['name']));
|
478 |
+
}else{
|
479 |
$this->notice(sprintf(__('%1$s subscriber have been removed from "%2$s".',WYSIJA),$this->_affected_rows, $result['name']));
|
480 |
+
}
|
481 |
|
482 |
+
$this->redirect_after_bulk_action();
|
483 |
}
|
484 |
|
485 |
/**
|
486 |
* Bulk confirm users
|
487 |
*/
|
488 |
function confirmusers(){
|
489 |
+
$this->requireSecurity();
|
490 |
+
$helper_user = WYSIJA::get('user','helper');
|
491 |
+
if(!empty($this->_batch_select)){
|
492 |
+
$helper_user->confirmUsers($this->_batch_select, true);
|
493 |
+
}else{
|
494 |
+
$helper_user->confirmUsers($_POST['wysija']['user']['user_id']);
|
495 |
+
}
|
496 |
|
497 |
+
if($this->_affected_rows > 1){
|
498 |
$this->notice(sprintf(__('%1$s subscribers have been confirmed.',WYSIJA),$this->_affected_rows));
|
499 |
+
}else{
|
500 |
+
$this->notice(sprintf(__('%1$s subscriber have been confirmed.',WYSIJA),$this->_affected_rows));
|
501 |
+
}
|
502 |
+
|
503 |
$this->redirect_after_bulk_action();
|
504 |
}
|
505 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
function lists(){
|
507 |
$this->js[]='wysija-admin-list';
|
508 |
$this->_commonlists();
|
529 |
}
|
530 |
|
531 |
function duplicatelist(){
|
532 |
+
$this->requireSecurity();
|
533 |
/* get the list's email id
|
534 |
* 0 duplicate the list's welcome email
|
535 |
* 1 duplicate the list
|
536 |
* 2 duplicate the list's subscribers
|
537 |
*/
|
538 |
+
$model_list = WYSIJA::get('list','model');
|
539 |
+
$data=$model_list->getOne(array('name','namekey','welcome_mail_id','unsub_mail_id'),array('list_id'=>(int)$_REQUEST['id']));
|
540 |
|
541 |
$query='INSERT INTO `[wysija]email` (`created_at`,`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`)
|
542 |
SELECT '.time().',`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status` FROM [wysija]email
|
543 |
WHERE email_id='.(int)$data['welcome_mail_id'];
|
544 |
+
$email_welcome_id = $model_list->query($query);
|
545 |
|
546 |
|
547 |
$query='INSERT INTO `[wysija]email` (`created_at`,`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`)
|
548 |
SELECT '.time().',`campaign_id`,`subject`,`body`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status` FROM [wysija]email
|
549 |
WHERE email_id='.(int)$data['unsub_mail_id'];
|
550 |
+
$email_unsub_id = $model_list->query($query);
|
551 |
|
552 |
|
553 |
$query='INSERT INTO `[wysija]list` (`created_at`,`name`,`namekey`,`description`,`welcome_mail_id`,`unsub_mail_id`,`is_enabled`,`ordering`)
|
554 |
+
SELECT '.time().',"'.stripslashes(__('Copy of ',WYSIJA)).$data['name'].'" ,"copy_'.$data['namekey'].time().'" ,`description`,'.$email_welcome_id.','.$email_unsub_id.' ,1,`ordering` FROM [wysija]list
|
555 |
WHERE list_id='.(int)$_REQUEST['id'];
|
556 |
|
557 |
+
$list_id = $model_list->query($query);
|
558 |
|
559 |
$query='INSERT INTO `[wysija]user_list` (`list_id`,`user_id`,`sub_date`,`unsub_date`)
|
560 |
+
SELECT '.$list_id .',`user_id`,`sub_date`,`unsub_date` FROM [wysija]user_list
|
561 |
WHERE list_id='.(int)$_REQUEST['id'];
|
562 |
|
563 |
+
$model_list->query($query);
|
564 |
|
565 |
$this->notice(sprintf(__('List "%1$s" has been duplicated.',WYSIJA),$data['name']));
|
566 |
$this->redirect('admin.php?page=wysija_subscribers&action=lists');
|
576 |
$this->data=array();
|
577 |
$this->data['user']=false;
|
578 |
if($data)$this->data['user']=$data;
|
579 |
+
$model_list = WYSIJA::get('list','model');
|
580 |
+
$model_list->limitON=false;
|
581 |
+
$this->data['list'] = $model_list->get(false,array('greater'=>array('is_enabled'=>'0') ));
|
582 |
|
583 |
}
|
584 |
|
684 |
|
685 |
|
686 |
function savelist(){
|
687 |
+
$this->requireSecurity();
|
688 |
$this->_resetGlobMsg();
|
689 |
$update=false;
|
690 |
|
691 |
+
if($_REQUEST['wysija']['list']['list_id']){
|
692 |
+
$update=true;
|
693 |
+
}
|
694 |
/* save the result */
|
695 |
/* 1-save the welcome email*/
|
696 |
/* 2-save the list*/
|
697 |
if(isset($_REQUEST['wysija']['list']['is_public'])){
|
698 |
+
if($_REQUEST['wysija']['list']['is_public']=='on'){
|
699 |
+
$_REQUEST['wysija']['list']['is_public']=1;
|
700 |
+
}else{
|
701 |
+
$_REQUEST['wysija']['list']['is_public']=0;
|
702 |
+
}
|
703 |
}
|
704 |
|
705 |
if($update){
|
722 |
function importpluginsave($id=false){
|
723 |
$this->requireSecurity();
|
724 |
$this->_resetGlobMsg();
|
725 |
+
$model_config = WYSIJA::get('config','model');
|
726 |
+
$helper_import = WYSIJA::get('plugins_import','helper');
|
727 |
$plugins_importable=$model_config->getValue('pluginsImportableEgg');
|
728 |
$plugins_imported=array();
|
729 |
foreach($_REQUEST['wysija']['import'] as $table_name =>$result){
|
779 |
}
|
780 |
|
781 |
function importmatch(){
|
782 |
+
$this->requireSecurity();
|
783 |
+
$this->jsTrans['subscribers_import_match_confirmation_1'] = __('The selected value is already matched to another column.', WYSIJA);
|
784 |
$this->jsTrans['subscribers_import_match_confirmation_2'] = __('Can you confirm that this column is corresponding to that field?', WYSIJA);
|
785 |
$this->js[] = 'wysija-validator';
|
786 |
$helper_numbers = WYSIJA::get('numbers','helper');
|
801 |
$import = new WJ_Import();
|
802 |
$this->data = $import->scan_csv_file();
|
803 |
|
804 |
+
if($this->data === false){
|
805 |
+
$this->redirect('admin.php?page=wysija_subscribers&action=import');
|
806 |
+
}
|
807 |
|
808 |
+
$model_config = WYSIJA::get('config', 'model');
|
809 |
+
$this->jsTrans['userStatuses'] = array(
|
810 |
+
-1 => __('Unsubscribed', WYSIJA),
|
811 |
+
0 => $model_config->getValue('confirm_dbleoptin') ? __('Unconfirmed',WYSIJA) : __('Subscribed',WYSIJA),
|
812 |
+
1 => __('Subscribed',WYSIJA)
|
813 |
+
);
|
814 |
+
$this->js[] = 'wysija-import-match';
|
815 |
$this->viewObj->title=__('Import Subscribers',WYSIJA);
|
816 |
$this->viewShow='importmatch';
|
817 |
|
818 |
}
|
819 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
820 |
function import_save(){
|
821 |
@ini_set('max_execution_time',0);
|
822 |
|
847 |
}
|
848 |
|
849 |
//get a list of list name
|
850 |
+
$model_list = WYSIJA::get('list','model');
|
851 |
+
$results = $model_list->get(array('name'),array('list_id'=>$_REQUEST['wysija']['user_list']['list']));
|
852 |
|
853 |
$list_names=array();
|
854 |
+
foreach($results as $k =>$v){
|
855 |
+
$list_names[]=$v['name'];
|
856 |
+
}
|
857 |
|
858 |
$this->notice( sprintf(__('%1$s subscribers added to %2$s.', WYSIJA),
|
859 |
$data_numbers['list_user_ids'],
|
887 |
$this->viewObj->title=__('Export Subscribers',WYSIJA);
|
888 |
$this->data=array();
|
889 |
//$this->data['lists']=$this->_getLists();
|
890 |
+
$this->data['lists'] = $model_list = WYSIJA::get('list','model');
|
891 |
+
$lists_results = $model_list->getLists();
|
892 |
|
893 |
$lists=array();
|
894 |
|
895 |
+
foreach($lists_results as $list_row){
|
896 |
+
$lists[$list_row['list_id']]=$list_row;
|
897 |
}
|
898 |
$this->data['lists']=$lists;
|
899 |
|
901 |
}
|
902 |
|
903 |
function exportcampaign(){
|
904 |
+
$this->requireSecurity();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
905 |
|
906 |
+
if(isset($_REQUEST['file_name'])){
|
907 |
+
$url = base64_decode($_REQUEST['file_name']);
|
908 |
|
909 |
+
if( substr( $url , 0 , 7) !== 'http://' ){
|
910 |
+
return false;
|
|
|
911 |
}
|
912 |
|
913 |
+
$content = file_get_contents( $url );
|
914 |
+
$user_ids=explode(",",$content);
|
|
|
|
|
|
|
|
|
|
|
915 |
}
|
916 |
+
$_REQUEST['wysija']['user']['user_id']=$user_ids;
|
917 |
|
918 |
+
$this->exportlist();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
919 |
}
|
920 |
|
921 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
922 |
/**
|
923 |
* bulk delete option
|
924 |
*/
|
925 |
function deleteusers(){
|
926 |
+
$this->requireSecurity();
|
927 |
$helper_user=WYSIJA::get('user','helper');
|
928 |
+
if(!empty($this->_batch_select)){
|
929 |
$helper_user->delete($this->_batch_select, false, true);
|
930 |
+
}else{
|
931 |
$helper_user->delete($_POST['wysija']['user']['user_id']);
|
932 |
+
}
|
933 |
+
|
934 |
+
if($this->_affected_rows > 1){
|
935 |
$this->notice(sprintf(__(' %1$s subscribers have been deleted.',WYSIJA),$this->_affected_rows));
|
936 |
+
}else{
|
937 |
$this->notice(sprintf(__(' %1$s subscriber have been deleted.',WYSIJA),$this->_affected_rows));
|
938 |
+
}
|
939 |
|
940 |
// make sure the total count of subscribers is updated
|
941 |
$helper_user->refreshUsers();
|
947 |
*/
|
948 |
function export_get(){
|
949 |
@ini_set('max_execution_time',0);
|
950 |
+
$this->requireSecurity();
|
951 |
$export = new WJ_Export();
|
952 |
|
953 |
+
if(!empty($this->_batch_select)){
|
954 |
+
$export->batch_select = $this->_batch_select;
|
955 |
+
}
|
956 |
|
957 |
$file_path_result = $export->export_subscribers();
|
958 |
|
|
|
959 |
$this->notice(str_replace(
|
960 |
array('[link]','[/link]'),
|
961 |
+
array('<a href="'.$file_path_result['url'].'" target="_blank" class="exported-file" >','</a>'),
|
962 |
sprintf(__('%1$s subscribers were exported. Get the exported file [link]here[/link].',WYSIJA),$export->get_user_ids_rows())));
|
963 |
|
964 |
if(isset($_REQUEST['camp_id'])){
|
968 |
}
|
969 |
}
|
970 |
|
971 |
+
public function exportlist(){
|
972 |
+
$this->requireSecurity();
|
973 |
+
if(!empty($_REQUEST['wysija']['user']['force_select_all'])){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
974 |
|
975 |
+
$select = array( 'COUNT(DISTINCT([wysija]user.user_id)) as total_users');
|
976 |
+
if(!empty($_REQUEST['wysija']['filter']['filter_list'])){
|
977 |
+
$select[] = '[wysija]user_list.list_id';
|
978 |
+
}
|
979 |
|
980 |
+
// filters for unsubscribed
|
981 |
+
$filters = $this->modelObj->detect_filters();
|
982 |
|
983 |
+
$count = $this->modelObj->get_subscribers( $select, $filters );
|
984 |
+
$number = $count['total_users'];
|
985 |
+
} else {
|
986 |
+
$number = count($_REQUEST['wysija']['user']['user_id']);
|
987 |
+
}
|
988 |
|
989 |
+
$this->viewObj->title = sprintf(__('Exporting %1$s subscribers',WYSIJA),$number);
|
990 |
$this->data=array();
|
|
|
|
|
|
|
|
|
|
|
991 |
|
992 |
+
$this->data['subscribers'] = $_REQUEST['wysija']['user']['user_id'];
|
993 |
+
$this->data['user'] = $_REQUEST['wysija']['user'];//for batch-selecting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
994 |
|
995 |
+
if(!empty($_REQUEST['search'])){
|
996 |
+
$_REQUEST['wysija']['filter']['search'] = $_REQUEST['search'];
|
|
|
|
|
997 |
}
|
998 |
|
999 |
+
if(isset($_REQUEST['wysija']['filter'])){
|
1000 |
+
$this->data['filter'] = $_REQUEST['wysija']['filter'];//for batch-selecting
|
1001 |
+
}
|
1002 |
+
$this->viewShow = 'export';
|
1003 |
}
|
1004 |
+
|
1005 |
}
|
core/base.php
CHANGED
@@ -19,7 +19,7 @@ class WYSIJA_object{
|
|
19 |
* Static variable holding core MailPoet's version
|
20 |
* @var array
|
21 |
*/
|
22 |
-
static $version = '2.6.
|
23 |
|
24 |
function WYSIJA_object(){
|
25 |
|
@@ -191,7 +191,7 @@ class WYSIJA_object{
|
|
191 |
global $wysija_msg;
|
192 |
|
193 |
if(isset($wysija_msg['private']['error'])){
|
194 |
-
$wysija_msg['error'][]=str_replace(array('[link]','[/link]'),array('<a class="showerrors" href="javascript:;">','</a>'),__('An error
|
195 |
}
|
196 |
|
197 |
if(isset($wysija_msg['private']['updated'])){
|
19 |
* Static variable holding core MailPoet's version
|
20 |
* @var array
|
21 |
*/
|
22 |
+
static $version = '2.6.11';
|
23 |
|
24 |
function WYSIJA_object(){
|
25 |
|
191 |
global $wysija_msg;
|
192 |
|
193 |
if(isset($wysija_msg['private']['error'])){
|
194 |
+
$wysija_msg['error'][]=str_replace(array('[link]','[/link]'),array('<a class="showerrors" href="javascript:;">','</a>'),__('An error occurred. [link]Show more details.[/link]',WYSIJA));
|
195 |
}
|
196 |
|
197 |
if(isset($wysija_msg['private']['updated'])){
|
core/controller.php
CHANGED
@@ -25,54 +25,72 @@ class WYSIJA_control extends WYSIJA_object{
|
|
25 |
$this->viewObj->model=WYSIJA::get($this->model,"model",false,$this->extension);
|
26 |
}
|
27 |
}
|
28 |
-
|
29 |
-
// Security test, we should never do anything before WordPress Init; It's just wrong
|
30 |
-
add_action('init', array(&$this, 'nonce_verification'));
|
31 |
}
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
if($_REQUEST['action']=='wysija_ajax'){
|
38 |
-
$actionnonce=
|
39 |
}else{
|
40 |
-
|
41 |
-
if(is_admin() && !empty($_REQUEST['page'])){
|
42 |
-
$actionnonce=$_REQUEST['page'].'-action_'.$_REQUEST['action'];
|
43 |
-
if(!empty($_REQUEST['id'])) $actionnonce.='-id_'.$_REQUEST['id'];
|
44 |
-
//frontend case
|
45 |
-
} elseif (!empty($_REQUEST['controller'])) {
|
46 |
-
$actionnonce=$_REQUEST['controller'].'-action_'.$_REQUEST['action'];
|
47 |
-
if(!empty($_REQUEST['id'])) $actionnonce.='-id_'.$_REQUEST['id'];
|
48 |
-
}
|
49 |
}
|
50 |
|
51 |
-
if(!$_REQUEST['action'])
|
52 |
-
return true;
|
53 |
-
|
54 |
//if the wp_nonce has been set up then we test it against the one here if it fails we just die
|
55 |
$nonce=$_REQUEST['_wpnonce'];
|
56 |
|
57 |
if(!wp_verify_nonce($nonce, $actionnonce) ){
|
58 |
wp_die("<h2>" . __('Security failure during request') . "</h2>", __("Security Problem"), array(
|
59 |
'response' => 403,
|
60 |
-
'back_link' =>
|
61 |
));
|
62 |
}
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
|
|
|
66 |
/**
|
67 |
* if a controller calls that page then it needs those global parameters to be set
|
68 |
* @return boolean
|
69 |
*/
|
70 |
function requireSecurity(){
|
71 |
|
72 |
-
if(
|
73 |
die('Your request is not safe.');
|
74 |
}else{
|
75 |
-
|
|
|
76 |
}
|
77 |
}
|
78 |
|
25 |
$this->viewObj->model=WYSIJA::get($this->model,"model",false,$this->extension);
|
26 |
}
|
27 |
}
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
+
private function _rebuild_ajax_nonce_action(){
|
31 |
+
$actionnonce = 'wysija_ajax';
|
32 |
+
if( !empty( $_REQUEST['controller']) && !empty( $_REQUEST['task']) ){
|
33 |
+
$actionnonce = 'wysija_'.$_REQUEST['controller'] . '-action_'.$_REQUEST['task'];
|
34 |
+
}
|
35 |
+
return $actionnonce;
|
36 |
+
}
|
37 |
|
38 |
+
private function _rebuild_nonce_action(){
|
39 |
+
$actionnonce = '';
|
40 |
+
//backend case
|
41 |
+
if(is_admin() && !empty($_REQUEST['page'])){
|
42 |
+
$actionnonce=$_REQUEST['page'].'-action_'.$_REQUEST['action'];
|
43 |
+
if(!empty($_REQUEST['id'])) $actionnonce.='-id_'.$_REQUEST['id'];
|
44 |
+
//frontend case
|
45 |
+
} elseif (!empty($_REQUEST['controller'])) {
|
46 |
+
$actionnonce=$_REQUEST['controller'].'-action_'.$_REQUEST['action'];
|
47 |
+
if(!empty($_REQUEST['id'])) $actionnonce.='-id_'.$_REQUEST['id'];
|
48 |
+
}
|
49 |
+
return $actionnonce;
|
50 |
+
}
|
51 |
+
|
52 |
+
private function _nonce_verification(){
|
53 |
+
if(!empty($_REQUEST['_wpnonce'])){
|
54 |
if($_REQUEST['action']=='wysija_ajax'){
|
55 |
+
$actionnonce = $this->_rebuild_ajax_nonce_action();
|
56 |
}else{
|
57 |
+
$actionnonce = $this->_rebuild_nonce_action();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
|
|
|
|
|
|
60 |
//if the wp_nonce has been set up then we test it against the one here if it fails we just die
|
61 |
$nonce=$_REQUEST['_wpnonce'];
|
62 |
|
63 |
if(!wp_verify_nonce($nonce, $actionnonce) ){
|
64 |
wp_die("<h2>" . __('Security failure during request') . "</h2>", __("Security Problem"), array(
|
65 |
'response' => 403,
|
66 |
+
'back_link' => false
|
67 |
));
|
68 |
}
|
69 |
+
|
70 |
+
|
71 |
+
}else{
|
72 |
+
if(!wp_verify_nonce($nonce, $actionnonce) ){
|
73 |
+
wp_die("<h2>" . __('Security failure during request') . "</h2>", __("Security Problem"), array(
|
74 |
+
'response' => 403,
|
75 |
+
'back_link' => false
|
76 |
+
));
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
}
|
81 |
|
82 |
+
|
83 |
/**
|
84 |
* if a controller calls that page then it needs those global parameters to be set
|
85 |
* @return boolean
|
86 |
*/
|
87 |
function requireSecurity(){
|
88 |
|
89 |
+
if( !isset($_REQUEST['_wpnonce']) ) {
|
90 |
die('Your request is not safe.');
|
91 |
}else{
|
92 |
+
$this->_nonce_verification();
|
93 |
+
return true;
|
94 |
}
|
95 |
}
|
96 |
|
core/view.php
CHANGED
@@ -277,10 +277,10 @@ class WYSIJA_view extends WYSIJA_object{
|
|
277 |
if(!$val) return '---';
|
278 |
|
279 |
//offset the time to the time of the WP site not the server
|
280 |
-
$
|
281 |
// get current time taking timezone into account.
|
282 |
|
283 |
-
$val = $
|
284 |
|
285 |
if($format) return date_i18n($format,$val);
|
286 |
else return date_i18n(get_option('date_format'),$val);
|
277 |
if(!$val) return '---';
|
278 |
|
279 |
//offset the time to the time of the WP site not the server
|
280 |
+
$helper_toolbox = WYSIJA::get('toolbox','helper');
|
281 |
// get current time taking timezone into account.
|
282 |
|
283 |
+
$val = $helper_toolbox->servertime_to_localtime($val);
|
284 |
|
285 |
if($format) return date_i18n($format,$val);
|
286 |
else return date_i18n(get_option('date_format'),$val);
|
helpers/back.php
CHANGED
@@ -78,6 +78,127 @@ class WYSIJA_help_back extends WYSIJA_help{
|
|
78 |
}
|
79 |
}
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
/**
|
83 |
* On any of the administration pages related to MailPoet, if the user
|
@@ -409,7 +530,7 @@ class WYSIJA_help_back extends WYSIJA_help{
|
|
409 |
if ( is_rtl() ) {
|
410 |
wp_enqueue_style('wysija-admin-rtl', WYSIJA_URL.'css/rtl.css',array(),WYSIJA::get_version());
|
411 |
}
|
412 |
-
|
413 |
}
|
414 |
$jstrans['newsletters']=__('Newsletters',WYSIJA);
|
415 |
$jstrans['urlpremium']='admin.php?page=wysija_config#tab-premium';
|
@@ -419,6 +540,7 @@ class WYSIJA_help_back extends WYSIJA_help{
|
|
419 |
wp_localize_script('wysija-admin', 'wysijatrans', $jstrans);
|
420 |
}
|
421 |
|
|
|
422 |
/**
|
423 |
* code only executed in the page or post in admin
|
424 |
*/
|
78 |
}
|
79 |
}
|
80 |
|
81 |
+
private function _set_ajax_nonces(){
|
82 |
+
if( isset( $_GET['page'] ) && substr( $_GET['page'] ,0 ,7 ) == 'wysija_' ){
|
83 |
+
|
84 |
+
$ajax_nonces = array(
|
85 |
+
'campaigns' => array(
|
86 |
+
'switch_theme' => WYSIJA_view::secure(array(
|
87 |
+
'controller' => 'wysija_campaigns',
|
88 |
+
'action' => 'switch_theme'
|
89 |
+
), true),
|
90 |
+
'save_editor' => WYSIJA_view::secure(array(
|
91 |
+
'controller' => 'wysija_campaigns',
|
92 |
+
'action' => 'save_editor'
|
93 |
+
), true),
|
94 |
+
'save_styles' => WYSIJA_view::secure(array(
|
95 |
+
'controller' => 'wysija_campaigns',
|
96 |
+
'action' => 'save_styles'
|
97 |
+
), true),
|
98 |
+
'deleteimg' => WYSIJA_view::secure(array(
|
99 |
+
'controller' => 'wysija_campaigns',
|
100 |
+
'action' => 'deleteimg'
|
101 |
+
), true),
|
102 |
+
'deleteTheme' => WYSIJA_view::secure(array(
|
103 |
+
'controller' => 'wysija_campaigns',
|
104 |
+
'action' => 'deleteTheme'
|
105 |
+
), true),
|
106 |
+
'save_IQS' => WYSIJA_view::secure(array(
|
107 |
+
'controller' => 'wysija_campaigns',
|
108 |
+
'action' => 'save_IQS'
|
109 |
+
), true),
|
110 |
+
'send_preview' => WYSIJA_view::secure(array(
|
111 |
+
'controller' => 'wysija_campaigns',
|
112 |
+
'action' => 'send_preview'
|
113 |
+
), true),
|
114 |
+
'send_spamtest' => WYSIJA_view::secure(array(
|
115 |
+
'controller' => 'wysija_campaigns',
|
116 |
+
'action' => 'send_spamtest'
|
117 |
+
), true),
|
118 |
+
'insert_articles' => WYSIJA_view::secure(array(
|
119 |
+
'controller' => 'wysija_campaigns',
|
120 |
+
'action' => 'insert_articles'
|
121 |
+
), true),
|
122 |
+
'set_divider' => WYSIJA_view::secure(array(
|
123 |
+
'controller' => 'wysija_campaigns',
|
124 |
+
'action' => 'set_divider'
|
125 |
+
), true),
|
126 |
+
'generate_social_bookmarks' => WYSIJA_view::secure(array(
|
127 |
+
'controller' => 'wysija_campaigns',
|
128 |
+
'action' => 'generate_social_bookmarks'
|
129 |
+
), true),
|
130 |
+
'install_theme' => WYSIJA_view::secure(array(
|
131 |
+
'controller' => 'wysija_campaigns',
|
132 |
+
'action' => 'install_theme'
|
133 |
+
), true),
|
134 |
+
'setDefaultTheme' => WYSIJA_view::secure(array(
|
135 |
+
'controller' => 'wysija_campaigns',
|
136 |
+
'action' => 'setDefaultTheme'
|
137 |
+
), true),
|
138 |
+
'deleteTheme' => WYSIJA_view::secure(array(
|
139 |
+
'controller' => 'wysija_campaigns',
|
140 |
+
'action' => 'deleteTheme'
|
141 |
+
), true),
|
142 |
+
'save_poll' => WYSIJA_view::secure(array(
|
143 |
+
'controller' => 'wysija_campaigns',
|
144 |
+
'action' => 'save_poll'
|
145 |
+
), true),
|
146 |
+
'sub_delete_image' => WYSIJA_view::secure(array(
|
147 |
+
'controller' => 'wysija_campaigns',
|
148 |
+
'action' => 'sub_delete_image',
|
149 |
+
), true),
|
150 |
+
|
151 |
+
),
|
152 |
+
'config' => array(
|
153 |
+
'send_test_mail' => WYSIJA_view::secure(array(
|
154 |
+
'controller' => 'wysija_config',
|
155 |
+
'action' => 'send_test_mail'
|
156 |
+
), true),
|
157 |
+
'send_test_mail_ms' => WYSIJA_view::secure(array(
|
158 |
+
'controller' => 'wysija_config',
|
159 |
+
'action' => 'send_test_mail_ms'
|
160 |
+
), true),
|
161 |
+
'bounce_process' => WYSIJA_view::secure(array(
|
162 |
+
'controller' => 'wysija_config',
|
163 |
+
'action' => 'bounce_process'
|
164 |
+
), true),
|
165 |
+
'share_analytics' => WYSIJA_view::secure(array(
|
166 |
+
'controller' => 'wysija_config',
|
167 |
+
'action' => 'share_analytics'
|
168 |
+
), true),
|
169 |
+
'wysija_form_manage_field' => WYSIJA_view::secure(array(
|
170 |
+
'controller' => 'wysija_config',
|
171 |
+
'action' => 'wysija_form_manage_field'
|
172 |
+
), true),
|
173 |
+
'form_field_delete' => WYSIJA_view::secure(array(
|
174 |
+
'controller' => 'wysija_config',
|
175 |
+
'action' => 'form_field_delete'
|
176 |
+
), true),
|
177 |
+
'form_name_save' => WYSIJA_view::secure(array(
|
178 |
+
'controller' => 'wysija_config',
|
179 |
+
'action' => 'form_name_save'
|
180 |
+
), true),
|
181 |
+
'form_save' => WYSIJA_view::secure(array(
|
182 |
+
'controller' => 'wysija_config',
|
183 |
+
'action' => 'form_save'
|
184 |
+
), true),
|
185 |
+
'validate' => WYSIJA_view::secure(array(
|
186 |
+
'controller' => 'wysija_config',
|
187 |
+
'action' => 'validate'
|
188 |
+
), true),
|
189 |
+
'linkignore' => WYSIJA_view::secure(array(
|
190 |
+
'controller' => 'wysija_config',
|
191 |
+
'action' => 'linkignore'
|
192 |
+
), true),
|
193 |
+
)
|
194 |
+
);
|
195 |
+
|
196 |
+
}else{
|
197 |
+
$ajax_nonces = array();
|
198 |
+
}
|
199 |
+
|
200 |
+
wp_localize_script('wysija-admin', 'wysijanonces', $ajax_nonces);
|
201 |
+
}
|
202 |
|
203 |
/**
|
204 |
* On any of the administration pages related to MailPoet, if the user
|
530 |
if ( is_rtl() ) {
|
531 |
wp_enqueue_style('wysija-admin-rtl', WYSIJA_URL.'css/rtl.css',array(),WYSIJA::get_version());
|
532 |
}
|
533 |
+
$this->_set_ajax_nonces();
|
534 |
}
|
535 |
$jstrans['newsletters']=__('Newsletters',WYSIJA);
|
536 |
$jstrans['urlpremium']='admin.php?page=wysija_config#tab-premium';
|
540 |
wp_localize_script('wysija-admin', 'wysijatrans', $jstrans);
|
541 |
}
|
542 |
|
543 |
+
|
544 |
/**
|
545 |
* code only executed in the page or post in admin
|
546 |
*/
|
helpers/file.php
CHANGED
@@ -116,13 +116,14 @@ class WYSIJA_help_file extends WYSIJA_object{
|
|
116 |
|
117 |
if(!$tempDir) return false;
|
118 |
|
|
|
|
|
119 |
|
120 |
-
$
|
121 |
-
$handle=fopen($tempDir.$filename, 'w');
|
122 |
fwrite($handle, $content);
|
123 |
fclose($handle);
|
124 |
|
125 |
-
return array('path'=>$tempDir.$
|
126 |
}
|
127 |
|
128 |
/**
|
@@ -143,38 +144,22 @@ class WYSIJA_help_file extends WYSIJA_object{
|
|
143 |
return str_replace(DS,'/',$url);
|
144 |
}
|
145 |
|
146 |
-
/**
|
147 |
-
* send file to be downloaded
|
148 |
-
* @param type $path
|
149 |
-
*/
|
150 |
-
function send($path){
|
151 |
-
/* submit the file to the admin */
|
152 |
-
if(file_exists($path)){
|
153 |
-
header('Content-type: application/csv');
|
154 |
-
header('Content-Disposition: attachment; filename="export_wysija.csv"');
|
155 |
-
readfile($path);
|
156 |
-
exit();
|
157 |
-
}else $this->error(__('Yikes! We couldn\'t export. Make sure that your folder permissions for /wp-content/uploads/wysija/temp is set to 755.',WYSIJA),true);
|
158 |
-
|
159 |
-
}
|
160 |
-
|
161 |
/*
|
162 |
*
|
163 |
*/
|
164 |
function clear(){
|
165 |
-
$
|
166 |
-
$
|
167 |
$deleted=array();
|
168 |
-
foreach($
|
169 |
$path=$this->getUploadDir($folder);
|
170 |
/* get a list of files from this folder and clear them */
|
171 |
if(!$path) continue;
|
172 |
$files = scandir($path);
|
173 |
foreach($files as $filename){
|
174 |
if(!in_array($filename, array('.','..',".DS_Store","Thumbs.db"))){
|
175 |
-
if(preg_match('/('.implode($
|
176 |
$deleted[]=$path.$filename;
|
177 |
-
|
178 |
}
|
179 |
}
|
180 |
}
|
@@ -234,38 +219,5 @@ class WYSIJA_help_file extends WYSIJA_object{
|
|
234 |
copy(str_replace('/',DS,$src), str_replace('/',DS,$dst));
|
235 |
}
|
236 |
}
|
237 |
-
|
238 |
-
/*
|
239 |
-
* taken from php.net
|
240 |
-
*/
|
241 |
-
function chmodr($path, $filemode=0644, $dirmode=0755) {
|
242 |
-
if (is_dir($path) ) {
|
243 |
-
if (!chmod($path, $dirmode)) {
|
244 |
-
$dirmode_str=decoct($dirmode);
|
245 |
-
print "Failed applying filemode '$dirmode_str' on directory '$path'\n";
|
246 |
-
print " `-> the directory '$path' will be skipped from recursive chmod\n";
|
247 |
-
return;
|
248 |
-
}
|
249 |
-
$dh = opendir($path);
|
250 |
-
while (($file = readdir($dh)) !== false) {
|
251 |
-
if($file != '.' && $file != '..') { // skip self and parent pointing directories
|
252 |
-
$fullpath = $path.DS.$file;
|
253 |
-
$this->chmodr($fullpath, $filemode,$dirmode);
|
254 |
-
}
|
255 |
-
}
|
256 |
-
closedir($dh);
|
257 |
-
} else {
|
258 |
-
if (is_link($path)) {
|
259 |
-
print "link '$path' is skipped\n";
|
260 |
-
return;
|
261 |
-
}
|
262 |
-
if (!chmod($path, $filemode)) {
|
263 |
-
$filemode_str=decoct($filemode);
|
264 |
-
print "Failed applying filemode '$filemode_str' on file '$path'\n";
|
265 |
-
return;
|
266 |
-
}
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
}
|
271 |
|
116 |
|
117 |
if(!$tempDir) return false;
|
118 |
|
119 |
+
$time_created = substr( md5(rand()), 0, 20);
|
120 |
+
$file_name = $key.'-'.$time_created.$format;
|
121 |
|
122 |
+
$handle=fopen($tempDir.$file_name, 'w');
|
|
|
123 |
fwrite($handle, $content);
|
124 |
fclose($handle);
|
125 |
|
126 |
+
return array('path'=>$tempDir.$file_name,'name'=>$file_name, 'url'=>$this->url($file_name,'temp'));
|
127 |
}
|
128 |
|
129 |
/**
|
144 |
return str_replace(DS,'/',$url);
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
/*
|
148 |
*
|
149 |
*/
|
150 |
function clear(){
|
151 |
+
$folders_to_clear = array("import","temp");
|
152 |
+
$filename_removal = array("import-","export-", 'export_userids-');
|
153 |
$deleted=array();
|
154 |
+
foreach($folders_to_clear as $folder){
|
155 |
$path=$this->getUploadDir($folder);
|
156 |
/* get a list of files from this folder and clear them */
|
157 |
if(!$path) continue;
|
158 |
$files = scandir($path);
|
159 |
foreach($files as $filename){
|
160 |
if(!in_array($filename, array('.','..',".DS_Store","Thumbs.db"))){
|
161 |
+
if(preg_match('/('.implode($filename_removal,'|').')[a-f0-9]*\.(csv|txt)/',$filename,$match)){
|
162 |
$deleted[]=$path.$filename;
|
|
|
163 |
}
|
164 |
}
|
165 |
}
|
219 |
copy(str_replace('/',DS,$src), str_replace('/',DS,$dst));
|
220 |
}
|
221 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
|
helpers/install.php
CHANGED
@@ -160,8 +160,8 @@ class WYSIJA_help_install extends WYSIJA_object{
|
|
160 |
|
161 |
$values['wysija_db_version'] = WYSIJA::get_version();
|
162 |
|
163 |
-
$
|
164 |
-
$values['dkim_domain'] = $
|
165 |
|
166 |
if( get_option('wysija_reinstall',0) ) $values['wysija_whats_new'] = WYSIJA::get_version();
|
167 |
$model_config->save($values);
|
@@ -480,7 +480,7 @@ class WYSIJA_help_install extends WYSIJA_object{
|
|
480 |
// execute the queries one by one
|
481 |
global $wpdb;
|
482 |
$has_errors = false;
|
483 |
-
|
484 |
foreach($queries as $qry){
|
485 |
$last_error = $wpdb->last_error;
|
486 |
$wpdb->query($qry);
|
160 |
|
161 |
$values['wysija_db_version'] = WYSIJA::get_version();
|
162 |
|
163 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
164 |
+
$values['dkim_domain'] = $helper_toolbox->_make_domain_name();
|
165 |
|
166 |
if( get_option('wysija_reinstall',0) ) $values['wysija_whats_new'] = WYSIJA::get_version();
|
167 |
$model_config->save($values);
|
480 |
// execute the queries one by one
|
481 |
global $wpdb;
|
482 |
$has_errors = false;
|
483 |
+
|
484 |
foreach($queries as $qry){
|
485 |
$last_error = $wpdb->last_error;
|
486 |
$wpdb->query($qry);
|
helpers/licence.php
CHANGED
@@ -159,8 +159,8 @@ class WYSIJA_help_licence extends WYSIJA_help{
|
|
159 |
|
160 |
|
161 |
//checkif the open ssl function for priv and ub key are present on that server
|
162 |
-
$
|
163 |
-
$dkim_domain = $
|
164 |
$res1=$errorssl=false;
|
165 |
if(function_exists('openssl_pkey_new')){
|
166 |
while ($err = openssl_error_string());
|
159 |
|
160 |
|
161 |
//checkif the open ssl function for priv and ub key are present on that server
|
162 |
+
$helper_toolbox = WYSIJA::get('toolbox','helper');
|
163 |
+
$dkim_domain = $helper_toolbox->_make_domain_name(admin_url('admin.php'));
|
164 |
$res1=$errorssl=false;
|
165 |
if(function_exists('openssl_pkey_new')){
|
166 |
while ($err = openssl_error_string());
|
helpers/queue.php
CHANGED
@@ -119,7 +119,7 @@ class WYSIJA_help_queue extends WYSIJA_object{
|
|
119 |
$html_response.= '</div>';
|
120 |
$html_response.= "<div id='divinfo' style='display:none; position:fixed; bottom:3px;left:3px;background-color : white; border : 1px solid grey; padding : 3px;'> </div>";
|
121 |
|
122 |
-
$url = 'admin.php?page=wysija_campaigns&action=manual_send&emailid='.$this->email_id.'&totalsend='.$this->total.'&alreadysent=';
|
123 |
|
124 |
$html_response.= '<script type="text/javascript" language="javascript">';
|
125 |
$html_response.= 'var mycounter = document.getElementById("counter");';
|
119 |
$html_response.= '</div>';
|
120 |
$html_response.= "<div id='divinfo' style='display:none; position:fixed; bottom:3px;left:3px;background-color : white; border : 1px solid grey; padding : 3px;'> </div>";
|
121 |
|
122 |
+
$url = 'admin.php?page=wysija_campaigns&action=manual_send&emailid='.$this->email_id.'&_wpnonce='.WYSIJA_view::secure(array('action' => 'manual_send'), true).'&totalsend='.$this->total.'&alreadysent=';
|
123 |
|
124 |
$html_response.= '<script type="text/javascript" language="javascript">';
|
125 |
$html_response.= 'var mycounter = document.getElementById("counter");';
|
helpers/toolbox.php
CHANGED
@@ -6,27 +6,6 @@ class WYSIJA_help_toolbox extends WYSIJA_object{
|
|
6 |
|
7 |
}
|
8 |
|
9 |
-
|
10 |
-
/**
|
11 |
-
* make a temporary file
|
12 |
-
* @param type $content
|
13 |
-
* @param type $key
|
14 |
-
* @param type $format
|
15 |
-
* @return type
|
16 |
-
*/
|
17 |
-
function temp($content,$key='temp',$format='.tmp'){
|
18 |
-
$helperF=WYSIJA::get('file','helper');
|
19 |
-
$tempDir=$helperF->makeDir();
|
20 |
-
|
21 |
-
|
22 |
-
$filename=$key.'-'.time().$format;
|
23 |
-
$handle=fopen($tempDir.$filename, 'w');
|
24 |
-
fwrite($handle, $content);
|
25 |
-
fclose($handle);
|
26 |
-
|
27 |
-
return array('path'=>$tempDir.$filename,'name'=>$filename, 'url'=>$this->url($filename,'temp'));
|
28 |
-
}
|
29 |
-
|
30 |
/**
|
31 |
* Get the url of a wysija file based on the filename and the wysija folder
|
32 |
* @param type $filename
|
@@ -44,50 +23,6 @@ class WYSIJA_help_toolbox extends WYSIJA_object{
|
|
44 |
return $url;
|
45 |
}
|
46 |
|
47 |
-
/**
|
48 |
-
* send file to be downloaded
|
49 |
-
* @param type $path
|
50 |
-
*/
|
51 |
-
function send($path){
|
52 |
-
/* submit the file to the admin */
|
53 |
-
if(file_exists($path)){
|
54 |
-
header('Content-type: application/csv');
|
55 |
-
header('Content-Disposition: attachment; filename="export_wysija.csv"');
|
56 |
-
readfile($path);
|
57 |
-
exit();
|
58 |
-
}else $this->error(__('Yikes! We couldn\'t export. Make sure that your folder permissions for /wp-content/uploads/wysija/temp is set to 755.',WYSIJA),true);
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* clear upload folders from things we don't need anymore
|
64 |
-
*/
|
65 |
-
function clear(){
|
66 |
-
$foldersToclear=array('import','temp');
|
67 |
-
$filenameRemoval=array('import-','export-');
|
68 |
-
$deleted=array();
|
69 |
-
$helperF=WYSIJA::get('file','helper');
|
70 |
-
foreach($foldersToclear as $folder){
|
71 |
-
$path=$helperF->getUploadDir($folder);
|
72 |
-
/* get a list of files from this folder and clear them */
|
73 |
-
|
74 |
-
$files = scandir($path);
|
75 |
-
foreach($files as $filename){
|
76 |
-
if(!in_array($filename, array('.','..','.DS_Store','Thumbs.db'))){
|
77 |
-
if(preg_match('/('.implode($filenameRemoval,'|').')[0-9]*\.csv/',$filename,$match)){
|
78 |
-
$deleted[]=$path.$filename;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
83 |
-
foreach($deleted as $filename){
|
84 |
-
if(file_exists($filename)){
|
85 |
-
unlink($filename);
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
function closetags($html) {
|
92 |
#put all opened tags into an array
|
93 |
preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
|
@@ -136,7 +71,7 @@ class WYSIJA_help_toolbox extends WYSIJA_object{
|
|
136 |
$domain_name=explode('/',$domain_name);
|
137 |
return $domain_name[0];
|
138 |
}
|
139 |
-
|
140 |
/**
|
141 |
* get base url of the current site or base url of a specific url WITHOUT http, https, www
|
142 |
* @param string $url
|
@@ -146,16 +81,16 @@ class WYSIJA_help_toolbox extends WYSIJA_object{
|
|
146 |
$url = !empty($url) ? $url : site_url();
|
147 |
return str_replace(array('https://','http://','www.'),'',strtolower($url));
|
148 |
}
|
149 |
-
|
150 |
/**
|
151 |
* Detect if this is an internal link, otherwise, it will be an external one
|
152 |
* @param string $url
|
153 |
-
* @return boolean
|
154 |
-
*/
|
155 |
function is_internal_link($url) {
|
156 |
$str_pos = strpos($this->get_base_uri($url), $this->get_base_uri());
|
157 |
// an internal link must CONTAIN base_uri of the current site and must START with that base_uri
|
158 |
-
return ($str_pos !== false && $str_pos === 0);
|
159 |
}
|
160 |
|
161 |
/**
|
6 |
|
7 |
}
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
* Get the url of a wysija file based on the filename and the wysija folder
|
11 |
* @param type $filename
|
23 |
return $url;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
function closetags($html) {
|
27 |
#put all opened tags into an array
|
28 |
preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
|
71 |
$domain_name=explode('/',$domain_name);
|
72 |
return $domain_name[0];
|
73 |
}
|
74 |
+
|
75 |
/**
|
76 |
* get base url of the current site or base url of a specific url WITHOUT http, https, www
|
77 |
* @param string $url
|
81 |
$url = !empty($url) ? $url : site_url();
|
82 |
return str_replace(array('https://','http://','www.'),'',strtolower($url));
|
83 |
}
|
84 |
+
|
85 |
/**
|
86 |
* Detect if this is an internal link, otherwise, it will be an external one
|
87 |
* @param string $url
|
88 |
+
* @return boolean
|
89 |
+
*/
|
90 |
function is_internal_link($url) {
|
91 |
$str_pos = strpos($this->get_base_uri($url), $this->get_base_uri());
|
92 |
// an internal link must CONTAIN base_uri of the current site and must START with that base_uri
|
93 |
+
return ($str_pos !== false && $str_pos === 0);
|
94 |
}
|
95 |
|
96 |
/**
|
helpers/update.php
CHANGED
@@ -127,8 +127,8 @@ class WYSIJA_help_update extends WYSIJA_object {
|
|
127 |
}
|
128 |
}
|
129 |
}
|
130 |
-
$
|
131 |
-
$model_config->save(array('dkim_domain'=>$
|
132 |
}
|
133 |
|
134 |
if(!$this->modelWysija->query("SHOW COLUMNS FROM `[wysija]list` LIKE 'is_public';")){
|
127 |
}
|
128 |
}
|
129 |
}
|
130 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
131 |
+
$model_config->save(array('dkim_domain'=>$helper_toolbox->_make_domain_name()));
|
132 |
}
|
133 |
|
134 |
if(!$this->modelWysija->query("SHOW COLUMNS FROM `[wysija]list` LIKE 'is_public';")){
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MailPoet Newsletters
|
4 |
Plugin URI: http://www.mailpoet.com/
|
5 |
Description: Create and send newsletters. Import and manage your lists. Add subscription forms in widgets, articles and pages. MailPoet (formerly Wysija) is a freemium plugin updated regularly with new features.
|
6 |
-
Version: 2.6.
|
7 |
Author: MailPoet
|
8 |
Author URI: http://www.mailpoet.com/
|
9 |
License: GPLv2 or later
|
3 |
Plugin Name: MailPoet Newsletters
|
4 |
Plugin URI: http://www.mailpoet.com/
|
5 |
Description: Create and send newsletters. Import and manage your lists. Add subscription forms in widgets, articles and pages. MailPoet (formerly Wysija) is a freemium plugin updated regularly with new features.
|
6 |
+
Version: 2.6.11
|
7 |
Author: MailPoet
|
8 |
Author URI: http://www.mailpoet.com/
|
9 |
License: GPLv2 or later
|
js/admin-ajax-proto.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function WYSIJA_SYNC_AJAX(s){$("ajax-loading").show(),void 0!==s.loading_message?$("wysija_notice_msg").update(s.loading_message):$("wysija_notice_msg").update(Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,asynchronous:!1,onSuccess:function(e){void 0!==s.success&&s.success(e);var i=Wysija_i18n.savednl;void 0!==s.message&&(i=s.message),"msgs"in e.responseJSON&&"error"in e.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=e.responseJSON.msgs.error),"msgs"in e.responseJSON&&"updated"in e.responseJSON.msgs&&(i=e.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(e){void 0!==s.failure&&s.failure(e),$("wysija_notices").writeAttribute("class","error"),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(Wysija_i18n.errorsavingnl),ajaxOver=!0}})}function WYSIJA_AJAX_POST(s){var e=s||{};$("ajax-loading").show(),void 0!==e.loading_message?$("wysija_notice_msg").update(e.loading_message):$("wysija_notice_msg").update(Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").setAttribute("class","notice")
|
1 |
+
function WYSIJA_SYNC_AJAX(s){$("ajax-loading").show(),void 0!==s.loading_message?$("wysija_notice_msg").update(s.loading_message):$("wysija_notice_msg").update(Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,asynchronous:!1,onSuccess:function(e){void 0!==s.success&&s.success(e);var i=Wysija_i18n.savednl;void 0!==s.message&&(i=s.message),"msgs"in e.responseJSON&&"error"in e.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=e.responseJSON.msgs.error),"msgs"in e.responseJSON&&"updated"in e.responseJSON.msgs&&(i=e.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(e){void 0!==s.failure&&s.failure(e),$("wysija_notices").writeAttribute("class","error"),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(Wysija_i18n.errorsavingnl),ajaxOver=!0}})}function WYSIJA_AJAX_POST(s){var e=s||{};$("ajax-loading").show(),void 0!==e.loading_message?$("wysija_notice_msg").update(e.loading_message):$("wysija_notice_msg").update(Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").setAttribute("class","notice"),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(s){$("wysija_notices").writeAttribute("class","notice");var i=Wysija_i18n.savednl;void 0!==e.success_message&&(i=e.success_message),void 0!=e.success&&e.success(s),"msgs"in s.responseJSON&&"error"in s.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=s.responseJSON.msgs.error),"msgs"in s.responseJSON&&"updated"in s.responseJSON.msgs&&(i=s.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(s){$("wysija_notices").setAttribute("class","error"),void 0!=e.failure&&e.failure(s),$("ajax-loading").hide(),$("wysija_notices").hide(),void 0!==e.error_message?$("wysija_notice_msg").update(e.error_message):$("wysija_notice_msg").update(Wysija_i18n.errorsavingnl),ajaxOver=!0}})}
|
js/admin-ajax.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wysijaAJAXcallback=function(){};wysijaAJAXcallback.prototype.onSuccess=function(){};var displaychange=1,popupopen=0;jQuery(function(a){a.WYSIJA_SEND=function(){displaychange=1,0===popupopen?(a(".wysija-msg.ajax").html('<div class="allmsgs" title="'+wysijaAJAX.popTitle+'"><blink>'+wysijaAJAX.loadingTrans+"</blink></div>"),a(".wysija-msg.ajax .allmsgs").dialog({modal:!0,draggable:!1,resizable:!1,width:400,close:function(){displaychange=0,popupopen=0,a(this).remove()}})):a(".allmsgs.ui-dialog-content.ui-widget-content").html("<blink>"+wysijaAJAX.loadingTrans+"</blink>"),popupopen=1,
|
1 |
+
var wysijaAJAXcallback=function(){};wysijaAJAXcallback.prototype.onSuccess=function(){};var displaychange=1,popupopen=0;jQuery(function(a){a.WYSIJA_SEND=function(){displaychange=1,0===popupopen?(a(".wysija-msg.ajax").html('<div class="allmsgs" title="'+wysijaAJAX.popTitle+'"><blink>'+wysijaAJAX.loadingTrans+"</blink></div>"),a(".wysija-msg.ajax .allmsgs").dialog({modal:!0,draggable:!1,resizable:!1,width:400,close:function(){displaychange=0,popupopen=0,a(this).remove()}})):a(".allmsgs.ui-dialog-content.ui-widget-content").html("<blink>"+wysijaAJAX.loadingTrans+"</blink>"),popupopen=1,"json"===wysijaAJAX.dataType?a.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:a.WYSIJA_HANDLE_RESPONSE,error:function(a){alert("Request error not JSON:"+a.responseText),wysijaAJAXcallback.onSuccess=""},dataType:wysijaAJAX.dataType}):a(".allmsgs.ui-dialog-content.ui-widget-content").load(wysijaAJAX.ajaxurl,wysijaAJAX,function(s){var i=JSON.parse(s);return"object"!=typeof i?!0:(a.WYSIJA_HANDLE_RESPONSE(i),void 0)})},a.WYSIJA_HANDLE_RESPONSE=function(s){a(".allmsgs.ui-dialog-content.ui-widget-content").html(""),a(".wysija-msg.ajax").html('<div class="allmsgs"></div>'),a.each(s.msgs,function(i,l){displaychange?(a(".allmsgs.ui-dialog-content.ui-widget-content ."+i+" ul").length||a(".allmsgs.ui-dialog-content.ui-widget-content").append('<div class="'+i+'"><ul></ul></div>'),a.each(l,function(s,l){a(".allmsgs.ui-dialog-content.ui-widget-content ."+i+" ul").append("<li>"+l+"</li>")})):(a(".wysija-msg.ajax .allmsgs ."+i+" ul").length||a(".wysija-msg.ajax .allmsgs").append('<div class="'+i+'"><ul></ul></div>'),a.each(l,function(s,l){a(".wysija-msg.ajax .allmsgs ."+i+" ul").append("<li>"+l+"</li>")})),a.isFunction(wysijaAJAXcallback.onSuccess)&&wysijaAJAXcallback.onSuccess(s),wysijaAJAXcallback.onSuccess=function(){}})}});
|
js/admin-campaigns-articles.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var query_offset=0,wysappend=0,totalReached=!1,searchRunning=!1,slider=null,colorpicker=null;jQuery(function(e){function t(){e(".submit-box").addClass("counting");var t=parseInt(e(".search_results .checkbox:checked").length,10);0===t?
|
1 |
+
var query_offset=0,wysappend=0,totalReached=!1,searchRunning=!1,slider=null,colorpicker=null;jQuery(function(e){function t(){e(".submit-box").addClass("counting");var t=parseInt(e(".search_results .checkbox:checked").length,10);0===t?i():o(t+" "+wysijatrans.post_selected)}function i(){e(".submit-box").removeClass("counting"),c()}function a(){return query_offset=0,wysappend=0,s(),!1}function n(){if(null===slider){var t=32,i=564,a=Math.min(Math.max(t,parseInt(e("#slider_info span").html())),i);slider=new Control.Slider("slider_handle","image_width_slider",{range:$R(t,i),slideValue:a,axis:"horizontal",onSlide:function(t){var i=parseInt(t,10);e("#slider_info").find("span").html(i),e("#image_width").val(i)},onChange:function(t){var i=parseInt(t,10);e("#slider_info").find("span").html(i),e("#image_width").val(i)}}),slider.setValue(a)}}function s(){var t="";wysappend||e("#results").html(t),wysijaAJAX.task="get_articles",wysijaAJAX.data=e("#articles-form").serializeArray(),wysijaAJAX.query_offset=query_offset,l(wysijatrans.loading_results),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:m,error:f,dataType:"json"})}function l(t){i(),e(".submit-box").addClass("loading"),o(t)}function o(t){void 0!==t&&e("#loading-message").html(t)}function c(){e("#loading-message").html("")}function r(){e(".submit-box").removeClass("loading"),c(),t()}function d(){e("#title_position_block")["title"===e('input[name="post_content"]:checked').val()?"hide":"show"](),e("#title_tag_list")["title"===e('input[name="post_content"]:checked').val()?"show":"hide"](),e("#advanced:visible").length>0&&(e("#title_tag_list:hidden").length>0&&"list"===e('input[name="title_tag"]:checked').val()&&e('input[name="title_tag"][value="h2"]').attr("checked","checked"),"list"===e('input[name="title_tag"]:checked').val()?u(["image","author","category","readmore","divider","bgcolor"]):h(["image","author","category","readmore","divider","bgcolor"]))}function u(t){e.each(t,function(t,i){e("#"+i+"-block").hide()})}function h(t){e.each(t,function(t,i){e("#"+i+"-block").show()})}function p(){null===colorpicker&&(colorpicker=!0,e("input.color").modcoder_excolor({hue_bar:1,border_color:"#969696",anim_speed:"fast",round_corners:!1,shadow_size:2,shadow_color:"#f0f0f0",background_color:"#ececec",backlight:!1,label_color:"#333333",effect:"fade",show_input:!1,z_index:2e4,callback_on_open:function(){e("html, body").animate({scrollTop:e("#modcoder_colorpicker_wrapper:visible").offset().top},200)}}))}function _(){e("#image_block")[e('input[name="title_tag"][value="list"]:checked').length>0?"hide":"show"]()}function g(){var t=e('input[name="image_alignment"]:checked').val(),i=!0,a=32,s=325;"center"===t?s=564:"none"===t&&(i=!1),i===!0?(e("#image_width_block").show(),n(),slider.range=$R(a,s),slider.setValue(slider.value)):e("#image_width_block").hide()}function m(t){var i="",a=null;t.result.result?(i='<ul class="search_results">',e.each(t.result.posts,function(e,t){a={src:null,alt:"",title:""},null!==t.post_image&&(a.src=t.post_image.src,a.alt=t.post_image.alt,a.title=t.post_title);var n=query_offset+e;i+='<li id="post-'+n+'" class="clearfix">',i+='<div class="checkbox_container">',i+='<input id="post-checkbox-'+n+'" data-post-id="'+n+'" type="checkbox" class="checkbox" value="'+t.ID+'" name="post_selection" />',i+="</div>",null!==a.src?(i+='<div class="thumbnail"><img width="60" title="'+a.title+'" src="'+a.src+'" alt="'+a.alt+'" /></div>',i+='<label class="with_thumbnail" for="post-checkbox-'+n+'">'+t.post_title+"</label>"):i+='<label for="post-checkbox-'+n+'">'+t.post_title+"</label>",i+='<span class="cpt-type">'+t.post_type+" - <small>"+t.post_status+"</small></span>",i+="</li>"}),i+="</ul>"):i=t.result.append?"":'<p class="message"><strong>'+t.result.msg+"</strong></p>",t.result.append?""!==i&&e("#results").append("<hr />"+i):e("#results").html(i),wysappend=0,searchRunning=!1,totalReached=parseInt(t.result.total)===e("ul.search_results li").length?!0:!1,r()}function f(){searchRunning=!1,wysappend=0}function w(){0!==e("#advanced:hidden").length&&searchRunning!==!0&&(searchRunning=!0,query_offset+=10,wysappend=1,s())}e("#toggle-advanced").toggle(function(){return e(this).html(wysijatrans.hide_advanced),e("#advanced").show(),e("#basic").hide(),n(),d(),g(),_(),p(),e(this).blur(),!1},function(){return e(this).html(wysijatrans.show_advanced),e("#basic").show(),e("#advanced").hide(),e(this).blur(),!1}),e("#back-selection").click(function(){return e("#toggle-advanced").trigger("click"),!1}),e("#insert-selection").click(function(){var t=[],i=e('#results input[name="post_selection"]:checked'),a=[],n=["readmore","author_label","category_label"];return 0===i.length?!1:(e.each(i,function(i,a){t.push(e(a).val())}),e("#articles-form").serializeArray().each(function(e){n.include(e.name)&&(e.value=window.parent.Wysija.encodeHtmlValue(e.value)),a.push(e)}),wysijaAJAX.task="insert_articles",wysijaAJAX.post_ids=t.join(","),wysijaAJAX.data=a,wysijaAJAX._wpnonce=wysijanonces.campaigns.insert_articles,wysijaAJAX.divider={src:window.parent.$$('.wysija_item[wysija_type="divider"]')[0].readAttribute("wysija_src"),width:window.parent.$$('.wysija_item[wysija_type="divider"]')[0].readAttribute("wysija_width"),height:window.parent.$$('.wysija_item[wysija_type="divider"]')[0].readAttribute("wysija_height")},l(wysijatrans.inserting_selection),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(e){window.parent.WysijaPopup.success(e.result.posts),r()},error:f,dataType:"json"}),!1)}),e(document).on("click",".search_results .checkbox",function(){e(this).is(":checked")===!0?e("#post-"+e(this).data("post-id")).addClass("selected"):e("#post-"+e(this).data("post-id")).removeClass("selected"),t()}),e(document).on("change","#post_type",function(){a()}),e(".post_category").change(function(){a()}),e("#post_status").change(function(){a()}),e(document).on("click","#search-submit",function(){return s(),!1}),e('input[name="image_alignment"]').click(function(){g()}),e('input[name="post_content"]').click(function(){d(),_(),g()}),e('input[name="title_tag"]').click(function(){d(),_(),g()}),e(function(){s()}),e(window).scroll(function(){totalReached===!1&&e("#results li").length>=10&&!wysappend&&e(window).scrollTop()===e(document).height()-e(window).height()&&w()})});
|
js/admin-campaigns-bookmarks.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(
|
1 |
+
jQuery(function(a){function s(s,e){wysijaAJAX.task="get_social_bookmarks",wysijaAJAX.wysijaData={size:s,theme:e},jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(s){if(void 0!=s.result){var e,o=JSON.parse(s.result),t="",i='class="selected"';a.each(Object.keys(o.icons).sort(),function(s,r){t+='<li class="clearfix"><a href="javascript:;" '+i+' rel="'+r+'">',e=o.icons[r],0==s&&(i="",a("#bookmarks-iconset").val(r),s++),a.each(["facebook","twitter","google","linkedin"],function(a,s){t+='<img src="'+e[s]+'" alt="'+s+'" />'})}),t+="</a></li>",a("ul.icons").html(t)}},dataType:"json"})}var e=window.parent.document.getElementById("bodyBgColorInput").value;(void 0===e||6!==e.length)&&(e="FFFFFF"),a("ul.icons").css("backgroundColor","#"+e),a(document).on("click",".bookmarks .sizes a",function(){return a(".bookmarks .sizes a").removeClass("selected"),a(this).addClass("selected"),s(a(this).attr("rel"),a("#bookmarks-theme").val()),a("#bookmarks-size").val(a(this).attr("rel")),a("#bookmarks-iconset").val(""),!1}),a(document).on("click",".bookmarks .icons a",function(){return a(".bookmarks .icons a").removeClass("selected"),a(this).addClass("selected"),a("#bookmarks-iconset").val(a(this).attr("rel")),!1}),a("#bookmarks-submit").click(function(){return wysijaAJAX.task="generate_social_bookmarks",wysijaAJAX._wpnonce=wysijanonces.campaigns.generate_social_bookmarks,wysijaAJAX.wysijaData=a("#bookmarks-form").serializeArray(),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(a){void 0!==a.result&&""!==a.result?window.parent.WysijaPopup.success(a.result):window.parent.WysijaPopup.cancel()}}),!1}),a(function(){s(a("#bookmarks-size").val(),a("#bookmarks-theme").val())})});
|
js/admin-campaigns-dividers.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(i){var e=window.parent.document.getElementById("bodyBgColorInput").value;(void 0==e||6!=e.length)&&(e="FFFFFF"),i("ul.dividers").css("backgroundColor","#"+e),i(document).on("click",".dividers a",function(){i(".dividers a").removeClass("selected"),i(this).addClass("selected");var e=i(this).children(":first");return i("#divider_src").val(e.attr("src")),i("#divider_width").val(e.attr("width")),i("#divider_height").val(e.attr("height")),!1}),i("#dividers-submit").click(function(){return wysijaAJAX.task="set_divider",wysijaAJAX.id=i("#email_id").val(),wysijaAJAX.wysijaData={src:i("#divider_src").val(),width:i("#divider_width").val(),height:i("#divider_height").val()},i.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(i){i.result!==!1&&(window.parent.Wysija.setDivider(Base64.decode(i.result),wysijaAJAX.wysijaData),window.parent.Wysija.replaceDividers(),window.parent.Wysija.init(),window.parent.Wysija.autoSave(),window.parent.WysijaPopup.close())}}),!1})});
|
1 |
+
jQuery(function(i){var e=window.parent.document.getElementById("bodyBgColorInput").value;(void 0==e||6!=e.length)&&(e="FFFFFF"),i("ul.dividers").css("backgroundColor","#"+e),i(document).on("click",".dividers a",function(){i(".dividers a").removeClass("selected"),i(this).addClass("selected");var e=i(this).children(":first");return i("#divider_src").val(e.attr("src")),i("#divider_width").val(e.attr("width")),i("#divider_height").val(e.attr("height")),!1}),i("#dividers-submit").click(function(){return wysijaAJAX.task="set_divider",wysijaAJAX._wpnonce=wysijanonces.campaigns.set_divider,wysijaAJAX.id=i("#email_id").val(),wysijaAJAX.wysijaData={src:i("#divider_src").val(),width:i("#divider_width").val(),height:i("#divider_height").val()},i.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(i){i.result!==!1&&(window.parent.Wysija.setDivider(Base64.decode(i.result),wysijaAJAX.wysijaData),window.parent.Wysija.replaceDividers(),window.parent.Wysija.init(),window.parent.Wysija.autoSave(),window.parent.WysijaPopup.close())}}),!1})});
|
js/admin-campaigns-editDetails.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(e){function t(){wysijaAJAX.popTitle=wysijatrans.previewemail,wysijaAJAX.dataType="json",wysijaAJAX.task="send_preview",jQuery("#campaignstep3").length>0&&(wysijaAJAX.data=jQuery("#campaignstep3").serializeArray(),wysijaAJAX.id=jQuery("#email_id").val()),wysijaAJAX.receiver=jQuery("#preview-receiver").val(),jQuery.WYSIJA_SEND()}function i(){return"function"==typeof saveWYSIJA?saveWYSIJA(function(){t()}):t(),!1}function a(){var t={};return e(".checkbox.checklists").each(function(){e(this).attr("checked")&&(t[e(this).attr("id")]={total:parseInt(e("#"+e(this).attr("id")+"count").val()),title:e(this).attr("alt")})}),t}function s(){var t=a(),i=0,s="";for(var r in t)i+=parseInt(t[r].total),s+=t[r].title+", ";if(s=s.substr(0,s.length-2),void 0!=wysijatrans.alertsend&&!e("#scheduleit").attr("checked")){var n=wysijatrans.alertsend;return n=n.replace("[#]",i),n=n.replace("[#nms]",s),confirm(n)?!0:!1}return void 0!=wysijatrans.ignoreprevious&&e("#ignore_subscribers").attr("checked")?confirm(wysijatrans.ignoreprevious)?!0:!1:!0}function r(){return e("#wysija-send-spamtest").hasClass("disabled")?!1:(WysijaPopup.showLoading(),WysijaPopup.showOverlay(),saveWYSIJA(function(){n()}),void 0)}function n(){wysijaAJAX.popTitle=wysijatrans.previewemail,wysijaAJAX.dataType="json",wysijaAJAX.task="send_spamtest",e.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(t){if(WysijaPopup.hideLoading(),t.result.result){e("#wysija-spam-results").attr("href",t.result.urlredirect).fadeIn("slow");var i=parseInt(e("#counttriesleft").html())-1;e("#counttriesleft").html(i),0>=i&&e("#wysija-send-spamtest").addClass("disabled"),WysijaPopup.hideOverlay()}else t.result.notriesleft&&alert(t.result.notriesleft),WysijaPopup.hideOverlay()},error:function(e){alert("Request error not JSON:"+e.responseText),delete wysijaAJAXcallback.onSuccess},dataType:wysijaAJAX.dataType})}e(".action-send-spam-test").click(function(){return tb_show(wysijatrans.processqueue,e(this).attr("href")+"&KeepThis=true&TB_iframe=true&height=618&width=1000",null),tb_showIframe(),!1}),e("#wj-send-preview").click(i),e("#submit-send").click(s),e(document).ready(function(){function t(t){e("#scheduleit").attr("checked")?(e(".schedule-row").show(),e("#submit-send").val(wysijatrans.schedule)):(e(".schedule-row").hide(),e("#submit-send").val(t))}if("function"!=typeof saveWYSIJA){e("#datepicker-day").datepicker({minDate:0,showOn:"focus",dateFormat:"yy-mm-dd"});var i=e("#submit-send").val();t(i),e("#scheduleit").change(function(){t(i)})}}),e("#wysija-send-spamtest").click(r),e("#link-back-step2").click(function(){return e("#hid-redir").attr("value","savelastback"),e("#campaignstep3").submit(),!1})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,t){"use strict";var i=t.mailpoet,a=i.fn={};a.isGoodFromAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:i.toLowerCase()!==t.location.host.toLowerCase()?!1:!0},a.isGmailAddress=function(e){var t=e.split("@")[1];return"undefined"==typeof t||""===t?!1:"gmail.com"!==t.toLowerCase()?!1:!0}}(jQuery,window),function(e,t){"use strict";var i=t.mailpoet;e(t).load(function(){"object"==typeof e.fn.tooltip&&(i.$.from_email=e("#from_email"),i.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return i.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(i.fn.isGoodFromAddress(i.$.from_email.val()))return i.$.from_email.data("message","").tooltip("hide");if("true"===wysijatrans.emailCheck.isGmail)return i.$.from_email.data("message","").tooltip("hide");var e="";return e=i.fn.isGmailAddress(i.$.from_email.val())?wysijatrans.emailCheck.gmailText:wysijatrans.emailCheck.text,i.$.from_email.is(":visible")?i.$.from_email.data("message",e).tooltip("show"):i.$.from_email.tooltip("hide")},keyup:function(){i.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"))})}(jQuery,window);
|
1 |
+
jQuery(function(e){function t(){wysijaAJAX.popTitle=wysijatrans.previewemail,wysijaAJAX.dataType="json",wysijaAJAX.task="send_preview",wysijaAJAX._wpnonce=wysijanonces.campaigns.send_preview,jQuery("#campaignstep3").length>0&&(wysijaAJAX.data=jQuery("#campaignstep3").serializeArray(),wysijaAJAX.id=jQuery("#email_id").val()),wysijaAJAX.receiver=jQuery("#preview-receiver").val(),jQuery.WYSIJA_SEND()}function i(){return"function"==typeof saveWYSIJA?saveWYSIJA(function(){t()}):t(),!1}function a(){var t={};return e(".checkbox.checklists").each(function(){e(this).attr("checked")&&(t[e(this).attr("id")]={total:parseInt(e("#"+e(this).attr("id")+"count").val()),title:e(this).attr("alt")})}),t}function s(){var t=a(),i=0,s="";for(var r in t)i+=parseInt(t[r].total),s+=t[r].title+", ";if(s=s.substr(0,s.length-2),void 0!=wysijatrans.alertsend&&!e("#scheduleit").attr("checked")){var n=wysijatrans.alertsend;return n=n.replace("[#]",i),n=n.replace("[#nms]",s),confirm(n)?!0:!1}return void 0!=wysijatrans.ignoreprevious&&e("#ignore_subscribers").attr("checked")?confirm(wysijatrans.ignoreprevious)?!0:!1:!0}function r(){return e("#wysija-send-spamtest").hasClass("disabled")?!1:(WysijaPopup.showLoading(),WysijaPopup.showOverlay(),saveWYSIJA(function(){n()}),void 0)}function n(){wysijaAJAX.popTitle=wysijatrans.previewemail,wysijaAJAX.dataType="json",wysijaAJAX.task="send_spamtest",wysijaAJAX._wpnonce=wysijanonces.campaigns.send_spamtest,e.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(t){if(WysijaPopup.hideLoading(),t.result.result){e("#wysija-spam-results").attr("href",t.result.urlredirect).fadeIn("slow");var i=parseInt(e("#counttriesleft").html())-1;e("#counttriesleft").html(i),0>=i&&e("#wysija-send-spamtest").addClass("disabled"),WysijaPopup.hideOverlay()}else t.result.notriesleft&&alert(t.result.notriesleft),WysijaPopup.hideOverlay()},error:function(e){alert("Request error not JSON:"+e.responseText),delete wysijaAJAXcallback.onSuccess},dataType:wysijaAJAX.dataType})}e(".action-send-spam-test").click(function(){return tb_show(wysijatrans.processqueue,e(this).attr("href")+"&KeepThis=true&TB_iframe=true&height=618&width=1000",null),tb_showIframe(),!1}),e("#wj-send-preview").click(i),e("#submit-send").click(s),e(document).ready(function(){function t(t){e("#scheduleit").attr("checked")?(e(".schedule-row").show(),e("#submit-send").val(wysijatrans.schedule)):(e(".schedule-row").hide(),e("#submit-send").val(t))}if("function"!=typeof saveWYSIJA){e("#datepicker-day").datepicker({minDate:0,showOn:"focus",dateFormat:"yy-mm-dd"});var i=e("#submit-send").val();t(i),e("#scheduleit").change(function(){t(i)})}}),e("#wysija-send-spamtest").click(r),e("#link-back-step2").click(function(){return e("#hid-redir").attr("value","savelastback"),e("#campaignstep3").submit(),!1})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,t){"use strict";var i=t.mailpoet,a=i.fn={};a.isGoodFromAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:i.toLowerCase()!==t.location.host.toLowerCase()?!1:!0},a.isGmailAddress=function(e){var t=e.split("@")[1];return"undefined"==typeof t||""===t?!1:"gmail.com"!==t.toLowerCase()?!1:!0}}(jQuery,window),function(e,t){"use strict";var i=t.mailpoet;e(t).load(function(){"object"==typeof e.fn.tooltip&&(i.$.from_email=e("#from_email"),i.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return i.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(i.fn.isGoodFromAddress(i.$.from_email.val()))return i.$.from_email.data("message","").tooltip("hide");if("true"===wysijatrans.emailCheck.isGmail)return i.$.from_email.data("message","").tooltip("hide");var e="";return e=i.fn.isGmailAddress(i.$.from_email.val())?wysijatrans.emailCheck.gmailText:wysijatrans.emailCheck.text,i.$.from_email.is(":visible")?i.$.from_email.data("message",e).tooltip("show"):i.$.from_email.tooltip("hide")},keyup:function(){i.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"))})}(jQuery,window);
|
js/admin-campaigns-editTemplate.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function handleRemoveImage(){$$(".wj_images li").invoke("stopObserving","mouseover"),$$(".wj_images li").invoke("stopObserving","mouseout"),$$(".wj_images li").invoke("observe","mouseover",function(){$(this).select("span.delete-wrap").first().show()}),$$(".wj_images li").invoke("observe","mouseout",function(){$(this).select("span.delete-wrap").first().hide()}),$$(".wj_images li .delete").invoke("observe","click",function(){removeImage($(this).innerHTML),$(this).stopObserving("click")})}function setDefaultTheme(e){var t=e.up().previous(".wysija_theme").readAttribute("rel");return wysijaAJAX.task="setDefaultTheme",wysijaAJAX.theme=t,WYSIJA_AJAX_POST({success:function(){$$(".wj_themes .default").invoke("removeClassName","selected"),$(e).addClassName("selected")},loading_message:wysijatrans.theme_setting_default,success_message:wysijatrans.theme_saved_default}),!1}function handleRemoveTheme(){$$(".wj_themes li").invoke("stopObserving","mouseover"),$$(".wj_themes li").invoke("stopObserving","mouseout"),$$(".wj_themes li").invoke("observe","mouseover",function(){$(this).down("span.delete-wrap").show(),$(this).down("span.default-wrap").show()}),$$(".wj_themes li").invoke("observe","mouseout",function(){$(this).down("span.delete-wrap").hide(),$(this).down(".default-wrap").hide()}),$$(".wj_themes li .delete").invoke("observe","click",function(){removeTheme($(this).innerHTML),$(this).stopObserving("click")})}function handleDefaultTheme(){$$(".wj_themes li .default").invoke("observe","click",function(){$$(".wj_themes li .default.selected").length>0&&$$(".wj_themes li .default.selected").first().up().hide(),setDefaultTheme(this)})}function handleSwitchTheme(){$$("a.wysija_theme").invoke("observe","click",function(e){switchThemeWYSIJA(e)})}function removeTheme(e){return confirm(wysijatrans.abouttodeletetheme.replace("%1$s",e))&&($("wysija-theme-"+e).remove(),wysijaAJAX.task="deleteTheme",wysijaAJAX.themekey=e,WYSIJA_AJAX_POST()),!0}function removeImage(e){var t=wysijaIMG.unset(e);return void 0!==t&&$("wysija-img-"+e).remove(),saveIQS(),!0}function addImage(e){var t=new Element("img",{width:80,height:80,wysija_height:e.height,wysija_width:e.width,wysija_src:e.url,src:e.thumb_url}),i=new Element("a",{wysija_type:"image","class":"wysija_item"}).update(t),s=new Element("li",{id:"wysija-img-"+e.identifier,"class":"new"}).update(i);return s.insert('<span class="delete-wrap" style="display:none;"><span class="delete">'+e.identifier+"</span></span>"),s.insert('<span class="default-wrap" style="display:none;"><span class="default">'+e.identifier+"</span></span>"),$("wj-images-quick").insert({top:s}),handleRemoveImage(),wysijaIMG.set(e.identifier,e),saveIQS(),!0}function imagesTabPostHandler(){return updateImagesToolbarSize()}function updateImagesToolbarSize(){var e=document.viewport.getDimensions().height,t=$("wpadminbar").getLayout().get("margin-box-height"),i=$("wpfooter").getLayout().get("margin-box-height"),s=$("wj-images-quick"),a=s.getLayout(),n=$("wysija_toolbar").getLayout().get("margin-box-height")-a.get("margin-box-height"),o=$("wysija-app").getLayout(),r=o.get("margin-box-height")-o.get("height"),h=$("wpbody-content").getLayout().get("height")-o.get("margin-box-height"),l=e-t-i-n-r-h;s.setStyle({height:l+"px"})}var wysijaIMG=$H(),ajaxOver=!0;document.observe("dom:loaded",function(){void 0!=$("wysija-upload-browse")&&$("wysija-upload-browse").observe("click",function(){return WysijaPopup.open($(this).innerHTML,$(this).readAttribute("href2")),!1}),void 0!=$("wysija-themes-browse")&&$("wysija-themes-browse").observe("click",function(){return WysijaPopup.open($(this).innerHTML,$(this).readAttribute("href2")),!1}),void 0!=$("wysija_divider_settings")&&$("wysija_divider_settings").observe("click",function(){return WysijaPopup.open(wysijatrans.dividerSelectionTitle,$(this).readAttribute("href2")),!1}),handleRemoveImage(),handleRemoveTheme(),handleSwitchTheme(),handleDefaultTheme(),$$(".wysija_toolbar_tabs a").invoke("observe","click",function(){$$(".wysija_toolbar_tabs a").invoke("removeClassName","selected"),$$(".wj_images, .wj_content, .wj_styles, .wj_themes").invoke("hide"),$$(".wj_"+$(this).readAttribute("rel"))[0].show(),$(this).addClassName("selected");var e=window[$(this).readAttribute("rel")+"TabPostHandler"];return"function"==typeof e&&e(),!1}),Event.observe(window,"resize",function(){updateImagesToolbarSize()})});
|
1 |
+
function handleRemoveImage(){$$(".wj_images li").invoke("stopObserving","mouseover"),$$(".wj_images li").invoke("stopObserving","mouseout"),$$(".wj_images li").invoke("observe","mouseover",function(){$(this).select("span.delete-wrap").first().show()}),$$(".wj_images li").invoke("observe","mouseout",function(){$(this).select("span.delete-wrap").first().hide()}),$$(".wj_images li .delete").invoke("observe","click",function(){removeImage($(this).innerHTML),$(this).stopObserving("click")})}function setDefaultTheme(e){var t=e.up().previous(".wysija_theme").readAttribute("rel");return wysijaAJAX.task="setDefaultTheme",wysijaAJAX.theme=t,wysijaAJAX._wpnonce=wysijanonces.campaigns.setDefaultTheme,WYSIJA_AJAX_POST({success:function(){$$(".wj_themes .default").invoke("removeClassName","selected"),$(e).addClassName("selected")},loading_message:wysijatrans.theme_setting_default,success_message:wysijatrans.theme_saved_default}),!1}function handleRemoveTheme(){$$(".wj_themes li").invoke("stopObserving","mouseover"),$$(".wj_themes li").invoke("stopObserving","mouseout"),$$(".wj_themes li").invoke("observe","mouseover",function(){$(this).down("span.delete-wrap").show(),$(this).down("span.default-wrap").show()}),$$(".wj_themes li").invoke("observe","mouseout",function(){$(this).down("span.delete-wrap").hide(),$(this).down(".default-wrap").hide()}),$$(".wj_themes li .delete").invoke("observe","click",function(){removeTheme($(this).innerHTML),$(this).stopObserving("click")})}function handleDefaultTheme(){$$(".wj_themes li .default").invoke("observe","click",function(){$$(".wj_themes li .default.selected").length>0&&$$(".wj_themes li .default.selected").first().up().hide(),setDefaultTheme(this)})}function handleSwitchTheme(){$$("a.wysija_theme").invoke("observe","click",function(e){switchThemeWYSIJA(e)})}function removeTheme(e){return confirm(wysijatrans.abouttodeletetheme.replace("%1$s",e))&&($("wysija-theme-"+e).remove(),wysijaAJAX.task="deleteTheme",wysijaAJAX.themekey=e,wysijaAJAX._wpnonce=wysijanonces.campaigns.deleteTheme,WYSIJA_AJAX_POST()),!0}function removeImage(e){var t=wysijaIMG.unset(e);return void 0!==t&&$("wysija-img-"+e).remove(),saveIQS(),!0}function addImage(e){var t=new Element("img",{width:80,height:80,wysija_height:e.height,wysija_width:e.width,wysija_src:e.url,src:e.thumb_url}),i=new Element("a",{wysija_type:"image","class":"wysija_item"}).update(t),s=new Element("li",{id:"wysija-img-"+e.identifier,"class":"new"}).update(i);return s.insert('<span class="delete-wrap" style="display:none;"><span class="delete">'+e.identifier+"</span></span>"),s.insert('<span class="default-wrap" style="display:none;"><span class="default">'+e.identifier+"</span></span>"),$("wj-images-quick").insert({top:s}),handleRemoveImage(),wysijaIMG.set(e.identifier,e),saveIQS(),!0}function imagesTabPostHandler(){return updateImagesToolbarSize()}function updateImagesToolbarSize(){var e=document.viewport.getDimensions().height,t=$("wpadminbar").getLayout().get("margin-box-height"),i=$("wpfooter").getLayout().get("margin-box-height"),s=$("wj-images-quick"),a=s.getLayout(),n=$("wysija_toolbar").getLayout().get("margin-box-height")-a.get("margin-box-height"),o=$("wysija-app").getLayout(),r=o.get("margin-box-height")-o.get("height"),h=$("wpbody-content").getLayout().get("height")-o.get("margin-box-height"),l=e-t-i-n-r-h;s.setStyle({height:l+"px"})}var wysijaIMG=$H(),ajaxOver=!0;document.observe("dom:loaded",function(){void 0!=$("wysija-upload-browse")&&$("wysija-upload-browse").observe("click",function(){return WysijaPopup.open($(this).innerHTML,$(this).readAttribute("href2")),!1}),void 0!=$("wysija-themes-browse")&&$("wysija-themes-browse").observe("click",function(){return WysijaPopup.open($(this).innerHTML,$(this).readAttribute("href2")),!1}),void 0!=$("wysija_divider_settings")&&$("wysija_divider_settings").observe("click",function(){return WysijaPopup.open(wysijatrans.dividerSelectionTitle,$(this).readAttribute("href2")),!1}),handleRemoveImage(),handleRemoveTheme(),handleSwitchTheme(),handleDefaultTheme(),$$(".wysija_toolbar_tabs a").invoke("observe","click",function(){$$(".wysija_toolbar_tabs a").invoke("removeClassName","selected"),$$(".wj_images, .wj_content, .wj_styles, .wj_themes").invoke("hide"),$$(".wj_"+$(this).readAttribute("rel"))[0].show(),$(this).addClassName("selected");var e=window[$(this).readAttribute("rel")+"TabPostHandler"];return"function"==typeof e&&e(),!1}),Event.observe(window,"resize",function(){updateImagesToolbarSize()})});
|
js/admin-campaigns-medias.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function closeLbox(){window.parent.WysijaPopup.close()}function unset(e){window.parent.removeImage(e)}function insert(e){window.parent.addImage(e),"undefined"!=typeof filesToAdd&&(filesToAdd>1?filesToAdd--:jQuery("#overlay").hide())}function hideShowOverlay(){if(window.parent.ajaxOver)formsubmit||jQuery("#overlay").hide();else if(formsubmit)return jQuery("#wysija-browse-form").submit(),formsubmit=!1,!1}var formsubmit=!1;jQuery(function(e){e(".wysija-thumb").click(function(){return e(this).hasClass("selected")?(e(this).removeClass("selected"),unset("wp-"+e(this).find("span.identifier").html())):(e(this).addClass("selected"),insert({identifier:"wp-"+e(this).find("span.identifier").html(),width:e(this).find("span.width").html(),height:e(this).find("span.height").html(),url:e(this).find("span.url").html(),thumb_url:e(this).find("span.thumb_url").html()})),!0}),e("#wysija-close, #close-pop-alt").click(function(){return closeLbox(),!1}),e(".del-attachment").click(function(i){return i.stopPropagation(),confirm(wysijatrans.deleteimg)&&(e("#wysija-browse-form").append('<input type="hidden" name="subaction" value="delete" /><input type="hidden" name="imgid" value="'+parseInt(e(this).html())+'" />'),formsubmit=!0,unset("wp-"+e(this).html()),jQuery("#overlay").show(),window.parent.ajaxOver=!1,hideShowOverlay()),!1})});
|
1 |
+
function closeLbox(){window.parent.WysijaPopup.close()}function unset(e){window.parent.removeImage(e)}function insert(e){window.parent.addImage(e),"undefined"!=typeof filesToAdd&&(filesToAdd>1?filesToAdd--:jQuery("#overlay").hide())}function hideShowOverlay(){if(window.parent.ajaxOver)formsubmit||jQuery("#overlay").hide();else if(formsubmit)return jQuery("#wysija-browse-form").submit(),formsubmit=!1,!1}var formsubmit=!1;jQuery(function(e){e(".wysija-thumb").click(function(){return e(this).hasClass("selected")?(e(this).removeClass("selected"),unset("wp-"+e(this).find("span.identifier").html())):(e(this).addClass("selected"),insert({identifier:"wp-"+e(this).find("span.identifier").html(),width:e(this).find("span.width").html(),height:e(this).find("span.height").html(),url:e(this).find("span.url").html(),thumb_url:e(this).find("span.thumb_url").html()})),!0}),e("#wysija-close, #close-pop-alt").click(function(){return closeLbox(),!1}),e(".del-attachment").click(function(i){return i.stopPropagation(),confirm(wysijatrans.deleteimg)&&(e("#wysija-browse-form").append('<input type="hidden" name="subaction" value="delete" /><input type="hidden" name="imgid" value="'+parseInt(e(this).html())+'" /><input type="hidden" name="_wpnonce" value="'+wysijanonces.campaigns.sub_delete_image+'" />'),formsubmit=!0,unset("wp-"+e(this).html()),jQuery("#overlay").show(),window.parent.ajaxOver=!1,hideShowOverlay()),!1})});
|
js/admin-campaigns-themes.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var allthemes={};displaychange=0,jQuery(function(a){function t(t,r){wysijaAJAX.task="install_theme";var i=allthemes[t];return wysijaAJAX.theme_id=i.id,wysijaAJAX.theme_key=i.key,wysijaAJAX.premium=parseInt(i.is_premium),wysijaAJAX.theme_name=i.name,r&&!confirm(wysijatrans.reinstallwarning.replace("%1$s",i.key))?!1:(wysijaAJAX._wpnonce=a("#wysijax").val(),jQuery("#overlay").show(),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(a){e("search-view"),jQuery("#overlay").hide(),jQuery.WYSIJA_HANDLE_RESPONSE(a),window.parent.jQuery("#wj_themes_list").html(a.result.themes),window.parent.handleSwitchTheme(),window.parent.handleRemoveTheme()},error:function(a){jQuery.WYSIJA_HANDLE_RESPONSE(a),jQuery("#overlay").hide(),e("search-view")},dataType:"json"}),void 0)}function e(t,e){a(".panel").hide(),a("#"+t).show(),void 0!==e&&e===!0&&setTimeout(function(){window.parent.WysijaPopup.setDimensions()},1)}function r(){i()}function i(t){var e='<li><img class="loading" title="Loading" alt="loading" src="../wp-content/plugins/wysija-newsletters/img/wpspin_light.gif" /></li>';a("#themes-list").html(e);var r="";if(void 0===t)var t={is_premium:0};else void 0===t.is_premium&&(t.is_premium=0);r="&"+jQuery.param(t),a.getJSON("//api.mailpoet.com/theme/search?domain="+wysijatrans.domainname+r+"&callback=?",function(t){var e="";if(t){var r="";jQuery.each(t.themes,function(a,t){allthemes[t.id]=t,r="",0===(a+1)%5&&(r+=" last");var i=wysijatrans.install;-1!==jQuery.inArray(t.key,wysijatrans.installedthemes)&&(r+=" installed",i=wysijatrans.reinstall),1===parseInt(t.is_premium)&&(r+=" premium",1!==parseInt(wysijatrans.ispremium)&&(i=wysijatrans.premiumonly)),e+='<li class="theme'+r+'">',e+='<div class="thumbnail">',e+='<img src="'+t.thumbnail_large+'" alt="'+t.name+'" title="'+t.name+'" />',e+='<a class="button-primary install'+r+'" href="javascript:;" data-id="'+t.id+'">'+i+"</a>",e+="</div>",e+='<a class="infos" href="javascript:;" data-id="'+t.id+'">'+wysijatrans.viewinfos+"</a>",e+="</li>"})}else{var e="<div>";e+="<strong>"+wysijatrans.errorconnecting+"</strong>",e+="</div>"}a("#themes-list").html(e)})}function s(a,t){if(null==a)return"http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s="+t;var e=function(a){function t(a,t){return a<<t|a>>>32-t}function e(a,t){var e,r,i,s,n;return i=2147483648&a,s=2147483648&t,e=1073741824&a,r=1073741824&t,n=(1073741823&a)+(1073741823&t),e&r?2147483648^n^i^s:e|r?1073741824&n?3221225472^n^i^s:1073741824^n^i^s:n^i^s}function r(a,t,e){return a&t|~a&e}function i(a,t,e){return a&e|t&~e}function s(a,t,e){return a^t^e}function n(a,t,e){return t^(a|~e)}function o(a,i,s,n,o,l,m){return a=e(a,e(e(r(i,s,n),o),m)),e(t(a,l),i)}function l(a,r,s,n,o,l,m){return a=e(a,e(e(i(r,s,n),o),m)),e(t(a,l),r)}function m(a,r,i,n,o,l,m){return a=e(a,e(e(s(r,i,n),o),m)),e(t(a,l),r)}function c(a,r,i,s,o,l,m){return a=e(a,e(e(n(r,i,s),o),m)),e(t(a,l),r)}function d(a){for(var t,e=a.length,r=e+8,i=(r-r%64)/64,s=16*(i+1),n=Array(s-1),o=0,l=0;e>l;)t=(l-l%4)/4,o=8*(l%4),n[t]=n[t]|a.charCodeAt(l)<<o,l++;return t=(l-l%4)/4,o=8*(l%4),n[t]=n[t]|128<<o,n[s-2]=e<<3,n[s-1]=e>>>29,n}function u(a){var t,e,r="",i="";for(e=0;3>=e;e++)t=255&a>>>8*e,i="0"+t.toString(16),r+=i.substr(i.length-2,2);return r}function h(a){a=a.replace(/rn/g,"n");for(var t="",e=0;a.length>e;e++){var r=a.charCodeAt(e);128>r?t+=String.fromCharCode(r):r>127&&2048>r?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|63&r>>6),t+=String.fromCharCode(128|63&r))}return t}var p,v,w,y,f,j,g,_,A,C=Array(),k=7,b=12,S=17,I=22,J=5,Q=9,X=14,x=20,T=4,$=11,E=16,N=23,O=6,P=10,L=15,R=21;for(a=h(a),C=d(a),j=1732584193,g=4023233417,_=2562383102,A=271733878,p=0;C.length>p;p+=16)v=j,w=g,y=_,f=A,j=o(j,g,_,A,C[p+0],k,3614090360),A=o(A,j,g,_,C[p+1],b,3905402710),_=o(_,A,j,g,C[p+2],S,606105819),g=o(g,_,A,j,C[p+3],I,3250441966),j=o(j,g,_,A,C[p+4],k,4118548399),A=o(A,j,g,_,C[p+5],b,1200080426),_=o(_,A,j,g,C[p+6],S,2821735955),g=o(g,_,A,j,C[p+7],I,4249261313),j=o(j,g,_,A,C[p+8],k,1770035416),A=o(A,j,g,_,C[p+9],b,2336552879),_=o(_,A,j,g,C[p+10],S,4294925233),g=o(g,_,A,j,C[p+11],I,2304563134),j=o(j,g,_,A,C[p+12],k,1804603682),A=o(A,j,g,_,C[p+13],b,4254626195),_=o(_,A,j,g,C[p+14],S,2792965006),g=o(g,_,A,j,C[p+15],I,1236535329),j=l(j,g,_,A,C[p+1],J,4129170786),A=l(A,j,g,_,C[p+6],Q,3225465664),_=l(_,A,j,g,C[p+11],X,643717713),g=l(g,_,A,j,C[p+0],x,3921069994),j=l(j,g,_,A,C[p+5],J,3593408605),A=l(A,j,g,_,C[p+10],Q,38016083),_=l(_,A,j,g,C[p+15],X,3634488961),g=l(g,_,A,j,C[p+4],x,3889429448),j=l(j,g,_,A,C[p+9],J,568446438),A=l(A,j,g,_,C[p+14],Q,3275163606),_=l(_,A,j,g,C[p+3],X,4107603335),g=l(g,_,A,j,C[p+8],x,1163531501),j=l(j,g,_,A,C[p+13],J,2850285829),A=l(A,j,g,_,C[p+2],Q,4243563512),_=l(_,A,j,g,C[p+7],X,1735328473),g=l(g,_,A,j,C[p+12],x,2368359562),j=m(j,g,_,A,C[p+5],T,4294588738),A=m(A,j,g,_,C[p+8],$,2272392833),_=m(_,A,j,g,C[p+11],E,1839030562),g=m(g,_,A,j,C[p+14],N,4259657740),j=m(j,g,_,A,C[p+1],T,2763975236),A=m(A,j,g,_,C[p+4],$,1272893353),_=m(_,A,j,g,C[p+7],E,4139469664),g=m(g,_,A,j,C[p+10],N,3200236656),j=m(j,g,_,A,C[p+13],T,681279174),A=m(A,j,g,_,C[p+0],$,3936430074),_=m(_,A,j,g,C[p+3],E,3572445317),g=m(g,_,A,j,C[p+6],N,76029189),j=m(j,g,_,A,C[p+9],T,3654602809),A=m(A,j,g,_,C[p+12],$,3873151461),_=m(_,A,j,g,C[p+15],E,530742520),g=m(g,_,A,j,C[p+2],N,3299628645),j=c(j,g,_,A,C[p+0],O,4096336452),A=c(A,j,g,_,C[p+7],P,1126891415),_=c(_,A,j,g,C[p+14],L,2878612391),g=c(g,_,A,j,C[p+5],R,4237533241),j=c(j,g,_,A,C[p+12],O,1700485571),A=c(A,j,g,_,C[p+3],P,2399980690),_=c(_,A,j,g,C[p+10],L,4293915773),g=c(g,_,A,j,C[p+1],R,2240044497),j=c(j,g,_,A,C[p+8],O,1873313359),A=c(A,j,g,_,C[p+15],P,4264355552),_=c(_,A,j,g,C[p+6],L,2734768916),g=c(g,_,A,j,C[p+13],R,1309151649),j=c(j,g,_,A,C[p+4],O,4149444226),A=c(A,j,g,_,C[p+11],P,3174756917),_=c(_,A,j,g,C[p+2],L,718787259),g=c(g,_,A,j,C[p+9],R,3951481745),j=e(j,v),g=e(g,w),_=e(_,y),A=e(A,f);var z=u(j)+u(g)+u(_)+u(A);return z.toLowerCase()},t=t||80;return"http://www.gravatar.com/avatar/"+e(a)+".jpg?s="+t}a(function(){a("#themes-reload").length>0&&(wysijaAJAX.task="refresh_themes",jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(a){window.parent.jQuery("#wj_themes_list").html(a.result.themes),window.parent.handleSwitchTheme(),window.parent.handleRemoveTheme()},error:function(){},dataType:"json"}))}),a(document).on("click",".install",function(){return t(a(this).data("id"),a(this).hasClass("installed")),!1}),a(document).on("click",".infos",function(){var t=allthemes[a(this).data("id")],r="",i=wysijatrans.install;if(void 0!==t){-1!==a.inArray(t.key,wysijatrans.installedthemes)&&(r=" installed",i=wysijatrans.reinstall),1===parseInt(t.is_premium)&&(r+=" premium",1!==parseInt(wysijatrans.ispremium)&&(i=wysijatrans.premiumonly));for(var n='<div class="theme-screenshot"><img src="'+t.screenshot+'" alt="'+t.name+'" /></div>',o='<img src="'+s(t.author_email,80)+'" class="avatar" width="80px"/>',l=o+"<h2>"+t.name+'</h2><p><input type="button" value="'+i+'" data-id="'+t.id+'" class="button-primary install'+r+'" /></p>',m='<div class="stars"><div id="average-vote" class="star-rating" style="width:'+95*t.rating/5+'px;"></div></div>',c='<div class="stars my-rating clearfix" data-theme="'+parseInt(t.id)+'">',d=0;5>d;d++)c+=parseInt(t.user_rating)>d?'<a href="javascript:;" class="active" data-value="'+(d+1)+'"></a>':'<a href="javascript:;" data-value="'+(d+1)+'"></a>';c+="</div>",l+='<div class="paragraph"><strong>'+wysijatrans.stars.replace("%1$s","</strong> "+wysijatrans.totalvotes.replace("%1$s",'<span id="total-votes">'+t.votes+"</span>")+m)+"</div>",l+='<div class="paragraph"><strong>'+wysijatrans.starsyr.replace("%1$s","</strong>"+c)+"</div>",l+="<p><strong>"+wysijatrans.downloads.replace("%1$s","</strong>"+t.downloads_zip)+"</p>",l+="<p><strong>"+wysijatrans.lastupdated.replace("%1$s","</strong>"+t.updated_at)+"</p>",l+="<p>"+wysijatrans.viewallthemes.replace("%1$s",'<a href="javascript:;" class="author-id-filter" id="author-id-filter'+t.author_id+'">'+t.author_name+"</a>")+"</p>",l+='<p><a href="//api.mailpoet.com/download/zip/'+t.id+"?domain="+wysijatrans.domainname+'">'+wysijatrans.downloadzip+"</a></p>";var u="";1==t.has_psd&&(u='<p><a href="//api.mailpoet.com/download/psd/'+t.id+"?domain="+wysijatrans.domainname+'" class="downpsd">'+wysijatrans.downloadpsd+"</a></p>",1===parseInt(t.is_premium)&&1!==parseInt(wysijatrans.ispremium)&&(u="<p><strong>"+wysijatrans.premiumfiles+"</strong></p>")),l+=u,l+='<p><a href="'+t.author_url+'" target="_blank">'+wysijatrans.viewauthorsite+"</a></p>";var h='<div class="wrap actions"><a class="button-secondary2 theme-view-back" href="javascript:;">'+wysijatrans.viewback+"</a>"+"</div>"+'<div class="theme-infos clearfix">'+'<div class="preview">'+n+"</div>"+'<div class="infos">'+l+"</div>"+"</div>";return a("#theme-view").html(h),e("theme-view",!0),!1}}),a(document).on("click",".theme-view-back",function(){return e("search-view",!0),!1}),a("#gallery-form").submit(function(){return r(),!1}),a(document).on("click",".my-rating a",function(){for(var t=parseInt(a(this).data("value")),e=0;5>e;e++)t>e?a(a(".my-rating a")[e]).addClass("active"):a(a(".my-rating a")[e]).removeClass("active");var r=parseInt(a(this).parent().data("theme"));return a.getJSON("//api.mailpoet.com/theme/rate/"+r+"?rating="+t+"&domain="+wysijatrans.domainname+"&callback=?",function(e){e&&(a("#average-vote").css("width",parseInt(95*e.rating/5)),a("#total-votes").html(e.votes),allthemes[r].votes=e.votes,allthemes[r].user_rating=t,allthemes[r].rating=e.rating)}),!1}),a(document).on("hover",".my-rating a",function(){var t=parseInt(a(this).data("value"));a(".my-rating a").removeClass("on").removeClass("off");for(var e=0;5>e;e++)t>e?a(a(".my-rating a")[e]).addClass("on"):a(a(".my-rating a")[e]).addClass("off")}),a(document).on("mouseout",".my-rating a",function(){a(".my-rating a").removeClass("on").removeClass("off")}),a("#sub-theme-box").click(function(){e("theme-upload",!0)}),a(document).on("click","a.author-id-filter",function(){return a("#filter-selection").html('<a href="javascript:;" class="button-secondary2 filter-none">'+wysijatrans.showallthemes+"</a>"),i({author_id:parseInt(a(this).attr("id").replace("author-id-filter",""))}),e("search-view",!0),!1}),a(document).on("click","a.filter-none",function(){return a("#filter-selection").html(""),i(),!1}),a("#wj_paginator").on("click","a",function(){return a("#filter-selection").html(""),a(this).hasClass("selected")?!1:(i({is_premium:"premium"===a(this).data("type")?1:0}),a("#wj_paginator a").removeClass("selected"),a(this).addClass("selected"),!1)}),i()});
|
1 |
+
var allthemes={};displaychange=0,jQuery(function(a){function t(a,t){wysijaAJAX.task="install_theme";var r=allthemes[a];return wysijaAJAX.theme_id=r.id,wysijaAJAX.theme_key=r.key,wysijaAJAX.premium=parseInt(r.is_premium),wysijaAJAX.theme_name=r.name,t&&!confirm(wysijatrans.reinstallwarning.replace("%1$s",r.key))?!1:(wysijaAJAX._wpnonce=wysijanonces.campaigns.install_theme,jQuery("#overlay").show(),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(a){e("search-view"),jQuery("#overlay").hide(),jQuery.WYSIJA_HANDLE_RESPONSE(a),window.parent.jQuery("#wj_themes_list").html(a.result.themes),window.parent.handleSwitchTheme(),window.parent.handleRemoveTheme()},error:function(a){jQuery.WYSIJA_HANDLE_RESPONSE(a),jQuery("#overlay").hide(),e("search-view")},dataType:"json"}),void 0)}function e(t,e){a(".panel").hide(),a("#"+t).show(),void 0!==e&&e===!0&&setTimeout(function(){window.parent.WysijaPopup.setDimensions()},1)}function r(){i()}function i(t){var e='<li><img class="loading" title="Loading" alt="loading" src="../wp-content/plugins/wysija-newsletters/img/wpspin_light.gif" /></li>';a("#themes-list").html(e);var r="";if(void 0===t)var t={is_premium:0};else void 0===t.is_premium&&(t.is_premium=0);r="&"+jQuery.param(t),a.getJSON("//api.mailpoet.com/theme/search?domain="+wysijatrans.domainname+r+"&callback=?",function(t){var e="";if(t){var r="";jQuery.each(t.themes,function(a,t){allthemes[t.id]=t,r="",0===(a+1)%5&&(r+=" last");var i=wysijatrans.install;-1!==jQuery.inArray(t.key,wysijatrans.installedthemes)&&(r+=" installed",i=wysijatrans.reinstall),1===parseInt(t.is_premium)&&(r+=" premium",1!==parseInt(wysijatrans.ispremium)&&(i=wysijatrans.premiumonly)),e+='<li class="theme'+r+'">',e+='<div class="thumbnail">',e+='<img src="'+t.thumbnail_large+'" alt="'+t.name+'" title="'+t.name+'" />',e+='<a class="button-primary install'+r+'" href="javascript:;" data-id="'+t.id+'">'+i+"</a>",e+="</div>",e+='<a class="infos" href="javascript:;" data-id="'+t.id+'">'+wysijatrans.viewinfos+"</a>",e+="</li>"})}else{var e="<div>";e+="<strong>"+wysijatrans.errorconnecting+"</strong>",e+="</div>"}a("#themes-list").html(e)})}function s(a,t){if(null==a)return"http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s="+t;var e=function(a){function t(a,t){return a<<t|a>>>32-t}function e(a,t){var e,r,i,s,n;return i=2147483648&a,s=2147483648&t,e=1073741824&a,r=1073741824&t,n=(1073741823&a)+(1073741823&t),e&r?2147483648^n^i^s:e|r?1073741824&n?3221225472^n^i^s:1073741824^n^i^s:n^i^s}function r(a,t,e){return a&t|~a&e}function i(a,t,e){return a&e|t&~e}function s(a,t,e){return a^t^e}function n(a,t,e){return t^(a|~e)}function o(a,i,s,n,o,l,m){return a=e(a,e(e(r(i,s,n),o),m)),e(t(a,l),i)}function l(a,r,s,n,o,l,m){return a=e(a,e(e(i(r,s,n),o),m)),e(t(a,l),r)}function m(a,r,i,n,o,l,m){return a=e(a,e(e(s(r,i,n),o),m)),e(t(a,l),r)}function c(a,r,i,s,o,l,m){return a=e(a,e(e(n(r,i,s),o),m)),e(t(a,l),r)}function d(a){for(var t,e=a.length,r=e+8,i=(r-r%64)/64,s=16*(i+1),n=Array(s-1),o=0,l=0;e>l;)t=(l-l%4)/4,o=8*(l%4),n[t]=n[t]|a.charCodeAt(l)<<o,l++;return t=(l-l%4)/4,o=8*(l%4),n[t]=n[t]|128<<o,n[s-2]=e<<3,n[s-1]=e>>>29,n}function u(a){var t,e,r="",i="";for(e=0;3>=e;e++)t=255&a>>>8*e,i="0"+t.toString(16),r+=i.substr(i.length-2,2);return r}function h(a){a=a.replace(/rn/g,"n");for(var t="",e=0;a.length>e;e++){var r=a.charCodeAt(e);128>r?t+=String.fromCharCode(r):r>127&&2048>r?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|63&r>>6),t+=String.fromCharCode(128|63&r))}return t}var p,v,w,y,f,j,g,_,A,C=Array(),k=7,b=12,S=17,I=22,J=5,Q=9,X=14,x=20,T=4,$=11,E=16,N=23,O=6,P=10,L=15,R=21;for(a=h(a),C=d(a),j=1732584193,g=4023233417,_=2562383102,A=271733878,p=0;C.length>p;p+=16)v=j,w=g,y=_,f=A,j=o(j,g,_,A,C[p+0],k,3614090360),A=o(A,j,g,_,C[p+1],b,3905402710),_=o(_,A,j,g,C[p+2],S,606105819),g=o(g,_,A,j,C[p+3],I,3250441966),j=o(j,g,_,A,C[p+4],k,4118548399),A=o(A,j,g,_,C[p+5],b,1200080426),_=o(_,A,j,g,C[p+6],S,2821735955),g=o(g,_,A,j,C[p+7],I,4249261313),j=o(j,g,_,A,C[p+8],k,1770035416),A=o(A,j,g,_,C[p+9],b,2336552879),_=o(_,A,j,g,C[p+10],S,4294925233),g=o(g,_,A,j,C[p+11],I,2304563134),j=o(j,g,_,A,C[p+12],k,1804603682),A=o(A,j,g,_,C[p+13],b,4254626195),_=o(_,A,j,g,C[p+14],S,2792965006),g=o(g,_,A,j,C[p+15],I,1236535329),j=l(j,g,_,A,C[p+1],J,4129170786),A=l(A,j,g,_,C[p+6],Q,3225465664),_=l(_,A,j,g,C[p+11],X,643717713),g=l(g,_,A,j,C[p+0],x,3921069994),j=l(j,g,_,A,C[p+5],J,3593408605),A=l(A,j,g,_,C[p+10],Q,38016083),_=l(_,A,j,g,C[p+15],X,3634488961),g=l(g,_,A,j,C[p+4],x,3889429448),j=l(j,g,_,A,C[p+9],J,568446438),A=l(A,j,g,_,C[p+14],Q,3275163606),_=l(_,A,j,g,C[p+3],X,4107603335),g=l(g,_,A,j,C[p+8],x,1163531501),j=l(j,g,_,A,C[p+13],J,2850285829),A=l(A,j,g,_,C[p+2],Q,4243563512),_=l(_,A,j,g,C[p+7],X,1735328473),g=l(g,_,A,j,C[p+12],x,2368359562),j=m(j,g,_,A,C[p+5],T,4294588738),A=m(A,j,g,_,C[p+8],$,2272392833),_=m(_,A,j,g,C[p+11],E,1839030562),g=m(g,_,A,j,C[p+14],N,4259657740),j=m(j,g,_,A,C[p+1],T,2763975236),A=m(A,j,g,_,C[p+4],$,1272893353),_=m(_,A,j,g,C[p+7],E,4139469664),g=m(g,_,A,j,C[p+10],N,3200236656),j=m(j,g,_,A,C[p+13],T,681279174),A=m(A,j,g,_,C[p+0],$,3936430074),_=m(_,A,j,g,C[p+3],E,3572445317),g=m(g,_,A,j,C[p+6],N,76029189),j=m(j,g,_,A,C[p+9],T,3654602809),A=m(A,j,g,_,C[p+12],$,3873151461),_=m(_,A,j,g,C[p+15],E,530742520),g=m(g,_,A,j,C[p+2],N,3299628645),j=c(j,g,_,A,C[p+0],O,4096336452),A=c(A,j,g,_,C[p+7],P,1126891415),_=c(_,A,j,g,C[p+14],L,2878612391),g=c(g,_,A,j,C[p+5],R,4237533241),j=c(j,g,_,A,C[p+12],O,1700485571),A=c(A,j,g,_,C[p+3],P,2399980690),_=c(_,A,j,g,C[p+10],L,4293915773),g=c(g,_,A,j,C[p+1],R,2240044497),j=c(j,g,_,A,C[p+8],O,1873313359),A=c(A,j,g,_,C[p+15],P,4264355552),_=c(_,A,j,g,C[p+6],L,2734768916),g=c(g,_,A,j,C[p+13],R,1309151649),j=c(j,g,_,A,C[p+4],O,4149444226),A=c(A,j,g,_,C[p+11],P,3174756917),_=c(_,A,j,g,C[p+2],L,718787259),g=c(g,_,A,j,C[p+9],R,3951481745),j=e(j,v),g=e(g,w),_=e(_,y),A=e(A,f);var z=u(j)+u(g)+u(_)+u(A);return z.toLowerCase()},t=t||80;return"http://www.gravatar.com/avatar/"+e(a)+".jpg?s="+t}a(function(){a("#themes-reload").length>0&&(wysijaAJAX.task="refresh_themes",jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(a){window.parent.jQuery("#wj_themes_list").html(a.result.themes),window.parent.handleSwitchTheme(),window.parent.handleRemoveTheme()},error:function(){},dataType:"json"}))}),a(document).on("click",".install",function(){return t(a(this).data("id"),a(this).hasClass("installed")),!1}),a(document).on("click",".infos",function(){var t=allthemes[a(this).data("id")],r="",i=wysijatrans.install;if(void 0!==t){-1!==a.inArray(t.key,wysijatrans.installedthemes)&&(r=" installed",i=wysijatrans.reinstall),1===parseInt(t.is_premium)&&(r+=" premium",1!==parseInt(wysijatrans.ispremium)&&(i=wysijatrans.premiumonly));for(var n='<div class="theme-screenshot"><img src="'+t.screenshot+'" alt="'+t.name+'" /></div>',o='<img src="'+s(t.author_email,80)+'" class="avatar" width="80px"/>',l=o+"<h2>"+t.name+'</h2><p><input type="button" value="'+i+'" data-id="'+t.id+'" class="button-primary install'+r+'" /></p>',m='<div class="stars"><div id="average-vote" class="star-rating" style="width:'+95*t.rating/5+'px;"></div></div>',c='<div class="stars my-rating clearfix" data-theme="'+parseInt(t.id)+'">',d=0;5>d;d++)c+=parseInt(t.user_rating)>d?'<a href="javascript:;" class="active" data-value="'+(d+1)+'"></a>':'<a href="javascript:;" data-value="'+(d+1)+'"></a>';c+="</div>",l+='<div class="paragraph"><strong>'+wysijatrans.stars.replace("%1$s","</strong> "+wysijatrans.totalvotes.replace("%1$s",'<span id="total-votes">'+t.votes+"</span>")+m)+"</div>",l+='<div class="paragraph"><strong>'+wysijatrans.starsyr.replace("%1$s","</strong>"+c)+"</div>",l+="<p><strong>"+wysijatrans.downloads.replace("%1$s","</strong>"+t.downloads_zip)+"</p>",l+="<p><strong>"+wysijatrans.lastupdated.replace("%1$s","</strong>"+t.updated_at)+"</p>",l+="<p>"+wysijatrans.viewallthemes.replace("%1$s",'<a href="javascript:;" class="author-id-filter" id="author-id-filter'+t.author_id+'">'+t.author_name+"</a>")+"</p>",l+='<p><a href="//api.mailpoet.com/download/zip/'+t.id+"?domain="+wysijatrans.domainname+'">'+wysijatrans.downloadzip+"</a></p>";var u="";1==t.has_psd&&(u='<p><a href="//api.mailpoet.com/download/psd/'+t.id+"?domain="+wysijatrans.domainname+'" class="downpsd">'+wysijatrans.downloadpsd+"</a></p>",1===parseInt(t.is_premium)&&1!==parseInt(wysijatrans.ispremium)&&(u="<p><strong>"+wysijatrans.premiumfiles+"</strong></p>")),l+=u,l+='<p><a href="'+t.author_url+'" target="_blank">'+wysijatrans.viewauthorsite+"</a></p>";var h='<div class="wrap actions"><a class="button-secondary2 theme-view-back" href="javascript:;">'+wysijatrans.viewback+"</a>"+"</div>"+'<div class="theme-infos clearfix">'+'<div class="preview">'+n+"</div>"+'<div class="infos">'+l+"</div>"+"</div>";return a("#theme-view").html(h),e("theme-view",!0),!1}}),a(document).on("click",".theme-view-back",function(){return e("search-view",!0),!1}),a("#gallery-form").submit(function(){return r(),!1}),a(document).on("click",".my-rating a",function(){for(var t=parseInt(a(this).data("value")),e=0;5>e;e++)t>e?a(a(".my-rating a")[e]).addClass("active"):a(a(".my-rating a")[e]).removeClass("active");var r=parseInt(a(this).parent().data("theme"));return a.getJSON("//api.mailpoet.com/theme/rate/"+r+"?rating="+t+"&domain="+wysijatrans.domainname+"&callback=?",function(e){e&&(a("#average-vote").css("width",parseInt(95*e.rating/5)),a("#total-votes").html(e.votes),allthemes[r].votes=e.votes,allthemes[r].user_rating=t,allthemes[r].rating=e.rating)}),!1}),a(document).on("hover",".my-rating a",function(){var t=parseInt(a(this).data("value"));a(".my-rating a").removeClass("on").removeClass("off");for(var e=0;5>e;e++)t>e?a(a(".my-rating a")[e]).addClass("on"):a(a(".my-rating a")[e]).addClass("off")}),a(document).on("mouseout",".my-rating a",function(){a(".my-rating a").removeClass("on").removeClass("off")}),a("#sub-theme-box").click(function(){e("theme-upload",!0)}),a(document).on("click","a.author-id-filter",function(){return a("#filter-selection").html('<a href="javascript:;" class="button-secondary2 filter-none">'+wysijatrans.showallthemes+"</a>"),i({author_id:parseInt(a(this).attr("id").replace("author-id-filter",""))}),e("search-view",!0),!1}),a(document).on("click","a.filter-none",function(){return a("#filter-selection").html(""),i(),!1}),a("#wj_paginator").on("click","a",function(){return a("#filter-selection").html(""),a(this).hasClass("selected")?!1:(i({is_premium:"premium"===a(this).data("type")?1:0}),a("#wj_paginator a").removeClass("selected"),a(this).addClass("selected"),!1)}),i()});
|
js/admin-campaigns-viewstats.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(n){n(".bulksubmitcamp").click(function(){return n(".global-action").attr("name","action"),!0})});
|
1 |
+
jQuery(function(n){n(".bulksubmitcamp").click(function(){return n(".global-action").attr("name","action"),n("#_wpnonce").prop("disabled",null),n("#_wpnonce").val(n(".global-action option:selected").data("nonce")),!0})});
|
js/admin-campaigns-welcome_new.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(u){function n(){return u("#poll_result").html(""),"url"==u(this).val()&&""!=u('input[name="how_did_you_find_us_url"]')?(u('input[name="how_did_you_find_us_url"]').focus(),!1):(wysijaAJAX.task="save_poll",wysijaAJAX.how=u('input[name="how_did_you_find_us"]').val(),wysijaAJAX.where=u('input[name="how_did_you_find_us_url"]').val(),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:_,error:
|
1 |
+
jQuery(function(u){function n(){return u("#poll_result").html(""),"url"==u(this).val()&&""!=u('input[name="how_did_you_find_us_url"]')?(u('input[name="how_did_you_find_us_url"]').focus(),!1):(wysijaAJAX.task="save_poll",wysijaAJAX._wpnonce=wysijanonces.campaigns.save_poll,wysijaAJAX.how=u('input[name="how_did_you_find_us"]').val(),wysijaAJAX.where=u('input[name="how_did_you_find_us_url"]').val(),jQuery.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:_,error:a,dataType:"json"}),!1)}function _(n){u("#poll_result").html(n.result.msg)}function a(u){alert("Request error not JSON:"+u.responseText)}u('input[name="how_did_you_find_us"]').change(n),u('input[name="how_did_you_find_us_url"]').blur(n)});
|
js/admin-config-form_widget_settings.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function generateWidgetTemplate(e){void 0===e?window.parent.WysijaPopup.cancel():(toggleSubmit("off"),wysijaAJAX.task="wysija_form_generate_template",wysijaAJAX.wysijaData=Base64.encode(Object.toJSON(e).gsub('\\"','"').gsub('"[{',"[{").gsub('}]"',"}]")),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(e){window.parent.WysijaPopup.success(e.responseJSON.result)},onFailure:function(){window.parent.WysijaPopup.cancel()}}))}function toggleSubmit(e){"on"===e?$("widget-settings-submit").removeAttribute("disabled"):$("widget-settings-submit").writeAttribute("disabled",!0)}function manageField(e){void 0===e?window.parent.WysijaPopup.cancel():(toggleSubmit("off"),wysijaAJAX.form_id=window.parent.wysijaAJAX.form_id,wysijaAJAX.task="wysija_form_manage_field",wysijaAJAX.wysijaData=Base64.encode(Object.toJSON(e).gsub('\\"','"').gsub('"[{',"[{").gsub('}]"',"}]")),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(e){var t=e.responseJSON.result;t.result===!1?displayError(t.error):window.parent.WysijaPopup.success(t.data)},onFailure:function(){window.parent.WysijaPopup.cancel()}}))}function saveData(e){switch(void 0!==e.label&&(e.label=window.parent.WysijaForm.encodeHtmlValue(e.label)),e.type){case"input":break;case"textarea":break;case"submit":break;case"country":case"select":case"checkbox":case"radio":if(null!==$("items-selection")){var t,i=$("items-selection").select("li"),a=[];if(i.each(function(e){t=$F(e.down(".value")),t.length>0&&a.push({value:window.parent.WysijaForm.encodeHtmlValue(t),is_checked:+e.down(".is_checked").checked})}),"checkbox"!==e.type&&2>a.length)throw new Error(window.parent.wysijatrans.not_enough_options);if("checkbox"===e.type&&1!==a.length)throw new Error(window.parent.wysijatrans.missing_checkbox_label);e.values=a}break;case"html":e.text=window.parent.WysijaForm.encodeHtmlValue(e.text);break;case"text":e.text=window.parent.WysijaForm.encodeHtmlValue(e.text);break;case"list":var s=$("lists-selection").select("input");if(0===s.length)throw new Error(window.parent.wysijatrans.list_cannot_be_empty);var n=[];s.each(function(e){n.push({list_id:+e.readAttribute("data-list"),is_checked:+e.checked})}),e.values=n}return delete e.name,delete e.field,delete e.type,delete e.submit,e}function hideError(){$("widget-settings-error").update("").hide(),window.parent.WysijaPopup.setDimensions()}function displayError(e){var t=void 0!==e.message?e.message:e;$("widget-settings-error").update(t).show(),window.parent.WysijaPopup.setDimensions(),toggleSubmit("on")}function setupSortableList(){if($$("ul.sortable").length>0){var e=$$(".sortable").first();Sortable.create(e,{tag:"li",scroll:window,handle:"handle",constraint:"vertical"})}}function setAvailableLists(){var e=$("lists-selection").select("input").map(function(e){return $(e).readAttribute("data-list")});$("lists-available").select("option").each(function(t){e.include(t.value)&&t.remove()}),$("lists-add-container")[0===$("lists-available").length?"hide":"show"](),jQuery(".mp-select-sort").trigger("sort")}function updateTabIndex(e){Draggables.removeObserver(e),Draggables.addObserver({element:e,onEnd:function(){e.select("li").each(function(e,t){$(e).down(".value").writeAttribute("tabindex",t+1)})}})}document.observe("dom:loaded",function(){var e=null!==$("widget-settings-form")?$("widget-settings-form").type.value:null;switch(e){case"list":$("lists-add-container").on("click","a.add",function(){if($("lists-available").selectedIndex>=0){var e={name:$("lists-available").options[$("lists-available").selectedIndex].innerHTML,list_id:$F("lists-available")},t=new Template($("selection-template").innerHTML);$("lists-selection").insert(t.evaluate(e)),setupSortableList(),setAvailableLists(),window.parent.WysijaPopup.setDimensions()}return!1}),$("lists-selection").on("click","a.remove",function(e,t){return $("lists-available").insert(new Element("option",{value:$(t).previous("input").readAttribute("data-list")}).update($(t).previous("label").innerHTML)),$(t).up("li").remove(),setupSortableList(),setAvailableLists(),window.parent.WysijaPopup.setDimensions(),!1}),setupSortableList(),setAvailableLists();break;case"country":case"select":case"radio":case"checkbox":$(document).on("click","a.add",function(){var e={item_index:parseInt($("items-selection").select("input.value").length,10)+1},t=new Template($("selection-template").innerHTML);return $("items-selection").insert(t.evaluate(e)),setupSortableList(),updateTabIndex($("items-selection")),window.parent.WysijaPopup.setDimensions(),!1}),$(document).on("click","#items-selection a.remove",function(e,t){return $(t).up("li").remove(),setupSortableList(),updateTabIndex($("items-selection")),window.parent.WysijaPopup.setDimensions(),!1}),setupSortableList(),updateTabIndex($("items-selection"));break;case"textarea":break;case"date":}null!==$("field-type-select")&&$("field-type-select").observe("change",function(){return $(this).up("form").submit(),!1}),$("widget-settings-submit").observe("click",function(e){e.preventDefault(),hideError();var t=$H(),i=$("widget-settings-form").serialize(!0),a=null!==$("field-settings-form");if(a===!0){var s=$("field-settings-form").serialize(!0);t.set("type",s.type),t.set("field","cf_"+s.field_id),t.set("name",window.parent.WysijaForm.encodeHtmlValue(i.name)),t.set("field_id",s.field_id)}else t.set("type",i.type),t.set("field",i.field),t.set("name",window.parent.WysijaForm.encodeHtmlValue(i.name));try{t.set("params",saveData(i)),a?manageField(t):generateWidgetTemplate(t)}catch(n){displayError(n)}return!1})});
|
1 |
+
function generateWidgetTemplate(e){void 0===e?window.parent.WysijaPopup.cancel():(toggleSubmit("off"),wysijaAJAX.task="wysija_form_generate_template",wysijaAJAX.wysijaData=Base64.encode(Object.toJSON(e).gsub('\\"','"').gsub('"[{',"[{").gsub('}]"',"}]")),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(e){window.parent.WysijaPopup.success(e.responseJSON.result)},onFailure:function(){window.parent.WysijaPopup.cancel()}}))}function toggleSubmit(e){"on"===e?$("widget-settings-submit").removeAttribute("disabled"):$("widget-settings-submit").writeAttribute("disabled",!0)}function manageField(e){void 0===e?window.parent.WysijaPopup.cancel():(toggleSubmit("off"),wysijaAJAX.form_id=window.parent.wysijaAJAX.form_id,wysijaAJAX.task="wysija_form_manage_field",wysijaAJAX._wpnonce=wysijanonces.config.wysija_form_manage_field,wysijaAJAX.wysijaData=Base64.encode(Object.toJSON(e).gsub('\\"','"').gsub('"[{',"[{").gsub('}]"',"}]")),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(e){var t=e.responseJSON.result;t.result===!1?displayError(t.error):window.parent.WysijaPopup.success(t.data)},onFailure:function(){window.parent.WysijaPopup.cancel()}}))}function saveData(e){switch(void 0!==e.label&&(e.label=window.parent.WysijaForm.encodeHtmlValue(e.label)),e.type){case"input":break;case"textarea":break;case"submit":break;case"country":case"select":case"checkbox":case"radio":if(null!==$("items-selection")){var t,i=$("items-selection").select("li"),a=[];if(i.each(function(e){t=$F(e.down(".value")),t.length>0&&a.push({value:window.parent.WysijaForm.encodeHtmlValue(t),is_checked:+e.down(".is_checked").checked})}),"checkbox"!==e.type&&2>a.length)throw new Error(window.parent.wysijatrans.not_enough_options);if("checkbox"===e.type&&1!==a.length)throw new Error(window.parent.wysijatrans.missing_checkbox_label);e.values=a}break;case"html":e.text=window.parent.WysijaForm.encodeHtmlValue(e.text);break;case"text":e.text=window.parent.WysijaForm.encodeHtmlValue(e.text);break;case"list":var s=$("lists-selection").select("input");if(0===s.length)throw new Error(window.parent.wysijatrans.list_cannot_be_empty);var n=[];s.each(function(e){n.push({list_id:+e.readAttribute("data-list"),is_checked:+e.checked})}),e.values=n}return delete e.name,delete e.field,delete e.type,delete e.submit,e}function hideError(){$("widget-settings-error").update("").hide(),window.parent.WysijaPopup.setDimensions()}function displayError(e){var t=void 0!==e.message?e.message:e;$("widget-settings-error").update(t).show(),window.parent.WysijaPopup.setDimensions(),toggleSubmit("on")}function setupSortableList(){if($$("ul.sortable").length>0){var e=$$(".sortable").first();Sortable.create(e,{tag:"li",scroll:window,handle:"handle",constraint:"vertical"})}}function setAvailableLists(){var e=$("lists-selection").select("input").map(function(e){return $(e).readAttribute("data-list")});$("lists-available").select("option").each(function(t){e.include(t.value)&&t.remove()}),$("lists-add-container")[0===$("lists-available").length?"hide":"show"](),jQuery(".mp-select-sort").trigger("sort")}function updateTabIndex(e){Draggables.removeObserver(e),Draggables.addObserver({element:e,onEnd:function(){e.select("li").each(function(e,t){$(e).down(".value").writeAttribute("tabindex",t+1)})}})}document.observe("dom:loaded",function(){var e=null!==$("widget-settings-form")?$("widget-settings-form").type.value:null;switch(e){case"list":$("lists-add-container").on("click","a.add",function(){if($("lists-available").selectedIndex>=0){var e={name:$("lists-available").options[$("lists-available").selectedIndex].innerHTML,list_id:$F("lists-available")},t=new Template($("selection-template").innerHTML);$("lists-selection").insert(t.evaluate(e)),setupSortableList(),setAvailableLists(),window.parent.WysijaPopup.setDimensions()}return!1}),$("lists-selection").on("click","a.remove",function(e,t){return $("lists-available").insert(new Element("option",{value:$(t).previous("input").readAttribute("data-list")}).update($(t).previous("label").innerHTML)),$(t).up("li").remove(),setupSortableList(),setAvailableLists(),window.parent.WysijaPopup.setDimensions(),!1}),setupSortableList(),setAvailableLists();break;case"country":case"select":case"radio":case"checkbox":$(document).on("click","a.add",function(){var e={item_index:parseInt($("items-selection").select("input.value").length,10)+1},t=new Template($("selection-template").innerHTML);return $("items-selection").insert(t.evaluate(e)),setupSortableList(),updateTabIndex($("items-selection")),window.parent.WysijaPopup.setDimensions(),!1}),$(document).on("click","#items-selection a.remove",function(e,t){return $(t).up("li").remove(),setupSortableList(),updateTabIndex($("items-selection")),window.parent.WysijaPopup.setDimensions(),!1}),setupSortableList(),updateTabIndex($("items-selection"));break;case"textarea":break;case"date":}null!==$("field-type-select")&&$("field-type-select").observe("change",function(){return $(this).up("form").submit(),!1}),$("widget-settings-submit").observe("click",function(e){e.preventDefault(),hideError();var t=$H(),i=$("widget-settings-form").serialize(!0),a=null!==$("field-settings-form");if(a===!0){var s=$("field-settings-form").serialize(!0);t.set("type",s.type),t.set("field","cf_"+s.field_id),t.set("name",window.parent.WysijaForm.encodeHtmlValue(i.name)),t.set("field_id",s.field_id)}else t.set("type",i.type),t.set("field",i.field),t.set("name",window.parent.WysijaForm.encodeHtmlValue(i.name));try{t.set("params",saveData(i)),a?manageField(t):generateWidgetTemplate(t)}catch(n){displayError(n)}return!1})});
|
js/admin-config-settings.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function n(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function t(){switch(e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==w&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#restapipossible").show();break;case"":""==w&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""))}""==w&&e("#smtp-secure").change()}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?e(".choice-no-restapi").hide():e(".choice-no-restapi").show())}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),n=e("#sending-emails-each"),t=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(n.val(),t)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function d(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var n="";return i.result.result&&(n='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(n):e("#bounce-connector").after(n),!0},e.WYSIJA_SEND(),!1}function l(){return wysijaAJAX.task="bounce_process",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function u(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function g(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==b&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==b&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==b&&e("#ms-smtp-secure").change()}function f(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function p(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function y(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var w=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){n(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(t),e("#smtp-rest").change(a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(d),e(document).on("click",".bounce-submit",function(){return l(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var n=trim(e(this).val());""!==n&&n==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),void 0)}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,n){var t,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="inner-tab-"+c),t.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,n){var t,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="tab-"+c),t.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var n=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+n.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),t(),a(),n(null),i(),e(".subscribers-count-list").change(u),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var b=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){p()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){y()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(g),e("#ms-smtp-rest").change(f),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var n="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return wysijaAJAX.task=n?"send_test_mail_ms":"send_test_mail",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){y(),p(),g(),f()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var n=i.mailpoet,t=n.fn={};t.getSendingMethod=function(){return n.$.sending_method instanceof jQuery||(n.$.sending_method=e('input[name="wysija[config][sending_method]"]')),n.$.sending_method.filter(":checked").val()},t.isGoodFromAddress=function(e){var n=e.split("@")[1];return"undefined"==typeof n||""===n?!1:n.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},t.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(n.$.from_email=e("#from_email"),n.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return n.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(n.fn.isGoodFromAddress(n.$.from_email.val()))return n.$.from_email.data("message","").tooltip("hide");if("gmail"===n.fn.getSendingMethod())return n.$.from_email.data("message","").tooltip("hide");var e="";return e=n.fn.isGmailAddress(n.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,n.$.from_email.is(":visible")?n.$.from_email.data("message",e).tooltip("show"):n.$.from_email.tooltip("hide")},keyup:function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),n.$.panels=e(".wysija-panel"),n.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).on({ready:function(){n.$.geeky=e(".mailpoet-geeky-toggle"),n.$.geeky.data("l18n",{hide:n.$.geeky.data("hide"),show:n.$.geeky.text()}),n.$.geeky_rows=e(".super-advanced"),n.$.geeky.on({click:function(i){i.preventDefault();var t=n.$.geeky.data("l18n");n.$.geeky.hasClass("is_toggled")?(n.$.geeky.removeClass("is_toggled").text(t.hide),n.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(n.$.geeky.addClass("is_toggled").text(t.show),n.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?n.$.geeky.trigger("click"):n.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
|
1 |
+
jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function n(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function t(){switch(e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==y&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#restapipossible").show();break;case"":""==y&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""))}""==y&&e("#smtp-secure").change()}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?e(".choice-no-restapi").hide():e(".choice-no-restapi").show())}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),n=e("#sending-emails-each"),t=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(n.val(),t)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function d(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var n="";return i.result.result&&(n='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(n):e("#bounce-connector").after(n),!0},e.WYSIJA_SEND(),!1}function l(){return wysijaAJAX.task="bounce_process",wysijaAJAX._wpnonce=wysijanonces.config.bounce_process,wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function u(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function g(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==_&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==_&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==_&&e("#ms-smtp-secure").change()}function f(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function p(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function w(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var y=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){n(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(t),e("#smtp-rest").change(a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(d),e(document).on("click",".bounce-submit",function(){return l(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var n=trim(e(this).val());""!==n&&n==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),void 0)}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,n){var t,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="inner-tab-"+c),t.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,n){var t,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="tab-"+c),t.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var n=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+n.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),t(),a(),n(null),i(),e(".subscribers-count-list").change(u),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var _=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){p()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){w()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(g),e("#ms-smtp-rest").change(f),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var n="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return n?(wysijaAJAX.task="send_test_mail_ms",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail_ms):(wysijaAJAX.task="send_test_mail",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail),wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){w(),p(),g(),f()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var n=i.mailpoet,t=n.fn={};t.getSendingMethod=function(){return n.$.sending_method instanceof jQuery||(n.$.sending_method=e('input[name="wysija[config][sending_method]"]')),n.$.sending_method.filter(":checked").val()},t.isGoodFromAddress=function(e){var n=e.split("@")[1];return"undefined"==typeof n||""===n?!1:n.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},t.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(n.$.from_email=e("#from_email"),n.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return n.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(n.fn.isGoodFromAddress(n.$.from_email.val()))return n.$.from_email.data("message","").tooltip("hide");if("gmail"===n.fn.getSendingMethod())return n.$.from_email.data("message","").tooltip("hide");var e="";return e=n.fn.isGmailAddress(n.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,n.$.from_email.is(":visible")?n.$.from_email.data("message",e).tooltip("show"):n.$.from_email.tooltip("hide")},keyup:function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),n.$.panels=e(".wysija-panel"),n.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).on({ready:function(){n.$.geeky=e(".mailpoet-geeky-toggle"),n.$.geeky.data("l18n",{hide:n.$.geeky.data("hide"),show:n.$.geeky.text()}),n.$.geeky_rows=e(".super-advanced"),n.$.geeky.on({click:function(i){i.preventDefault();var t=n.$.geeky.data("l18n");n.$.geeky.hasClass("is_toggled")?(n.$.geeky.removeClass("is_toggled").text(t.hide),n.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(n.$.geeky.addClass("is_toggled").text(t.show),n.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?n.$.geeky.trigger("click"):n.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
|
js/admin-listing.js
CHANGED
@@ -1 +1,199 @@
|
|
1 |
-
jQuery(function(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function($){
|
2 |
+
/*snippet for listing bulk actions*/
|
3 |
+
var $_wpnonce = $("#_wpnonce").attr( 'disabled', 'disabled' ),
|
4 |
+
$bulk_action = $('.global-action');
|
5 |
+
|
6 |
+
$bulk_action.change(function (e){
|
7 |
+
var value = $bulk_action.val();
|
8 |
+
if(value=="delete" || value=="bulk_delete"){
|
9 |
+
$_wpnonce.prop( 'disabled', null );
|
10 |
+
}else{
|
11 |
+
$_wpnonce.attr( 'disabled','disabled' );
|
12 |
+
}
|
13 |
+
});
|
14 |
+
|
15 |
+
|
16 |
+
$('.orderlink').click(function(){
|
17 |
+
$(this).parent("th.sortable , th.sorted").click();
|
18 |
+
return false;
|
19 |
+
});
|
20 |
+
|
21 |
+
/*posts-filter form submit disabled bulk action except when bulkaction submitted */
|
22 |
+
$('#posts-filter').submit(function(){
|
23 |
+
if($('#wysija-pagination').length && (parseInt($('#wysija-pagination').val()) > parseInt($('#wysija-pagination-max').val()))){
|
24 |
+
$('#wysija-pagination').val($('#wysija-pagination-max').val());
|
25 |
+
}
|
26 |
+
});
|
27 |
+
|
28 |
+
|
29 |
+
/*snippet bulkaction check*/
|
30 |
+
$('.bulksubmit').click(function(){
|
31 |
+
/* activate the bulk action*/
|
32 |
+
var locale = $bulk_action.data('locale'), // Grab from Data Attr the l18n strings
|
33 |
+
action = $bulk_action.val(),
|
34 |
+
$selected = $('#posts-filter .check-column input:checked');
|
35 |
+
|
36 |
+
if ($selected.length===0){
|
37 |
+
alert(wysijatrans.selecmiss);
|
38 |
+
return false;
|
39 |
+
}
|
40 |
+
|
41 |
+
switch(action){
|
42 |
+
// Delete confirmation messages
|
43 |
+
case 'deleteusers':
|
44 |
+
if (!confirm( (($selected.length === 1) ? locale.delete : locale.delete_bulk) ))
|
45 |
+
return false
|
46 |
+
break;
|
47 |
+
|
48 |
+
// There is not default action yet
|
49 |
+
default:
|
50 |
+
break;
|
51 |
+
}
|
52 |
+
|
53 |
+
$("<input/>", {
|
54 |
+
'type': 'hidden',
|
55 |
+
'name': 'action',
|
56 |
+
'value': $bulk_action.val(),
|
57 |
+
}).insertAfter($(this));
|
58 |
+
|
59 |
+
$_wpnonce.prop( 'disabled', null );
|
60 |
+
$("#_wpnonce").val( $( ".global-action option:selected").data("nonce") );
|
61 |
+
return true;
|
62 |
+
});
|
63 |
+
|
64 |
+
$('.check-column input[type="checkbox"]').click(function(){
|
65 |
+
/*if(is_one_checkbox_selected() === false){
|
66 |
+
$('#bulksubmit-area').hide();
|
67 |
+
}else{
|
68 |
+
$('#bulksubmit-area').show();
|
69 |
+
}*/
|
70 |
+
});
|
71 |
+
|
72 |
+
function is_one_checkbox_selected(){
|
73 |
+
if($('#posts-filter .check-column input:checked').length === 0){
|
74 |
+
return false;
|
75 |
+
}else{
|
76 |
+
return $('#posts-filter .check-column input:checked').length;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
function fixForceSelectAllWrapper()
|
81 |
+
{
|
82 |
+
flag = false;
|
83 |
+
$('.batch-select td').children().each(function(){
|
84 |
+
if($(this).hasClass('display')){
|
85 |
+
flag = true;
|
86 |
+
}
|
87 |
+
});
|
88 |
+
if(!flag){
|
89 |
+
$('.batch-select').hide();
|
90 |
+
}
|
91 |
+
else{
|
92 |
+
$('.batch-select').show();
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
function batchSelect()
|
97 |
+
{
|
98 |
+
if($('#force_select_all').is(':checked')){
|
99 |
+
$('.checkboxselec, #user-id input, #force_select_all').attr('checked',false);
|
100 |
+
}
|
101 |
+
subscriberCount = $('#posts-filter input.checkboxselec:checked').length;
|
102 |
+
$('.batch-select div.clear_select_all').removeClass('display').hide();
|
103 |
+
if (subscriberCount > 0){
|
104 |
+
$('.batch-select div.force_to_select_all_link').removeClass('display').addClass('display').show();
|
105 |
+
}else{
|
106 |
+
$('.batch-select div.force_to_select_all_link').removeClass('display').hide();
|
107 |
+
}
|
108 |
+
|
109 |
+
fixForceSelectAllWrapper();
|
110 |
+
}
|
111 |
+
|
112 |
+
$('#user-id').click(batchSelect);
|
113 |
+
$('.checkboxselec').click(function(){
|
114 |
+
if(!$(this).is(':checked')){
|
115 |
+
$('#user-id input, #force_select_all').attr('checked',false);
|
116 |
+
$('.batch-select div.force_to_select_all_link').removeClass('display').hide();
|
117 |
+
$('.batch-select div.clear_select_all').removeClass('display').hide();
|
118 |
+
}
|
119 |
+
fixForceSelectAllWrapper();
|
120 |
+
});
|
121 |
+
$('.force_to_select_all_link a').click(function(_event){
|
122 |
+
_event.preventDefault();
|
123 |
+
$('.checkboxselec, #user-id input, #force_select_all').attr('checked','checked');
|
124 |
+
$('.batch-select div.force_to_select_all_link').removeClass('display').hide();
|
125 |
+
$('.batch-select div.clear_select_all').removeClass('display').addClass('display').show();
|
126 |
+
//batchSelect();
|
127 |
+
fixForceSelectAllWrapper();
|
128 |
+
});
|
129 |
+
|
130 |
+
$('.clear_select_all a').click(function(_event){
|
131 |
+
$('.batch-select div.force_to_select_all_link').removeClass('display').hide();
|
132 |
+
$('.batch-select div.clear_select_all').removeClass('display').hide();
|
133 |
+
$('.checkboxselec, #user-id input, #force_select_all').attr('checked',false);
|
134 |
+
fixForceSelectAllWrapper();
|
135 |
+
});
|
136 |
+
|
137 |
+
|
138 |
+
/* snippet for listing ordering*/
|
139 |
+
$('th.sortable , th.sorted').click(function(){
|
140 |
+
var valorder='';
|
141 |
+
if($(this).hasClass('sorted')){
|
142 |
+
if($(this).hasClass('asc')) valorder="desc";
|
143 |
+
else valorder="asc";
|
144 |
+
}else{
|
145 |
+
valorder="desc";
|
146 |
+
}
|
147 |
+
var idheader=$(this).attr("id");
|
148 |
+
|
149 |
+
if($('#wysija-orderby').length){
|
150 |
+
$('#wysija-orderby').val(idheader);
|
151 |
+
$('#wysija-ordert').val(valorder);
|
152 |
+
}else{
|
153 |
+
$('#posts-filter').append('<input id="wysija-ordert" type="hidden" name="ordert" value="'+valorder+'" />');
|
154 |
+
$('#posts-filter').append('<input id="wysija-orderby" type="hidden" name="orderby" value="'+idheader+'" />');
|
155 |
+
}
|
156 |
+
|
157 |
+
$('#posts-filter').submit();
|
158 |
+
});
|
159 |
+
|
160 |
+
/* snippet for pagination submit */
|
161 |
+
$('a.page-numbers').click(function(){
|
162 |
+
var valpagi=$(this).attr('alt');
|
163 |
+
|
164 |
+
if($('#wysija-pagination').length){
|
165 |
+
$('#wysija-pagination').val(valpagi);
|
166 |
+
}else{
|
167 |
+
$('#posts-filter').append('<input id="wysija-pagination" type="hidden" name="pagi" value="'+valpagi+'" />');
|
168 |
+
}
|
169 |
+
|
170 |
+
$('#posts-filter').submit();
|
171 |
+
return false;
|
172 |
+
});
|
173 |
+
|
174 |
+
$('a.page-limit').click(function(){
|
175 |
+
var valpagi=$(this).html();
|
176 |
+
|
177 |
+
if($('#wysija-pagelimit').length){
|
178 |
+
$('#wysija-pagelimit').val(valpagi);
|
179 |
+
}else{
|
180 |
+
$('#posts-filter').append('<input id="wysija-pagelimit" type="hidden" name="limit_pp" value="'+valpagi+'" />');
|
181 |
+
}
|
182 |
+
|
183 |
+
$('#posts-filter').submit();
|
184 |
+
return false;
|
185 |
+
});
|
186 |
+
|
187 |
+
/*snippet for launching file download after an export*/
|
188 |
+
$(document).ready(function() {
|
189 |
+
if($('a.exported-file').length){
|
190 |
+
window.open($('a.exported-file').attr('href'),'Download');
|
191 |
+
}
|
192 |
+
});
|
193 |
+
|
194 |
+
$('.searchbox').blur(function(){
|
195 |
+
$(this).val(trim($(this).val()));
|
196 |
+
});
|
197 |
+
|
198 |
+
fixForceSelectAllWrapper();
|
199 |
+
});
|
js/admin-wysija.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(a){function i(i){i?(a(".wysija-premium-activate").addClass("wysija-button-loading"),a(".wysija-premium-activate").html(wysijatrans.premium_activating+"<span>.</span><span>.</span><span>.</span>")):(a(".wysija-premium-activate").removeClass("wysija-button-loading"),a(".wysija-premium-activate").html(wysijatrans.premium_activate))}a("#wysija-app .submitdelete").click(function(){return confirm(wysijatrans.suredelete)}),a("#wysija-app .linkignore, .wysija-version .linkignore").click(function(){var i=this;return wysijaAJAX.controller="config",wysijaAJAX.task="linkignore",wysijaAJAX.ignorewhat=a.trim(a(this).attr("class").replace(/linkignore/g,"")),wysijaAJAX._wpnonce=
|
1 |
+
jQuery(function(a){function i(i){i?(a(".wysija-premium-activate").addClass("wysija-button-loading"),a(".wysija-premium-activate").html(wysijatrans.premium_activating+"<span>.</span><span>.</span><span>.</span>")):(a(".wysija-premium-activate").removeClass("wysija-button-loading"),a(".wysija-premium-activate").html(wysijatrans.premium_activate))}a("#wysija-app .submitdelete").click(function(){return confirm(wysijatrans.suredelete)}),a("#wysija-app .linkignore, .wysija-version .linkignore").click(function(){var i=this;return wysijaAJAX.controller="config",wysijaAJAX.task="linkignore",wysijaAJAX.ignorewhat=a.trim(a(this).attr("class").replace(/linkignore/g,"")),wysijaAJAX._wpnonce=wysijanonces.config.linkignore,a.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(){a(i).parents(".removeme").length>0?a(i).parents(".removeme").fadeOut():a(i).parents("li").siblings().size()>0?a(i).parents("li").fadeOut():a(i).parents("div.updated").fadeOut()},error:function(a){alert("Request error not JSON:"+a.responseText),wysijaAJAXcallback.onSuccess=""},dataType:"json"}),!0}),a(document).on("click","#wysija-app .premium-tab, .wysija-msg .premium-tab, #theme-view .premium-tab",function(){a("#wysija-app .wysija-premium img").hide(),a(this).hasClass("ispopup")?(window.parent.tb_remove(),window.parent.location.href=wysijatrans.urlpremium):a("#wysija-tabs").length>0?a('#wysija-tabs a[href="#premium"]').trigger("click"):window.location.href=wysijatrans.urlpremium}),a(".wysija-premium-activate").click(function(){wysijaAJAX.controller="config",wysijaAJAX.task="validate",wysijaAJAX._wpnonce=wysijanonces.config.validate,i(!0);var e=this;return a.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(t){t.result.result?window.location.href="admin.php?page=wysija_campaigns&sp=1":(t.result.nocontact?window.location.href="admin.php?page=wysija_campaigns&nocontact=1":(displaychange=0,a.WYSIJA_HANDLE_RESPONSE(t)),i(!1)),a(e).removeClass("wysija-button-loading")},error:function(a){alert(a.responseText),delete wysijaAJAXcallback.onSuccess,i(!1)},dataType:"json"}),!1}),a("#install-wjp,#switch_to_package").click(function(){return confirm(a(this).data("warn"))?(tb_show(a(this).attr("title"),a(this).attr("href")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1):!1}),a("#share_analytics").click(function(){var i=this;return wysijaAJAX.controller="config",wysijaAJAX.task="share_analytics",wysijaAJAX._wpnonce=wysijanonces.config.share_analytics,a.ajax({type:"POST",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(){a(i).text("Thanks!").contents().unwrap()},error:function(a){alert("Request error not JSON:"+a.responseText),wysijaAJAXcallback.onSuccess=""},dataType:"json"}),!0})});
|
languages/wysija-newsletters-de_DE.mo
CHANGED
Binary file
|
languages/wysija-newsletters-hu_HU.mo
CHANGED
Binary file
|
languages/wysija-newsletters-it_IT.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ja.mo
CHANGED
Binary file
|
languages/wysija-newsletters-pt_BR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ru_RU.mo
CHANGED
Binary file
|
models/wp_posts.php
CHANGED
@@ -138,8 +138,8 @@ class WYSIJA_model_wp_posts extends WYSIJA_model{
|
|
138 |
break;
|
139 |
case 'post_date':
|
140 |
// apply timezone to date value
|
141 |
-
$
|
142 |
-
$value = $
|
143 |
|
144 |
if($value !== '') {
|
145 |
$conditions[] = array('col' => 'A.post_date', 'sign' => '>', 'val' => $value);
|
138 |
break;
|
139 |
case 'post_date':
|
140 |
// apply timezone to date value
|
141 |
+
$helper_toolbox = WYSIJA::get('toolbox','helper');
|
142 |
+
$value = $helper_toolbox->time_tzed($value);
|
143 |
|
144 |
if($value !== '') {
|
145 |
$conditions[] = array('col' => 'A.post_date', 'sign' => '>', 'val' => $value);
|
modules/stats_newsletter_std/stats_newsletter_std_view.php
CHANGED
@@ -143,15 +143,13 @@ class WYSIJA_module_view_stats_newsletter_std_view extends WYSIJA_view_back {
|
|
143 |
echo '<a id="action-view" target="_blank" href="'.$link_view.'" class="action-view '.$classes.'">'.__('View', WYSIJA).'</a>';
|
144 |
|
145 |
//duplicate button
|
146 |
-
$
|
147 |
-
if (isset($data['email_object']['type']) && (int)$data['email_object']['type'] == 1) {
|
148 |
-
$duplicate_suffix = 'Email';
|
149 |
-
}
|
150 |
-
$action = 'duplicate'.$duplicate_suffix;
|
151 |
$params = array(
|
152 |
'page' => 'wysija_campaigns',
|
153 |
'action' => $action,
|
154 |
-
'id' => $data['
|
|
|
|
|
155 |
);
|
156 |
$link_duplicate = 'admin.php?'.http_build_query($params);
|
157 |
echo '<a id="action-'.$action.'" href="'.$link_duplicate.'" class="action-'.$action.' '.$classes.'">'.__('Duplicate', WYSIJA).'</a>';
|
143 |
echo '<a id="action-view" target="_blank" href="'.$link_view.'" class="action-view '.$classes.'">'.__('View', WYSIJA).'</a>';
|
144 |
|
145 |
//duplicate button
|
146 |
+
$action = 'duplicate';
|
|
|
|
|
|
|
|
|
147 |
$params = array(
|
148 |
'page' => 'wysija_campaigns',
|
149 |
'action' => $action,
|
150 |
+
'id' => $data['id'],
|
151 |
+
'email_id' => $data['email_id'],
|
152 |
+
'_wpnonce' => WYSIJA_view::secure(array('action' => $action , 'id' => $data['id']), true)
|
153 |
);
|
154 |
$link_duplicate = 'admin.php?'.http_build_query($params);
|
155 |
echo '<a id="action-'.$action.'" href="'.$link_duplicate.'" class="action-'.$action.' '.$classes.'">'.__('Duplicate', WYSIJA).'</a>';
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: wysija, kgjerstad, benheu, JoN1oP, badshark, tung-wysija, bordoni
|
3 |
Tags: newsletter, newsletters, wysija, newsletter signup, newsletter widget, subscribers, post notification, email subscription, email alerts, automatic newsletter, auto newsletter, autoresponder, follow up, email, marketing, emailing, subscription, mail poet, mailpoet
|
4 |
Requires at least: 3.3
|
5 |
-
Tested up to:
|
6 |
-
Stable tag: 2.6.
|
7 |
Send newsletters, post notifications or autoresponders from WordPress easily, and beautifully.
|
8 |
|
9 |
== Description ==
|
@@ -133,6 +133,12 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
|
|
133 |
|
134 |
== Changelog ==
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
= 2.6.10 - 2014-08-04 =
|
137 |
* Improved protection of themes upload, unsubscribe links, file access and statistics.
|
138 |
* Improved the "Send a test email" function.
|
@@ -825,12 +831,12 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
|
|
825 |
|
826 |
* fixed small IE8 and IE9 compatibility issues
|
827 |
* fixed fatal error for new installation
|
828 |
-
* fixed MailPoet admin white screen on
|
829 |
* fixed unsubscribe link disappearing because of qtranslate fix
|
830 |
* fixed old separators just blocked the email wizard
|
831 |
* fixed unsubscribe link disappearing because of default color
|
832 |
* fixed settings panel redirection
|
833 |
-
* fixed update error message corrected :"An error
|
834 |
* fixed rendering of aligned text
|
835 |
* fixed daily report email information
|
836 |
* fixed export: first line with comma, the rest with semi colon now is all semi colon
|
@@ -838,7 +844,7 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
|
|
838 |
* fixed get_avatar during install completely irrelevant
|
839 |
* fixed wordpress post in editor when an article had an image with height 0px
|
840 |
* fixed when domain does not exist, trying to send email, we need to flag it as undelivered after 3 tries and remove it from the queue
|
841 |
-
* fixed user tags [user:firstname |
|
842 |
* fixed get_version when wp-admin folder doesn't exist...
|
843 |
* fixed Bulk Unsubscribe from all list "why can't I add him"
|
844 |
|
2 |
Contributors: wysija, kgjerstad, benheu, JoN1oP, badshark, tung-wysija, bordoni
|
3 |
Tags: newsletter, newsletters, wysija, newsletter signup, newsletter widget, subscribers, post notification, email subscription, email alerts, automatic newsletter, auto newsletter, autoresponder, follow up, email, marketing, emailing, subscription, mail poet, mailpoet
|
4 |
Requires at least: 3.3
|
5 |
+
Tested up to: 4.0
|
6 |
+
Stable tag: 2.6.11
|
7 |
Send newsletters, post notifications or autoresponders from WordPress easily, and beautifully.
|
8 |
|
9 |
== Description ==
|
133 |
|
134 |
== Changelog ==
|
135 |
|
136 |
+
= 2.6.11 - 2014-08-14 =
|
137 |
+
* Improved protection against CSRF attacks thanks to Yoshinori Matsumoto.
|
138 |
+
* Fixed bug on scheduled newsletters edited back and forth and becoming uneditable.
|
139 |
+
* Fixed when duplicating an email through the stats page of a newsletter, then deleting the duplicate would also delete the original.
|
140 |
+
* Old code Spring cleaning part 2, getting rid of the junk.
|
141 |
+
|
142 |
= 2.6.10 - 2014-08-04 =
|
143 |
* Improved protection of themes upload, unsubscribe links, file access and statistics.
|
144 |
* Improved the "Send a test email" function.
|
831 |
|
832 |
* fixed small IE8 and IE9 compatibility issues
|
833 |
* fixed fatal error for new installation
|
834 |
+
* fixed MailPoet admin white screen on wordpress due to get_current_screen function
|
835 |
* fixed unsubscribe link disappearing because of qtranslate fix
|
836 |
* fixed old separators just blocked the email wizard
|
837 |
* fixed unsubscribe link disappearing because of default color
|
838 |
* fixed settings panel redirection
|
839 |
+
* fixed update error message corrected :"An error occurred during the update" sounding like update failed even though it succeeded
|
840 |
* fixed rendering of aligned text
|
841 |
* fixed daily report email information
|
842 |
* fixed export: first line with comma, the rest with semi colon now is all semi colon
|
844 |
* fixed get_avatar during install completely irrelevant
|
845 |
* fixed wordpress post in editor when an article had an image with height 0px
|
846 |
* fixed when domain does not exist, trying to send email, we need to flag it as undelivered after 3 tries and remove it from the queue
|
847 |
+
* fixed user tags [user:firstname | default:subscriber] left over when sent through queue and on some users
|
848 |
* fixed get_version when wp-admin folder doesn't exist...
|
849 |
* fixed Bulk Unsubscribe from all list "why can't I add him"
|
850 |
|
views/back/campaigns.php
CHANGED
@@ -265,38 +265,29 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
265 |
<div class="tablenav">
|
266 |
|
267 |
<div class="alignleft actions">
|
268 |
-
<select name="action2" class="global-action">
|
269 |
-
<option
|
270 |
<?php
|
271 |
if (isset($_REQUEST['link_filter']) && $_REQUEST['link_filter'] == 'notsent') {
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
<?php
|
277 |
-
} */
|
278 |
-
?>
|
279 |
-
<option value="removequeue"><?php _e('Remove from the queue', WYSIJA); ?></option>
|
280 |
-
<?php
|
281 |
}
|
282 |
?>
|
283 |
-
<option value="createnewlist"><?php _e('Create a new list', WYSIJA);
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
if ($list['is_enabled'])
|
294 |
-
echo '<option value="actionvar_unsubscribelist-listid_' . $list['list_id'] . '">' . sprintf(__('Unsubscribe from list: %1$s', WYSIJA), $list['name']) . ' (' . $list['users'] . ')' . '</option>';
|
295 |
-
}
|
296 |
-
?>
|
297 |
-
<option value="export"><?php _e('Export to CSV', WYSIJA); ?></option>
|
298 |
|
299 |
</select>
|
|
|
300 |
<input type="submit" class="bulksubmitcamp button-secondary action" name="doaction" value="<?php echo esc_attr(__('Apply', WYSIJA)); ?>">
|
301 |
</div>
|
302 |
<?php $this->pagination(); ?>
|
@@ -420,12 +411,12 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
420 |
$durationsent = $statusshared = '';
|
421 |
?><a href="admin.php?page=wysija_campaigns&id=<?php echo $row['email_id'] ?>&action=edit" class="row-title"><?php echo $row['name']; ?></a> - <span class="post-state"><?php
|
422 |
if (isset($row['params']['schedule']['isscheduled']) && $row['status'] == 4) {
|
423 |
-
$
|
424 |
|
425 |
|
426 |
//no recording just conversion
|
427 |
$scheduletimenoffset = strtotime($row['params']['schedule']['day'] . ' ' . $row['params']['schedule']['time']);
|
428 |
-
$timeleft = $
|
429 |
if ($timeleft <= 0) {
|
430 |
$autoNL = WYSIJA::get('autonews', 'helper');
|
431 |
$autoNL->checkScheduled();
|
@@ -433,17 +424,13 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
433 |
|
434 |
$scheduled_on = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $scheduletimenoffset);
|
435 |
if ($timeleft <= (60 * 60 * 24)) { // 1 day
|
436 |
-
$timeleft = $
|
437 |
$durationsent = '<span title="' . $scheduled_on . '">' . sprintf(__('Scheduled to be sent in %1$s'), $timeleft) . '</span>';
|
438 |
} else {
|
439 |
|
440 |
$durationsent = sprintf(__('Scheduled to be sent on %1$s'), $scheduled_on);
|
441 |
}
|
442 |
|
443 |
-
// $durationsent.='<br/>Time server : '.date('l jS \of F Y h:i:s A', time());
|
444 |
-
// $durationsent.='<br/>Next publish server time'.date('l jS \of F Y h:i:s A', $toolboxH->servertime_to_localtime($scheduletimenoffset));
|
445 |
-
// $durationsent.='<br/>Local time '.date('l jS \of F Y h:i:s A', $toolboxH->servertime_to_localtime());
|
446 |
-
// $durationsent.='<br/>Next publish Local time'.date('l jS \of F Y h:i:s A', $scheduletimenoffset);
|
447 |
}
|
448 |
|
449 |
|
@@ -472,7 +459,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
472 |
} else {
|
473 |
if ($row["type"] == 2) {
|
474 |
?>
|
475 |
-
<a href="admin.php?page=wysija_campaigns&id=<?php echo $row["email_id"] ?>&action=pause" class="row-title pause-edit">
|
476 |
<?php echo $row['name']; ?>
|
477 |
</a><?php
|
478 |
} else {
|
@@ -490,11 +477,9 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
490 |
</span><?php
|
491 |
$deleteAction = '';
|
492 |
$dupid = $deleteId = $row['campaign_id'];
|
493 |
-
$dupaction = 'duplicate';
|
494 |
if (isset($row['params']['autonl']['parent']) || ((int) $row['type'] === 2 && $row['params']['autonl']['event'] == 'new-articles')) {
|
495 |
$deleteAction = 'Email';
|
496 |
$deleteId = $row['email_id'];
|
497 |
-
//$dupaction='duplicateEmail';
|
498 |
}
|
499 |
|
500 |
if ($row['status'] == 0 || $row['status'] == 4) {
|
@@ -514,7 +499,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
514 |
}
|
515 |
?>
|
516 |
| <span class="duplicate">
|
517 |
-
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row['email_id'] ?>&action=<?php echo $
|
518 |
</span>
|
519 |
| <span class="delete">
|
520 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array('action' => 'delete' . $deleteAction, 'id' => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
@@ -536,7 +521,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
536 |
<?php }
|
537 |
?>
|
538 |
| <span class="duplicate">
|
539 |
-
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row['email_id'] ?>&action=<?php echo $
|
540 |
</span>
|
541 |
| <span class="delete">
|
542 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array("action" => "delete" . $deleteAction, "id" => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
@@ -546,7 +531,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
546 |
if ($row['type'] == 2) {
|
547 |
?>
|
548 |
| <span class="edit">
|
549 |
-
<a href="admin.php?page=wysija_campaigns&id=<?php echo $row["email_id"] ?>&action=pause" class="submitedit pause-edit"><?php _e('Edit', WYSIJA) ?></a>
|
550 |
</span>
|
551 |
<?php
|
552 |
}
|
@@ -561,7 +546,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
561 |
}
|
562 |
?>
|
563 |
| <span class="duplicate">
|
564 |
-
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row["email_id"] ?>&action=<?php echo $
|
565 |
</span>
|
566 |
| <span class="delete">
|
567 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array("action" => "delete" . $deleteAction, "id" => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
@@ -593,18 +578,18 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
593 |
$nextSend = $row['params']['autonl']['nextSend'];
|
594 |
}
|
595 |
|
596 |
-
$
|
597 |
-
$time = $
|
598 |
-
$dayname = $
|
599 |
-
$daynumber = $
|
600 |
-
$weeknumber = $
|
601 |
$durationsent = '';
|
602 |
if ($nextSend) {
|
603 |
-
$timeleft = $
|
604 |
|
605 |
$scheduled_on = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $nextSend);
|
606 |
if ($timeleft < (3600 * 24)) {
|
607 |
-
$timeleft = $
|
608 |
$durationsent = '<span title="' . $scheduled_on . '">' . sprintf(__('Next send out in %1$s', WYSIJA), $timeleft) . '</span>';
|
609 |
} else {
|
610 |
$timeleft = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $nextSend);
|
@@ -612,11 +597,6 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
612 |
}
|
613 |
}
|
614 |
|
615 |
-
//extra debug messages that can help in our auto newsletter debugging
|
616 |
-
// $durationsent.='<br/>Time server : '.date('l jS \of F Y h:i:s A', time());
|
617 |
-
// $durationsent.='<br/>Next publish server time'.date('l jS \of F Y h:i:s A', $toolboxH->servertime_to_localtime($nextSend));
|
618 |
-
// $durationsent.='<br/>Local time '.date('l jS \of F Y h:i:s A', $toolboxH->servertime_to_localtime());
|
619 |
-
// $durationsent.='<br/>Next publish Local time'.date('l jS \of F Y h:i:s A', $nextSend);
|
620 |
|
621 |
switch ($row['params']['autonl']['when-article']) {
|
622 |
case 'daily':
|
@@ -664,7 +644,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
664 |
}
|
665 |
} else {
|
666 |
// standard emails
|
667 |
-
$pause = ' <a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=pause" class="submitedit button">' . __("Pause", WYSIJA) . '</a>';
|
668 |
echo $this->dataBatches($data, $row, $pause, $statuses);
|
669 |
}
|
670 |
|
@@ -672,10 +652,10 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
672 |
case -1:
|
673 |
|
674 |
if ($row['type'] == 2) {
|
675 |
-
$resumelink = __('Not active.', WYSIJA) . ' | <a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=resume" class="submitedit">' . __('Activate', WYSIJA) . '</a>';
|
676 |
echo $resumelink;
|
677 |
} else {
|
678 |
-
$resumelink = '<a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=resume" class="submitedit">' . __('Resume', WYSIJA) . '</a>';
|
679 |
echo sprintf($statuses[$row['status']], $data['sent'][$row['email_id']]['to'], $data['sent'][$row['email_id']]['total']);
|
680 |
echo ' | ' . $resumelink;
|
681 |
}
|
@@ -813,7 +793,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
813 |
|
814 |
if ($letsgo) {
|
815 |
|
816 |
-
$
|
817 |
|
818 |
// Standard newsletter. Let's show the progress bar.
|
819 |
if ($row['type'] != 2) {
|
@@ -825,7 +805,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
825 |
if($data['sent'][$row['email_id']]['remaining_time'] < 1){
|
826 |
$return .= __('The last batch of emails should start sending automatically in the next few minutes.',WYSIJA);
|
827 |
}else{
|
828 |
-
$return .= sprintf(__('Time remaining: %1$s', WYSIJA), $
|
829 |
}
|
830 |
|
831 |
$return .= '</strong></p>';
|
@@ -858,14 +838,14 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
858 |
|
859 |
//Next batch of xx emails will be sent in xx minutes. Don't wait & send right now.
|
860 |
if ($pending) {
|
861 |
-
$return.= '<span style="color:#555"><a href="admin.php?page=wysija_campaigns&action=manual_send&emailid=' . $row['email_id'] . '&pending=1" title="view pending" class="action-send-test-editor" >' . sprintf(__(' %1$s email(s) scheduled.', WYSIJA) . '</a>', $sentleft);
|
862 |
$return.= '</span>';
|
863 |
} else {
|
864 |
if ($data['sent'][$row['email_id']]['running_for']) {
|
865 |
$return.= sprintf(__('Latest batch was sent %1$s ago.', WYSIJA), $data['sent'][$row['email_id']]['running_for']);
|
866 |
} else {
|
867 |
-
$time_remaining = trim($
|
868 |
-
$return.= '<a href="admin.php?page=wysija_campaigns&action=manual_send&emailid=' . $row['email_id'] . '" class="action-send-test-editor" >' . __('Don\'t wait & send right now.', WYSIJA) . '</a>';
|
869 |
}
|
870 |
}
|
871 |
} else {
|
@@ -1165,13 +1145,6 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1165 |
$wjEngine->setStyles();
|
1166 |
}
|
1167 |
|
1168 |
-
// print "\n\n--------\n\n";
|
1169 |
-
// echo '<div style="width:900px;margin:0 auto;">';
|
1170 |
-
// echo $wjEngine->renderEmail($data['email']);
|
1171 |
-
// echo '</div>';
|
1172 |
-
// print "\n\n--------\n\n";
|
1173 |
-
// exit;
|
1174 |
-
|
1175 |
?>
|
1176 |
<style type="text/css" id="wj_css">
|
1177 |
<?php echo $wjEngine->renderStyles(); ?>
|
@@ -1339,7 +1312,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1339 |
<?php
|
1340 |
// we cannot have it everywhere
|
1341 |
if (false && $data && (int) $data['email']['type'] === 2) {
|
1342 |
-
echo '<a id="save-reactivate" class="button-primary wysija" href="admin.php?page=wysija_campaigns&action=resume&id='.$data['email']['email_id'].'">'.__("Save and reactivate",WYSIJA).'</a>';
|
1343 |
}
|
1344 |
?>
|
1345 |
<?php echo '<a href="admin.php?page=wysija_campaigns&action=edit&id=' . $data['email']['email_id'] . '">' . __('go back to Step 1', WYSIJA) . '</a>' ?>
|
@@ -1351,6 +1324,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1351 |
|
1352 |
function saveWYSIJA(callback) {
|
1353 |
wysijaAJAX.task = 'save_editor';
|
|
|
1354 |
wysijaAJAX.wysijaData = Wysija.save();
|
1355 |
WYSIJA_SYNC_AJAX({success: callback});
|
1356 |
}
|
@@ -1367,6 +1341,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1367 |
|
1368 |
if(window.confirm("<?php _e('If you confirm the theme switch, it will override your header, footer, dividers and styles', WYSIJA) ?>")) {
|
1369 |
wysijaAJAX.task = 'switch_theme';
|
|
|
1370 |
wysijaAJAX.wysijaData = Object.toJSON(new Hash({theme: $(target).readAttribute('rel')}));
|
1371 |
wysijaAJAX.popTitle = "Switch theme";
|
1372 |
WYSIJA_AJAX_POST({
|
@@ -1418,6 +1393,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1418 |
|
1419 |
function applyStyles() {
|
1420 |
wysijaAJAX.task = 'save_styles';
|
|
|
1421 |
wysijaAJAX.wysijaStyles = Object.toJSON($('wj_styles_form').serialize(true));
|
1422 |
wysijaAJAX.popTitle = "Save styles";
|
1423 |
WYSIJA_AJAX_POST({
|
@@ -1473,6 +1449,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
|
|
1473 |
|
1474 |
function saveIQS() {
|
1475 |
wysijaAJAX.task = 'save_IQS';
|
|
|
1476 |
wysijaAJAX.wysijaIMG = Object.toJSON(wysijaIMG);
|
1477 |
WYSIJA_AJAX_POST();
|
1478 |
}
|
265 |
<div class="tablenav">
|
266 |
|
267 |
<div class="alignleft actions">
|
268 |
+
<select name="action2" class="global-action" id="viewstats_ddp">
|
269 |
+
<option value="" data-sort="0"><?php _e('With this segment', WYSIJA); ?></option>
|
270 |
<?php
|
271 |
if (isset($_REQUEST['link_filter']) && $_REQUEST['link_filter'] == 'notsent') {
|
272 |
+
|
273 |
+
?>
|
274 |
+
<option value="removequeue" data-nonce="<?php echo $this->secure(array('action' => "removequeue", 'id' => $_REQUEST['id']), true) ?>"><?php _e('Remove from the queue', WYSIJA); ?></option>
|
275 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
276 |
}
|
277 |
?>
|
278 |
+
<option value="createnewlist" data-nonce="<?php echo $this->secure(array('action' => "createnewlist", 'id' => $_REQUEST['id']), true) ?>"><?php _e('Create a new list', WYSIJA); ?></option>
|
279 |
+
<option value="unsubscribeall" data-nonce="<?php echo $this->secure(array('action' => "unsubscribeall", 'id' => $_REQUEST['id']), true) ?>"><?php _e('Unsubscribe from all lists', WYSIJA); ?></option>
|
280 |
+
<?php
|
281 |
+
foreach ($data['lists'] as $listK => $list) {
|
282 |
+
if ($list['is_enabled']){
|
283 |
+
echo '<option value="actionvar_unsubscribelist-listid_' . $list['list_id'] . '" data-nonce="'. $this->secure(array('action' => "actionvar_unsubscribelist-listid_" . $list['list_id'], 'id' => $_REQUEST['id']), true).'">' . sprintf(__('Unsubscribe from list: %1$s', WYSIJA), $list['name']) . ' (' . $list['users'] . ')' . '</option>';
|
284 |
+
}
|
285 |
+
}
|
286 |
+
?>
|
287 |
+
<option value="export" data-nonce="<?php echo $this->secure(array('action' => "export", 'id' => $_REQUEST['id']), true) ?>"><?php _e('Export to CSV', WYSIJA); ?></option>
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
</select>
|
290 |
+
<?php $this->secure(array('action' => "bulkoptions", 'id' => $_REQUEST['id'])); ?>
|
291 |
<input type="submit" class="bulksubmitcamp button-secondary action" name="doaction" value="<?php echo esc_attr(__('Apply', WYSIJA)); ?>">
|
292 |
</div>
|
293 |
<?php $this->pagination(); ?>
|
411 |
$durationsent = $statusshared = '';
|
412 |
?><a href="admin.php?page=wysija_campaigns&id=<?php echo $row['email_id'] ?>&action=edit" class="row-title"><?php echo $row['name']; ?></a> - <span class="post-state"><?php
|
413 |
if (isset($row['params']['schedule']['isscheduled']) && $row['status'] == 4) {
|
414 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
415 |
|
416 |
|
417 |
//no recording just conversion
|
418 |
$scheduletimenoffset = strtotime($row['params']['schedule']['day'] . ' ' . $row['params']['schedule']['time']);
|
419 |
+
$timeleft = $helper_toolbox->localtime_to_servertime($scheduletimenoffset) - time();
|
420 |
if ($timeleft <= 0) {
|
421 |
$autoNL = WYSIJA::get('autonews', 'helper');
|
422 |
$autoNL->checkScheduled();
|
424 |
|
425 |
$scheduled_on = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $scheduletimenoffset);
|
426 |
if ($timeleft <= (60 * 60 * 24)) { // 1 day
|
427 |
+
$timeleft = $helper_toolbox->duration_string($timeleft, true, 4);
|
428 |
$durationsent = '<span title="' . $scheduled_on . '">' . sprintf(__('Scheduled to be sent in %1$s'), $timeleft) . '</span>';
|
429 |
} else {
|
430 |
|
431 |
$durationsent = sprintf(__('Scheduled to be sent on %1$s'), $scheduled_on);
|
432 |
}
|
433 |
|
|
|
|
|
|
|
|
|
434 |
}
|
435 |
|
436 |
|
459 |
} else {
|
460 |
if ($row["type"] == 2) {
|
461 |
?>
|
462 |
+
<a href="admin.php?page=wysija_campaigns&id=<?php echo $row["email_id"] ?>&action=pause&_wpnonce=<?php echo $this->secure(array('action' => 'pause' , 'id' => $row["email_id"]), true); ?>" class="row-title pause-edit">
|
463 |
<?php echo $row['name']; ?>
|
464 |
</a><?php
|
465 |
} else {
|
477 |
</span><?php
|
478 |
$deleteAction = '';
|
479 |
$dupid = $deleteId = $row['campaign_id'];
|
|
|
480 |
if (isset($row['params']['autonl']['parent']) || ((int) $row['type'] === 2 && $row['params']['autonl']['event'] == 'new-articles')) {
|
481 |
$deleteAction = 'Email';
|
482 |
$deleteId = $row['email_id'];
|
|
|
483 |
}
|
484 |
|
485 |
if ($row['status'] == 0 || $row['status'] == 4) {
|
499 |
}
|
500 |
?>
|
501 |
| <span class="duplicate">
|
502 |
+
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row['email_id'] ?>&action=duplicate&_wpnonce=<?php echo $this->secure(array("action" => "duplicate", "id" => $dupid), true); ?>" class="submitedit"><?php _e('Duplicate', WYSIJA) ?></a>
|
503 |
</span>
|
504 |
| <span class="delete">
|
505 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array('action' => 'delete' . $deleteAction, 'id' => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
521 |
<?php }
|
522 |
?>
|
523 |
| <span class="duplicate">
|
524 |
+
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row['email_id'] ?>&action=duplicate&_wpnonce=<?php echo $this->secure(array("action" => "duplicate", "id" => $dupid), true); ?>" class="submitedit"><?php _e('Duplicate', WYSIJA) ?></a>
|
525 |
</span>
|
526 |
| <span class="delete">
|
527 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array("action" => "delete" . $deleteAction, "id" => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
531 |
if ($row['type'] == 2) {
|
532 |
?>
|
533 |
| <span class="edit">
|
534 |
+
<a href="admin.php?page=wysija_campaigns&id=<?php echo $row["email_id"] ?>&action=pause&_wpnonce=<?php echo $this->secure(array('action' => 'pause' , 'id' => $row["email_id"]), true); ?>" class="submitedit pause-edit"><?php _e('Edit', WYSIJA) ?></a>
|
535 |
</span>
|
536 |
<?php
|
537 |
}
|
546 |
}
|
547 |
?>
|
548 |
| <span class="duplicate">
|
549 |
+
<a href="admin.php?page=wysija_campaigns&id=<?php echo $dupid ?>&email_id=<?php echo $row["email_id"] ?>&action=duplicate&_wpnonce=<?php echo $this->secure(array("action" => "duplicate", "id" => $dupid), true); ?>" class="submitedit"><?php _e('Duplicate', WYSIJA) ?></a>
|
550 |
</span>
|
551 |
| <span class="delete">
|
552 |
<a href="<?php echo $data['base_url'] ?>&id=<?php echo $deleteId ?>&action=delete<?php echo $deleteAction ?>&_wpnonce=<?php echo $this->secure(array("action" => "delete" . $deleteAction, "id" => $deleteId), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
578 |
$nextSend = $row['params']['autonl']['nextSend'];
|
579 |
}
|
580 |
|
581 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
582 |
+
$time = $helper_toolbox->localtime($row['params']['autonl']['time'], true);
|
583 |
+
$dayname = $helper_toolbox->getday($row['params']['autonl']['dayname']);
|
584 |
+
$daynumber = $helper_toolbox->getdaynumber($row['params']['autonl']['daynumber']);
|
585 |
+
$weeknumber = $helper_toolbox->getweeksnumber($row['params']['autonl']['dayevery']);
|
586 |
$durationsent = '';
|
587 |
if ($nextSend) {
|
588 |
+
$timeleft = $helper_toolbox->localtime_to_servertime($nextSend) - time();
|
589 |
|
590 |
$scheduled_on = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $nextSend);
|
591 |
if ($timeleft < (3600 * 24)) {
|
592 |
+
$timeleft = $helper_toolbox->duration_string($timeleft, true, 2);
|
593 |
$durationsent = '<span title="' . $scheduled_on . '">' . sprintf(__('Next send out in %1$s', WYSIJA), $timeleft) . '</span>';
|
594 |
} else {
|
595 |
$timeleft = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $nextSend);
|
597 |
}
|
598 |
}
|
599 |
|
|
|
|
|
|
|
|
|
|
|
600 |
|
601 |
switch ($row['params']['autonl']['when-article']) {
|
602 |
case 'daily':
|
644 |
}
|
645 |
} else {
|
646 |
// standard emails
|
647 |
+
$pause = ' <a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=pause&_wpnonce='.$this->secure(array('action' => 'pause' , 'id' => $row["email_id"]), true).'" class="submitedit button">' . __("Pause", WYSIJA) . '</a>';
|
648 |
echo $this->dataBatches($data, $row, $pause, $statuses);
|
649 |
}
|
650 |
|
652 |
case -1:
|
653 |
|
654 |
if ($row['type'] == 2) {
|
655 |
+
$resumelink = __('Not active.', WYSIJA) . ' | <a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=resume&_wpnonce='.$this->secure(array('action' => 'resume' , 'id' => $row["email_id"]), true).'" class="submitedit">' . __('Activate', WYSIJA) . '</a>';
|
656 |
echo $resumelink;
|
657 |
} else {
|
658 |
+
$resumelink = '<a href="admin.php?page=wysija_campaigns&id=' . $row['email_id'] . '&action=resume&_wpnonce='.$this->secure(array('action' => 'resume' , 'id' => $row["email_id"]), true).'" class="submitedit">' . __('Resume', WYSIJA) . '</a>';
|
659 |
echo sprintf($statuses[$row['status']], $data['sent'][$row['email_id']]['to'], $data['sent'][$row['email_id']]['total']);
|
660 |
echo ' | ' . $resumelink;
|
661 |
}
|
793 |
|
794 |
if ($letsgo) {
|
795 |
|
796 |
+
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
|
797 |
|
798 |
// Standard newsletter. Let's show the progress bar.
|
799 |
if ($row['type'] != 2) {
|
805 |
if($data['sent'][$row['email_id']]['remaining_time'] < 1){
|
806 |
$return .= __('The last batch of emails should start sending automatically in the next few minutes.',WYSIJA);
|
807 |
}else{
|
808 |
+
$return .= sprintf(__('Time remaining: %1$s', WYSIJA), $helper_toolbox->duration_string($data['sent'][$row['email_id']]['remaining_time'], true, 4, 4));
|
809 |
}
|
810 |
|
811 |
$return .= '</strong></p>';
|
838 |
|
839 |
//Next batch of xx emails will be sent in xx minutes. Don't wait & send right now.
|
840 |
if ($pending) {
|
841 |
+
$return.= '<span style="color:#555"><a href="admin.php?page=wysija_campaigns&action=manual_send&emailid=' . $row['email_id'] . '&pending=1&_wpnonce='.$this->secure(array('action' => 'manual_send'), true).'" title="view pending" class="action-send-test-editor" >' . sprintf(__(' %1$s email(s) scheduled.', WYSIJA) . '</a>', $sentleft);
|
842 |
$return.= '</span>';
|
843 |
} else {
|
844 |
if ($data['sent'][$row['email_id']]['running_for']) {
|
845 |
$return.= sprintf(__('Latest batch was sent %1$s ago.', WYSIJA), $data['sent'][$row['email_id']]['running_for']);
|
846 |
} else {
|
847 |
+
$time_remaining = trim($helper_toolbox->duration_string($data['sent'][$row['email_id']]['next_batch'], true, 4));
|
848 |
+
$return.= '<a href="admin.php?page=wysija_campaigns&action=manual_send&emailid=' . $row['email_id'] . '&_wpnonce='.$this->secure(array('action' => 'manual_send'), true).'" class="action-send-test-editor" >' . __('Don\'t wait & send right now.', WYSIJA) . '</a>';
|
849 |
}
|
850 |
}
|
851 |
} else {
|
1145 |
$wjEngine->setStyles();
|
1146 |
}
|
1147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1148 |
?>
|
1149 |
<style type="text/css" id="wj_css">
|
1150 |
<?php echo $wjEngine->renderStyles(); ?>
|
1312 |
<?php
|
1313 |
// we cannot have it everywhere
|
1314 |
if (false && $data && (int) $data['email']['type'] === 2) {
|
1315 |
+
echo '<a id="save-reactivate" class="button-primary wysija" href="admin.php?page=wysija_campaigns&action=resume&id='.$data['email']['email_id'].'&_wpnonce='.$this->secure(array('action' => 'resume' , 'id' => $data['email']["email_id"]), true).'">'.__("Save and reactivate",WYSIJA).'</a>';
|
1316 |
}
|
1317 |
?>
|
1318 |
<?php echo '<a href="admin.php?page=wysija_campaigns&action=edit&id=' . $data['email']['email_id'] . '">' . __('go back to Step 1', WYSIJA) . '</a>' ?>
|
1324 |
|
1325 |
function saveWYSIJA(callback) {
|
1326 |
wysijaAJAX.task = 'save_editor';
|
1327 |
+
wysijaAJAX._wpnonce = wysijanonces.campaigns.save_editor;
|
1328 |
wysijaAJAX.wysijaData = Wysija.save();
|
1329 |
WYSIJA_SYNC_AJAX({success: callback});
|
1330 |
}
|
1341 |
|
1342 |
if(window.confirm("<?php _e('If you confirm the theme switch, it will override your header, footer, dividers and styles', WYSIJA) ?>")) {
|
1343 |
wysijaAJAX.task = 'switch_theme';
|
1344 |
+
wysijaAJAX._wpnonce = wysijanonces.campaigns.switch_theme;
|
1345 |
wysijaAJAX.wysijaData = Object.toJSON(new Hash({theme: $(target).readAttribute('rel')}));
|
1346 |
wysijaAJAX.popTitle = "Switch theme";
|
1347 |
WYSIJA_AJAX_POST({
|
1393 |
|
1394 |
function applyStyles() {
|
1395 |
wysijaAJAX.task = 'save_styles';
|
1396 |
+
wysijaAJAX._wpnonce = wysijanonces.campaigns.save_styles;
|
1397 |
wysijaAJAX.wysijaStyles = Object.toJSON($('wj_styles_form').serialize(true));
|
1398 |
wysijaAJAX.popTitle = "Save styles";
|
1399 |
WYSIJA_AJAX_POST({
|
1449 |
|
1450 |
function saveIQS() {
|
1451 |
wysijaAJAX.task = 'save_IQS';
|
1452 |
+
wysijaAJAX._wpnonce = wysijanonces.campaigns.save_IQS;
|
1453 |
wysijaAJAX.wysijaIMG = Object.toJSON(wysijaIMG);
|
1454 |
WYSIJA_AJAX_POST();
|
1455 |
}
|
views/back/config.php
CHANGED
@@ -1277,7 +1277,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
1277 |
$advanced_fields ['debug_log'] = array(
|
1278 |
'type' => 'debuglog',
|
1279 |
'label' => 'Logs',
|
1280 |
-
'desc' => str_replace(array('[link]', '[linkclear]', '[/link]', '[/linkclear]'), array('<a href="admin.php?page=wysija_config&action=log">', '<a href="admin.php?page=wysija_config&action=clearlog">', '</a>', '</a>'), 'View them [link]here[/link]. Clear them [linkclear]here[/linkclear]'));
|
1281 |
}
|
1282 |
|
1283 |
//attach 'super-advanced' class to super_advanced_fields
|
@@ -1745,7 +1745,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
1745 |
|
1746 |
<!-- Create a new form -->
|
1747 |
<p class="new_form">
|
1748 |
-
<a class="<?php echo $classes; ?>" href="admin.php?page=wysija_config&action=form_add"><?php _e('Create a new form', WYSIJA); ?></a>
|
1749 |
</p>
|
1750 |
|
1751 |
<?php
|
@@ -1804,7 +1804,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
1804 |
<a href="admin.php?page=wysija_config&action=form_edit&id=<?php echo $row['form_id'] ?>"><?php _e('Edit', WYSIJA); ?></a>
|
1805 |
</span> |
|
1806 |
<span class="duplicate">
|
1807 |
-
<a href="admin.php?page=wysija_config&action=form_duplicate&id=<?php echo $row['form_id'] ?>"><?php _e('Duplicate', WYSIJA) ?></a>
|
1808 |
</span> |
|
1809 |
<span class="delete">
|
1810 |
<a href="admin.php?page=wysija_config&action=form_delete&id=<?php echo $row['form_id'] ?>&_wpnonce=<?php echo $this->secure(array('action' => 'form_delete', 'id' => $row['form_id']), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
@@ -1960,6 +1960,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
1960 |
|
1961 |
function formEditorSave(callback) {
|
1962 |
wysijaAJAX.task = 'form_save';
|
|
|
1963 |
wysijaAJAX.wysijaData = WysijaForm.save();
|
1964 |
WYSIJA_SYNC_AJAX({
|
1965 |
success: callback
|
@@ -2045,6 +2046,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
2045 |
if(window.confirm(wysijatrans.delete_field_confirmation)) {
|
2046 |
// make ajax request
|
2047 |
wysijaAJAX.task = 'form_field_delete';
|
|
|
2048 |
// build data with field id
|
2049 |
var data = { field_id: parseInt($(this).readAttribute('data-field-id'), 10) },
|
2050 |
self = this;
|
@@ -2140,6 +2142,7 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
2140 |
externalControl: 'edit-form-name',
|
2141 |
callback: function(form, value) {
|
2142 |
wysijaAJAX.task = 'form_name_save';
|
|
|
2143 |
return Object.toQueryString(wysijaAJAX) + '&id=' + wysijaAJAX.form_id + '&name=' + encodeURIComponent(value);
|
2144 |
},
|
2145 |
onComplete: function(response, element) {
|
1277 |
$advanced_fields ['debug_log'] = array(
|
1278 |
'type' => 'debuglog',
|
1279 |
'label' => 'Logs',
|
1280 |
+
'desc' => str_replace(array('[link]', '[linkclear]', '[/link]', '[/linkclear]'), array('<a href="admin.php?page=wysija_config&action=log" target="_blank">', '<a target="_blank" href="admin.php?page=wysija_config&action=clearlog&_wpnonce='.$this->secure(array('action' => 'clearlog' ), true).'">', '</a>', '</a>'), 'View them [link]here[/link]. Clear them [linkclear]here[/linkclear]'));
|
1281 |
}
|
1282 |
|
1283 |
//attach 'super-advanced' class to super_advanced_fields
|
1745 |
|
1746 |
<!-- Create a new form -->
|
1747 |
<p class="new_form">
|
1748 |
+
<a class="<?php echo $classes; ?>" href="admin.php?page=wysija_config&action=form_add&_wpnonce=<?php echo $this->secure(array("action" => "form_add"), true); ?>"><?php _e('Create a new form', WYSIJA); ?></a>
|
1749 |
</p>
|
1750 |
|
1751 |
<?php
|
1804 |
<a href="admin.php?page=wysija_config&action=form_edit&id=<?php echo $row['form_id'] ?>"><?php _e('Edit', WYSIJA); ?></a>
|
1805 |
</span> |
|
1806 |
<span class="duplicate">
|
1807 |
+
<a href="admin.php?page=wysija_config&action=form_duplicate&id=<?php echo $row['form_id'] ?>&_wpnonce=<?php echo $this->secure(array('action' => 'form_duplicate', 'id' => $row['form_id']), true); ?>"><?php _e('Duplicate', WYSIJA) ?></a>
|
1808 |
</span> |
|
1809 |
<span class="delete">
|
1810 |
<a href="admin.php?page=wysija_config&action=form_delete&id=<?php echo $row['form_id'] ?>&_wpnonce=<?php echo $this->secure(array('action' => 'form_delete', 'id' => $row['form_id']), true); ?>" class="submitdelete"><?php _e('Delete', WYSIJA) ?></a>
|
1960 |
|
1961 |
function formEditorSave(callback) {
|
1962 |
wysijaAJAX.task = 'form_save';
|
1963 |
+
wysijaAJAX._wpnonce = wysijanonces.config.form_save;
|
1964 |
wysijaAJAX.wysijaData = WysijaForm.save();
|
1965 |
WYSIJA_SYNC_AJAX({
|
1966 |
success: callback
|
2046 |
if(window.confirm(wysijatrans.delete_field_confirmation)) {
|
2047 |
// make ajax request
|
2048 |
wysijaAJAX.task = 'form_field_delete';
|
2049 |
+
wysijaAJAX._wpnonce = wysijanonces.config.form_field_delete;
|
2050 |
// build data with field id
|
2051 |
var data = { field_id: parseInt($(this).readAttribute('data-field-id'), 10) },
|
2052 |
self = this;
|
2142 |
externalControl: 'edit-form-name',
|
2143 |
callback: function(form, value) {
|
2144 |
wysijaAJAX.task = 'form_name_save';
|
2145 |
+
wysijaAJAX._wpnonce = wysijanonces.config.form_name_save;
|
2146 |
return Object.toQueryString(wysijaAJAX) + '&id=' + wysijaAJAX.form_id + '&name=' + encodeURIComponent(value);
|
2147 |
},
|
2148 |
onComplete: function(response, element) {
|
views/back/subscribers.php
CHANGED
@@ -123,7 +123,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
123 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
124 |
if ($list['is_enabled'])
|
125 |
{
|
126 |
-
?><option value="actionvar_movetolist-listid_<?php echo $listK ?>"><?php
|
127 |
echo str_repeat(' ', 5).$list['name'];
|
128 |
if (isset($list['users']))
|
129 |
echo ' ('.$list['users'].')';
|
@@ -138,7 +138,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
138 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
139 |
if ($list['is_enabled'])
|
140 |
{
|
141 |
-
?><option value="actionvar_copytolist-listid_<?php echo $listK ?>"><?php
|
142 |
echo str_repeat(' ', 5).$list['name'];
|
143 |
if (isset($list['users']))
|
144 |
echo ' ('.$list['users'].')';
|
@@ -153,7 +153,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
153 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
154 |
if ($list['is_enabled'])
|
155 |
{
|
156 |
-
?><option value="actionvar_removefromlist-listid_<?php echo $listK ?>"><?php
|
157 |
echo str_repeat(' ', 5).$list['name'];
|
158 |
if (isset($list['users']))
|
159 |
echo ' ('.$list['users'].')';
|
@@ -161,15 +161,15 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
161 |
}
|
162 |
}
|
163 |
?>
|
164 |
-
<option value="actionvar_removefromalllists"><?php _e('Remove from all lists', WYSIJA); ?></option>
|
165 |
-
<option value="exportlist"><?php _e('Export', WYSIJA); ?></option>
|
166 |
-
<option value="deleteusers"><?php _e('Delete subscribers', WYSIJA); ?></option>
|
167 |
<?php
|
168 |
$config_model = WYSIJA::get('config', 'model');
|
169 |
if ($config_model->getValue('confirm_dbleoptin'))
|
170 |
{
|
171 |
?>
|
172 |
-
<option value="actionvar_confirmusers"><?php _e('Confirm unconfirmed subscribers', WYSIJA); ?></option>
|
173 |
<?php } ?>
|
174 |
</select>
|
175 |
<input type="submit" class="bulksubmit button-secondary action" name="doaction" value="<?php echo esc_attr(__('Apply', WYSIJA)); ?>">
|
@@ -454,6 +454,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
454 |
<p class="submit">
|
455 |
<input type="hidden" name="wysija[export][user_ids]" id="user_ids" value="<?php if (isset($data['subscribers'])) echo base64_encode(serialize($data['subscribers'])) ?>" />
|
456 |
<input type="hidden" value="export_get" name="action" />
|
|
|
457 |
<input type="submit" value="<?php echo esc_attr(__('Export', WYSIJA)) ?>" class="button-primary wysija">
|
458 |
</p>
|
459 |
</form>
|
@@ -740,7 +741,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
740 |
<a href="admin.php?page=wysija_subscribers&id=<?php echo $columns['list_id'] ?>&action=editlist" class="submitedit"><?php _e('Edit', WYSIJA) ?></a> |
|
741 |
</span>
|
742 |
<span class="duplicate">
|
743 |
-
<a href="admin.php?page=wysija_subscribers&id=<?php echo $columns['list_id'] ?>&action=duplicatelist" class="submitduplicate"><?php _e('Duplicate', WYSIJA) ?></a>
|
744 |
</span>
|
745 |
<?php if ($columns['namekey'] != "users"): ?>
|
746 |
|
|
@@ -936,7 +937,7 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
|
|
936 |
|
937 |
<p class="submit">
|
938 |
<input type="hidden" value="importmatch" name="action" />
|
939 |
-
|
940 |
<input type="submit" value="<?php echo esc_attr(__('Next step', WYSIJA)) ?>" class="button-primary wysija">
|
941 |
|
942 |
</p>
|
123 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
124 |
if ($list['is_enabled'])
|
125 |
{
|
126 |
+
?><option value="actionvar_movetolist-listid_<?php echo $listK ?>" data-nonce="<?php echo $this->secure(array('action' => "actionvar_movetolist-listid_" . $listK), true)?>"><?php
|
127 |
echo str_repeat(' ', 5).$list['name'];
|
128 |
if (isset($list['users']))
|
129 |
echo ' ('.$list['users'].')';
|
138 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
139 |
if ($list['is_enabled'])
|
140 |
{
|
141 |
+
?><option value="actionvar_copytolist-listid_<?php echo $listK ?>" data-nonce="<?php echo $this->secure(array('action' => "actionvar_copytolist-listid_" . $listK), true)?>"><?php
|
142 |
echo str_repeat(' ', 5).$list['name'];
|
143 |
if (isset($list['users']))
|
144 |
echo ' ('.$list['users'].')';
|
153 |
//if(!(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']== $listK) && $list['is_enabled']){ // Commented by TNT
|
154 |
if ($list['is_enabled'])
|
155 |
{
|
156 |
+
?><option value="actionvar_removefromlist-listid_<?php echo $listK ?>" data-nonce="<?php echo $this->secure(array('action' => "actionvar_removefromlist-listid_" . $listK), true)?>"><?php
|
157 |
echo str_repeat(' ', 5).$list['name'];
|
158 |
if (isset($list['users']))
|
159 |
echo ' ('.$list['users'].')';
|
161 |
}
|
162 |
}
|
163 |
?>
|
164 |
+
<option value="actionvar_removefromalllists" data-nonce="<?php echo $this->secure(array('action' => "actionvar_removefromalllists" ), true)?>"><?php _e('Remove from all lists', WYSIJA); ?></option>
|
165 |
+
<option value="exportlist" data-nonce="<?php echo $this->secure(array('action' => "exportlist" ), true)?>"><?php _e('Export', WYSIJA); ?></option>
|
166 |
+
<option value="deleteusers" data-nonce="<?php echo $this->secure(array('action' => "deleteusers" ), true)?>"><?php _e('Delete subscribers', WYSIJA); ?></option>
|
167 |
<?php
|
168 |
$config_model = WYSIJA::get('config', 'model');
|
169 |
if ($config_model->getValue('confirm_dbleoptin'))
|
170 |
{
|
171 |
?>
|
172 |
+
<option value="actionvar_confirmusers" data-nonce="<?php echo $this->secure(array('action' => "actionvar_confirmusers" ), true)?>"><?php _e('Confirm unconfirmed subscribers', WYSIJA); ?></option>
|
173 |
<?php } ?>
|
174 |
</select>
|
175 |
<input type="submit" class="bulksubmit button-secondary action" name="doaction" value="<?php echo esc_attr(__('Apply', WYSIJA)); ?>">
|
454 |
<p class="submit">
|
455 |
<input type="hidden" name="wysija[export][user_ids]" id="user_ids" value="<?php if (isset($data['subscribers'])) echo base64_encode(serialize($data['subscribers'])) ?>" />
|
456 |
<input type="hidden" value="export_get" name="action" />
|
457 |
+
<?php $this->secure(array('action' => "export_get")); ?>
|
458 |
<input type="submit" value="<?php echo esc_attr(__('Export', WYSIJA)) ?>" class="button-primary wysija">
|
459 |
</p>
|
460 |
</form>
|
741 |
<a href="admin.php?page=wysija_subscribers&id=<?php echo $columns['list_id'] ?>&action=editlist" class="submitedit"><?php _e('Edit', WYSIJA) ?></a> |
|
742 |
</span>
|
743 |
<span class="duplicate">
|
744 |
+
<a href="admin.php?page=wysija_subscribers&id=<?php echo $columns['list_id'] ?>&action=duplicatelist&_wpnonce=<?php echo $this->secure(array("action" => "duplicatelist", "id" => $columns['list_id']), true); ?>" class="submitduplicate"><?php _e('Duplicate', WYSIJA) ?></a>
|
745 |
</span>
|
746 |
<?php if ($columns['namekey'] != "users"): ?>
|
747 |
|
|
937 |
|
938 |
<p class="submit">
|
939 |
<input type="hidden" value="importmatch" name="action" />
|
940 |
+
<?php $this->secure(array('action' => "importmatch")); ?>
|
941 |
<input type="submit" value="<?php echo esc_attr(__('Next step', WYSIJA)) ?>" class="button-primary wysija">
|
942 |
|
943 |
</p>
|
widgets/wysija_nl.php
CHANGED
@@ -208,7 +208,8 @@ class WYSIJA_NL_Widget extends WP_Widget {
|
|
208 |
$field_html .= '</select>';
|
209 |
break;
|
210 |
case 'edit_link':
|
211 |
-
|
|
|
212 |
break;
|
213 |
default:
|
214 |
$field_html = $helper_forms->input(
|
208 |
$field_html .= '</select>';
|
209 |
break;
|
210 |
case 'edit_link':
|
211 |
+
|
212 |
+
$field_html = '<a href="admin.php?page=wysija_config&action=form_add&_wpnonce='.wp_create_nonce('wysija_config-action_form_add').'" target="_blank" title="'.$field_params['label'].'">'.$field_params['label'].'</a>';
|
213 |
break;
|
214 |
default:
|
215 |
$field_html = $helper_forms->input(
|