CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 1.8.0

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 1.8.0
Comparing to
See all releases

Code changes from version 1.7.0 to 1.8.0

cmp-about.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ ?>
5
+
6
+ <h3>About Page</h3>
cmp-help.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ ?>
4
+
5
+ <style>
6
+ h3, p {text-align: center;}
7
+ .wrap {margin-top: 5em;}
8
+ </style>
9
+
10
+ <div class="wrap">
11
+ <div id="icon-users" class="icon32"></div>
12
+ <h3><?php _e('Thank you for using our CMP - Coming Soon, Maintenance & Landing Page NiteoThemes`s plugin for Wordpress', 'cmp-coming-soon-maintenance');?></h3>
13
+ <p><?php _e('If you have any question or issue feel free to ask Wordpress Community or for our expert support on Wordpress Support Forum!', 'cmp-coming-soon-maintenance');?></p>
14
+
15
+ <p><a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance" class="button" target="_blank"><?php _e('GET SUPPORT!', 'cmp-coming-soon-maintenance');?></a></p>
16
+ </div>
cmp-options.php → cmp-settings.php RENAMED
@@ -8,30 +8,61 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
8
  }
9
  }
10
 
11
- if (isset($_POST['niteoCS_logo_id']) && ( is_numeric($_POST['niteoCS_logo_id']) || empty($_POST['niteoCS_logo_id']))) {
12
- update_option('niteoCS_logo_id', sanitize_text_field($_POST['niteoCS_logo_id']));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
 
15
- if (isset($_POST['niteoCS_banner']) && is_numeric($_POST['niteoCS_banner'])) {
16
- update_option('niteoCS_banner', sanitize_text_field($_POST['niteoCS_banner']));
 
17
  }
18
 
19
- if (isset($_POST['niteoCS_banner_color'])) {
20
- update_option('niteoCS_banner_color', sanitize_text_field($_POST['niteoCS_banner_color']));
21
  }
22
- if (isset($_POST['niteoCS_banner_pattern'])) {
23
- update_option('niteoCS_banner_pattern', sanitize_text_field($_POST['niteoCS_banner_pattern']));
 
24
  }
25
 
26
- if (isset($_POST['niteoCS_banner_pattern_custom'])) {
27
- update_option('niteoCS_banner_pattern_custom', esc_url_raw($_POST['niteoCS_banner_pattern_custom']));
28
  }
29
 
30
 
31
- if (isset($_POST['niteoCS_banner_id'])) {
32
  $allnums = true;
33
 
34
- $ids = explode( ',', $_POST['niteoCS_banner_id'] );
35
  foreach ( $ids as $id ) {
36
 
37
  if ( !is_numeric($id) ) {
@@ -39,59 +70,63 @@ if (isset($_POST['niteoCS_banner_id'])) {
39
  }
40
  }
41
 
42
- if ( $allnums === true || $_POST['niteoCS_banner_id'] == '' ) {
43
- update_option('niteoCS_banner_id', sanitize_text_field($_POST['niteoCS_banner_id']));
44
  }
45
 
46
  }
47
 
48
- if (isset($_POST['unsplash_feed']) && is_numeric($_POST['unsplash_feed'])) {
49
- update_option('niteoCS_unsplash_feed', sanitize_text_field($_POST['unsplash_feed']));
50
  }
51
 
52
- if (isset($_POST['niteoCS_unsplash_0'])) {
53
- $url = $_POST['niteoCS_unsplash_0'];
54
  // if we have url sanitize url
55
  if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) {
56
- update_option('niteoCS_unsplash_0', esc_url_raw($_POST['niteoCS_unsplash_0']));
57
  } else {
58
  // sanitize string
59
- update_option('niteoCS_unsplash_0', sanitize_text_field($_POST['niteoCS_unsplash_0']));
60
  }
61
  }
62
 
63
- if (isset($_POST['niteoCS_unsplash_2'])) {
64
- $url = $_POST['niteoCS_unsplash_2'];
65
  // if we have url sanitize url
66
  if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) {
67
- update_option('niteoCS_unsplash_2', esc_url_raw($_POST['niteoCS_unsplash_2']));
68
  } else {
69
  // sanitize string
70
- update_option('niteoCS_unsplash_2', sanitize_text_field($_POST['niteoCS_unsplash_2']));
71
  }
72
  }
73
 
74
- if (isset($_POST['niteoCS_unsplash_3'])) {
75
- update_option('niteoCS_unsplash_3', sanitize_text_field($_POST['niteoCS_unsplash_3']));
76
  }
77
 
78
- if (isset($_POST['unsplash_category'])) {
79
- update_option('niteoCS_unsplash_category', sanitize_text_field($_POST['unsplash_category']));
80
  }
81
- if (isset($_POST['niteoCS_cat_keyword'])) {
82
- update_option('niteoCS_cat_keyword', sanitize_text_field($_POST['niteoCS_cat_keyword']));
83
  }
84
 
85
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
86
 
87
- if (isset($_POST['niteoCS_unsplash_feat'])) {
88
- update_option('niteoCS_unsplash_feat', $this->sanitize_checkbox($_POST['niteoCS_unsplash_feat']));
89
  } else {
90
- update_option('niteoCS_unsplash_feat', false);
91
  }
92
 
93
  }
94
 
 
 
 
 
95
 
96
  if (isset($_POST['niteoCS_title'])) {
97
  update_option('niteoCS_title', sanitize_text_field($_POST['niteoCS_title']));
@@ -109,9 +144,7 @@ if (isset($_POST['niteoCS_custom_css'])) {
109
  update_option('niteoCS_custom_css', $_POST['niteoCS_custom_css']);
110
  }
111
 
112
- if ( isset($_POST['select_theme']) && in_array($_POST['select_theme'], $this->theme_array)) {
113
- update_option('niteoCS_theme', sanitize_text_field($_POST['select_theme']));
114
- }
115
 
116
  if (isset($_POST['niteoCS_subscribe_type']) && is_numeric($_POST['niteoCS_subscribe_type'])) {
117
  update_option('niteoCS_subscribe_type', sanitize_text_field($_POST['niteoCS_subscribe_type']));
@@ -121,20 +154,7 @@ if (isset($_POST['niteoCS_subscribe_label'])) {
121
  update_option('niteoCS_subscribe_label', sanitize_text_field($_POST['niteoCS_subscribe_label']));
122
  }
123
 
124
- if (isset($_POST['niteoCS_font_headings'])) {
125
- update_option('niteoCS_font_headings', sanitize_text_field($_POST['niteoCS_font_headings']));
126
- }
127
-
128
- if (isset($_POST['niteoCS_font_content'])) {
129
- update_option('niteoCS_font_content', sanitize_text_field($_POST['niteoCS_font_content']));
130
- }
131
- if (isset($_POST['niteoCS_font_headings_custom'])) {
132
- update_option('niteoCS_font_headings_custom', ucwords( sanitize_text_field($_POST['niteoCS_font_headings_custom']) ) );
133
- }
134
 
135
- if (isset($_POST['niteoCS_font_content_custom'])) {
136
- update_option('niteoCS_font_content_custom', ucwords( sanitize_text_field($_POST['niteoCS_font_content_custom']) ) );
137
- }
138
 
139
  if (isset($_POST['niteoCS_soc_title'])) {
140
  update_option('niteoCS_soc_title', sanitize_text_field($_POST['niteoCS_soc_title']));
@@ -163,65 +183,101 @@ if (isset($_POST['niteoCS_copyright'])) {
163
  update_option('niteoCS_copyright', $this->niteo_sanitize_html( $_POST['niteoCS_copyright']));
164
  }
165
 
 
 
 
 
 
 
166
 
167
  $ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
168
- // get saved options
169
- $title = stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!'));
170
- $descr = stripslashes(get_option('niteoCS_descr', 'Just another Coming Soon Page'));
171
- $niteoCS_analytics = stripslashes(get_option('niteoCS_analytics', ''));
172
- $niteoCS_custom_css = stripslashes(get_option('niteoCS_custom_css', ''));
173
- $niteoCS_unsplash_id = get_option('niteoCS_unsplash_id', '');
174
- $logo_id = get_option('niteoCS_logo_id');
175
- $niteoCS_banner = get_option('niteoCS_banner', '2');
176
- $banner_id = get_option('niteoCS_banner_id');
177
- $unsplash_feed = get_option('niteoCS_unsplash_feed', '3');
178
- $niteoCS_unsplash_0 = get_option('niteoCS_unsplash_0');
179
- $niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2');
180
- $niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3');
181
- $unsplash_category = get_option('niteoCS_unsplash_category', 'buildings');
182
- $niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
183
- $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
184
- $niteoCS_banner_pattern_custom = get_option('niteoCS_banner_pattern_custom');
185
- $niteoCS_cat_keyword = get_option('niteoCS_cat_keyword');
186
  $niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
 
 
187
  $niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '2');
188
  $niteoCS_subscribe_code = get_option('niteoCS_subscribe_code');
189
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
190
- $subscriber_list = get_option('niteoCS_subscribers_list');
191
  $niteoCS_csv_export_time = get_option('niteoCS_csv_export_time');
192
- $niteoCS_font_content = get_option('niteoCS_font_content', 'Playfair Display');
193
- $niteoCS_font_headings = get_option('niteoCS_font_headings', 'Raleway');
194
- $niteoCS_font_content_custom = get_option('niteoCS_font_content_custom');
195
- $niteoCS_font_headings_custom = get_option('niteoCS_font_headings_custom');
196
- $niteoCS_body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
197
- $body = get_option('niteoCS_body');
198
- $niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
199
- $premium_themes = $this->cmp_plugin_premium();
200
- $niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
 
203
  // get logo url from id
204
- if ( $logo_id != '' ) {
205
- $logo_url = wp_get_attachment_image_src($logo_id, 'medium');
206
  if ( isset($logo_url[0]) ){
207
  $logo_url = $logo_url[0];
208
  }
209
  }
210
 
 
 
 
 
 
 
 
 
 
211
  // get logo url from id
212
  if ( $niteoCS_banner_pattern == 'custom' && $niteoCS_banner_pattern_custom != '' ) {
213
  $pattern_url = $niteoCS_banner_pattern_custom;
214
 
215
  } else {
216
- $pattern_url = WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png';
217
  }
218
 
219
 
220
  // count new subscribers
221
  $new_subs = array();
222
 
223
- if ( $subscriber_list ) {
224
- foreach ($subscriber_list as $subscriber) {
225
 
226
  if ( $subscriber['timestamp'] > $niteoCS_csv_export_time )
227
  array_push($new_subs, $subscriber['email']);
@@ -296,49 +352,74 @@ add_thickbox();
296
  <div id="icon-options-general" class="icon32">
297
  <br />
298
  </div>
299
- <form method="post" action="options-general.php?page=cmp-settings&status=settings-saved" id="csoptions">
300
 
301
  <h2 class="nav-tab-wrapper">
302
- <a class="nav-tab nav-tab-active settings" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
303
- <a class="nav-tab content" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="content"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Content', 'cmp-coming-soon-maintenance');?></a>
304
- <a class="nav-tab seo" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="seo"><i class="fa fa-users" aria-hidden="true"></i><?php _e('SEO', 'cmp-coming-soon-maintenance');?></a>
305
- <a class="nav-tab custom_css" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp-coming-soon-maintenance');?></a>
 
 
 
 
 
 
306
  <a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp-coming-soon-maintenance');?></a>
307
- <a class="nav-tab install" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="install"><i class="fa fa-plus" aria-hidden="true"></i><?php _e('Install New Theme', 'cmp-coming-soon-maintenance');?></a>
 
308
  </h2>
309
 
 
 
 
 
310
  <div class="table-wrapper general">
311
  <h3><?php _e('General Settings', 'cmp-coming-soon-maintenance');?></h3>
312
  <table class="general">
 
313
  <tr>
314
  <th><h4><?php _e('Status', 'cmp-coming-soon-maintenance');?></h4></th>
315
  <td>
316
- <fieldset>
 
317
  <legend class="screen-reader-text">
318
  <span><?php _e('Status', 'cmp-coming-soon-maintenance');?></span>
319
  </legend>
320
- <label title="disabled">
321
- <input type="radio" name="activate" value="0"<?php if ($this->cmp_status() == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
322
- <p class="info"><?php _e('Disable plugin and display standard WordPress page to all users and indexing engines.','cmp-coming-soon-maintenance')?></p>
323
- </label><br />
324
- <label title="cmp">
325
- <input type="radio" name="activate" value="2"<?php if ($this->cmp_status() == 2) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Coming Soon & Landing Page', 'cmp-coming-soon-maintenance');?>
326
- <p class="info"><?php _e('Returns standard 200 HTTP OK response code to indexing robots. Set this option if you want to use our plugin as "Coming Soon" page.','cmp-coming-soon-maintenance')?></p>
327
- </label>
328
- <label title="maintanance">
329
- <input type="radio" name="activate" value="1"<?php if ($this->cmp_status() == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Maintanance Mode', 'cmp-coming-soon-maintenance');?>
330
- <p class="info"><?php _e('Returns 503 HTTP Service unavailable code to indexing robots. Set this option if your site is down due to maintanance and you want to display Maintanance page.','cmp-coming-soon-maintenance')?></p>
331
- </label><br />
332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  </fieldset>
334
  </td>
335
  </tr>
336
-
 
 
 
 
 
 
337
  </table>
338
- <p class="cmp-submit">
339
- <?php wp_nonce_field('save_options','save_options_field'); ?>
340
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
341
- </p>
342
  </div>
343
 
344
  <div class="table-wrapper general">
@@ -373,7 +454,7 @@ add_thickbox();
373
  }
374
 
375
  // get thumbnail
376
- $thumbnail = plugins_url().'/'.$this->installedFolder.'\/themes/'. $theme_slug . '/img/'. $theme_slug . '_thumbnail.jpg';
377
 
378
  // get theme version
379
  $version = '';
@@ -416,17 +497,22 @@ add_thickbox();
416
  </fieldset>
417
  </td>
418
  </tr>
 
 
 
 
 
 
 
419
  </table>
420
- <p class="cmp-submit">
421
- <?php wp_nonce_field('save_options','save_options_field'); ?>
422
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
423
- </p>
424
  </div>
425
  <?php
426
  if ( !empty($premium_themes) ) { ?>
427
  <div class="table-wrapper general">
428
  <h3><?php _e('Premium Themes', 'cmp-coming-soon-maintenance');?></h3>
429
  <table class="general theme-selector">
 
430
  <tr>
431
  <td class="theme-selector">
432
  <fieldset>
@@ -447,7 +533,7 @@ add_thickbox();
447
  if ( !in_array( $theme_slug, $this->theme_array) ) {
448
  $purchased = false;
449
  $version = '';
450
- $thumbnail = plugins_url().'/'.$this->installedFolder.'\/themes/'. $theme_slug. '_thumbnail.jpg';
451
 
452
  }
453
 
@@ -479,17 +565,12 @@ add_thickbox();
479
 
480
  <?php
481
  if ($purchased === true) { ?>
482
- <div class="button theme-select hide<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' activated'; } ?>">
483
  <input type="radio" name="select_theme" value="<?php echo esc_attr($theme_slug);?>" id="displayOption-<?php echo esc_attr($theme_slug);?>"<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' checked="checked"'; } ?>>
484
  <span class="input-label"><?php if ( $this->cmp_selectedTheme() == $theme_slug ) { _e('Active', 'cmp-coming-soon-maintenance'); } else { _e('Select', 'cmp-coming-soon-maintenance'); }?></span>
485
  </div>
486
 
487
  <?php
488
- $theme_update = false;
489
- $transient = get_transient( $theme_slug.'_updatecheck' );
490
- if ( $transient != false && $transient =! '' ) {
491
- $theme_update = true;
492
- }
493
  // echo update button if update is available
494
  if ( $theme_update === true ) { ?>
495
  <button type="button" class="theme-update button hide"><i class="fa fa-refresh" aria-hidden="true"></i><?php _e('Update', 'cmp-coming-soon-maintenance');?></button>
@@ -515,46 +596,21 @@ add_thickbox();
515
  <?php
516
  } // if !empty($premium_themes ?>
517
 
518
- <div class="theme-overlay cmp"></div>
519
-
520
- </table>
521
- <p class="cmp-submit">
522
- <?php wp_nonce_field('save_options','save_options_field'); ?>
523
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
524
- </p>
525
- </div>
526
-
527
- <div class="table-wrapper content">
528
- <h3><?php _e('Logo', 'cmp-coming-soon-maintenance');?></h3>
529
- <table class="content">
530
- <tr>
531
- <th><h4><?php _e('Upload or select Logo', 'cmp-coming-soon-maintenance');?></h4></th>
532
- <td>
533
- <fieldset>
534
- <input type="hidden" class="widefat" id="niteoCS-logo-id" name="niteoCS_logo_id" type="text" value="<?php echo esc_attr( $logo_id ); ?>" />
535
- <input id="add-logo" type="button" class="button" value="Select Logo" />
536
-
537
- <div class="logo-wrapper">
538
- <?php
539
- if ( isset($logo_url) && $logo_url !== '' ) {
540
- echo '<img src="'.esc_url($logo_url).'" alt="">';
541
- } ?>
542
- </div>
543
- <input id="delete-logo" type="button" class="button" value="Remove Logo" />
544
-
545
- </fieldset>
546
- </td>
547
- </tr>
548
  </table>
549
- <p class="cmp-submit">
550
- <?php wp_nonce_field('save_options','save_options_field'); ?>
551
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
552
- </p>
553
  </div>
554
 
555
  <div class="table-wrapper content">
556
  <h3><?php _e('Content', 'cmp-coming-soon-maintenance');?></h3>
557
  <table class="content">
 
558
  <tr class="body-title">
559
  <th><h4><?php _e('Title', 'cmp-coming-soon-maintenance');?></h4></th>
560
  <td>
@@ -567,248 +623,33 @@ add_thickbox();
567
  <tr>
568
  <th><h4><?php _e('Message', 'cmp-coming-soon-maintenance');?></h4></th>
569
  <td>
570
- <?php wp_editor( stripslashes( $this->niteo_sanitize_html( $body ) ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
571
  </td>
572
  </tr>
 
 
 
 
 
 
 
573
  </table>
574
- <p class="cmp-submit">
575
- <?php wp_nonce_field('save_options','save_options_field'); ?>
576
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
577
- </p>
578
- </div>
579
-
580
- <div class="table-wrapper content">
581
- <h3><?php _e('Theme Background', 'cmp-coming-soon-maintenance');?></h3>
582
- <table class="content">
583
- <tr>
584
- <th>
585
- <fieldset>
586
- <legend class="screen-reader-text">
587
- <span><?php _e('Banner Settings', 'cmp-coming-soon-maintenance');?></span>
588
- </legend>
589
-
590
- <p>
591
- <label title="Custom Media">
592
- <input type="radio" name="niteoCS_banner" value="0"<?php if ( $niteoCS_banner == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Custom Media', 'cmp-coming-soon-maintenance');?>
593
- </label>
594
- </p>
595
 
596
- <p>
597
- <label title="Unsplash Media">
598
- <input type="radio" name="niteoCS_banner" value="1"<?php if ( $niteoCS_banner == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Unsplash library', 'cmp-coming-soon-maintenance');?>
599
- </label>
600
- </p>
601
-
602
- <p>
603
- <label title="Default Banner">
604
- <input type="radio" name="niteoCS_banner" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Default Media', 'cmp-coming-soon-maintenance');?>
605
- </label>
606
- </p>
607
- <p>
608
- <label title="Graphic Pattern">
609
- <input type="radio" name="niteoCS_banner" value="3"<?php if ( $niteoCS_banner == 3) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Graphic Pattern', 'cmp-coming-soon-maintenance');?>
610
- </label>
611
- </p>
612
- <p>
613
- <label title="Solid Color">
614
- <input type="radio" name="niteoCS_banner" value="4"<?php if ( $niteoCS_banner == 4) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Solid Color', 'cmp-coming-soon-maintenance');?>
615
- </label>
616
- </p>
617
-
618
- </fieldset>
619
- </th>
620
-
621
- <td class="theme_background">
622
-
623
- <fieldset id="custom_banner">
624
- <input type="hidden" class="widefat" id="niteoCS-banner-id" name="niteoCS_banner_id" type="text" value="<?php echo esc_attr( $banner_id ); ?>" />
625
- <input id="add-banner" type="button" class="button" value="Media Library" />
626
- <p class="info"><?php _e('Pro Tip! You can select multiple Media from your library by holding CTRL+click (Command+click if you sit on MacOS) while selecting photos.','cmp-coming-soon-maintenance')?></p>
627
- <div class="banner-wrapper">
628
- <?php
629
- if ( isset( $banner_id ) && $banner_id != '' ) {
630
- $ids = explode( ',', $banner_id );
631
- foreach ( $ids as $id ) {
632
- $img = wp_get_attachment_image_src($id, 'large');
633
- if (isset($img[0])) {
634
- echo '<img src="'.$img[0].'" alt="">';
635
- }
636
- }
637
- }
638
- ?>
639
- </div>
640
- <input id="delete-banner" type="button" class="button" value="Remove Media" />
641
- </fieldset>
642
-
643
- <fieldset id="unsplash_banner">
644
- <p class="unplash-description"><a href="http://unsplash.com" target="_blank">Unsplash</a> <?php _e('is a world leading source for free to use high quality stock images. All of the images that are submitted and published on Unsplash fall under under the Creative Commons Zero (CC0) license, which means you can use the image for any personal or commercial use.', 'cmp-coming-soon-maintenance');?></p>
645
- <label for="unsplash_feed"><?php _e('Choose Unsplash Feed', 'cmp-coming-soon-maintenance');?></label></br>
646
- <select name="unsplash_feed">
647
- <option value="0" <?php if ( $unsplash_feed == '0' ) { echo ' selected="selected"'; } ?>><?php _e('Specific Photo', 'cmp-coming-soon-maintenance');?></option>
648
- <option value="1" <?php if ( $unsplash_feed == '1' ) { echo ' selected="selected"'; } ?>><?php _e('Random from Category', 'cmp-coming-soon-maintenance');?></option>
649
- <option value="2" <?php if ( $unsplash_feed == '2' ) { echo ' selected="selected"'; } ?>><?php _e('Random from Collection', 'cmp-coming-soon-maintenance');?></option>
650
- <option value="3" <?php if ( $unsplash_feed == '3' ) { echo ' selected="selected"'; } ?>><?php _e('Random Photo', 'cmp-coming-soon-maintenance');?></option>
651
- </select>
652
-
653
- <p class="unsplash-feed" id="unsplash-feed-0">
654
- <label for="niteoCS_unsplash_0"><?php _e('Enter Unsplash Photo URL or Photo ID', 'cmp-coming-soon-maintenance');?></label>
655
- <input type="text" class="widefat" id="niteoCS-unsplash-0" name="niteoCS_unsplash_0" type="text" value="<?php echo esc_attr($niteoCS_unsplash_0); ?>" />
656
- </p>
657
-
658
- <p class="unsplash-feed" id="unsplash-feed-1">
659
- <label for="unsplash_category"><?php _e('Select Category', 'cmp-coming-soon-maintenance');?></label></br>
660
- <select name="unsplash_category">
661
- <option value="buildings" <?php if ( $unsplash_category == 'buildings') { echo ' selected="selected"'; } ?>><?php _e('Buildings', 'cmp-coming-soon-maintenance');?></option>
662
- <option value="food" <?php if ( $unsplash_category == 'food') { echo ' selected="selected"'; } ?>><?php _e('Food', 'cmp-coming-soon-maintenance');?></option>
663
- <option value="nature" <?php if ( $unsplash_category == 'nature') { echo ' selected="selected"'; } ?>><?php _e('Nature', 'cmp-coming-soon-maintenance');?></option>
664
- <option value="people" <?php if ( $unsplash_category == 'people') { echo ' selected="selected"'; } ?>><?php _e('People', 'cmp-coming-soon-maintenance');?></option>
665
- <option value="technology" <?php if ( $unsplash_category == 'technology') { echo ' selected="selected"'; } ?>><?php _e('Technology', 'cmp-coming-soon-maintenance');?></option>
666
- <option value="objects" <?php if ( $unsplash_category == 'objects') { echo ' selected="selected"'; } ?>><?php _e('Objects', 'cmp-coming-soon-maintenance');?></option>
667
- </select></br>
668
-
669
- <label for="niteoCS_cat_keyword"><?php _e('You can limit Category to Specific Keyword', 'cmp-coming-soon-maintenance');?></label>
670
- <input type="text" class="widefat" id="niteoCS-category-keyword" name="niteoCS_cat_keyword" type="text" value="<?php echo esc_attr($niteoCS_cat_keyword); ?>" />
671
- </p>
672
-
673
- <p class="unsplash-feed" id="unsplash-feed-2">
674
- <label for="niteoCS_unsplash_2"><?php _e('Enter Unsplash Collection URL or Collection ID. Doesn`t work for Curated Collections.', 'cmp-coming-soon-maintenance');?></label>
675
- <input type="text" class="widefat" id="niteoCS-unsplash-2" name="niteoCS_unsplash_2" type="text" value="<?php echo esc_attr($niteoCS_unsplash_2); ?>" />
676
- </p>
677
-
678
- <p class="unsplash-feed" id="unsplash-feed-3">
679
- <label for="niteoCS_unsplash_3"><?php _e('Specify search terms', 'cmp-coming-soon-maintenance');?></label>
680
- <input type="text" class="widefat" id="niteoCS-unsplash-3" name="niteoCS_unsplash_3" type="text" value="<?php echo esc_attr($niteoCS_unsplash_3); ?>" />
681
-
682
- </br>
683
- <input type="checkbox" name="niteoCS_unsplash_feat" id="niteoCS_unsplash_feat" value="1" <?php checked( '1', get_option( 'niteoCS_unsplash_feat', '0' ) ); ?> class="regular-text code"><label for="niteoCS_unsplash_feat"><?php _e('Limit search only to Featured/Curated Photos', 'cmp-coming-soon-maintenance');?></label>
684
- </p>
685
-
686
- <button id="test-unsplash" class="button" data-security="<?php echo esc_attr($ajax_nonce);?>">Test Unsplash</button>
687
- <div id="unsplash-media"></div>
688
- </fieldset>
689
-
690
- <fieldset id="default_banner">
691
- <div class="banner-wrapper default">
692
- <img src="<?php echo esc_url($this->cmp_themeDirPath().$this->cmp_selectedTheme().'/img/'.$this->cmp_selectedTheme().'_banner_large.jpg');?>" alt="Default Media">
693
- </div>
694
- </fieldset>
695
-
696
- <fieldset id="graphic_pattern">
697
- <div class="banner-wrapper default">
698
- <label for="niteoCS_banner_pattern"><?php _e('Select Pattern', 'cmp-coming-soon-maintenance');?></label></br>
699
- <select name="niteoCS_banner_pattern" data-url="<?php echo esc_url(WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/img/patterns/');?>">
700
- <?php
701
- foreach ($patterns as $pattern) { ?>
702
- <option value="<?php echo esc_attr($pattern);?>" <?php if ( $niteoCS_banner_pattern == $pattern ) { echo ' selected="selected"'; } ?>><?php echo esc_html(ucfirst(str_replace('_', ' ', $pattern)));?></option>
703
- <?php
704
- } ?>
705
- <option value="custom" <?php if ( $niteoCS_banner_pattern == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom Pattern...', 'cmp-coming-soon-maintenance');?></option>
706
- </select><br>
707
-
708
- <input type="hidden" class="widefat" id="niteoCS_banner_pattern_custom" name="niteoCS_banner_pattern_custom" type="text" value="<?php echo esc_attr( $niteoCS_banner_pattern_custom ); ?>" />
709
-
710
- <input id="add-pattern" type="button" class="button" value="Media Library" style="display:<?php echo ($niteoCS_banner_pattern == 'custom') ? 'block' : 'none'?>;"/>
711
-
712
- <div class="pattern-preview" style="background-image: url('<?php echo esc_url($pattern_url);?>');"></div>
713
- <span><?php _e('Get more subtle patterns on', 'cmp-coming-soon-maintenance');?> <a href="https://www.toptal.com/designers/subtlepatterns/" target="_blank">Toptal</a>.</span>
714
- </div>
715
- </fieldset>
716
-
717
- <fieldset id="solid_color">
718
- <div class="banner-wrapper default">
719
- <label for="niteoCS_banner_color"><?php _e('Select Color', 'cmp-coming-soon-maintenance');?></label><br>
720
- <input type="text" name="niteoCS_banner_color" id="niteoCS_banner_color" value="<?php echo esc_attr( $niteoCS_banner_color); ?>" data-default-color="#bdc3c7" class="regular-text code"><br>
721
- <div class="color-preview" style="background-color:<?php echo esc_attr( $niteoCS_banner_color); ?>"></div>
722
- </div>
723
- </fieldset>
724
- </td>
725
- </tr>
726
- </table>
727
- <p class="cmp-submit">
728
- <?php wp_nonce_field('save_options','save_options_field'); ?>
729
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
730
- </p>
731
  </div>
732
 
733
  <?php
734
- // include theme slider settings, if exists
735
- if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-slider_settings.php')) {
736
- include ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-slider_settings.php' );
737
- }
738
-
739
- // include theme related settings
740
- if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php')) {
741
- require ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' );
742
  }
743
  ?>
744
 
745
- <div class="table-wrapper content">
746
- <h3><?php _e('Customize Fonts', 'cmp-coming-soon-maintenance');?></h3>
747
- <table class="content">
748
-
749
- <tr>
750
- <th><h4><?php _e('Headings Font', 'cmp-coming-soon-maintenance');?></h4></th>
751
- <td>
752
- <fieldset>
753
- <label for="niteoCS_font_headings"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp-coming-soon-maintenance');?></label></br>
754
- <select name="niteoCS_font_headings">
755
- <?php
756
- foreach ($fonts as $font) { ?>
757
- <option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_headings == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
758
- <?php
759
- } ?>
760
- <option value="custom" <?php if ( $niteoCS_font_headings == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp-coming-soon-maintenance');?></option>
761
- </select><br>
762
- </fieldset>
763
-
764
- <fieldset id="custom_headings_font" <?php if ( $niteoCS_font_headings == 'custom' ) { echo 'style="display:block"'; } ?>>
765
- <label for="niteoCS_font_headings_custom"><?php _e('Enter name of ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
766
- <input type="text" name="niteoCS_font_headings_custom" id="niteoCS_font_headings_custom" value="<?php echo esc_attr( $niteoCS_font_headings_custom); ?>" class="regular-text code">
767
- </fieldset>
768
-
769
- </td>
770
- </tr>
771
-
772
- <tr>
773
- <th><h4><?php _e('Content Font', 'cmp-coming-soon-maintenance');?></h4></th>
774
- <td>
775
- <fieldset>
776
- <label for="niteoCS_font_content"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp-coming-soon-maintenance');?></label></br>
777
- <select name="niteoCS_font_content">
778
- <?php
779
- foreach ($fonts as $font) { ?>
780
- <option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_content == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
781
- <?php
782
- } ?>
783
- <option value="custom" <?php if ( $niteoCS_font_content == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp-coming-soon-maintenance');?></option>
784
- </select><br>
785
- </fieldset>
786
-
787
- <fieldset id="custom_content_font" <?php if ( $niteoCS_font_content == 'custom' ) { echo 'style="display:block"'; } ?>>
788
- <label for="niteoCS_font_content_custom"><?php _e('Enter name of ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
789
- <input type="text" name="niteoCS_font_content_custom" id="niteoCS_font_content_custom" value="<?php echo esc_attr( $niteoCS_font_content_custom); ?>" class="regular-text code">
790
- </fieldset>
791
-
792
- <span>Fonts preview</span>
793
- <div id="font-example-wrapper">
794
- <h3 id="heading-example">Hello, I am your Headings font!</h3>
795
- <p id="content-example">And this is a long paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
796
- </div>
797
-
798
- </td>
799
-
800
- </tr>
801
- </table>
802
- <p class="cmp-submit">
803
- <?php wp_nonce_field('save_options','save_options_field'); ?>
804
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
805
- </p>
806
- </div>
807
-
808
-
809
  <div class="table-wrapper content" id="subscribe-section">
810
  <h3><?php _e('Subscribe Form', 'cmp-coming-soon-maintenance');?></h3>
811
  <table class="content">
 
812
  <tr>
813
  <th>
814
  <fieldset>
@@ -868,7 +709,7 @@ add_thickbox();
868
  <input type="text" name="niteoCS_subscribe_label" id="niteoCS_subscribe_label" value="<?php echo esc_attr($niteoCS_subscribe_label );?>" class="regular-text code">
869
  </label>
870
 
871
- <p><?php _e('Total Subscribers: ', 'cmp-coming-soon-maintenance'); echo $subscriber_list ? count( $subscriber_list ) : '0';?></p>
872
  <p><?php _e('Since last export: ', 'cmp-coming-soon-maintenance'); echo $new_subs;?></p>
873
  <p><?php _e('Last Export Date: ', 'cmp-coming-soon-maintenance'); echo $niteoCS_csv_export_time ? date('Y-m-d\ H:i:s\ ', $niteoCS_csv_export_time) : __('Never exported', 'cmp-coming-soon-maintenance');?></p>
874
  <a href="#generate-mailinglist" id="csv-generate" class="button"><?php _e('Generate CSV', 'cmp-coming-soon-maintenance');?></a>
@@ -877,17 +718,20 @@ add_thickbox();
877
  </td>
878
 
879
  </tr>
 
 
 
 
 
 
 
880
  </table>
881
- <p class="cmp-submit">
882
- <?php wp_nonce_field('save_options','save_options_field'); ?>
883
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
884
- </p>
885
  </div>
886
 
887
  <div class="table-wrapper content" id="social-section">
888
  <h3><?php _e('Social Media', 'cmp-coming-soon-maintenance');?></h3>
889
  <table class="content">
890
-
891
  <tr>
892
  <th><h4><?php _e('Social Section Title', 'cmp-coming-soon-maintenance');?></h4></th>
893
  <td>
@@ -932,9 +776,7 @@ add_thickbox();
932
  <?php
933
  } ?>
934
  </ul>
935
-
936
-
937
-
938
  <ul class="social-inputs">
939
  <span class="label"><?php _e('Position', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Active', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Website URL', 'cmp-coming-soon-maintenance');?></span>
940
  <?php
@@ -963,22 +805,26 @@ add_thickbox();
963
  </tr>
964
 
965
  <?php
966
- // include theme slider settings, if exists
 
967
  if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php')) {
968
  include ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php' );
969
  }
970
  ?>
 
 
 
 
 
 
 
971
  </table>
972
- <p class="cmp-submit">
973
- <?php wp_nonce_field('save_options','save_options_field'); ?>
974
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
975
- </p>
976
  </div>
977
 
978
  <div class="table-wrapper content" id="copyright-section">
979
  <h3><?php _e('Footer Content', 'cmp-coming-soon-maintenance');?></h3>
980
  <table class="content">
981
-
982
  <tr>
983
  <th><h4><?php _e('Copyright', 'cmp-coming-soon-maintenance');?></h4></th>
984
  <td>
@@ -987,23 +833,353 @@ add_thickbox();
987
  </fieldset>
988
  </td>
989
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
990
  </table>
991
- <p class="cmp-submit">
992
- <?php wp_nonce_field('save_options','save_options_field'); ?>
993
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
994
- </p>
995
  </div>
996
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
997
 
998
  <div class="table-wrapper seo">
999
  <h3><?php _e('SEO Settings', 'cmp-coming-soon-maintenance');?></h3>
1000
  <table class="seo">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
 
1002
  <tr class="seo-title">
1003
  <th><h4><?php _e('Header Title', 'cmp-coming-soon-maintenance');?></h4></th>
1004
  <td>
1005
  <fieldset>
1006
- <input type="text" name="niteoCS_title" id="niteoCS_title" value="<?php echo esc_attr( $title); ?>" class="regular-text code">
1007
  </fieldset>
1008
  </td>
1009
  </tr>
@@ -1012,7 +1188,7 @@ add_thickbox();
1012
  <th><h4><?php _e('Description', 'cmp-coming-soon-maintenance');?></h4></th>
1013
  <td>
1014
  <fieldset>
1015
- <textarea name="niteoCS_descr" id="niteoCS_descr" class="code"><?php echo esc_attr( $descr); ?></textarea>
1016
  </fieldset>
1017
  </td>
1018
  </tr>
@@ -1024,16 +1200,20 @@ add_thickbox();
1024
  </fieldset>
1025
  </td>
1026
  </tr>
 
 
 
 
 
 
 
1027
  </table>
1028
- <p class="cmp-submit">
1029
- <?php wp_nonce_field('save_options','save_options_field'); ?>
1030
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1031
- </p>
1032
  </div>
1033
 
1034
  <div class="table-wrapper custom_css">
1035
  <h3><?php _e('Enter Custom CSS', 'cmp-coming-soon-maintenance');?></h3>
1036
  <table class="custom_css">
 
1037
  <tr>
1038
  <td>
1039
  <fieldset>
@@ -1041,18 +1221,23 @@ add_thickbox();
1041
  </fieldset>
1042
  </td>
1043
  </tr>
 
 
 
 
 
 
 
1044
  </table>
1045
- <p class="cmp-submit">
1046
- <?php wp_nonce_field('save_options','save_options_field'); ?>
1047
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1048
- </p>
1049
  </div>
1050
 
1051
  </form>
1052
 
1053
  <div class="upload-plugin comingsoon install">
1054
- <form action="options-general.php?page=cmp-settings" class="wp-upload-form" method="post" enctype="multipart/form-data">
1055
  <table class="install">
 
1056
  <tr>
1057
  <td>
1058
  <h3><?php _e('Install New CMP Coming Soon & Maintenance Theme', 'cmp-coming-soon-maintenance');?></h3>
@@ -1066,9 +1251,34 @@ add_thickbox();
1066
  <input id="install-theme" type="submit" value="Install Theme" name="submit_theme">
1067
  </td>
1068
  </tr>
 
1069
  </table>
1070
 
1071
  </form>
1072
  </div>
1073
 
1074
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  }
9
  }
10
 
11
+ if ( isset($_POST['select_theme']) && in_array($_POST['select_theme'], $this->theme_array)) {
12
+ update_option('niteoCS_theme', sanitize_text_field($_POST['select_theme']));
13
+ }
14
+
15
+ $themeslug = $this->cmp_selectedTheme();
16
+
17
+ if (isset($_POST['niteoCS_logo_id_'.$themeslug]) && ( is_numeric($_POST['niteoCS_logo_id_'.$themeslug]) || empty($_POST['niteoCS_logo_id_'.$themeslug]))) {
18
+ update_option('niteoCS_logo_id['.$themeslug.']', sanitize_text_field($_POST['niteoCS_logo_id_'.$themeslug]));
19
+ }
20
+ if (isset($_POST['niteoCS_logo_type_'.$themeslug])) {
21
+ update_option('niteoCS_logo_type['.$themeslug.']', sanitize_text_field($_POST['niteoCS_logo_type_'.$themeslug]));
22
+ }
23
+
24
+ if (isset($_POST['niteoCS_text_logo_'.$themeslug])) {
25
+ update_option('niteoCS_text_logo['.$themeslug.']', sanitize_text_field($_POST['niteoCS_text_logo_'.$themeslug]));
26
+ }
27
+
28
+
29
+ if (isset($_POST['niteoCS_font_headings_'.$themeslug])) {
30
+ update_option('niteoCS_font_headings['.$themeslug.']', sanitize_text_field($_POST['niteoCS_font_headings_'.$themeslug]));
31
+ }
32
+
33
+ if (isset($_POST['niteoCS_font_content_'.$themeslug])) {
34
+ update_option('niteoCS_font_content['.$themeslug.']', sanitize_text_field($_POST['niteoCS_font_content_'.$themeslug]));
35
+ }
36
+ if (isset($_POST['niteoCS_font_headings_custom_'.$themeslug])) {
37
+ update_option('niteoCS_font_headings_custom['.$themeslug.']', ucwords( sanitize_text_field($_POST['niteoCS_font_headings_custom_'.$themeslug]) ) );
38
+ }
39
+
40
+ if (isset($_POST['niteoCS_font_content_custom_'.$themeslug])) {
41
+ update_option('niteoCS_font_content_custom['.$themeslug.']', ucwords( sanitize_text_field($_POST['niteoCS_font_content_custom_'.$themeslug]) ) );
42
  }
43
 
44
+
45
+ if (isset($_POST['niteoCS_banner_'.$themeslug]) && is_numeric($_POST['niteoCS_banner_'.$themeslug])) {
46
+ update_option('niteoCS_banner['.$themeslug.']', sanitize_text_field($_POST['niteoCS_banner_'.$themeslug]));
47
  }
48
 
49
+ if (isset($_POST['niteoCS_banner_color_'.$themeslug])) {
50
+ update_option('niteoCS_banner_color['.$themeslug.']', sanitize_text_field($_POST['niteoCS_banner_color_'.$themeslug]));
51
  }
52
+
53
+ if (isset($_POST['niteoCS_banner_pattern_'.$themeslug])) {
54
+ update_option('niteoCS_banner_pattern['.$themeslug.']', sanitize_text_field($_POST['niteoCS_banner_pattern_'.$themeslug]));
55
  }
56
 
57
+ if (isset($_POST['niteoCS_banner_pattern_custom_'.$themeslug])) {
58
+ update_option('niteoCS_banner_pattern_custom['.$themeslug.']', esc_url_raw($_POST['niteoCS_banner_pattern_custom_'.$themeslug]));
59
  }
60
 
61
 
62
+ if (isset($_POST['niteoCS_banner_id_'.$themeslug])) {
63
  $allnums = true;
64
 
65
+ $ids = explode( ',', $_POST['niteoCS_banner_id_'.$themeslug] );
66
  foreach ( $ids as $id ) {
67
 
68
  if ( !is_numeric($id) ) {
70
  }
71
  }
72
 
73
+ if ( $allnums === true || $_POST['niteoCS_banner_id_'.$themeslug] == '' ) {
74
+ update_option('niteoCS_banner_id['.$themeslug.']', sanitize_text_field($_POST['niteoCS_banner_id_'.$themeslug]));
75
  }
76
 
77
  }
78
 
79
+ if (isset($_POST['unsplash_feed_'.$themeslug]) && is_numeric($_POST['unsplash_feed_'.$themeslug])) {
80
+ update_option('niteoCS_unsplash_feed['.$themeslug.']', sanitize_text_field($_POST['unsplash_feed_'.$themeslug]));
81
  }
82
 
83
+ if (isset($_POST['niteoCS_unsplash_0_'.$themeslug])) {
84
+ $url = $_POST['niteoCS_unsplash_0_'.$themeslug];
85
  // if we have url sanitize url
86
  if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) {
87
+ update_option('niteoCS_unsplash_0['.$themeslug.']', esc_url_raw($_POST['niteoCS_unsplash_0_'.$themeslug]));
88
  } else {
89
  // sanitize string
90
+ update_option('niteoCS_unsplash_0['.$themeslug.']', sanitize_text_field($_POST['niteoCS_unsplash_0_'.$themeslug]));
91
  }
92
  }
93
 
94
+ if (isset($_POST['niteoCS_unsplash_2_'.$themeslug])) {
95
+ $url = $_POST['niteoCS_unsplash_2_'.$themeslug];
96
  // if we have url sanitize url
97
  if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) {
98
+ update_option('niteoCS_unsplash_2['.$themeslug.']', esc_url_raw($_POST['niteoCS_unsplash_2_'.$themeslug]));
99
  } else {
100
  // sanitize string
101
+ update_option('niteoCS_unsplash_2['.$themeslug.']', sanitize_text_field($_POST['niteoCS_unsplash_2_'.$themeslug]));
102
  }
103
  }
104
 
105
+ if (isset($_POST['niteoCS_unsplash_3_'.$themeslug])) {
106
+ update_option('niteoCS_unsplash_3['.$themeslug.']', sanitize_text_field($_POST['niteoCS_unsplash_3_'.$themeslug]));
107
  }
108
 
109
+ if (isset($_POST['unsplash_category_'.$themeslug])) {
110
+ update_option('niteoCS_unsplash_category['.$themeslug.']', sanitize_text_field($_POST['unsplash_category_'.$themeslug]));
111
  }
112
+ if (isset($_POST['niteoCS_cat_keyword_'.$themeslug])) {
113
+ update_option('niteoCS_cat_keyword['.$themeslug.']', sanitize_text_field($_POST['niteoCS_cat_keyword_'.$themeslug]));
114
  }
115
 
116
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
117
 
118
+ if (isset($_POST['niteoCS_unsplash_feat_'.$themeslug])) {
119
+ update_option('niteoCS_unsplash_feat', $this->sanitize_checkbox($_POST['niteoCS_unsplash_feat_'.$themeslug]));
120
  } else {
121
+ update_option('niteoCS_unsplash_feat['.$themeslug.']', false);
122
  }
123
 
124
  }
125
 
126
+ if (isset($_POST['niteoCS_favicon_id']) && ( is_numeric($_POST['niteoCS_favicon_id']) || empty($_POST['niteoCS_favicon_id']))) {
127
+ update_option('niteoCS_favicon_id', sanitize_text_field($_POST['niteoCS_favicon_id']));
128
+ }
129
+
130
 
131
  if (isset($_POST['niteoCS_title'])) {
132
  update_option('niteoCS_title', sanitize_text_field($_POST['niteoCS_title']));
144
  update_option('niteoCS_custom_css', $_POST['niteoCS_custom_css']);
145
  }
146
 
147
+
 
 
148
 
149
  if (isset($_POST['niteoCS_subscribe_type']) && is_numeric($_POST['niteoCS_subscribe_type'])) {
150
  update_option('niteoCS_subscribe_type', sanitize_text_field($_POST['niteoCS_subscribe_type']));
154
  update_option('niteoCS_subscribe_label', sanitize_text_field($_POST['niteoCS_subscribe_label']));
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
157
 
 
 
 
158
 
159
  if (isset($_POST['niteoCS_soc_title'])) {
160
  update_option('niteoCS_soc_title', sanitize_text_field($_POST['niteoCS_soc_title']));
183
  update_option('niteoCS_copyright', $this->niteo_sanitize_html( $_POST['niteoCS_copyright']));
184
  }
185
 
186
+ if (isset($_POST['niteoCS_URL_redirect'])) {
187
+ update_option('niteoCS_URL_redirect', esc_url_raw( $_POST['niteoCS_URL_redirect']));
188
+ }
189
+
190
+
191
+
192
 
193
  $ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
194
+
195
+ // get Settings TAB
196
+ $premium_themes = $this->cmp_plugin_premium();
197
+ $niteoCS_URL_redirect = get_option('niteoCS_URL_redirect');
198
+
199
+ // get Content Settings
200
+ $niteoCS_body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
201
+ $niteoCS_body = get_option('niteoCS_body');
202
+ $niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
 
 
 
 
 
 
 
 
 
203
  $niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
204
+ $niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
205
+ // get subscribe settings
206
  $niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '2');
207
  $niteoCS_subscribe_code = get_option('niteoCS_subscribe_code');
208
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
209
+ $niteoCS_subscribers_list = get_option('niteoCS_subscribers_list');
210
  $niteoCS_csv_export_time = get_option('niteoCS_csv_export_time');
211
+ // get SEO
212
+ $niteoCS_favicon_id = get_option('niteoCS_favicon_id');
213
+ $niteoCS_title = stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!'));
214
+ $niteoCS_descr = stripslashes(get_option('niteoCS_descr', 'Just another Coming Soon Page'));
215
+ $niteoCS_analytics = stripslashes(get_option('niteoCS_analytics', ''));
216
+ // get Custom CSS
217
+ $niteoCS_custom_css = stripslashes(get_option('niteoCS_custom_css', ''));
218
+
219
+ //get theme specific settings
220
+ $niteoCS_logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
221
+ $niteoCS_logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
222
+ $niteoCS_text_logo = get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' ));
223
+ $niteoCS_font_content_custom = get_option('niteoCS_font_content_custom['.$themeslug.']', '');
224
+ $niteoCS_font_headings_custom = get_option('niteoCS_font_headings_custom['.$themeslug.']', '');
225
+
226
+ $niteoCS_banner_custom_id = get_option('niteoCS_banner_id['.$themeslug.']');
227
+ $niteoCS_unsplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '3');
228
+ $niteoCS_unsplash_0 = get_option('niteoCS_unsplash_0['.$themeslug.']');
229
+ $niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2['.$themeslug.']');
230
+ $niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3['.$themeslug.']');
231
+ $niteoCS_unsplash_category = get_option('niteoCS_unsplash_category['.$themeslug.']', 'buildings');
232
+ $niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
233
+ $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
234
+ $niteoCS_banner_pattern_custom = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
235
+ $niteoCS_cat_keyword = get_option('niteoCS_cat_keyword['.$themeslug.']');
236
+
237
+
238
+ //include theme defaults
239
+ if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
240
+ include ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php' );
241
+ }
242
+
243
+
244
+ // load old settings for a case when theme is not upgraded yet
245
+ if (!isset($niteoCS_banner)) $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']');
246
+ if (!isset($niteoCS_font_headings)) $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']');
247
+ if (!isset($niteoCS_font_content)) $niteoCS_font_content = get_option('niteoCS_font_content['.$themeslug.']');
248
 
249
 
250
  // get logo url from id
251
+ if ( $niteoCS_logo_id != '' ) {
252
+ $logo_url = wp_get_attachment_image_src($niteoCS_logo_id, 'medium');
253
  if ( isset($logo_url[0]) ){
254
  $logo_url = $logo_url[0];
255
  }
256
  }
257
 
258
+
259
+ // get favicon url from id
260
+ if ( $niteoCS_favicon_id != '' ) {
261
+ $niteoCS_favicon_url = wp_get_attachment_image_src($niteoCS_favicon_id, 'thumbnail');
262
+ if ( isset($niteoCS_favicon_url[0]) ){
263
+ $niteoCS_favicon_url = $niteoCS_favicon_url[0];
264
+ }
265
+ }
266
+
267
  // get logo url from id
268
  if ( $niteoCS_banner_pattern == 'custom' && $niteoCS_banner_pattern_custom != '' ) {
269
  $pattern_url = $niteoCS_banner_pattern_custom;
270
 
271
  } else {
272
+ $pattern_url = plugins_url('/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png', __FILE__);
273
  }
274
 
275
 
276
  // count new subscribers
277
  $new_subs = array();
278
 
279
+ if ( $niteoCS_subscribers_list ) {
280
+ foreach ($niteoCS_subscribers_list as $subscriber) {
281
 
282
  if ( $subscriber['timestamp'] > $niteoCS_csv_export_time )
283
  array_push($new_subs, $subscriber['email']);
352
  <div id="icon-options-general" class="icon32">
353
  <br />
354
  </div>
355
+ <form method="post" action="admin.php?page=cmp-settings&status=settings-saved" id="csoptions">
356
 
357
  <h2 class="nav-tab-wrapper">
358
+ <a class="nav-tab nav-tab-active general" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
359
+
360
+ <a class="nav-tab content" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="content"><i class="fa fa-pencil-square-o" aria-hidden="true"></i><?php _e('Global Content', 'cmp-coming-soon-maintenance');?></a>
361
+
362
+ <a class="nav-tab theme-setup" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="theme-setup"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Theme Setup', 'cmp-coming-soon-maintenance');?></a>
363
+
364
+ <a class="nav-tab seo" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="seo"><i class="fa fa-users" aria-hidden="true"></i><?php _e('SEO', 'cmp-coming-soon-maintenance');?></a>
365
+
366
+ <a class="nav-tab custom_css" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp-coming-soon-maintenance');?></a>
367
+
368
  <a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp-coming-soon-maintenance');?></a>
369
+
370
+ <a class="nav-tab install" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="install"><i class="fa fa-plus" aria-hidden="true"></i><?php _e('Install New Theme', 'cmp-coming-soon-maintenance');?></a>
371
  </h2>
372
 
373
+ <div class="cmp-settings-wrapper">
374
+
375
+ <div class="cmp-inputs-wrapper">
376
+
377
  <div class="table-wrapper general">
378
  <h3><?php _e('General Settings', 'cmp-coming-soon-maintenance');?></h3>
379
  <table class="general">
380
+ <tbody>
381
  <tr>
382
  <th><h4><?php _e('Status', 'cmp-coming-soon-maintenance');?></h4></th>
383
  <td>
384
+ <fieldset class="cmp-status">
385
+
386
  <legend class="screen-reader-text">
387
  <span><?php _e('Status', 'cmp-coming-soon-maintenance');?></span>
388
  </legend>
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
+ <legend title="disabled" <?php echo ($this->cmp_status() == 0) ? 'class="active"' : '';?>>
391
+ <input type="radio" name="activate" value="0" <?php echo ($this->cmp_status() == 0) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?><br>
392
+ <span class="info"><?php _e('Disable plugin and display standard WordPress page to all users and indexing engines.','cmp-coming-soon-maintenance')?></span>
393
+ </legend><br>
394
+
395
+ <legend title="cmp" <?php echo ($this->cmp_status() == 2) ? 'class="active"' : '';?>>
396
+ <input type="radio" name="activate" value="2" <?php echo ($this->cmp_status() == 2) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Coming Soon & Landing Page', 'cmp-coming-soon-maintenance');?><br>
397
+ <span class="info"><?php _e('Returns standard 200 HTTP OK response code to indexing robots. Set this option if you want to use our plugin as "Coming Soon" page.','cmp-coming-soon-maintenance')?></span>
398
+ </legend><br>
399
+
400
+ <legend title="maintanance" <?php echo ($this->cmp_status() == 1) ? 'class="active"' : '';?>>
401
+ <input type="radio" name="activate" value="1" <?php echo ($this->cmp_status() == 1) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Maintanance Mode', 'cmp-coming-soon-maintenance');?><br>
402
+ <span class="info"><?php _e('Returns 503 HTTP Service unavailable code to indexing robots. Set this option if your site is down due to maintanance and you want to display Maintanance page.','cmp-coming-soon-maintenance')?></span>
403
+ </legend><br>
404
+
405
+ <legend title="maintanance" <?php echo ($this->cmp_status() == 3) ? 'class="active"' : '';?>>
406
+ <input type="radio" name="activate" value="3" <?php echo ($this->cmp_status() == 3) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Redirect Mode', 'cmp-coming-soon-maintenance');?><br>
407
+ <span class="info redirect"><?php _e('Choose Redirect Mode if you want to redirect your website to another URL.','cmp-coming-soon-maintenance')?></span>
408
+ <input type="text" id="niteoCS_URL_redirect" name="niteoCS_URL_redirect" value="<?php echo esc_url( $niteoCS_URL_redirect); ?>" class="regular-text code" <?php echo ($this->cmp_status() == 3) ? '' : 'disabled';?>><br>
409
+ </legend>
410
+
411
  </fieldset>
412
  </td>
413
  </tr>
414
+ <tr><th>
415
+ <p class="cmp-submit">
416
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
417
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
418
+ </p>
419
+ </th></tr>
420
+ </tbody>
421
  </table>
422
+
 
 
 
423
  </div>
424
 
425
  <div class="table-wrapper general">
454
  }
455
 
456
  // get thumbnail
457
+ $thumbnail = plugins_url('/themes/'. $theme_slug . '/img/'. $theme_slug . '_thumbnail.jpg', __FILE__);
458
 
459
  // get theme version
460
  $version = '';
497
  </fieldset>
498
  </td>
499
  </tr>
500
+ <tr><th>
501
+ <p class="cmp-submit">
502
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
503
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
504
+ </p>
505
+ </th></tr>
506
+ </tbody>
507
  </table>
508
+
 
 
 
509
  </div>
510
  <?php
511
  if ( !empty($premium_themes) ) { ?>
512
  <div class="table-wrapper general">
513
  <h3><?php _e('Premium Themes', 'cmp-coming-soon-maintenance');?></h3>
514
  <table class="general theme-selector">
515
+ <tbody>
516
  <tr>
517
  <td class="theme-selector">
518
  <fieldset>
533
  if ( !in_array( $theme_slug, $this->theme_array) ) {
534
  $purchased = false;
535
  $version = '';
536
+ $thumbnail = plugins_url('/themes/'. $theme_slug. '_thumbnail.jpg', __FILE__);
537
 
538
  }
539
 
565
 
566
  <?php
567
  if ($purchased === true) { ?>
568
+ <div class="button theme-select hide <?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo 'activated'; } ?>">
569
  <input type="radio" name="select_theme" value="<?php echo esc_attr($theme_slug);?>" id="displayOption-<?php echo esc_attr($theme_slug);?>"<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' checked="checked"'; } ?>>
570
  <span class="input-label"><?php if ( $this->cmp_selectedTheme() == $theme_slug ) { _e('Active', 'cmp-coming-soon-maintenance'); } else { _e('Select', 'cmp-coming-soon-maintenance'); }?></span>
571
  </div>
572
 
573
  <?php
 
 
 
 
 
574
  // echo update button if update is available
575
  if ( $theme_update === true ) { ?>
576
  <button type="button" class="theme-update button hide"><i class="fa fa-refresh" aria-hidden="true"></i><?php _e('Update', 'cmp-coming-soon-maintenance');?></button>
596
  <?php
597
  } // if !empty($premium_themes ?>
598
 
599
+ <tr><th>
600
+ <p class="cmp-submit">
601
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
602
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
603
+ </p>
604
+ </th></tr>
605
+ </tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
  </table>
607
+ <div class="theme-overlay cmp"></div>
 
 
 
608
  </div>
609
 
610
  <div class="table-wrapper content">
611
  <h3><?php _e('Content', 'cmp-coming-soon-maintenance');?></h3>
612
  <table class="content">
613
+ <tbody>
614
  <tr class="body-title">
615
  <th><h4><?php _e('Title', 'cmp-coming-soon-maintenance');?></h4></th>
616
  <td>
623
  <tr>
624
  <th><h4><?php _e('Message', 'cmp-coming-soon-maintenance');?></h4></th>
625
  <td>
626
+ <?php wp_editor( stripslashes( $this->niteo_sanitize_html( $niteoCS_body ) ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
627
  </td>
628
  </tr>
629
+ <tr><th>
630
+ <p class="cmp-submit">
631
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
632
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
633
+ </p>
634
+ </th></tr>
635
+ </tbody>
636
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  </div>
639
 
640
  <?php
641
+ // get countdown settings if in countdown array themes
642
+ if ( in_array($this->cmp_selectedTheme(), $this->countdown_themes) ){
643
+ if ( file_exists(dirname(__FILE__) . '/inc/settings-counter.php') ) {
644
+ require (dirname(__FILE__) . '/inc/settings-counter.php');
645
+ }
 
 
 
646
  }
647
  ?>
648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  <div class="table-wrapper content" id="subscribe-section">
650
  <h3><?php _e('Subscribe Form', 'cmp-coming-soon-maintenance');?></h3>
651
  <table class="content">
652
+ <tbody>
653
  <tr>
654
  <th>
655
  <fieldset>
709
  <input type="text" name="niteoCS_subscribe_label" id="niteoCS_subscribe_label" value="<?php echo esc_attr($niteoCS_subscribe_label );?>" class="regular-text code">
710
  </label>
711
 
712
+ <p><?php _e('Total Subscribers: ', 'cmp-coming-soon-maintenance'); echo $niteoCS_subscribers_list ? count( $niteoCS_subscribers_list ) : '0';?></p>
713
  <p><?php _e('Since last export: ', 'cmp-coming-soon-maintenance'); echo $new_subs;?></p>
714
  <p><?php _e('Last Export Date: ', 'cmp-coming-soon-maintenance'); echo $niteoCS_csv_export_time ? date('Y-m-d\ H:i:s\ ', $niteoCS_csv_export_time) : __('Never exported', 'cmp-coming-soon-maintenance');?></p>
715
  <a href="#generate-mailinglist" id="csv-generate" class="button"><?php _e('Generate CSV', 'cmp-coming-soon-maintenance');?></a>
718
  </td>
719
 
720
  </tr>
721
+ <tr><th>
722
+ <p class="cmp-submit">
723
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
724
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
725
+ </p>
726
+ </th></tr>
727
+ </tbody>
728
  </table>
 
 
 
 
729
  </div>
730
 
731
  <div class="table-wrapper content" id="social-section">
732
  <h3><?php _e('Social Media', 'cmp-coming-soon-maintenance');?></h3>
733
  <table class="content">
734
+ <tbody>
735
  <tr>
736
  <th><h4><?php _e('Social Section Title', 'cmp-coming-soon-maintenance');?></h4></th>
737
  <td>
776
  <?php
777
  } ?>
778
  </ul>
779
+
 
 
780
  <ul class="social-inputs">
781
  <span class="label"><?php _e('Position', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Active', 'cmp-coming-soon-maintenance');?></span><span class="label"><?php _e('Website URL', 'cmp-coming-soon-maintenance');?></span>
782
  <?php
805
  </tr>
806
 
807
  <?php
808
+
809
+ // include social special settings
810
  if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php')) {
811
  include ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-social_settings.php' );
812
  }
813
  ?>
814
+ <tr><th>
815
+ <p class="cmp-submit">
816
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
817
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
818
+ </p>
819
+ </th></tr>
820
+ </tbody>
821
  </table>
 
 
 
 
822
  </div>
823
 
824
  <div class="table-wrapper content" id="copyright-section">
825
  <h3><?php _e('Footer Content', 'cmp-coming-soon-maintenance');?></h3>
826
  <table class="content">
827
+ <tbody>
828
  <tr>
829
  <th><h4><?php _e('Copyright', 'cmp-coming-soon-maintenance');?></h4></th>
830
  <td>
833
  </fieldset>
834
  </td>
835
  </tr>
836
+ <tr><th>
837
+ <p class="cmp-submit">
838
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
839
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
840
+ </p>
841
+ </th></tr>
842
+ </tbody>
843
+ </table>
844
+ </div>
845
+
846
+ <div class="table-wrapper theme-setup">
847
+ <h3><?php _e('Logo Setup', 'cmp-coming-soon-maintenance');?></h3>
848
+ <table class="theme-setup">
849
+ <tbody>
850
+ <tr>
851
+ <th>
852
+ <fieldset>
853
+ <legend class="screen-reader-text">
854
+ <span><?php _e('Logo setup', 'cmp-coming-soon-maintenance');?></span>
855
+ </legend>
856
+
857
+ <p>
858
+ <label title="<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>">
859
+ <input type="radio" class="niteoCS-logo-type" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="text"<?php if ( $niteoCS_logo_type == 'text') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>
860
+ </label>
861
+ </p>
862
+
863
+ <p>
864
+ <label title="<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>">
865
+ <input type="radio" class="niteoCS-logo-type" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="graphic"<?php if ( $niteoCS_logo_type == 'graphic') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>
866
+ </label>
867
+ </p>
868
+
869
+ <p>
870
+ <label title="<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>">
871
+ <input type="radio" class="niteoCS-logo-type" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="disabled"<?php if ( $niteoCS_logo_type == 'disabled') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
872
+ </label>
873
+ </p>
874
+
875
+ </fieldset>
876
+ </th>
877
+
878
+ <td>
879
+ <fieldset class="text-logo" <?php echo ( $niteoCS_logo_type != 'text') ? 'style="display:none"' : '';?>>
880
+
881
+ <p>
882
+ <input type="text" class="widefat" id="niteoCS-text-logo" name="niteoCS_text_logo_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_text_logo); ?>" />
883
+ </p>
884
+ </fieldset>
885
+
886
+ <fieldset class="graphic-logo" <?php echo ( $niteoCS_logo_type != 'graphic') ? 'style="display:none"' : '';?>>
887
+
888
+ <input type="hidden" class="widefat" id="niteoCS-logo-id" name="niteoCS_logo_id_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr( $niteoCS_logo_id ); ?>" />
889
+ <input id="add-logo" type="button" class="button" value="Select Logo" />
890
+
891
+ <div class="logo-wrapper">
892
+ <?php
893
+ if ( isset($logo_url) && $logo_url !== '' ) {
894
+ echo '<img src="'.esc_url($logo_url).'" alt="">';
895
+ } ?>
896
+ </div>
897
+ <input id="delete-logo" type="button" class="button" value="Remove Logo" />
898
+
899
+ </fieldset>
900
+
901
+ <p class="disabled-logo" <?php echo ( $niteoCS_logo_type != 'disabled') ? 'style="display:none"' : '';?>><?php _e('Logo is disabled', 'cmp-coming-soon-maintenance');?></p>
902
+ </td>
903
+ </tr>
904
+ <tr><th>
905
+ <p class="cmp-submit">
906
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
907
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
908
+ </p>
909
+ </th></tr>
910
+ </tbody>
911
  </table>
 
 
 
 
912
  </div>
913
 
914
+ <div class="table-wrapper theme-setup">
915
+ <h3><?php _e('Graphic Background', 'cmp-coming-soon-maintenance');?></h3>
916
+ <table class="theme-setup">
917
+ <tbody>
918
+ <tr>
919
+ <th>
920
+ <fieldset>
921
+ <legend class="screen-reader-text">
922
+ <span><?php _e('Banner Settings', 'cmp-coming-soon-maintenance');?></span>
923
+ </legend>
924
+
925
+ <p>
926
+ <label title="Custom Media">
927
+ <input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="0"<?php if ( $niteoCS_banner == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Custom Media', 'cmp-coming-soon-maintenance');?>
928
+ </label>
929
+ </p>
930
+
931
+ <p>
932
+ <label title="Unsplash Media">
933
+ <input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="1"<?php if ( $niteoCS_banner == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Unsplash library', 'cmp-coming-soon-maintenance');?>
934
+ </label>
935
+ </p>
936
+
937
+ <p>
938
+ <label title="Default Banner">
939
+ <input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Default Media', 'cmp-coming-soon-maintenance');?>
940
+ </label>
941
+ </p>
942
+ <p>
943
+ <label title="Graphic Pattern">
944
+ <input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="3"<?php if ( $niteoCS_banner == 3) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Graphic Pattern', 'cmp-coming-soon-maintenance');?>
945
+ </label>
946
+ </p>
947
+ <p>
948
+ <label title="Solid Color">
949
+ <input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="4"<?php if ( $niteoCS_banner == 4) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Solid Color', 'cmp-coming-soon-maintenance');?>
950
+ </label>
951
+ </p>
952
+
953
+ </fieldset>
954
+ </th>
955
+
956
+ <td class="theme_background">
957
+
958
+ <fieldset id="custom_banner">
959
+ <input type="hidden" class="widefat" id="niteoCS-banner-id" name="niteoCS_banner_id_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr( $niteoCS_banner_custom_id ); ?>" />
960
+ <input id="add-banner" type="button" class="button" value="Media Library" />
961
+ <p class="info"><?php _e('Pro Tip! You can select multiple Media from your library by holding CTRL+click (Command+click if you sit on MacOS) while selecting photos.','cmp-coming-soon-maintenance')?></p>
962
+ <div class="banner-wrapper">
963
+ <?php
964
+ if ( isset( $niteoCS_banner_custom_id ) && $niteoCS_banner_custom_id != '' ) {
965
+ $ids = explode( ',', $niteoCS_banner_custom_id );
966
+ foreach ( $ids as $id ) {
967
+ $img = wp_get_attachment_image_src($id, 'large');
968
+ if (isset($img[0])) {
969
+ echo '<img src="'.$img[0].'" alt="">';
970
+ }
971
+ }
972
+ }
973
+ ?>
974
+ </div>
975
+ <input id="delete-banner" type="button" class="button" value="Remove Media" />
976
+ </fieldset>
977
+
978
+ <fieldset id="unsplash_banner">
979
+ <p class="unplash-description"><a href="http://unsplash.com" target="_blank">Unsplash</a> <?php _e('is a world leading source for free to use high quality stock images. All of the images that are submitted and published on Unsplash fall under under the Creative Commons Zero (CC0) license, which means you can use the image for any personal or commercial use.', 'cmp-coming-soon-maintenance');?></p>
980
+ <label for="unsplash_feed_<?php echo esc_attr($themeslug);?>"><?php _e('Choose Unsplash Feed', 'cmp-coming-soon-maintenance');?></label></br>
981
+ <select name="unsplash_feed_<?php echo esc_attr($themeslug);?>">
982
+ <option value="0" <?php if ( $niteoCS_unsplash_feed == '0' ) { echo ' selected="selected"'; } ?>><?php _e('Specific Photo', 'cmp-coming-soon-maintenance');?></option>
983
+ <option value="1" <?php if ( $niteoCS_unsplash_feed == '1' ) { echo ' selected="selected"'; } ?>><?php _e('Random from Category', 'cmp-coming-soon-maintenance');?></option>
984
+ <option value="2" <?php if ( $niteoCS_unsplash_feed == '2' ) { echo ' selected="selected"'; } ?>><?php _e('Random from Collection', 'cmp-coming-soon-maintenance');?></option>
985
+ <option value="3" <?php if ( $niteoCS_unsplash_feed == '3' ) { echo ' selected="selected"'; } ?>><?php _e('Random Photo', 'cmp-coming-soon-maintenance');?></option>
986
+ </select>
987
+
988
+ <p class="unsplash-feed" id="unsplash-feed-0">
989
+ <label for="niteoCS_unsplash_0_<?php echo esc_attr($themeslug);?>"><?php _e('Enter Unsplash Photo URL or Photo ID', 'cmp-coming-soon-maintenance');?></label>
990
+ <input type="text" class="widefat" id="niteoCS-unsplash-0" name="niteoCS_unsplash_0_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_0); ?>" />
991
+ </p>
992
+
993
+ <p class="unsplash-feed" id="unsplash-feed-1">
994
+ <label for="unsplash_category_<?php echo esc_attr($themeslug);?>"><?php _e('Select Category', 'cmp-coming-soon-maintenance');?></label></br>
995
+ <select name="unsplash_category_<?php echo esc_attr($themeslug);?>">
996
+ <option value="buildings" <?php if ( $niteoCS_unsplash_category == 'buildings') { echo ' selected="selected"'; } ?>><?php _e('Buildings', 'cmp-coming-soon-maintenance');?></option>
997
+ <option value="food" <?php if ( $niteoCS_unsplash_category == 'food') { echo ' selected="selected"'; } ?>><?php _e('Food', 'cmp-coming-soon-maintenance');?></option>
998
+ <option value="nature" <?php if ( $niteoCS_unsplash_category == 'nature') { echo ' selected="selected"'; } ?>><?php _e('Nature', 'cmp-coming-soon-maintenance');?></option>
999
+ <option value="people" <?php if ( $niteoCS_unsplash_category == 'people') { echo ' selected="selected"'; } ?>><?php _e('People', 'cmp-coming-soon-maintenance');?></option>
1000
+ <option value="technology" <?php if ( $niteoCS_unsplash_category == 'technology') { echo ' selected="selected"'; } ?>><?php _e('Technology', 'cmp-coming-soon-maintenance');?></option>
1001
+ <option value="objects" <?php if ( $niteoCS_unsplash_category == 'objects') { echo ' selected="selected"'; } ?>><?php _e('Objects', 'cmp-coming-soon-maintenance');?></option>
1002
+ </select></br>
1003
+
1004
+ <label for="niteoCS_cat_keyword"><?php _e('You can limit Category to Specific Keyword', 'cmp-coming-soon-maintenance');?></label>
1005
+ <input type="text" class="widefat" id="niteoCS-category-keyword" name="niteoCS_cat_keyword_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_cat_keyword); ?>" />
1006
+ </p>
1007
+
1008
+ <p class="unsplash-feed" id="unsplash-feed-2">
1009
+ <label for="niteoCS_unsplash_2_<?php echo esc_attr($themeslug);?>"><?php _e('Enter Unsplash Collection URL or Collection ID. Doesn`t work for Curated Collections.', 'cmp-coming-soon-maintenance');?></label>
1010
+ <input type="text" class="widefat" id="niteoCS-unsplash-2" name="niteoCS_unsplash_2_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_2); ?>" />
1011
+ </p>
1012
+
1013
+ <p class="unsplash-feed" id="unsplash-feed-3">
1014
+ <label for="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>"><?php _e('Specify search terms', 'cmp-coming-soon-maintenance');?></label>
1015
+ <input type="text" class="widefat" id="niteoCS-unsplash-3" name="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_3); ?>" />
1016
+
1017
+ </br>
1018
+ <input type="checkbox" name="niteoCS_unsplash_feat_<?php echo esc_attr($themeslug);?>" id="niteoCS_unsplash_feat" value="1" <?php checked( '1', get_option( 'niteoCS_unsplash_feat', '0' ) ); ?> class="regular-text code"><label for="niteoCS_unsplash_feat"><?php _e('Limit search only to Featured/Curated Photos', 'cmp-coming-soon-maintenance');?></label>
1019
+ </p>
1020
+
1021
+ <button id="test-unsplash" class="button" data-security="<?php echo esc_attr($ajax_nonce);?>">Test Unsplash</button>
1022
+ <div id="unsplash-media"></div>
1023
+ </fieldset>
1024
+
1025
+ <fieldset id="default_banner">
1026
+ <div class="banner-wrapper default">
1027
+ <img src="<?php echo esc_url($this->cmp_themeDirPath().$this->cmp_selectedTheme().'/img/'.$this->cmp_selectedTheme().'_banner_large.jpg');?>" alt="Default Media">
1028
+ </div>
1029
+ </fieldset>
1030
+
1031
+ <fieldset id="graphic_pattern">
1032
+ <div class="banner-wrapper default">
1033
+ <label for="niteoCS_banner_pattern_<?php echo esc_attr($themeslug);?>"><?php _e('Select Pattern', 'cmp-coming-soon-maintenance');?></label></br>
1034
+ <select name="niteoCS_banner_pattern_<?php echo esc_attr($themeslug);?>" data-url="<?php echo esc_url(WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/img/patterns/');?>">
1035
+ <?php
1036
+ foreach ($patterns as $pattern) { ?>
1037
+ <option value="<?php echo esc_attr($pattern);?>" <?php if ( $niteoCS_banner_pattern == $pattern ) { echo ' selected="selected"'; } ?>><?php echo esc_html(ucfirst(str_replace('_', ' ', $pattern)));?></option>
1038
+ <?php
1039
+ } ?>
1040
+ <option value="custom" <?php if ( $niteoCS_banner_pattern == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom Pattern...', 'cmp-coming-soon-maintenance');?></option>
1041
+ </select><br>
1042
+
1043
+ <input type="hidden" class="widefat" id="niteoCS_banner_pattern_custom" name="niteoCS_banner_pattern_custom_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr( $niteoCS_banner_pattern_custom ); ?>" />
1044
+
1045
+ <input id="add-pattern" type="button" class="button" value="Media Library" style="display:<?php echo ($niteoCS_banner_pattern == 'custom') ? 'block' : 'none'?>;"/>
1046
+
1047
+ <div class="pattern-preview" style="background-image: url('<?php echo esc_url($pattern_url);?>');"></div>
1048
+ </div>
1049
+ </fieldset>
1050
+
1051
+ <fieldset id="solid_color">
1052
+ <div class="banner-wrapper default">
1053
+ <label for="niteoCS_banner_color_<?php echo esc_attr($themeslug);?>"><?php _e('Select Color', 'cmp-coming-soon-maintenance');?></label><br>
1054
+ <input type="text" name="niteoCS_banner_color_<?php echo esc_attr($themeslug);?>" id="niteoCS_banner_color" value="<?php echo esc_attr( $niteoCS_banner_color); ?>" data-default-color="#bdc3c7" class="regular-text code"><br>
1055
+ <div class="color-preview" style="background-color:<?php echo esc_attr( $niteoCS_banner_color); ?>"></div>
1056
+ </div>
1057
+ </fieldset>
1058
+ </td>
1059
+ </tr>
1060
+ <tr><th>
1061
+ <p class="cmp-submit">
1062
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
1063
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1064
+ </p>
1065
+ </th></tr>
1066
+ </tbody>
1067
+ </table>
1068
+
1069
+ </div>
1070
+ <?php
1071
+ // get countdown settings if in countdown array themes
1072
+ if ( in_array($this->cmp_selectedTheme(), $this->slider_themes) ){
1073
+ if ( file_exists(dirname(__FILE__) . '/inc/settings-slider.php') ) {
1074
+ require (dirname(__FILE__) . '/inc/settings-slider.php');
1075
+ }
1076
+ }
1077
+ ?>
1078
+
1079
+ <?php
1080
+ // include theme related settings
1081
+ if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php')) {
1082
+ require ( $this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-settings.php' );
1083
+ }
1084
+
1085
+ ?>
1086
+
1087
+ <div class="table-wrapper theme-setup">
1088
+ <h3><?php _e('Customize Fonts', 'cmp-coming-soon-maintenance');?></h3>
1089
+ <table class="theme-setup">
1090
+ <tbody>
1091
+ <tr>
1092
+ <th><h4><?php _e('Headings Font', 'cmp-coming-soon-maintenance');?></h4></th>
1093
+ <td>
1094
+ <fieldset>
1095
+ <label for="niteoCS_font_headings_<?php echo esc_attr($themeslug);?>"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp-coming-soon-maintenance');?></label></br>
1096
+ <select name="niteoCS_font_headings_<?php echo esc_attr($themeslug);?>" class="niteoCS_font_headings">
1097
+ <?php
1098
+ foreach ($fonts as $font) { ?>
1099
+ <option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_headings == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
1100
+ <?php
1101
+ } ?>
1102
+ <option value="custom" <?php if ( $niteoCS_font_headings == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp-coming-soon-maintenance');?></option>
1103
+ </select><br>
1104
+ </fieldset>
1105
+
1106
+ <fieldset id="custom_headings_font" <?php if ( $niteoCS_font_headings == 'custom' ) { echo 'style="display:block"'; } ?>>
1107
+ <label for="niteoCS_font_headings_custom_<?php echo esc_attr($themeslug);?>"><?php _e('Enter name of ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
1108
+ <input type="text" name="niteoCS_font_headings_custom_<?php echo esc_attr($themeslug);?>" id="niteoCS_font_headings_custom" value="<?php echo esc_attr( $niteoCS_font_headings_custom); ?>" class="regular-text code">
1109
+ </fieldset>
1110
+
1111
+ </td>
1112
+ </tr>
1113
+
1114
+ <tr>
1115
+ <th><h4><?php _e('Content Font', 'cmp-coming-soon-maintenance');?></h4></th>
1116
+ <td>
1117
+ <fieldset>
1118
+ <label for="niteoCS_font_content_<?php echo esc_attr($themeslug);?>"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp-coming-soon-maintenance');?></label></br>
1119
+ <select name="niteoCS_font_content_<?php echo esc_attr($themeslug);?>" class="niteoCS_font_content">
1120
+ <?php
1121
+ foreach ($fonts as $font) { ?>
1122
+ <option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_content == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
1123
+ <?php
1124
+ } ?>
1125
+ <option value="custom" <?php if ( $niteoCS_font_content == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp-coming-soon-maintenance');?></option>
1126
+ </select><br>
1127
+ </fieldset>
1128
+
1129
+ <fieldset id="custom_content_font" <?php if ( $niteoCS_font_content == 'custom' ) { echo 'style="display:block"'; } ?>>
1130
+ <label for="niteoCS_font_content_custom_<?php echo esc_attr($themeslug);?>"><?php _e('Enter name of ', 'cmp-coming-soon-maintenance');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
1131
+ <input type="text" name="niteoCS_font_content_custom_<?php echo esc_attr($themeslug);?>" id="niteoCS_font_content_custom" value="<?php echo esc_attr( $niteoCS_font_content_custom); ?>" class="regular-text code">
1132
+ </fieldset>
1133
+
1134
+ <span>Fonts preview</span>
1135
+ <div id="font-example-wrapper">
1136
+ <h3 id="heading-example">Hello, I am your Headings font!</h3>
1137
+ <p id="content-example">And this is a long paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
1138
+ </div>
1139
+
1140
+ </td>
1141
+
1142
+ </tr>
1143
+ <tr><th>
1144
+ <p class="cmp-submit">
1145
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
1146
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1147
+ </p>
1148
+ </th></tr>
1149
+ </tbody>
1150
+ </table>
1151
+
1152
+ </div>
1153
 
1154
  <div class="table-wrapper seo">
1155
  <h3><?php _e('SEO Settings', 'cmp-coming-soon-maintenance');?></h3>
1156
  <table class="seo">
1157
+ <tbody>
1158
+
1159
+ <tr>
1160
+ <th><h4><?php _e('Favicon', 'cmp-coming-soon-maintenance');?></h4></th>
1161
+ <td>
1162
+ <fieldset>
1163
+ <input type="hidden" class="widefat" id="niteoCS-favicon-id" name="niteoCS_favicon_id" type="text" value="<?php echo esc_attr( $niteoCS_favicon_id ); ?>" />
1164
+ <input id="add-favicon" type="button" class="button" value="Select Favicon" />
1165
+
1166
+ <div class="favicon-wrapper">
1167
+ <?php
1168
+ if ( isset($niteoCS_favicon_url) && $niteoCS_favicon_url !== '' ) {
1169
+ echo '<img src="'.esc_url($niteoCS_favicon_url).'" alt="">';
1170
+ } ?>
1171
+ </div>
1172
+ <input id="delete-favicon" type="button" class="button" value="Remove Favicon" />
1173
+
1174
+ </fieldset>
1175
+ </td>
1176
+ </tr>
1177
 
1178
  <tr class="seo-title">
1179
  <th><h4><?php _e('Header Title', 'cmp-coming-soon-maintenance');?></h4></th>
1180
  <td>
1181
  <fieldset>
1182
+ <input type="text" name="niteoCS_title" id="niteoCS_title" value="<?php echo esc_attr( $niteoCS_title); ?>" class="regular-text code">
1183
  </fieldset>
1184
  </td>
1185
  </tr>
1188
  <th><h4><?php _e('Description', 'cmp-coming-soon-maintenance');?></h4></th>
1189
  <td>
1190
  <fieldset>
1191
+ <textarea name="niteoCS_descr" id="niteoCS_descr" class="code"><?php echo esc_attr( $niteoCS_descr); ?></textarea>
1192
  </fieldset>
1193
  </td>
1194
  </tr>
1200
  </fieldset>
1201
  </td>
1202
  </tr>
1203
+ <tr><th>
1204
+ <p class="cmp-submit">
1205
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
1206
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1207
+ </p>
1208
+ </th></tr>
1209
+ </tbody>
1210
  </table>
 
 
 
 
1211
  </div>
1212
 
1213
  <div class="table-wrapper custom_css">
1214
  <h3><?php _e('Enter Custom CSS', 'cmp-coming-soon-maintenance');?></h3>
1215
  <table class="custom_css">
1216
+ <tbody>
1217
  <tr>
1218
  <td>
1219
  <fieldset>
1221
  </fieldset>
1222
  </td>
1223
  </tr>
1224
+ <tr><th>
1225
+ <p class="cmp-submit">
1226
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
1227
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
1228
+ </p>
1229
+ </th></tr>
1230
+ </tbody>
1231
  </table>
1232
+
 
 
 
1233
  </div>
1234
 
1235
  </form>
1236
 
1237
  <div class="upload-plugin comingsoon install">
1238
+ <form action="admin.php?page=cmp-settings" class="wp-upload-form" method="post" enctype="multipart/form-data">
1239
  <table class="install">
1240
+ <tbody>
1241
  <tr>
1242
  <td>
1243
  <h3><?php _e('Install New CMP Coming Soon & Maintenance Theme', 'cmp-coming-soon-maintenance');?></h3>
1251
  <input id="install-theme" type="submit" value="Install Theme" name="submit_theme">
1252
  </td>
1253
  </tr>
1254
+ </tbody>
1255
  </table>
1256
 
1257
  </form>
1258
  </div>
1259
 
1260
+ </div> <!-- <div class="cmp-settings-wrapper"> -->
1261
+
1262
+ <?php
1263
+ // get sidebar with "widgets"
1264
+ if ( file_exists(dirname(__FILE__) . '/cmp-sidebar.php') ) {
1265
+ require (dirname(__FILE__) . '/cmp-sidebar.php');
1266
+ }
1267
+
1268
+ ?>
1269
+
1270
+ </div> <!-- <div class="cmp-inputs-wrapper"> -->
1271
+
1272
+ </div> <!-- <div id="wrap"> -->
1273
+
1274
+ <script>
1275
+
1276
+ // jQuery(document).ready(function($){
1277
+
1278
+ // jQuery('#csoptions :input').change(function(){
1279
+ // console.log(jQuery(this));
1280
+ // console.log("Form changed");
1281
+ // });
1282
+ // });
1283
+
1284
+ </script>
cmp-sidebar.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="cmp-sidebar-wrapper">
2
+ <div class="cmp-rate-us widget">
3
+ <h3 class="cmp-rate-us title"><?php _e('Thank you for rating us with five stars!', 'cmp-coming-soon-maintenance');?></h3>
4
+ <p><?php _e('If you like our CMP plugin, please show us some love and give 5-star feedback by pressing button below.', 'cmp-coming-soon-maintenance');?></p>
5
+ <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/?rate=5#new-post" target="_blank" style="text-decoration:none;">
6
+
7
+ <p class="button button-primary"><?php _e('Rate Us', 'cmp-coming-soon-maintenance');?></p>
8
+ <span class="dashicons dashicons-star-filled"></span>
9
+ <span class="dashicons dashicons-star-filled"></span>
10
+ <span class="dashicons dashicons-star-filled"></span>
11
+ <span class="dashicons dashicons-star-filled"></span>
12
+ <span class="dashicons dashicons-star-filled"></span>
13
+ </a>
14
+ <p><?php _e('Also don`t forget you can ask Wordpress Community or for our expert support on', 'cmp-coming-soon-maintenance');?> <a href="http://wordpress.org/support/plugin/cmp-coming-soon-maintenance/" target="_blank"><?php _e('Wordpress Support Forum', 'cmp-coming-soon-maintenance');?></a>
15
+ </p>
16
+
17
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
18
+ <input type="hidden" name="cmd" value="_s-xclick">
19
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJBQ2LnaehhVpQYn5qVhtwXrweyURxj+cT2BsnPUN4RZn/UC7ftqhv6B733Cjh5J2xrEF0MOu7mFxywWPZEpiStKwXEyos6eIx9SRqeiaM3bpjjyPqDRjWuhrXaA2eHb7nRxEv7C/4HjiPaFuyp5RFpT1R0yINRFqVVuDubtYQtDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIY1CTgb1/WqKAgYiwcmBIHYF08XkEezhgYklpp5d2J5wi6cOlEJsmxW4jVisb7CieTsadjEDiiLx4X9/IGp7IzRx1K+rx/dh9bpcJbz5NoB3oikfTqpdzqDAh8L0CW5AP0To368X2uDN40XElz4wDiwBXYAAtjsy3kVRH+/TrRIhWaezVUNqO7JmQ9hqxlOOjoMNyoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNTIzMTQzOTU0WjAjBgkqhkiG9w0BCQQxFgQUt08IwV3KFygWn0gNImPQ1mMrjAAwDQYJKoZIhvcNAQEBBQAEgYCISWoorrWsDcVzFPdWvmWNgGKcjW/PA4o6J/IYtUU+uMqD5Hg3s5FJO9pNzeGg4VFLB3hGJ5YJJ868qb/3/T2tIcED7CbGMqk/OsedUb2dyucYTCiBYViOOLPu/cxjdXjCLrB7UNTssqd4+3RvW4gzRSMThv98Lh/CA/BxHRZ45g==-----END PKCS7-----
20
+ ">
21
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
22
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
23
+ </form>
24
+
25
+ </div>
26
+
27
+
28
+ </div>
cmp-subscribers.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ // delete_option('niteoCS_subscribers_list');
5
+ $subscribe_list = get_option('niteoCS_subscribers_list');
6
+
7
+ // check for < 1.8 version where ID was not set
8
+ if ( is_array($subscribe_list) && count($subscribe_list) > 0 && !array_key_exists ('id', $subscribe_list[0])) {
9
+ $i = 1;
10
+ foreach($subscribe_list as &$sub){
11
+ $sub['id'] = $i;
12
+ $sub = array('id' => $sub['id']) + $sub;
13
+ // check if ip address is set
14
+ if (!array_key_exists('ip_address', $sub)) {
15
+ $sub['ip_address'] = 'nodata';
16
+ }
17
+ $i++;
18
+ }
19
+ update_option('niteoCS_subscribers_list', $subscribe_list);
20
+ }
21
+
22
+
23
+ // WP_List_Table is not loaded automatically so we need to load it in our application
24
+ if( ! class_exists( 'WP_List_Table' ) ) {
25
+ require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
26
+ }
27
+ // load WP_List_Table extension
28
+ if( ! class_exists( 'cmp_subs_list_table' ) ) {
29
+ require( dirname(__FILE__).'/inc/class-cmp-subscribers.php' );
30
+ }
31
+
32
+ // create subscriber table
33
+ $cmp_subs_list_table = new cmp_subs_list_table();
34
+ $cmp_subs_list_table->prepare_items();
35
+ ?>
36
+
37
+ <form name="cmp_subscribe_form" method="post" action="admin.php?page=cmp-subscribers">
38
+ <div class="wrap">
39
+ <div id="icon-users" class="icon32"></div>
40
+ <?php wp_nonce_field('cmp_process_bulk_action', '_nonce'); ?>
41
+ <h2><?php _e('View / Edit Subscribers', 'cmp-coming-soon-maintenance');?></h2>
42
+ <?php $cmp_subs_list_table->display(); ?>
43
+ </div>
44
+ </form>
45
+
46
+ <button id="export_csv" class="button"><?php _e('Export All Subscribers','cmp-coming-soon-maintenance');?></button>
47
+
48
+
49
+ <script type="text/javascript">
50
+ jQuery(document).ready(function($){
51
+ jQuery('#export_csv').click(function(){
52
+ var action = 'action=niteo_export_csv';
53
+ jQuery.post(ajaxurl, action, function(response) {
54
+ if(response) {
55
+ jQuery('<iframe />').attr('src', ajaxurl + '?action=niteo_export_csv').appendTo('body').hide();
56
+ }
57
+ });
58
+ });
59
+ });
60
+ </script>
comingsoon.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(a){function e(a){return(a+"").replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function f(a){return(a+"").toLowerCase()}navtab=function(a){jQuery(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+a).addClass("nav-tab-active"),!jQuery(".table-wrapper.content.slider").length||0!=jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()&&1!=jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery(".table-wrapper."+a+":not(.slider)").css("display","block"),jQuery(".comingsoon."+a+":not(.slider)").css("display","block")):(jQuery(".table-wrapper."+a).css("display","block"),jQuery(".comingsoon."+a).css("display","block")),jQuery(".table-wrapper:not(."+a+")").css("display","none"),jQuery(".comingsoon:not(."+a+")").css("display","none"),"install"==a?jQuery(".submit").css("display","none"):jQuery(".submit").css("display","block")};var b=document.location.hash.substring(1);""!=b&&navtab(b),window.onhashchange=function(){b=document.location.hash.substring(1),navtab(b)},a(".nav-tab:not(.theme-preview)").click(function(c){c.preventDefault(),b=a(this).data("tab"),document.location.hash=b});var c=jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val();jQuery("#unsplash-feed-"+c).css("display","block"),jQuery('#unsplash_banner select[name="unsplash_feed"]').on("change",function(){c=jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery("#unsplash-feed-"+c).css("display","block"),0==c?jQuery(".table-wrapper.slider input, .table-wrapper.slider select").prop("disabled",!0):jQuery(".table-wrapper.slider input, .table-wrapper.slider select").prop("disabled",!1)}),jQuery('#unsplash_banner select[name="unsplash_feed"]').trigger("change"),jQuery("#test-unsplash").click(function(b){b.preventDefault();var c=jQuery("#unsplash-media"),d=jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val(),e="",f="",g="",h=jQuery(this).data("security");switch(d){case"0":e=jQuery("#niteoCS-unsplash-0").val();break;case"1":e=jQuery("#niteoCS-unsplash-1").val(),f=jQuery('#unsplash_banner select[name="unsplash_category"] option:selected').val(),g=jQuery("#niteoCS-category-keyword").val();break;case"2":e=jQuery("#niteoCS-unsplash-2").val();break;case"3":e=jQuery("#niteoCS-unsplash-3").val(),f=jQuery("#niteoCS_unsplash_feat").is(":checked")?"1":"0"}var i={feed:d,url:e,cat:f,custom_str:g};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'),c.html("");var j={action:"niteo_unsplash",security:h,params:i};a.post(ajaxurl,j,function(a){jQuery("#unsplash_img").remove(),img_url=a.replace("WIDTHxHEIGHT","400x225"),jQuery("<img />",{src:img_url,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(c),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Unsplash")})})});var d=jQuery(".logo-wrapper");""!=jQuery("#niteoCS-logo-id").val()&&(jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block")),jQuery("#add-logo").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Logo",button:{text:"Insert Logo"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();jQuery(".logo-wrapper").empty(),d.append('<img src="'+a.url+'" alt="" style="max-width:588px"/>'),jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block"),jQuery("#niteoCS-logo-id").val(a.id)}).open()}),jQuery("#delete-logo").click(function(a){jQuery(".logo-wrapper").empty(),jQuery("#add-logo").val("Select Logo"),jQuery(this).css("display","none"),jQuery("#niteoCS-logo-id").val("")}),""!=jQuery("#niteoCS-banner-id").val()&&jQuery("#delete-banner").css("display","block"),jQuery("#add-banner").click(function(a){var b=jQuery(".banner-wrapper:not(.default)");if(a.preventDefault(),c)return void c.open();var c=wp.media({title:"Select Photos",button:{text:"Insert Photos"},multiple:!0,type:"image"}).on("select",function(){var a=c.state().get("selection").toJSON(),d="";a.length>0&&(b.empty(),jQuery(a).each(function(c){b.append('<img src="'+a[c].sizes.large.url+'" alt="" style="max-width:588px;"/>'),jQuery("#delete-banner").css("display","block"),d+=(0===c?"":",")+a[c].id}),jQuery("#niteoCS-banner-id").val(d))}).open()}),jQuery("#delete-banner").click(function(a){jQuery(".banner-wrapper:not(.default)").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("")}),jQuery('#csoptions input[name="niteoCS_banner"]').change(function(){switch(jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()){case"0":jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none");break;case"1":jQuery("#unsplash_banner").css("display","block"),jQuery(".theme_background fieldset:not(#unsplash_banner)").css("display","none");break;case"2":jQuery("#default_banner").css("display","block"),jQuery(".theme_background fieldset:not(#default_banner)").css("display","none");break;case"3":jQuery("#graphic_pattern").css("display","block"),jQuery(".theme_background fieldset:not(#graphic_pattern)").css("display","none");break;case"4":jQuery("#solid_color").css("display","block"),jQuery(".theme_background fieldset:not(#solid_color)").css("display","none");break;default:jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none")}}),jQuery('#csoptions input[name="niteoCS_banner"]').trigger("change"),jQuery("#niteoCS_banner_color").wpColorPicker({change:function(a,b){jQuery(".color-preview").css("background-color",b.color.toString())}}),jQuery('select[name="niteoCS_banner_pattern"]').on("change",function(){var a=jQuery('select[name="niteoCS_banner_pattern"] option:selected').val();if("custom"!=a){var b=jQuery(this).data("url");jQuery("#add-pattern").css("display","none"),jQuery(".pattern-preview").css("background-image","url('"+b+a+".png')")}else{var b=jQuery("#niteoCS_banner_pattern_custom").val();jQuery("#add-pattern").css("display","block"),jQuery(".pattern-preview").css("background-image","url('"+b+"')")}}),jQuery("#add-pattern").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Pattern",button:{text:"Select Pattern"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();if(jQuery(".pattern-preview").css("background-image",""),void 0===a.sizes.large)var c=a.url;else var c=a.sizes.large.url;jQuery(".pattern-preview").css("background-image","url('"+c+"')"),jQuery("#niteoCS_banner_pattern_custom").val(a.url)}).open()}),1==jQuery("#niteoCS_subscribe").prop("checked")&&jQuery(".subscribe").css("display","block"),jQuery("#niteoCS_subscribe").change(function(){jQuery(this)[0].checked?jQuery(".subscribe").css("display","block"):jQuery(".subscribe").css("display","none")}),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function(){0==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","block"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","block"),jQuery("#subscribe-niteo").css("display","none")):(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","block"))}),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change"),jQuery("#csv-generate").click(function(b){b.preventDefault(),jQuery("#csv-download").length&&jQuery("#csv-download").remove(),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"niteo_export_csv"},success:function(b){b=b.slice(0,-1);var c=a("<a />",{id:"csv-download",href:"data:text/plain;charset=UTF-8,"+encodeURIComponent(b),text:"Download CSV",download:"subscriber_list.csv"});jQuery("#subscribe-niteo").append(c)}})});var g="",h="";g="custom"==jQuery('select[name="niteoCS_font_headings"] option:selected').val()?e(f(jQuery("#niteoCS_font_headings_custom").val())):jQuery('select[name="niteoCS_font_headings"] option:selected').val(),h="custom"==jQuery('select[name="niteoCS_font_content"] option:selected').val()?e(f(jQuery("#niteoCS_font_content_custom").val())):jQuery('select[name="niteoCS_font_content"] option:selected').val(),WebFont.load({google:{families:[e(f(g)),e(f(h))]},active:function(){a("#heading-example").css("font-family",g),a("#content-example").css("font-family",h)}}),jQuery('select[name="niteoCS_font_headings"]').on("change",function(){niteoCS_font_headings=jQuery('select[name="niteoCS_font_headings"] option:selected').val(),"custom"==niteoCS_font_headings?(jQuery("#custom_headings_font").css("display","block"),jQuery("#custom_headings_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[e(f(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){a("#heading-example").css("font-family",jQuery("#niteoCS_font_headings_custom").val())}})},1e3))})):(jQuery("#custom_headings_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){a("#heading-example").css("font-family",niteoCS_font_headings||"")}}))}),jQuery('select[name="niteoCS_font_content"]').on("change",function(){niteoCS_font_content=jQuery('select[name="niteoCS_font_content"] option:selected').val(),"custom"==niteoCS_font_content?(jQuery("#custom_content_font").css("display","block"),jQuery("#custom_content_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[e(f(jQuery("#niteoCS_font_content_custom").val()))]},active:function(){a("#content-example").css("font-family",jQuery("#niteoCS_font_content_custom").val())}})},1e3))})):(jQuery("#custom_content_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_content]},active:function(){a("#content-example").css("font-family",niteoCS_font_content||"")}}))});var i=function(b,c,d){var e=a("#niteoCS_socialmedia").attr("value");e=a.parseJSON(e),a.each(e,function(a,e){e.name==b&&(e[c]=d)}),a("#niteoCS_socialmedia").attr("value",JSON.stringify(e))},j=a(".social-inputs"),k=function(b,c){var d=j.find('input[type="text"]');c.item.index();d.each(function(b,c){var d=a(c).data("name");i(d,"order",b)})};j.sortable({stop:k}),j.on("sortchange",k),function(a){a.fn.toggleDisabled=function(){return this.each(function(){var c,b=a(this),d=b.data("name");b.attr("disabled")?(b.prop("disabled",!1),c="1"):(b.prop("disabled",!0),c="0"),i(d,"active",c)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var a=jQuery(this).data("name"),b=jQuery(this).attr("value");i(a,"url",b)}),jQuery('.social-inputs input[type="checkbox"]').click(function(b){a(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".social-media i").click(function(){var a=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".social-inputs li."+a).toggleClass("active"),jQuery(this).hasClass("active")?i(a,"hidden","0"):i(a,"hidden","1"),jQuery(".social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".social-inputs .label").css("display","none")}),jQuery(".social-media i.active").length&&jQuery(".social-inputs .label").css("display","block"),jQuery(".view-release").click(function(a){a.preventDefault(),$this=jQuery(this);var b=$this.attr("href");jQuery.get(b,function(a){$this.closest(".notice").find(".release-note .notes").remove(),$this.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){$this.closest(".notice").find(".release-note p").remove(),$this.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".update-theme").click(function(b){b.preventDefault();var c=a(this),d=c.parents(".notice"),e=c.data("security"),f=c.data("slug"),g=c.data("type"),h=d.find(".theme-name").text(),i=jQuery(this).data("remote_url");update={name:f,tmp_name:"",type:g,url:i+"?action=download&slug="+f};var j={action:"cmp_theme_update_install",security:e,file:update};d.find(".message").html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'),a.post(ajaxurl,j,function(b){if("success"==b)setTimeout(function(){d.removeClass("notice-warning").addClass("notice-success"),d.find(".message").html("<span> "+h+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500);else{b=b.slice(0,-1);var c=a("p",a(b)).text();d.removeClass("notice-warning").addClass("notice-error"),d.find(".message").html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+c+"</span>")}})}),jQuery(".theme-select").click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().find(".theme-select").addClass("selected")}),jQuery(".theme-update.button").one("click",function(b){b.preventDefault();var c=a(this),d=c.closest(".theme-wrapper"),e=d.data("security"),f=d.data("slug"),g=d.data("type"),h=d.data("remote_url"),i={name:f,tmp_name:"",type:g,url:h+"?action=download&slug="+f},j={action:"cmp_theme_update_install",security:e,file:i};c.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),a.post(ajaxurl,j,function(a){"success"==a?setTimeout(function(){c.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){c.fadeOut()},1500)},1500):(a=a.slice(0,-1),c.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".theme-details").click(function(){var b=a(this),c=b.closest(".theme-wrapper"),d=c.data("slug"),e=c.data("version"),f=c.data("remote_url"),g=c.data("type"),h=c.data("purchased"),i="",j=jQuery(".update-theme").data("security"),k=1;a.getJSON(f+"?action=get_metadata&slug="+d,function(l){if(jQuery("body").addClass("modal-open"),"1"==h){e<l.version&&(i='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+l.name+' theme available. <a href="'+f+"readme/"+d+'-readme.php" class="view-release">View update '+l.version+' notes</a> or <a href="'+window.location.href+"&action=update-cmp-theme&theme="+d+"&type="+g+'" class="update-theme" data-type="'+g+'" data-security="'+j+'" data-slug="'+d+'" data-remote_url="'+f+'">Update now.</a></strong></p><div class="release-note"></div></div>'),e==l.version&&(i='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>');var m='<span class="theme-version">Version: '+e+"</span>",n="",o=""}else var m="",n="disabled ",p=c.find("a").attr("href"),o='<button type="button" class="theme-purchase button hide"><a href="'+p+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>';var q=a.parseJSON(l.details_url),r="";Object.keys(q).length>1&&(r='<div class="screenshots-nav"><div class="left"><i class="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa fa-chevron-right" aria-hidden="true"></i></div></div>');var s=a(['<div class="theme-backdrop">','\t<div class="theme-wrap">','\t\t<div class="theme-header">','\t\t\t<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',"\t\t</div>",'\t\t<div class="theme-about">','\t\t\t<div class="theme-screenshots">','\t\t\t\t<div class="screenshot" style="background-image:url(\''+q[1]+"')\">"+r+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+l.name+m+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+l.author_homepage+'">'+l.author+"</a></p>",i,'\t\t\t\t<div class="theme-description">'+l.description+"</div>",o,"\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<button type="submit" '+n+'class="button activate" name="Submit" aria-label="Select '+l.name+'">Activate</button>','\t\t\t<a href="http://cmp.niteo.cz/?cmp_preview=true&theme='+d+'" class="button cmp-preview" target="_blank" aria-label="Preview '+l.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(s),jQuery(".theme-overlay.cmp .view-release").click(function(a){a.preventDefault(),b=jQuery(this);var c=b.attr("href");jQuery.get(c,function(a){b.closest(".notice").find(".release-note .notes").remove(),b.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){b.closest(".notice").find(".release-note p").remove(),b.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".theme-overlay.cmp .close").click(function(a){a.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".theme-overlay.cmp .activate").click(function(a){a.preventDefault(),jQuery('input[name="select_theme"]').each(function(){jQuery(this).val()==d&&(jQuery(this).prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().addClass("selected"))}),jQuery("#csoptions").submit()}),jQuery(".screenshots-nav .right").click(function(){k++,k>Object.keys(q).length&&(k=1),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")}),jQuery(".screenshots-nav .left").click(function(){k--,k<1&&(k=Object.keys(q).length),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")})})})});
 
cs_admin.css → css/cmp-admin-head.css RENAMED
@@ -2,5 +2,12 @@
2
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a:hover{background:#c0392b;color:#ffffff;}
3
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon{background:#46b450;}
4
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a:hover{background:#59dc64;color:#ffffff;}
 
 
5
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a,
6
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a {color:#ffffff;}
 
 
 
 
 
2
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a:hover{background:#c0392b;color:#ffffff;}
3
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon{background:#46b450;}
4
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a:hover{background:#59dc64;color:#ffffff;}
5
+ #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect{background:#d88910;}
6
+ #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect a:hover{background:#ea9410;color:#ffffff;}
7
  #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a,
8
+ #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a,
9
+ #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect a {color:#ffffff;}
10
+ #toplevel_page_cmp-settings img {
11
+ max-width: 20px;
12
+ padding-top: 6px!important;
13
+ }
cs_style.css → css/cmp-settings-style.css RENAMED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  .comingsoon-error,
2
  .comingsoon-success{
3
  padding: 1em;
@@ -12,15 +21,72 @@
12
 
13
  input[type="text"], textarea{width:100%;}
14
  .table-wrapper.content,
 
15
  .table-wrapper.install,
16
  .table-wrapper.seo,
17
- .table-wrapper.custom_css {
 
 
18
  display: none;
19
  }
20
  .upload-plugin.comingsoon .wp-upload-form {
21
  max-width: 600px;
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  .table-wrapper table {
25
  width: 90%;
26
  }
@@ -53,7 +119,7 @@ input[type="text"], textarea{width:100%;}
53
  width: 180px;
54
  text-align: left;
55
  }
56
- #delete-logo,#delete-banner{display:none;}
57
 
58
  .social-media {margin-top: 0;margin-bottom: 3em;}
59
  .social-inputs {position: relative;}
@@ -65,6 +131,13 @@ input[type="text"], textarea{width:100%;}
65
  left: -8px;
66
  }
67
 
 
 
 
 
 
 
 
68
  .social-description {
69
  margin-top: 0;
70
  }
@@ -105,13 +178,11 @@ th label {font-weight: 600;}
105
  #add-pattern {margin-bottom: 1em;}
106
  .info{font-size: 12px;}
107
  .nav-tab i {padding-right:3px}
108
- .table-wrapper h4 {margin:0;}
109
 
110
- .table-wrapper {background-color: #ffffff;border:1px solid #dedede;margin:1em 0;}
111
- .table-wrapper h3 {padding-bottom: .5em;margin-bottom: 0;padding-left:1em;border-bottom:1px solid #dedede;}
112
- .table-wrapper table{padding:1em;}
113
- .logo-wrapper, .banner-wrapper {margin: 1em 0;}
114
- .logo-wrapper img {background-color: #efefef;padding:1em;}
115
  .logo-wrapper img, .banner-wrapper img{max-width: 100%;}
116
  .logo-wrapper img {max-height: 150px;}
117
 
@@ -298,10 +369,10 @@ th label {font-weight: 600;}
298
 
299
 
300
  p.cmp-submit {
301
- text-align: left;
302
- margin-top: 0;
303
  padding-top: 0;
304
- margin-left: 1em;
 
305
  }
306
 
307
 
@@ -353,12 +424,75 @@ p.cmp-submit {
353
  font-size: 13px;
354
  }
355
 
356
- @media screen and (max-width: 1024px) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  .theme-wrapper { width: calc(50% - 3em - 5px);}
 
358
  }
359
- @media screen and (max-width: 600px) {
 
 
360
  .theme-wrapper { margin-right:0;width: calc(100% - 5px);}
 
 
 
 
 
 
 
 
361
  }
362
 
 
 
 
 
 
 
 
 
363
 
364
 
1
+ #wpwrap {
2
+ overflow-x: hidden;
3
+ }
4
+
5
+ .cmp-settings-wrapper {
6
+ position: relative;
7
+ margin-top: 1em;
8
+ }
9
+
10
  .comingsoon-error,
11
  .comingsoon-success{
12
  padding: 1em;
21
 
22
  input[type="text"], textarea{width:100%;}
23
  .table-wrapper.content,
24
+ .table-wrapper.theme-setup,
25
  .table-wrapper.install,
26
  .table-wrapper.seo,
27
+ .table-wrapper.custom_css,
28
+ #niteoCS_countdown_text,
29
+ #niteoCS_countdown_redirect {
30
  display: none;
31
  }
32
  .upload-plugin.comingsoon .wp-upload-form {
33
  max-width: 600px;
34
  }
35
 
36
+ .cmp-status legend {
37
+ width: 95%;
38
+ padding: 10px;
39
+ }
40
+
41
+ .cmp-status .active {
42
+ background-color: #effffc;
43
+ }
44
+
45
+ .redirect {
46
+ margin-bottom: 0;
47
+ }
48
+
49
+ .table-wrapper {
50
+ background-color: #ffffff;
51
+ border:1px solid #dedede;
52
+ margin:1em 0;
53
+ margin-top: 0;
54
+ max-width: 920px;
55
+ }
56
+
57
+ .table-wrapper h3 {
58
+ position: relative;
59
+ padding: .5em 0;
60
+ margin: 0;
61
+ padding-left:1em;
62
+ border-bottom:1px solid #dedede;
63
+ cursor: pointer;
64
+ }
65
+
66
+ .table-wrapper h3::after {
67
+ font-family: fontAwesome;
68
+ content: "\f147";
69
+ position: absolute;
70
+ right: 10px;
71
+ font-weight: 400;
72
+ opacity: .6;
73
+ -webkit-font-smoothing: antialiased;
74
+ -moz-osx-font-smoothing: grayscale;
75
+ }
76
+
77
+ .table-wrapper h3.closed::after {
78
+ font-family: fontAwesome;
79
+ content: "\f196";
80
+ position: absolute;
81
+ }
82
+
83
+ .table-wrapper h4 {margin:0;}
84
+
85
+ .table-wrapper table{
86
+ padding:1em;
87
+ height: 100%;
88
+ }
89
+
90
  .table-wrapper table {
91
  width: 90%;
92
  }
119
  width: 180px;
120
  text-align: left;
121
  }
122
+ #delete-logo,#delete-banner, #delete-favicon{display:none;}
123
 
124
  .social-media {margin-top: 0;margin-bottom: 3em;}
125
  .social-inputs {position: relative;}
131
  left: -8px;
132
  }
133
 
134
+ #niteoCS-text-logo {
135
+ border: none;
136
+ box-shadow: none;
137
+ font-size: 3em;
138
+ font-weight: 600;
139
+ }
140
+
141
  .social-description {
142
  margin-top: 0;
143
  }
178
  #add-pattern {margin-bottom: 1em;}
179
  .info{font-size: 12px;}
180
  .nav-tab i {padding-right:3px}
 
181
 
182
+ .logo-wrapper, .banner-wrapper,.favicon-wrapper {margin: 1em 0;}
183
+ .logo-wrapper img,
184
+ .favicon-wrapper img {background-color: #efefef;padding:1em;}
185
+ .favicon-wrapper img {max-width: 32px;}
 
186
  .logo-wrapper img, .banner-wrapper img{max-width: 100%;}
187
  .logo-wrapper img {max-height: 150px;}
188
 
369
 
370
 
371
  p.cmp-submit {
372
+ margin: 0;
 
373
  padding-top: 0;
374
+ font-weight: 400;
375
+ text-align: left;
376
  }
377
 
378
 
424
  font-size: 13px;
425
  }
426
 
427
+
428
+ .wp-list-table .column-id { width: 5%; }
429
+
430
+
431
+ /* SIDEBAR */
432
+ .cmp-inputs-wrapper {
433
+ display: inline-block;
434
+ max-width: 70%;
435
+ min-width: 920px;
436
+ }
437
+
438
+ .cmp-sidebar-wrapper {
439
+ display: inline-block;
440
+ width: calc(100% - 6em - 920px);
441
+ max-width: 350px;
442
+ border: 1px solid #dedede;
443
+ padding: 2em;
444
+ margin-left: 1em;
445
+ padding-top: 0;
446
+ background: white;
447
+ vertical-align: top;
448
+ }
449
+
450
+ .cmp-rate-us a,
451
+ .cmp-rate-us .button {display: block;
452
+ text-align:center;
453
+ }
454
+
455
+ .cmp-rate-us a {
456
+ padding: 1em 0;
457
+ }
458
+
459
+ .cmp-rate-us .button {
460
+ max-width: 150px;
461
+ margin: 0 auto;
462
+ margin-bottom: 1em;
463
+ }
464
+
465
+ .cmp-rate-us form {
466
+ text-align: center;
467
+ }
468
+
469
+ @media screen and (max-width: 1450px) {
470
+ .cmp-inputs-wrapper {min-width: initial;}
471
+ .cmp-sidebar-wrapper {width: calc(30% - 6em);}
472
  .theme-wrapper { width: calc(50% - 3em - 5px);}
473
+
474
  }
475
+
476
+
477
+ @media screen and (max-width: 1110px) {
478
  .theme-wrapper { margin-right:0;width: calc(100% - 5px);}
479
+ .table-wrapper th {display: block;}
480
+
481
+ }
482
+
483
+ @media screen and (max-width: 1024px) {
484
+
485
+ .table-wrapper table {width:100%;}
486
+ .table-wrapper th {width: 140px;}
487
  }
488
 
489
+ @media screen and (max-width: 782px) {
490
+
491
+ .social-inputs input[type=checkbox]:checked:before {margin: -1px 0px 0 -4px;}
492
+ .cmp-sidebar-wrapper,
493
+ .cmp-inputs-wrapper {display: block;max-width:100%;width: 100%; }
494
+ }
495
+
496
+
497
 
498
 
{themes/countdown/css → css}/flatpickr.min.css RENAMED
File without changes
img/cmp.png ADDED
Binary file
inc/class-cmp-subscribers.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ /**
5
+ * Create a new table class that will extend the WP_List_Table
6
+ */
7
+ class cmp_subs_list_table extends WP_List_Table {
8
+ var $dateformat;
9
+ var $subscriber_list;
10
+
11
+ function __construct(){
12
+ $this->subscriber_list = get_option('niteoCS_subscribers_list');
13
+ $this->dateformat = get_option('date_format');
14
+ parent::__construct([
15
+ 'singular' => __( 'subscriber', 'cmp' ), //singular name of the listed records
16
+ 'plural' => __( 'subscribers', 'cmp' ), //plural name of the listed records
17
+ ]);
18
+ }
19
+ /**
20
+ * Prepare the items for the table to process
21
+ *
22
+ * @return Void
23
+ */
24
+ function prepare_items() {
25
+
26
+ $columns = $this->get_columns();
27
+ $hidden = $this->get_hidden_columns();
28
+ $sortable = $this->get_sortable_columns();
29
+ $this->process_bulk_action();
30
+ $data = $this->table_data();
31
+
32
+ $perPage = 20;
33
+ $currentPage = $this->get_pagenum();
34
+ $totalItems = count($data);
35
+ $this->set_pagination_args( array(
36
+ 'total_items' => $totalItems,
37
+ 'per_page' => $perPage
38
+ ) );
39
+ if (is_array($data)) {
40
+ usort( $data, array( &$this, 'sort_data' ) );
41
+ $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);
42
+ }
43
+
44
+ $this->_column_headers = array($columns, $hidden, $sortable);
45
+ $this->items = $data;
46
+
47
+
48
+
49
+ }
50
+
51
+ // Displaying checkboxes!
52
+ function column_cb($item) {
53
+ return sprintf(
54
+ '<input type="checkbox" name="id[%s]" value="%s" />', $item['id'], $item['id']
55
+ );
56
+ }
57
+ /**
58
+ * Define bulk actions
59
+ *
60
+ * @since 1.2
61
+ * @returns array() $actions Bulk actions
62
+ */
63
+ function get_bulk_actions() {
64
+ $actions = array(
65
+ 'delete' => __( 'Delete Selected' , 'cmp'),
66
+ // 'export' => __( 'Export Selected' , 'cmp')
67
+ );
68
+
69
+ return $actions;
70
+ }
71
+
72
+ /**
73
+ * Process bulk actions
74
+ *
75
+ * @since 1.2
76
+ */
77
+ function process_bulk_action() {
78
+
79
+ // security check!
80
+ // check onces and wordpress rights, else DIE
81
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
82
+ if( !wp_verify_nonce($_POST['_nonce'], 'cmp_process_bulk_action') || !current_user_can('publish_pages') ) {
83
+ die('Sorry, but this request is invalid');
84
+ }
85
+ }
86
+
87
+ // check onces and wordpress rights, else DIE
88
+ if ( $_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET['id'])) {
89
+ if( !wp_verify_nonce($_GET['_nonce'], 'cmp_delete_subscriber' ) || !current_user_can('publish_pages') ) {
90
+ die('Sorry, but this request is invalid');
91
+ }
92
+ }
93
+
94
+ $action = $this->current_action();
95
+ switch ( $action ) {
96
+
97
+ case 'delete':
98
+ // if bulk action
99
+ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['id']) && is_array($_POST['id'])) {
100
+ foreach ($this->subscriber_list as $key => $subscriber) {
101
+ // unset posted ids from subscribers bulk action
102
+ if (in_array($subscriber['id'], $_POST['id'])) {
103
+ unset($this->subscriber_list[$key]);
104
+ }
105
+ }
106
+ }
107
+
108
+ // if delete action
109
+ if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET['id'])) {
110
+ foreach ($this->subscriber_list as $key => $subscriber) {
111
+ // unset posted id from subscribers delete
112
+ if ($subscriber['id'] == $_GET['id']) {
113
+ unset($this->subscriber_list[$key]);
114
+ }
115
+ }
116
+ }
117
+
118
+ // reindex subscribers array
119
+ $this->subscriber_list = array_values($this->subscriber_list);
120
+ // change subscribers array column id
121
+ foreach ($this->subscriber_list as $key => $subscriber) {
122
+ $this->subscriber_list[$key]['id'] = $key;
123
+ }
124
+ // save new subscribers array
125
+ update_option('niteoCS_subscribers_list', $this->subscriber_list);
126
+ break;
127
+
128
+ case 'export':
129
+ return;
130
+ break;
131
+
132
+ default:
133
+ // do nothing or something else
134
+ return;
135
+ break;
136
+ }
137
+
138
+
139
+ return;
140
+ }
141
+
142
+ /**
143
+ * Override the parent columns method. Defines the columns to use in your listing table
144
+ *
145
+ * @return Array
146
+ */
147
+ function get_columns() {
148
+ $columns = array(
149
+ 'cb' => '<input type="checkbox" />',
150
+ 'id' => __('ID', 'cmp'),
151
+ 'email' => __('Email', 'cmp'),
152
+ 'timestamp' => __('Time', 'cmp'),
153
+ 'ip_address' => __('IP Address', 'cmp'),
154
+
155
+ );
156
+ return $columns;
157
+ }
158
+ /**
159
+ * Define which columns are hidden
160
+ *
161
+ * @return Array
162
+ */
163
+ function get_hidden_columns() {
164
+ return array();
165
+ }
166
+ /**
167
+ * Define the sortable columns
168
+ *
169
+ * @return Array
170
+ */
171
+ function get_sortable_columns() {
172
+ return array('timestamp' => array('timestamp', false));
173
+ }
174
+ /**
175
+ * Get the table data
176
+ *
177
+ * @return Array
178
+ */
179
+ function table_data() {
180
+ return $this->subscriber_list;
181
+ }
182
+ /**
183
+ * Define what data to show on each column of the table
184
+ *
185
+ * @param Array $item Data
186
+ * @param String $column_name - Current column name
187
+ *
188
+ * @return Mixed
189
+ */
190
+ function column_default( $item, $column_name ) {
191
+ switch( $column_name ) {
192
+ case 'id':
193
+ return $item[ $column_name ]+1;
194
+ case 'email':
195
+ case 'ip_address':
196
+ return $item[ $column_name ];
197
+
198
+ case 'timestamp':
199
+ return date($this->dateformat, $item[ $column_name ]);
200
+
201
+ default:
202
+ return print_r( $item, true ) ;
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Display delete action at each email row.
208
+ *
209
+ * @return Mixed
210
+ */
211
+ function column_email($item) {
212
+ $complete_url = wp_nonce_url( sprintf('?page=%s&action=%s&id=%s', $_REQUEST['page'],'delete',$item['id']), 'cmp_delete_subscriber', '_nonce' );
213
+ $actions = array(
214
+ 'delete' => '<a href="'.$complete_url.'">'.__('Delete', 'cmp').'</a>',
215
+ );
216
+
217
+ return sprintf('%1$s %2$s', $item['email'], $this->row_actions($actions) );
218
+ }
219
+ /**
220
+ * Allows you to sort the data by the variables set in the $_GET
221
+ *
222
+ * @return Mixed
223
+ */
224
+ function sort_data( $a, $b ) {
225
+ // Set defaults
226
+ $orderby = 'timestamp';
227
+ $order = 'asc';
228
+ // If orderby is set, use this as the sort column
229
+ if(!empty($_GET['orderby']))
230
+ {
231
+ $orderby = $_GET['orderby'];
232
+ }
233
+ // If order is set use this as the order
234
+ if(!empty($_GET['order']))
235
+ {
236
+ $order = $_GET['order'];
237
+ }
238
+ $result = strcmp( $a[$orderby], $b[$orderby] );
239
+ if($order === 'asc')
240
+ {
241
+ return $result;
242
+ }
243
+ return -$result;
244
+ }
245
+
246
+ function no_items() {
247
+ _e( 'No subscribers yet!', 'cmp' );
248
+ }
249
+ }
inc/settings-counter.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ // check onces and wordpress rights, else DIE
5
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
6
+ if( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
7
+ die('Sorry, but this request is invalid');
8
+ }
9
+ }
10
+
11
+ if (isset($_POST['niteoCS_counter']) && is_numeric($_POST['niteoCS_counter'])) {
12
+ update_option('niteoCS_counter', sanitize_text_field($_POST['niteoCS_counter']));
13
+ }
14
+
15
+ if (isset($_POST['niteoCS_counter_date'])) {
16
+ update_option('niteoCS_counter_date', sanitize_text_field($_POST['niteoCS_counter_date']));
17
+ }
18
+
19
+ if (isset($_POST['niteoCS_countdown_action'])) {
20
+ update_option('niteoCS_countdown_action', sanitize_text_field($_POST['niteoCS_countdown_action']));
21
+ }
22
+
23
+ if (isset($_POST['niteoCS_countdown_text'])) {
24
+ update_option('niteoCS_countdown_text', sanitize_text_field($_POST['niteoCS_countdown_text']));
25
+ }
26
+
27
+ if (isset($_POST['niteoCS_countdown_redirect'])) {
28
+ update_option('niteoCS_countdown_redirect', esc_url_raw($_POST['niteoCS_countdown_redirect']));
29
+ }
30
+
31
+ // register and enqueue admin needed scripts
32
+ wp_register_script('countdown_flatpicker_js', plugins_url('/js/flatpickr.min.js', dirname(__FILE__)));
33
+ wp_register_style( 'countdown_flatpicker_css', plugins_url('/css/flatpickr.min.css', dirname(__FILE__)));
34
+ wp_enqueue_script('countdown_flatpicker_js');
35
+ wp_enqueue_style( 'countdown_flatpicker_css');
36
+
37
+ // get counter settings
38
+ $niteoCS_counter = get_option('niteoCS_counter', '1');
39
+ $niteoCS_counter_date = get_option('niteoCS_counter_date', time()+86400);
40
+ $niteoCS_countdown_action = get_option('niteoCS_countdown_action', 'no-action');
41
+ $niteoCS_countdown_text = get_option('niteoCS_countdown_text');
42
+ $niteoCS_countdown_redirect = get_option('niteoCS_countdown_redirect');
43
+
44
+ ?>
45
+
46
+
47
+ <div class="table-wrapper content">
48
+ <h3><?php _e('Countdown Timer Setup', 'cmp');?></h3>
49
+ <table class="content">
50
+ <tr>
51
+ <th>
52
+ <fieldset>
53
+ <legend class="screen-reader-text">
54
+ <span><?php _e('Counter setup', 'cmp');?></span>
55
+ </legend>
56
+
57
+ <p>
58
+ <label title="Enabled">
59
+ <input type="radio" name="niteoCS_counter" value="1"<?php if ( $niteoCS_counter == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Enabled', 'cmp');?>
60
+ </label>
61
+ </p>
62
+
63
+ <p>
64
+ <label title="Disabled">
65
+ <input type="radio" name="niteoCS_counter" value="0"<?php if ( $niteoCS_counter == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp');?>
66
+ </label>
67
+ </p>
68
+
69
+ </fieldset>
70
+ </th>
71
+
72
+ <td id="counter-disabled">
73
+ <p><?php _e('Countdown Timer is disabled.', 'cmp');?></p>
74
+ </td>
75
+
76
+ <td id="counter-enabled">
77
+ <p><?php _e('Click on date input and set a date & time for a Countdown timer.', 'cmp');?></p>
78
+ <fieldset>
79
+ <legend class="screen-reader-text">
80
+ <span><?php _e('Counter setup', 'cmp');?></span>
81
+ </legend>
82
+
83
+ <input type="text" name="niteoCS_counter_date" id="niteoCS_counter_date" placeholder="<?php _e('Select Date..','cmp');?>" value="<?php echo esc_attr( $niteoCS_counter_date); ?>" class="regular-text code"><br>
84
+
85
+ <label for="niteoCS_countdown_action"><?php _e('Countdown action:', 'cmp');?></label>
86
+ <select name="niteoCS_countdown_action">
87
+ <option value="no-action" <?php if ( $niteoCS_countdown_action == 'no-action' ) { echo ' selected="selected"'; } ?>><?php _e('No action', 'cmp');?></option>
88
+ <!-- <option value="display-text" <?php if ( $niteoCS_countdown_action == 'display-text' ) { echo ' selected="selected"'; } ?>><?php _e('Display custom text', 'cmp');?></option> -->
89
+ <option value="disable-cmp" <?php if ( $niteoCS_countdown_action == 'disable-cmp' ) { echo ' selected="selected"'; } ?>><?php _e('Disable CMP Plugin Page', 'cmp');?></option>
90
+ <option value="redirect" <?php if ( $niteoCS_countdown_action == 'redirect' ) { echo ' selected="selected"'; } ?>><?php _e('URL redirect', 'cmp');?></option>
91
+ </select>
92
+
93
+ <label for="niteoCS_countdown_text" id="niteoCS_countdown_text"><?php _e('Enter custom text', 'cmp');?>
94
+ <input type="text" name="niteoCS_countdown_text" value="<?php echo esc_attr( $niteoCS_countdown_text); ?>" class="regular-text code"><br>
95
+ </label>
96
+
97
+ <label for="niteoCS_countdown_redirect" id="niteoCS_countdown_redirect"><?php _e('Enter redirect URL', 'cmp');?>
98
+ <input type="text" name="niteoCS_countdown_redirect" value="<?php echo esc_url( $niteoCS_countdown_redirect); ?>" class="regular-text code"><br>
99
+ </label>
100
+ </fieldset>
101
+ </td>
102
+ </tr>
103
+ <tr><th>
104
+ <p class="cmp-submit">
105
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
106
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
107
+ </p>
108
+ </th></tr>
109
+ </table>
110
+
111
+ </div>
112
+
113
+ <script>
114
+ jQuery(document).ready(function($){
115
+
116
+ // enable-disable counter
117
+ $('#csoptions input[name="niteoCS_counter"]').bind('change', function(){
118
+ if ( jQuery('#csoptions input[name="niteoCS_counter"]:checked' ).val() == 0 ) {
119
+ jQuery('#counter-disabled').css('display','block');
120
+ jQuery('#counter-enabled').css('display','none');
121
+
122
+ } else if ( jQuery('#csoptions input[name="niteoCS_counter"]:checked' ).val() == 1 ) {
123
+ jQuery('#counter-disabled').css('display','none');
124
+ jQuery('#counter-enabled').css('display','block');
125
+ }
126
+ });
127
+
128
+
129
+ // set countdown action
130
+ $('#csoptions select[name="niteoCS_countdown_action"]').bind('change', function(){
131
+ if ( jQuery('#csoptions select[name="niteoCS_countdown_action"]' ).val() == 'display-text' ) {
132
+ jQuery('#niteoCS_countdown_text').css('display','block');
133
+ jQuery('#niteoCS_countdown_redirect').css('display','none');
134
+
135
+ } else if ( jQuery('#csoptions select[name="niteoCS_countdown_action"]' ).val() == 'redirect' ) {
136
+ jQuery('#niteoCS_countdown_text').css('display','none');
137
+ jQuery('#niteoCS_countdown_redirect').css('display','block');
138
+ } else {
139
+ jQuery('#niteoCS_countdown_text').css('display','none');
140
+ jQuery('#niteoCS_countdown_redirect').css('display','none')
141
+ }
142
+ });
143
+
144
+ jQuery('#csoptions input[name="niteoCS_counter"]').trigger('change');
145
+ jQuery('#csoptions select[name="niteoCS_countdown_action"]').trigger('change');
146
+
147
+ <?php
148
+ if ( $niteoCS_counter_date != '') { ?>
149
+ var date = new Date(<?php echo esc_attr($niteoCS_counter_date);?>*1000);
150
+ <?php
151
+ } else { ?>
152
+ var date = false;
153
+ <?php
154
+ } ?>
155
+ // flatpicker
156
+ $('#niteoCS_counter_date').flatpickr({
157
+ minDate: 'today',
158
+ defaultDate: date,
159
+ enableTime: true,
160
+ altInput: true,
161
+ dateFormat: 'U'
162
+ });
163
+ });
164
+ </script>
inc/settings-slider.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ // check onces and wordpress rights, else DIE
5
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
6
+ if( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
7
+ die('Sorry, but this request is invalid');
8
+ }
9
+ }
10
+
11
+
12
+ if (isset($_POST['niteoCS_slider_'.$themeslug]) && is_numeric($_POST['niteoCS_slider_'.$themeslug])) {
13
+ update_option('niteoCS_slider['.$themeslug.']', sanitize_text_field($_POST['niteoCS_slider_'.$themeslug]));
14
+ }
15
+
16
+ if (isset($_POST['niteoCS_slider_count_'.$themeslug]) && is_numeric($_POST['niteoCS_slider_count_'.$themeslug])) {
17
+ update_option('niteoCS_slider_count['.$themeslug.']', sanitize_text_field($_POST['niteoCS_slider_count_'.$themeslug]));
18
+ }
19
+
20
+ if (isset($_POST['niteoCS_slider_effect_'.$themeslug])) {
21
+ update_option('niteoCS_slider_effect['.$themeslug.']', sanitize_text_field($_POST['niteoCS_slider_effect_'.$themeslug]));
22
+ }
23
+
24
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
25
+
26
+ if (isset($_POST['niteoCS_slider_auto_'.$themeslug])) {
27
+ update_option('niteoCS_slider_auto['.$themeslug.']', $this->sanitize_checkbox($_POST['niteoCS_slider_auto_'.$themeslug]));
28
+ } else {
29
+ update_option('niteoCS_slider_auto['.$themeslug.']', 'false');
30
+ }
31
+ }
32
+
33
+ $niteoCS_slider = get_option('niteoCS_slider['.$themeslug.']', '1');
34
+ $niteoCS_slider_count = get_option('niteoCS_slider_count['.$themeslug.']', '3');
35
+ $niteoCS_slider_effect = get_option('niteoCS_slider_effect['.$themeslug.']', 'false');
36
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '0');
37
+ $niteoCS_slider_auto = get_option('niteoCS_slider_auto['.$themeslug.']', '1');
38
+ ?>
39
+
40
+ <div class="table-wrapper theme-setup slider">
41
+ <h3><?php _e('Slider Setup', 'cmp-coming-soon-maintenance');?></h3>
42
+ <table class="theme-setup slider">
43
+ <tr>
44
+ <th>
45
+ <fieldset>
46
+ <legend class="screen-reader-text">
47
+ <span><?php _e('Slider setup', 'cmp-coming-soon-maintenance');?></span>
48
+ </legend>
49
+
50
+ <p>
51
+ <label title="Enabled">
52
+ <input type="radio" name="niteoCS_slider_<?php echo esc_attr($themeslug);?>" value="1"<?php if ( $niteoCS_slider == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
53
+ </label>
54
+ </p>
55
+
56
+ <p>
57
+ <label title="Disabled">
58
+ <input type="radio" name="niteoCS_slider_<?php echo esc_attr($themeslug);?>" value="0"<?php if ( $niteoCS_slider == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
59
+ </label>
60
+ </p>
61
+
62
+ </fieldset>
63
+ </th>
64
+
65
+ <td id="slider-disabled">
66
+ <p><?php _e('Slider is disabled.', 'cmp-coming-soon-maintenance');?></p>
67
+ </td>
68
+
69
+ <td id="slider-enabled">
70
+ <p><?php _e('To display Slider on CMP Landing page make sure you inserted two or more Custom Photos from Media Library. Slider is also disabled when Specific Unsplash photo or Default Media is selected.', 'cmp-coming-soon-maintenance');?></p>
71
+ <fieldset>
72
+ <legend class="screen-reader-text">
73
+ <span><?php _e('Slider setup', 'cmp-coming-soon-maintenance');?></span>
74
+ </legend>
75
+ <p>
76
+ <label for="niteoCS_slider_effect">Slider Effect</label><br>
77
+ <label title="Slide Effect">
78
+ <input type="radio" name="niteoCS_slider_effect_<?php echo esc_attr($themeslug);?>" value="false"<?php if ( $niteoCS_slider_effect == 'false') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Slide', 'cmp-coming-soon-maintenance');?>
79
+ </label><br>
80
+
81
+ <label title="Fade Effect">
82
+ <input type="radio" name="niteoCS_slider_effect_<?php echo esc_attr($themeslug);?>" value="true"<?php if ( $niteoCS_slider_effect == 'true') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Fade', 'cmp-coming-soon-maintenance');?>
83
+ </label>
84
+
85
+ </p>
86
+
87
+ <p>
88
+ <input type="checkbox" name="niteoCS_slider_auto_<?php echo esc_attr($themeslug);?>" id="niteoCS_slider_auto" value="1" <?php checked( '1', get_option( 'niteoCS_slider_auto', '0' ) ); ?> class="regular-text code"><label for="niteoCS_slider_auto"><?php _e('Slider Autostart', 'cmp-coming-soon-maintenance');?></label><br>
89
+ </p>
90
+
91
+ <label for="niteoCS_slider_count"><?php _e('Number of Unplash media Slides', 'cmp-coming-soon-maintenance');?></label></br>
92
+ <select name="niteoCS_slider_count_<?php echo esc_attr($themeslug);?>" <?php if ( $niteoCS_banner !== '1' ) { echo 'disabled'; } ?>>
93
+ <option value="2" <?php if ( $niteoCS_slider_count == '2' ) { echo ' selected="selected"'; } ?>>2</option>
94
+ <option value="3" <?php if ( $niteoCS_slider_count == '3' ) { echo ' selected="selected"'; } ?>>3</option>
95
+ <option value="4" <?php if ( $niteoCS_slider_count == '4' ) { echo ' selected="selected"'; } ?>>4</option>
96
+ <option value="5" <?php if ( $niteoCS_slider_count == '5' ) { echo ' selected="selected"'; } ?>>5</option>
97
+ </select>
98
+
99
+
100
+ </fieldset>
101
+ </td>
102
+ </tr>
103
+ <tr><th>
104
+ <p class="cmp-submit">
105
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
106
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
107
+ </p>
108
+ </th></tr>
109
+ </table>
110
+ </div>
111
+
112
+ <script>
113
+ jQuery(document).ready(function($){
114
+ // enable/disable slider
115
+ $('#csoptions input[name="niteoCS_slider_<?php echo esc_attr($themeslug);?>"]').bind('change', function(){
116
+ if ( jQuery('#csoptions input[name="niteoCS_slider_<?php echo esc_attr($themeslug);?>"]:checked' ).val() == 0 ) {
117
+ jQuery('#slider-disabled').css('display','block');
118
+ jQuery('#slider-enabled').css('display','none');
119
+
120
+ } else if ( jQuery('#csoptions input[name="niteoCS_slider_<?php echo esc_attr($themeslug);?>"]:checked' ).val() == 1 ) {
121
+ jQuery('#slider-disabled').css('display','none');
122
+ jQuery('#slider-enabled').css('display','block');
123
+ }
124
+ });
125
+ jQuery('#csoptions input[name="niteoCS_slider_<?php echo esc_attr($themeslug);?>"]').trigger('change');
126
+
127
+ // hide slider if media doesnt support it
128
+ if (document.location.hash.substring(1) == 'theme-setup') {
129
+ jQuery('#csoptions input[name="niteoCS_banner_<?php echo esc_attr($themeslug);?>"]').bind('change', function () {
130
+
131
+ switch( jQuery('#csoptions input[name="niteoCS_banner_<?php echo esc_attr($themeslug);?>"]:checked' ).val() ) {
132
+ case '0':
133
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', false);
134
+ jQuery('#csoptions select[name="niteoCS_slider_coun_<?php echo esc_attr($themeslug);?>t"]').attr('disabled', true);
135
+
136
+ break;
137
+ case '1':
138
+ if (jQuery('select[name="unsplash_feed_<?php echo esc_attr($themeslug);?>"]').val() != 0 ) {
139
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', false);
140
+ }
141
+ break;
142
+
143
+ case '2':
144
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', true);
145
+ break;
146
+ case '3':
147
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', true);
148
+ break;
149
+ case '4':
150
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', true);
151
+ break;
152
+ default:
153
+ jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', true);
154
+ }
155
+ });
156
+ jQuery('#csoptions input[name="niteoCS_banner_<?php echo esc_attr($themeslug);?>"]').trigger('change');
157
+ }
158
+
159
+ });
160
+ </script>
{themes/countdown/js → js}/flatpickr.min.js RENAMED
File without changes
comingsoon.js → js/settings.js RENAMED
@@ -1,30 +1,30 @@
1
  jQuery(document).ready(function($){
2
-
 
 
 
 
3
  navtab = function(tab) {
 
4
  jQuery('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
5
  jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
6
 
7
- // if slider exists and background is custom media or unsplash display slider
8
- if (jQuery('.table-wrapper.content.slider' ).length && (jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 0 || jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 1)) {
9
- jQuery('.table-wrapper.' + tab).css('display', 'block');
10
- jQuery('.comingsoon.' + tab).css('display', 'block');
11
-
12
- } else {
13
- jQuery('.table-wrapper.' + tab + ':not(.slider)').css('display', 'block');
14
- jQuery('.comingsoon.' + tab + ':not(.slider)').css('display', 'block');
15
- }
16
 
17
  jQuery('.table-wrapper:not(.' + tab + ')').css('display', 'none');
18
  jQuery('.comingsoon:not(.' + tab + ')').css('display', 'none');
19
 
20
  if ( tab == 'install' ) {
21
  jQuery('.submit').css('display', 'none');
 
22
  } else {
23
  jQuery('.submit').css('display', 'block');
 
 
24
  }
25
  }
26
 
27
- var tab = document.location.hash.substring(1);
28
  if (tab != '') {
29
  navtab(tab);
30
  }
@@ -40,92 +40,45 @@ jQuery(document).ready(function($){
40
  document.location.hash = tab;
41
  });
42
 
43
- // display selected unsplash feed
44
- var unsplasfeed = jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val();
45
- jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
46
-
47
- jQuery('#unsplash_banner select[name="unsplash_feed"]').on('change', function() {
48
- unsplasfeed = jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val();
49
- jQuery('.unsplash-feed').css('display', 'none');
50
- jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
51
- // set slider disabled/enabled
52
- if (unsplasfeed == 0) {
53
- jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', true);
54
- } else {
55
- jQuery('.table-wrapper.slider input, .table-wrapper.slider select').prop('disabled', false);
56
- }
57
- })
58
-
59
- jQuery('#unsplash_banner select[name="unsplash_feed"]').trigger('change');
60
-
61
-
62
- // test unsplash image
63
- jQuery('#test-unsplash').click(function(e){
64
- e.preventDefault();
65
-
66
- var media_wrapper = jQuery('#unsplash-media'),
67
- unsplash_feed = jQuery('#unsplash_banner select[name="unsplash_feed"] option:selected').val(),
68
- unsp_url = '',
69
- cat = '',
70
- custom_str = '',
71
- security = jQuery(this).data('security');
72
-
73
- switch( unsplash_feed ) {
74
- case '0':
75
- unsp_url = jQuery('#niteoCS-unsplash-0').val();
76
- break;
77
-
78
- case '1':
79
- unsp_url = jQuery('#niteoCS-unsplash-1').val();
80
- cat = jQuery('#unsplash_banner select[name="unsplash_category"] option:selected').val();
81
- custom_str = jQuery('#niteoCS-category-keyword').val();
82
- break;
83
-
84
- case '2':
85
- unsp_url = jQuery('#niteoCS-unsplash-2').val();
86
- break;
87
-
88
- case '3':
89
- unsp_url = jQuery('#niteoCS-unsplash-3').val();
90
- if ( jQuery('#niteoCS_unsplash_feat' ).is( ':checked' ) ) {
91
- cat = '1';
92
- } else {
93
- cat = '0';
94
- }
95
- break;
96
-
97
- default:
98
- // code block
99
  }
 
100
 
101
- var params = {feed: unsplash_feed, url: unsp_url, cat: cat, custom_str: custom_str};
102
-
103
- jQuery(this).prop('disabled', true);
104
- jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');
105
- media_wrapper.html('');
106
-
107
-
108
- var data = {
109
- action: 'niteo_unsplash',
110
- security: security,
111
- params: params
112
- };
113
-
114
- $.post(ajaxurl, data, function(response) {
115
- jQuery('#unsplash_img').remove();
116
- img_url = response.replace('WIDTHxHEIGHT', '400x225');
117
- jQuery('<img />', {src: img_url, id: 'unsplash_img'}).
118
-
119
- one('load', function() { //Set something to run when it finishes loading
120
- jQuery(this).appendTo(media_wrapper);
121
- jQuery(this).fadeIn();
122
- jQuery('#test-unsplash').prop('disabled', false);
123
- jQuery('#test-unsplash').text('Test Unsplash');
124
- });
125
- });
126
 
 
 
 
 
127
  });
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  // script for logo upload
131
  var logoContainer = jQuery('.logo-wrapper');
@@ -165,7 +118,7 @@ jQuery(document).ready(function($){
165
  // Display Delete Gallery
166
  jQuery('#delete-logo').css( 'display', 'block' );
167
 
168
- jQuery('#niteoCS-logo-id').val( attachment.id );
169
 
170
  })
171
  .open();
@@ -176,9 +129,67 @@ jQuery(document).ready(function($){
176
  jQuery('#add-logo').val( 'Select Logo' );
177
  jQuery(this).css('display', 'none');
178
  jQuery('#niteoCS-logo-id').val('');
 
179
 
180
  });
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  // script for banner upload
184
 
@@ -214,7 +225,12 @@ jQuery(document).ready(function($){
214
 
215
  jQuery(attachment).each(function(i) {
216
  // Send the attachment URL to our custom image input field.
217
- bannerContainer.append( '<img src="' + attachment[i]['sizes']['large'].url + '" alt="" style="max-width:588px;"/>' );
 
 
 
 
 
218
  // Display Delete Gallery
219
  jQuery('#delete-banner').css( 'display', 'block' );
220
  // add image ID and url to comma-separated variable
@@ -222,7 +238,7 @@ jQuery(document).ready(function($){
222
  imgID += ( comma + attachment[i].id );
223
  });
224
  // add image ID and url to input val
225
- jQuery('#niteoCS-banner-id').val( imgID );
226
  }
227
  })
228
  .open();
@@ -231,14 +247,79 @@ jQuery(document).ready(function($){
231
  jQuery('#delete-banner').click(function(e) {
232
  jQuery('.banner-wrapper:not(.default)').empty();
233
  jQuery(this).css('display', 'none');
234
- jQuery('#niteoCS-banner-id').val('');
235
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
 
237
 
238
  // hiding banner on change
239
- jQuery('#csoptions input[name="niteoCS_banner"]').change(function() {
240
 
241
- switch(jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() ) {
242
  case '0':
243
  jQuery('#custom_banner').css('display','block');
244
  jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
@@ -264,19 +345,30 @@ jQuery(document).ready(function($){
264
  jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
265
  }
266
  });
 
 
 
 
 
 
 
 
 
 
 
267
 
268
- jQuery('#csoptions input[name="niteoCS_banner"]').trigger('change');
269
 
270
  // banner background colorpicker
271
  jQuery('#niteoCS_banner_color').wpColorPicker({
272
  change: function(event, ui){
273
  jQuery('.color-preview').css('background-color', ui.color.toString());
274
- }
 
275
  });
276
 
277
  // banner pattern on change image preview
278
- jQuery('select[name="niteoCS_banner_pattern"]').on('change', function() {
279
- var pattern = jQuery('select[name="niteoCS_banner_pattern"] option:selected').val();
280
 
281
  if (pattern != 'custom') {
282
  var pattern_url = jQuery(this).data('url');
@@ -343,7 +435,7 @@ jQuery(document).ready(function($){
343
  }
344
  });
345
 
346
- // hiding banner on change
347
  jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function() {
348
  if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 0 ) {
349
  jQuery('#subscribe-disabled').css('display','block');
@@ -360,34 +452,17 @@ jQuery(document).ready(function($){
360
  jQuery('#subscribe-niteo').css('display','block');
361
  }
362
  });
363
- jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger('change');
364
-
365
 
366
  // export CSV
367
  jQuery('#csv-generate').click(function(e){
368
  e.preventDefault();
369
-
370
- if ( jQuery('#csv-download').length ) {
371
- jQuery('#csv-download').remove();
372
- }
373
-
374
- jQuery.ajax({
375
- type:'POST',
376
- url: ajaxurl,
377
- data: {action: 'niteo_export_csv'},
378
- success: function(data) {
379
- data = data.slice(0, -1);
380
- var newLink = $("<a />", {
381
- id : 'csv-download',
382
- href : 'data:text/plain;charset=UTF-8,' + encodeURIComponent(data),
383
- text : 'Download CSV',
384
- download: "subscriber_list.csv"
385
- });
386
-
387
- jQuery('#subscribe-niteo').append(newLink);
388
-
389
- },
390
- });
391
  });
392
 
393
  function ucwords (str) {
@@ -403,16 +478,16 @@ jQuery(document).ready(function($){
403
  // Google FONTS
404
  var heading_family = '';
405
  var content_family = '';
406
- if ( jQuery('select[name="niteoCS_font_headings"] option:selected').val() == 'custom') {
407
  heading_family = ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val()));
408
  } else {
409
- heading_family = jQuery('select[name="niteoCS_font_headings"] option:selected').val();
410
  }
411
 
412
- if ( jQuery('select[name="niteoCS_font_content"] option:selected').val() == 'custom') {
413
  content_family = ucwords(strtolower(jQuery('#niteoCS_font_content_custom').val()));
414
  } else {
415
- content_family = jQuery('select[name="niteoCS_font_content"] option:selected').val();
416
  }
417
 
418
  WebFont.load({
@@ -420,13 +495,14 @@ jQuery(document).ready(function($){
420
  families: [ ucwords(strtolower(heading_family)), ucwords(strtolower(content_family)) ]
421
  },
422
  active: function() {
423
- $('#heading-example').css('font-family', heading_family );
424
  $('#content-example').css('font-family', content_family );
425
  },
426
  });
427
 
428
- jQuery('select[name="niteoCS_font_headings"]').on('change', function() {
429
- niteoCS_font_headings = jQuery('select[name="niteoCS_font_headings"] option:selected').val();
 
430
  if ( niteoCS_font_headings == 'custom') {
431
  jQuery('#custom_headings_font').css('display', 'block');
432
  jQuery('#custom_headings_font').data('timeout', null).keyup(function(){
@@ -438,7 +514,7 @@ jQuery(document).ready(function($){
438
  families: [ ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val())) ]
439
  },
440
  active: function() {
441
- $('#heading-example').css('font-family', jQuery('#niteoCS_font_headings_custom').val() );
442
  },
443
  });
444
  }, 1000));
@@ -451,14 +527,15 @@ jQuery(document).ready(function($){
451
  families: [niteoCS_font_headings]
452
  },
453
  active: function() {
454
- $('#heading-example').css('font-family', niteoCS_font_headings ? niteoCS_font_headings : '' );
455
  },
456
  });;
457
  }
458
  });
459
 
460
- jQuery('select[name="niteoCS_font_content"]').on('change', function() {
461
- niteoCS_font_content = jQuery('select[name="niteoCS_font_content"] option:selected').val();
 
462
  if ( niteoCS_font_content == 'custom') {
463
  jQuery('#custom_content_font').css('display', 'block');
464
  jQuery('#custom_content_font').data('timeout', null).keyup(function(){
@@ -562,6 +639,8 @@ jQuery(document).ready(function($){
562
  var name = jQuery(this).data('name');
563
  jQuery(this).toggleClass('active');
564
  jQuery('.social-inputs li.' + name).toggleClass('active');
 
 
565
  if (jQuery(this).hasClass('active')) {
566
  update_social(name, 'hidden', '0');
567
  } else {
@@ -640,7 +719,7 @@ jQuery(document).ready(function($){
640
  // theme-selector scripts
641
  // select theme by click on thumbnail or select button
642
  jQuery('.theme-select').click(function(){
643
- jQuery(this).parent().find('input[name="select_theme"]').prop("checked", true);
644
  jQuery('.theme-select').removeClass('selected');
645
  jQuery(this).parent().find('.theme-select').addClass('selected');
646
  });
@@ -710,7 +789,7 @@ jQuery(document).ready(function($){
710
  if ( purchased == '1' ) {
711
  // generate update notice
712
  if ( version < data['version'] ) {
713
- noticeHtml = '<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+data['name']+' theme available. <a href="'+remoteUrl+'readme/'+slug+'-readme.php" class="view-release">View update '+data['version']+' notes</a> or <a href="'+window.location.href+'&action=update-cmp-theme&theme='+slug+'&type='+type+'" class="update-theme" data-type="'+type+'" data-security="'+security+'" data-slug="'+slug+'" data-remote_url="'+remoteUrl+'">Update now.</a></strong></p><div class="release-note"></div></div>';
714
  }
715
  // generate up-to-date notice
716
  if ( version == data['version'] ) {
@@ -759,7 +838,7 @@ jQuery(document).ready(function($){
759
  ' </div>',
760
  ' <div class="theme-actions">',
761
  ' <button type="submit" '+buttonDisabled+'class="button activate" name="Submit" aria-label="Select '+data['name']+'">Activate</button>',
762
- ' <a href="http://cmp.niteo.cz/?cmp_preview=true&theme='+slug+'" class="button cmp-preview" target="_blank" aria-label="Preview '+data['name']+'">Live Preview</a>',
763
  ' </div>',
764
  ' </div>',
765
  '</div>',
@@ -834,5 +913,11 @@ jQuery(document).ready(function($){
834
 
835
  });
836
 
 
 
 
837
  });
838
 
 
 
 
1
  jQuery(document).ready(function($){
2
+
3
+ var formChanged = false;
4
+ var tab = document.location.hash.substring(1);
5
+ var action = jQuery('#csoptions').attr('action');
6
+
7
  navtab = function(tab) {
8
+
9
  jQuery('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
10
  jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
11
 
12
+ jQuery('.table-wrapper.' + tab).css('display', 'block');
13
+ jQuery('.comingsoon.' + tab).css('display', 'block');
 
 
 
 
 
 
 
14
 
15
  jQuery('.table-wrapper:not(.' + tab + ')').css('display', 'none');
16
  jQuery('.comingsoon:not(.' + tab + ')').css('display', 'none');
17
 
18
  if ( tab == 'install' ) {
19
  jQuery('.submit').css('display', 'none');
20
+ jQuery('#csoptions').attr('action', action);
21
  } else {
22
  jQuery('.submit').css('display', 'block');
23
+ // change form action to display current tab after save
24
+ jQuery('#csoptions').attr('action', action + '#' + tab);
25
  }
26
  }
27
 
 
28
  if (tab != '') {
29
  navtab(tab);
30
  }
40
  document.location.hash = tab;
41
  });
42
 
43
+ // Make clickable status radio buttons
44
+ jQuery('.cmp-status legend').click(function(){
45
+ var $children = jQuery(this).children('input');
46
+ $children.prop("checked", true);
47
+ jQuery('.cmp-status legend').removeClass('active');
48
+ jQuery(this).addClass('active');
49
+ $children.trigger('change');
50
+ if ( $children.val() == '3' ) {
51
+ jQuery('#niteoCS_URL_redirect').prop('disabled',false);
52
+ } else {
53
+ jQuery('#niteoCS_URL_redirect').prop('disabled',true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
+ });
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ // expandable tabs
59
+ jQuery('.table-wrapper h3').click(function(){
60
+ jQuery(this).toggleClass('closed');
61
+ jQuery(this).next().toggle();
62
  });
63
 
64
+ // Logo type inputs
65
+ jQuery('.niteoCS-logo-type').change(function() {
66
+ if ( jQuery('.niteoCS-logo-type:checked' ).val() == 'text' ) {
67
+ jQuery('.text-logo').css('display','block');
68
+ jQuery('.graphic-logo').css('display','none');
69
+ jQuery('.disabled-logo').css('display','none');
70
+
71
+ } else if ( jQuery('.niteoCS-logo-type:checked' ).val() == 'graphic' ) {
72
+ jQuery('.text-logo').css('display','none');
73
+ jQuery('.graphic-logo').css('display','block');
74
+ jQuery('.disabled-logo').css('display','none');
75
+
76
+ } else if ( jQuery('.niteoCS-logo-type:checked' ).val() == 'disabled' ) {
77
+ jQuery('.text-logo').css('display','none');
78
+ jQuery('.graphic-logo').css('display','none');
79
+ jQuery('.disabled-logo').css('display','block');
80
+ }
81
+ });
82
 
83
  // script for logo upload
84
  var logoContainer = jQuery('.logo-wrapper');
118
  // Display Delete Gallery
119
  jQuery('#delete-logo').css( 'display', 'block' );
120
 
121
+ jQuery('#niteoCS-logo-id').val( attachment.id ).trigger('change');
122
 
123
  })
124
  .open();
129
  jQuery('#add-logo').val( 'Select Logo' );
130
  jQuery(this).css('display', 'none');
131
  jQuery('#niteoCS-logo-id').val('');
132
+ jQuery('#niteoCS-logo-id').trigger('change');
133
 
134
  });
135
 
136
+ // script for favicon upload
137
+ var favContainer = jQuery('.favicon-wrapper');
138
+
139
+ if ( jQuery('#niteoCS-favicon-id').val() != '' ) {
140
+ jQuery('#add-favicon').val( 'Change favicon' );
141
+ jQuery('#delete-favicon').css( 'display', 'block' );
142
+ }
143
+
144
+ jQuery('#add-favicon').click(function(e) {
145
+ e.preventDefault();
146
+ // If the media frame already exists, reopen it.
147
+ if ( media_uploader ) {
148
+ media_uploader.open();
149
+ return;
150
+ }
151
+ var media_uploader = wp.media({
152
+ title: 'Select favicon',
153
+ button: {
154
+ text: 'Insert favicon'
155
+ },
156
+ multiple: false, // Set this to true to allow multiple files to be selected
157
+ type : 'image'
158
+ })
159
+ .on('select', function() {
160
+ // Get media attachment details from the frame state
161
+ var attachment = media_uploader.state().get('selection').first().toJSON();
162
+
163
+ jQuery('.favicon-wrapper').empty();
164
+
165
+ // Send the attachment URL to our custom image input field.
166
+ favContainer.append( '<img src="' + attachment.url + '" alt="" style="max-width:32px"/>' );
167
+ // Add Gallery Button To Change Gallery
168
+ jQuery('#add-favicon').val( 'Change favicon' );
169
+ // Display Delete Gallery
170
+ jQuery('#delete-favicon').css( 'display', 'block' );
171
+
172
+ jQuery('#niteoCS-favicon-id').val( attachment.id ).trigger('change');
173
+
174
+ if (!jQuery('#favicon').length) {
175
+ jQuery('head').append('<link id="favicon" rel="shortcut icon" href="'+attachment.url+'" />');
176
+ } else {
177
+ jQuery('#favicon').attr('href', attachment.url);
178
+ }
179
+
180
+
181
+ })
182
+ .open();
183
+ });
184
+
185
+ jQuery('#delete-favicon').click(function(e) {
186
+ jQuery('.favicon-wrapper').empty();
187
+ jQuery('#add-favicon').val( 'Select favicon' );
188
+ jQuery(this).css('display', 'none');
189
+ jQuery('#niteoCS-favicon-id').val('').trigger('change');
190
+ jQuery('#favicon').remove();
191
+
192
+ });
193
 
194
  // script for banner upload
195
 
225
 
226
  jQuery(attachment).each(function(i) {
227
  // Send the attachment URL to our custom image input field.
228
+ if ('large' in attachment[i]['sizes']) {
229
+ bannerContainer.append( '<img src="' + attachment[i]['sizes']['large'].url + '" alt="" style="max-width:588px;"/>' );
230
+ } else {
231
+ bannerContainer.append( '<img src="' + attachment[i].url + '" alt="" style="max-width:588px;"/>' );
232
+ }
233
+
234
  // Display Delete Gallery
235
  jQuery('#delete-banner').css( 'display', 'block' );
236
  // add image ID and url to comma-separated variable
238
  imgID += ( comma + attachment[i].id );
239
  });
240
  // add image ID and url to input val
241
+ jQuery('#niteoCS-banner-id').val( imgID ).trigger('change');
242
  }
243
  })
244
  .open();
247
  jQuery('#delete-banner').click(function(e) {
248
  jQuery('.banner-wrapper:not(.default)').empty();
249
  jQuery(this).css('display', 'none');
250
+ jQuery('#niteoCS-banner-id').val('').trigger('change');
251
  });
252
+ // test unsplash image
253
+ jQuery('#test-unsplash').click(function(e){
254
+ e.preventDefault();
255
+
256
+ var media_wrapper = jQuery('#unsplash-media'),
257
+ unsplash_feed = jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),
258
+ unsp_url = '',
259
+ cat = '',
260
+ custom_str = '',
261
+ security = jQuery(this).data('security');
262
+
263
+ switch( unsplash_feed ) {
264
+ case '0':
265
+ unsp_url = jQuery('#niteoCS-unsplash-0').val();
266
+ break;
267
+
268
+ case '1':
269
+ unsp_url = jQuery('#niteoCS-unsplash-1').val();
270
+ cat = jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val();
271
+ custom_str = jQuery('#niteoCS-category-keyword').val();
272
+ break;
273
+
274
+ case '2':
275
+ unsp_url = jQuery('#niteoCS-unsplash-2').val();
276
+ break;
277
+
278
+ case '3':
279
+ unsp_url = jQuery('#niteoCS-unsplash-3').val();
280
+ if ( jQuery('#niteoCS_unsplash_feat' ).is( ':checked' ) ) {
281
+ cat = '1';
282
+ } else {
283
+ cat = '0';
284
+ }
285
+ break;
286
+
287
+ default:
288
+ // code block
289
+ }
290
+
291
+ var params = {feed: unsplash_feed, url: unsp_url, cat: cat, custom_str: custom_str};
292
+
293
+ jQuery(this).prop('disabled', true);
294
+ jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');
295
+ media_wrapper.html('');
296
+
297
+
298
+ var data = {
299
+ action: 'niteo_unsplash',
300
+ security: security,
301
+ params: params
302
+ };
303
+
304
+ $.post(ajaxurl, data, function(response) {
305
+ jQuery('#unsplash_img').remove();
306
+ img_url = response.replace('WIDTHxHEIGHT', '400x225');
307
+ jQuery('<img />', {src: img_url, id: 'unsplash_img'}).
308
+
309
+ one('load', function() { //Set something to run when it finishes loading
310
+ jQuery(this).appendTo(media_wrapper);
311
+ jQuery(this).fadeIn();
312
+ jQuery('#test-unsplash').prop('disabled', false);
313
+ jQuery('#test-unsplash').text('Test Unsplash');
314
+ });
315
+ });
316
 
317
+ });
318
 
319
  // hiding banner on change
320
+ jQuery('#csoptions .niteoCS_banner').change(function() {
321
 
322
+ switch(jQuery('#csoptions .niteoCS_banner:checked' ).val() ) {
323
  case '0':
324
  jQuery('#custom_banner').css('display','block');
325
  jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
345
  jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
346
  }
347
  });
348
+ jQuery('#csoptions .niteoCS_banner').trigger('change');
349
+
350
+ // display selected unsplash feed
351
+ var unsplasfeed = jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();
352
+ jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
353
+
354
+ jQuery('#unsplash_banner select[name^="unsplash_feed"]').on('change', function() {
355
+ unsplasfeed = jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();
356
+ jQuery('.unsplash-feed').css('display', 'none');
357
+ jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
358
+ })
359
 
 
360
 
361
  // banner background colorpicker
362
  jQuery('#niteoCS_banner_color').wpColorPicker({
363
  change: function(event, ui){
364
  jQuery('.color-preview').css('background-color', ui.color.toString());
365
+ // jQuery(this).trigger('change');
366
+ }
367
  });
368
 
369
  // banner pattern on change image preview
370
+ jQuery('select[name^="niteoCS_banner_pattern"]').on('change', function() {
371
+ var pattern = jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();
372
 
373
  if (pattern != 'custom') {
374
  var pattern_url = jQuery(this).data('url');
435
  }
436
  });
437
 
438
+ // hiding subscribe on change
439
  jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function() {
440
  if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 0 ) {
441
  jQuery('#subscribe-disabled').css('display','block');
452
  jQuery('#subscribe-niteo').css('display','block');
453
  }
454
  });
455
+
 
456
 
457
  // export CSV
458
  jQuery('#csv-generate').click(function(e){
459
  e.preventDefault();
460
+ var action = 'action=niteo_export_csv';
461
+ jQuery.post(ajaxurl, action, function(response) {
462
+ if(response) {
463
+ jQuery('<iframe />').attr('src', ajaxurl + '?action=niteo_export_csv').appendTo('body').hide();
464
+ }
465
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  });
467
 
468
  function ucwords (str) {
478
  // Google FONTS
479
  var heading_family = '';
480
  var content_family = '';
481
+ if ( jQuery('.niteoCS_font_headings option:selected').val() == 'custom') {
482
  heading_family = ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val()));
483
  } else {
484
+ heading_family = jQuery('.niteoCS_font_headings option:selected').val();
485
  }
486
 
487
+ if ( jQuery('.niteoCS_font_content option:selected').val() == 'custom') {
488
  content_family = ucwords(strtolower(jQuery('#niteoCS_font_content_custom').val()));
489
  } else {
490
+ content_family = jQuery('.niteoCS_font_contentoption:selected').val();
491
  }
492
 
493
  WebFont.load({
495
  families: [ ucwords(strtolower(heading_family)), ucwords(strtolower(content_family)) ]
496
  },
497
  active: function() {
498
+ $('#heading-example, #niteoCS-text-logo').css('font-family', heading_family );
499
  $('#content-example').css('font-family', content_family );
500
  },
501
  });
502
 
503
+ // Font selector heading
504
+ jQuery('.niteoCS_font_headings').on('change', function() {
505
+ niteoCS_font_headings = jQuery('.niteoCS_font_headings option:selected').val();
506
  if ( niteoCS_font_headings == 'custom') {
507
  jQuery('#custom_headings_font').css('display', 'block');
508
  jQuery('#custom_headings_font').data('timeout', null).keyup(function(){
514
  families: [ ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val())) ]
515
  },
516
  active: function() {
517
+ $('#heading-example, #niteoCS-text-logo').css('font-family', jQuery('#niteoCS_font_headings_custom').val() );
518
  },
519
  });
520
  }, 1000));
527
  families: [niteoCS_font_headings]
528
  },
529
  active: function() {
530
+ $('#heading-example, #niteoCS-text-logo').css('font-family', niteoCS_font_headings ? niteoCS_font_headings : '' );
531
  },
532
  });;
533
  }
534
  });
535
 
536
+ // Font selector content
537
+ jQuery('.niteoCS_font_content').on('change', function() {
538
+ niteoCS_font_content = jQuery('.niteoCS_font_content option:selected').val();
539
  if ( niteoCS_font_content == 'custom') {
540
  jQuery('#custom_content_font').css('display', 'block');
541
  jQuery('#custom_content_font').data('timeout', null).keyup(function(){
639
  var name = jQuery(this).data('name');
640
  jQuery(this).toggleClass('active');
641
  jQuery('.social-inputs li.' + name).toggleClass('active');
642
+ jQuery('.social-inputs li.' + name + ' input').trigger('change');
643
+
644
  if (jQuery(this).hasClass('active')) {
645
  update_social(name, 'hidden', '0');
646
  } else {
719
  // theme-selector scripts
720
  // select theme by click on thumbnail or select button
721
  jQuery('.theme-select').click(function(){
722
+ jQuery(this).parent().find('input[name="select_theme"]').prop("checked", true).trigger('change');
723
  jQuery('.theme-select').removeClass('selected');
724
  jQuery(this).parent().find('.theme-select').addClass('selected');
725
  });
789
  if ( purchased == '1' ) {
790
  // generate update notice
791
  if ( version < data['version'] ) {
792
+ noticeHtml = '<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+data['name']+' theme available. <a href="'+remoteUrl+'readme/'+slug+'-readme.html" class="view-release">View update '+data['version']+' notes</a> or <a href="'+window.location.href+'&action=update-cmp-theme&theme='+slug+'&type='+type+'" class="update-theme" data-type="'+type+'" data-security="'+security+'" data-slug="'+slug+'" data-remote_url="'+remoteUrl+'">Update now.</a></strong></p><div class="release-note"></div></div>';
793
  }
794
  // generate up-to-date notice
795
  if ( version == data['version'] ) {
838
  ' </div>',
839
  ' <div class="theme-actions">',
840
  ' <button type="submit" '+buttonDisabled+'class="button activate" name="Submit" aria-label="Select '+data['name']+'">Activate</button>',
841
+ ' <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+slug+'" class="button cmp-preview" target="_blank" aria-label="Preview '+data['name']+'">Live Preview</a>',
842
  ' </div>',
843
  ' </div>',
844
  '</div>',
913
 
914
  });
915
 
916
+ jQuery('#csoptions input[name="niteoCS_banner"]').trigger('change');
917
+ jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger('change');
918
+
919
  });
920
 
921
+
922
+
923
+
js/settings.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){function h(a){return(a+"").replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function i(a){return(a+"").toLowerCase()}var c=document.location.hash.substring(1),d=jQuery("#csoptions").attr("action");navtab=function(a){jQuery(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+a).addClass("nav-tab-active"),jQuery(".table-wrapper."+a).css("display","block"),jQuery(".comingsoon."+a).css("display","block"),jQuery(".table-wrapper:not(."+a+")").css("display","none"),jQuery(".comingsoon:not(."+a+")").css("display","none"),"install"==a?(jQuery(".submit").css("display","none"),jQuery("#csoptions").attr("action",d)):(jQuery(".submit").css("display","block"),jQuery("#csoptions").attr("action",d+"#"+a))},""!=c&&navtab(c),window.onhashchange=function(){c=document.location.hash.substring(1),navtab(c)},a(".nav-tab:not(.theme-preview)").click(function(b){b.preventDefault(),c=a(this).data("tab"),document.location.hash=c}),jQuery(".cmp-status legend").click(function(){var a=jQuery(this).children("input");a.prop("checked",!0),jQuery(".cmp-status legend").removeClass("active"),jQuery(this).addClass("active"),a.trigger("change"),"3"==a.val()?jQuery("#niteoCS_URL_redirect").prop("disabled",!1):jQuery("#niteoCS_URL_redirect").prop("disabled",!0)}),jQuery(".table-wrapper h3").click(function(){jQuery(this).toggleClass("closed"),jQuery(this).next().toggle()}),jQuery(".niteoCS-logo-type").change(function(){"text"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","block"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","none")):"graphic"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","block"),jQuery(".disabled-logo").css("display","none")):"disabled"==jQuery(".niteoCS-logo-type:checked").val()&&(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","block"))});var e=jQuery(".logo-wrapper");""!=jQuery("#niteoCS-logo-id").val()&&(jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block")),jQuery("#add-logo").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Logo",button:{text:"Insert Logo"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();jQuery(".logo-wrapper").empty(),e.append('<img src="'+a.url+'" alt="" style="max-width:588px"/>'),jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block"),jQuery("#niteoCS-logo-id").val(a.id).trigger("change")}).open()}),jQuery("#delete-logo").click(function(a){jQuery(".logo-wrapper").empty(),jQuery("#add-logo").val("Select Logo"),jQuery(this).css("display","none"),jQuery("#niteoCS-logo-id").val(""),jQuery("#niteoCS-logo-id").trigger("change")});var f=jQuery(".favicon-wrapper");""!=jQuery("#niteoCS-favicon-id").val()&&(jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block")),jQuery("#add-favicon").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select favicon",button:{text:"Insert favicon"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();jQuery(".favicon-wrapper").empty(),f.append('<img src="'+a.url+'" alt="" style="max-width:32px"/>'),jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block"),jQuery("#niteoCS-favicon-id").val(a.id).trigger("change"),jQuery("#favicon").length?jQuery("#favicon").attr("href",a.url):jQuery("head").append('<link id="favicon" rel="shortcut icon" href="'+a.url+'" />')}).open()}),jQuery("#delete-favicon").click(function(a){jQuery(".favicon-wrapper").empty(),jQuery("#add-favicon").val("Select favicon"),jQuery(this).css("display","none"),jQuery("#niteoCS-favicon-id").val("").trigger("change"),jQuery("#favicon").remove()}),""!=jQuery("#niteoCS-banner-id").val()&&jQuery("#delete-banner").css("display","block"),jQuery("#add-banner").click(function(a){var b=jQuery(".banner-wrapper:not(.default)");if(a.preventDefault(),c)return void c.open();var c=wp.media({title:"Select Photos",button:{text:"Insert Photos"},multiple:!0,type:"image"}).on("select",function(){var a=c.state().get("selection").toJSON(),d="";a.length>0&&(b.empty(),jQuery(a).each(function(c){"large"in a[c].sizes?b.append('<img src="'+a[c].sizes.large.url+'" alt="" style="max-width:588px;"/>'):b.append('<img src="'+a[c].url+'" alt="" style="max-width:588px;"/>'),jQuery("#delete-banner").css("display","block"),d+=(0===c?"":",")+a[c].id}),jQuery("#niteoCS-banner-id").val(d).trigger("change"))}).open()}),jQuery("#delete-banner").click(function(a){jQuery(".banner-wrapper:not(.default)").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("").trigger("change")}),jQuery("#test-unsplash").click(function(b){b.preventDefault();var c=jQuery("#unsplash-media"),d=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),e="",f="",g="",h=jQuery(this).data("security");switch(d){case"0":e=jQuery("#niteoCS-unsplash-0").val();break;case"1":e=jQuery("#niteoCS-unsplash-1").val(),f=jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val(),g=jQuery("#niteoCS-category-keyword").val();break;case"2":e=jQuery("#niteoCS-unsplash-2").val();break;case"3":e=jQuery("#niteoCS-unsplash-3").val(),f=jQuery("#niteoCS_unsplash_feat").is(":checked")?"1":"0"}var i={feed:d,url:e,cat:f,custom_str:g};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'),c.html("");var j={action:"niteo_unsplash",security:h,params:i};a.post(ajaxurl,j,function(a){jQuery("#unsplash_img").remove(),img_url=a.replace("WIDTHxHEIGHT","400x225"),jQuery("<img />",{src:img_url,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(c),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Unsplash")})})}),jQuery("#csoptions .niteoCS_banner").change(function(){switch(jQuery("#csoptions .niteoCS_banner:checked").val()){case"0":jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none");break;case"1":jQuery("#unsplash_banner").css("display","block"),jQuery(".theme_background fieldset:not(#unsplash_banner)").css("display","none");break;case"2":jQuery("#default_banner").css("display","block"),jQuery(".theme_background fieldset:not(#default_banner)").css("display","none");break;case"3":jQuery("#graphic_pattern").css("display","block"),jQuery(".theme_background fieldset:not(#graphic_pattern)").css("display","none");break;case"4":jQuery("#solid_color").css("display","block"),jQuery(".theme_background fieldset:not(#solid_color)").css("display","none");break;default:jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none")}}),jQuery("#csoptions .niteoCS_banner").trigger("change");var g=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery("#unsplash-feed-"+g).css("display","block"),jQuery('#unsplash_banner select[name^="unsplash_feed"]').on("change",function(){g=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery("#unsplash-feed-"+g).css("display","block")}),jQuery("#niteoCS_banner_color").wpColorPicker({change:function(a,b){jQuery(".color-preview").css("background-color",b.color.toString())}}),jQuery('select[name^="niteoCS_banner_pattern"]').on("change",function(){var a=jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();if("custom"!=a){var b=jQuery(this).data("url");jQuery("#add-pattern").css("display","none"),jQuery(".pattern-preview").css("background-image","url('"+b+a+".png')")}else{var b=jQuery("#niteoCS_banner_pattern_custom").val();jQuery("#add-pattern").css("display","block"),jQuery(".pattern-preview").css("background-image","url('"+b+"')")}}),jQuery("#add-pattern").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Pattern",button:{text:"Select Pattern"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();if(jQuery(".pattern-preview").css("background-image",""),void 0===a.sizes.large)var c=a.url;else var c=a.sizes.large.url;jQuery(".pattern-preview").css("background-image","url('"+c+"')"),jQuery("#niteoCS_banner_pattern_custom").val(a.url)}).open()}),1==jQuery("#niteoCS_subscribe").prop("checked")&&jQuery(".subscribe").css("display","block"),jQuery("#niteoCS_subscribe").change(function(){jQuery(this)[0].checked?jQuery(".subscribe").css("display","block"):jQuery(".subscribe").css("display","none")}),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function(){0==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","block"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","block"),jQuery("#subscribe-niteo").css("display","none")):(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","block"))}),jQuery("#csv-generate").click(function(a){a.preventDefault(),jQuery.post(ajaxurl,"action=niteo_export_csv",function(a){a&&jQuery("<iframe />").attr("src",ajaxurl+"?action=niteo_export_csv").appendTo("body").hide()})});var j="",k="";j="custom"==jQuery(".niteoCS_font_headings option:selected").val()?h(i(jQuery("#niteoCS_font_headings_custom").val())):jQuery(".niteoCS_font_headings option:selected").val(),k="custom"==jQuery(".niteoCS_font_content option:selected").val()?h(i(jQuery("#niteoCS_font_content_custom").val())):jQuery(".niteoCS_font_contentoption:selected").val(),WebFont.load({google:{families:[h(i(j)),h(i(k))]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",j),a("#content-example").css("font-family",k)}}),jQuery(".niteoCS_font_headings").on("change",function(){niteoCS_font_headings=jQuery(".niteoCS_font_headings option:selected").val(),"custom"==niteoCS_font_headings?(jQuery("#custom_headings_font").css("display","block"),jQuery("#custom_headings_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[h(i(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",jQuery("#niteoCS_font_headings_custom").val())}})},1e3))})):(jQuery("#custom_headings_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",niteoCS_font_headings||"")}}))}),jQuery(".niteoCS_font_content").on("change",function(){niteoCS_font_content=jQuery(".niteoCS_font_content option:selected").val(),"custom"==niteoCS_font_content?(jQuery("#custom_content_font").css("display","block"),jQuery("#custom_content_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[h(i(jQuery("#niteoCS_font_content_custom").val()))]},active:function(){a("#content-example").css("font-family",jQuery("#niteoCS_font_content_custom").val())}})},1e3))})):(jQuery("#custom_content_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_content]},active:function(){a("#content-example").css("font-family",niteoCS_font_content||"")}}))});var l=function(b,c,d){var e=a("#niteoCS_socialmedia").attr("value");e=a.parseJSON(e),a.each(e,function(a,e){e.name==b&&(e[c]=d)}),a("#niteoCS_socialmedia").attr("value",JSON.stringify(e))},m=a(".social-inputs"),n=function(b,c){var d=m.find('input[type="text"]');c.item.index();d.each(function(b,c){var d=a(c).data("name");l(d,"order",b)})};m.sortable({stop:n}),m.on("sortchange",n),function(a){a.fn.toggleDisabled=function(){return this.each(function(){var c,b=a(this),d=b.data("name");b.attr("disabled")?(b.prop("disabled",!1),c="1"):(b.prop("disabled",!0),c="0"),l(d,"active",c)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var a=jQuery(this).data("name"),b=jQuery(this).attr("value");l(a,"url",b)}),jQuery('.social-inputs input[type="checkbox"]').click(function(b){a(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".social-media i").click(function(){var a=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".social-inputs li."+a).toggleClass("active"),jQuery(".social-inputs li."+a+" input").trigger("change"),jQuery(this).hasClass("active")?l(a,"hidden","0"):l(a,"hidden","1"),jQuery(".social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".social-inputs .label").css("display","none")}),jQuery(".social-media i.active").length&&jQuery(".social-inputs .label").css("display","block"),jQuery(".view-release").click(function(a){a.preventDefault(),$this=jQuery(this);var b=$this.attr("href");jQuery.get(b,function(a){$this.closest(".notice").find(".release-note .notes").remove(),$this.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){$this.closest(".notice").find(".release-note p").remove(),$this.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".update-theme").click(function(b){b.preventDefault();var c=a(this),d=c.parents(".notice"),e=c.data("security"),f=c.data("slug"),g=c.data("type"),h=d.find(".theme-name").text(),i=jQuery(this).data("remote_url");update={name:f,tmp_name:"",type:g,url:i+"?action=download&slug="+f};var j={action:"cmp_theme_update_install",security:e,file:update};d.find(".message").html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'),a.post(ajaxurl,j,function(b){if("success"==b)setTimeout(function(){d.removeClass("notice-warning").addClass("notice-success"),d.find(".message").html("<span> "+h+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500);else{b=b.slice(0,-1);var c=a("p",a(b)).text();d.removeClass("notice-warning").addClass("notice-error"),d.find(".message").html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+c+"</span>")}})}),jQuery(".theme-select").click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0).trigger("change"),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().find(".theme-select").addClass("selected")}),jQuery(".theme-update.button").one("click",function(b){b.preventDefault();var c=a(this),d=c.closest(".theme-wrapper"),e=d.data("security"),f=d.data("slug"),g=d.data("type"),h=d.data("remote_url"),i={name:f,tmp_name:"",type:g,url:h+"?action=download&slug="+f},j={action:"cmp_theme_update_install",security:e,file:i};c.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),a.post(ajaxurl,j,function(a){"success"==a?setTimeout(function(){c.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){c.fadeOut()},1500)},1500):(a=a.slice(0,-1),c.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".theme-details").click(function(){var b=a(this),c=b.closest(".theme-wrapper"),d=c.data("slug"),e=c.data("version"),f=c.data("remote_url"),g=c.data("type"),h=c.data("purchased"),i="",j=jQuery(".update-theme").data("security"),k=1;a.getJSON(f+"?action=get_metadata&slug="+d,function(l){if(jQuery("body").addClass("modal-open"),"1"==h){e<l.version&&(i='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+l.name+' theme available. <a href="'+f+"readme/"+d+'-readme.html" class="view-release">View update '+l.version+' notes</a> or <a href="'+window.location.href+"&action=update-cmp-theme&theme="+d+"&type="+g+'" class="update-theme" data-type="'+g+'" data-security="'+j+'" data-slug="'+d+'" data-remote_url="'+f+'">Update now.</a></strong></p><div class="release-note"></div></div>'),e==l.version&&(i='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>');var m='<span class="theme-version">Version: '+e+"</span>",n="",o=""}else var m="",n="disabled ",p=c.find("a").attr("href"),o='<button type="button" class="theme-purchase button hide"><a href="'+p+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>';var q=a.parseJSON(l.details_url),r="";Object.keys(q).length>1&&(r='<div class="screenshots-nav"><div class="left"><i class="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa fa-chevron-right" aria-hidden="true"></i></div></div>');var s=a(['<div class="theme-backdrop">','\t<div class="theme-wrap">','\t\t<div class="theme-header">','\t\t\t<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',"\t\t</div>",'\t\t<div class="theme-about">','\t\t\t<div class="theme-screenshots">','\t\t\t\t<div class="screenshot" style="background-image:url(\''+q[1]+"')\">"+r+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+l.name+m+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+l.author_homepage+'">'+l.author+"</a></p>",i,'\t\t\t\t<div class="theme-description">'+l.description+"</div>",o,"\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<button type="submit" '+n+'class="button activate" name="Submit" aria-label="Select '+l.name+'">Activate</button>','\t\t\t<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+d+'" class="button cmp-preview" target="_blank" aria-label="Preview '+l.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(s),jQuery(".theme-overlay.cmp .view-release").click(function(a){a.preventDefault(),b=jQuery(this);var c=b.attr("href");jQuery.get(c,function(a){b.closest(".notice").find(".release-note .notes").remove(),b.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){b.closest(".notice").find(".release-note p").remove(),b.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".theme-overlay.cmp .close").click(function(a){a.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".theme-overlay.cmp .activate").click(function(a){a.preventDefault(),jQuery('input[name="select_theme"]').each(function(){jQuery(this).val()==d&&(jQuery(this).prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().addClass("selected"))}),jQuery("#csoptions").submit()}),jQuery(".screenshots-nav .right").click(function(){k++,k>Object.keys(q).length&&(k=1),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")}),jQuery(".screenshots-nav .left").click(function(){k--,k<1&&(k=Object.keys(q).length),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")})})}),jQuery('#csoptions input[name="niteoCS_banner"]').trigger("change"),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change")});
niteo-cmp.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
- Version: 1.7.0
7
  Author: NiteoThemes
8
- Author URI: http://www.niteo.cz
9
  Text Domain: cmp-coming-soon-maintenance
10
  Domain Path: /languages
11
  License: GPL-2.0+
@@ -21,15 +21,19 @@ class niteo_cmp {
21
  var $theme_array = array();
22
  var $premium_installed = array();
23
  var $countdown_themes = array();
 
24
 
25
  function __construct() {
26
- $this->version = '1.7.0';
27
  $this->dev = false;
28
  $this->installedFolder = basename(dirname(__FILE__));
29
 
30
  // set array of themes with countdown
31
  $this->countdown_themes = array('frame', 'countdown');
32
 
 
 
 
33
  // get all installed themes [folder names under /themes] and put them to array
34
  $this->themes_standard = array_map('basename', glob( plugin_dir_path( __FILE__ ) . 'themes/*', GLOB_ONLYDIR));
35
 
@@ -41,7 +45,7 @@ class niteo_cmp {
41
  $this->theme_array = $this->themes_standard;
42
  }
43
  // set remote server URL for updates
44
- $this->remoteServer = ($this->dev == true) ? 'http://niteo.cz/updates-test/' : 'http://niteo.cz/niteo-updates/';
45
  }
46
 
47
  function cmp() {
@@ -49,30 +53,44 @@ class niteo_cmp {
49
  }
50
 
51
  function cmp_adminInit() {
52
- wp_register_script('cmp_mainjs', plugins_url().'/'.$this->installedFolder.'/comingsoon.min.js','webfont',$this->version);
 
53
  wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
54
- wp_register_style( 'cmp_style', plugins_url().'/'.$this->installedFolder.'/cs_style.css','',$this->version);
55
  wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
56
  }
57
 
58
  function cmp_add_admin_style() {
59
- wp_register_style( 'cmp_admin_style', plugins_url().'/'.$this->installedFolder.'/cs_admin.css','',$this->version);
60
  wp_enqueue_style( 'cmp_admin_style' );
61
  }
62
 
 
 
 
 
 
 
 
 
63
  function cmp_enqueueScripts() {
64
  // enqueue required admin scripts and styles
 
 
 
65
  wp_enqueue_style('cmp_style');
66
  wp_enqueue_style( 'wp-color-picker');
67
  wp_enqueue_style('font_awesome');
68
- wp_enqueue_script( 'webfont' );
69
- wp_enqueue_script('cmp_mainjs');
70
- wp_enqueue_media();
71
- wp_enqueue_script( 'wp-color-picker');
72
 
73
  // check for them updates, not sure where else this to put
74
  $this->cmp_check_update();
 
 
 
 
 
 
75
 
 
76
  }
77
 
78
 
@@ -80,48 +98,63 @@ class niteo_cmp {
80
  function cmp_adminMenu() {
81
 
82
  /* Register our plugin page */
83
- $page = add_options_page('CMP Settings', 'CMP Settings', 'activate_plugins', 'cmp-settings', array($this, 'cmp_admin_options'));
 
 
 
 
84
 
85
  /* Using registered $page handle to hook script load */
86
  add_action('admin_print_scripts-'.$page, array($this, 'cmp_enqueueScripts'));
87
- // add admin menu notice
 
88
 
89
  // check onces and wordpress rights, else DIE
90
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
91
 
92
- if ( isset($_POST['activate']) ) {
93
-
94
  //verify nonce and user rights
95
  if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
96
  die('Sorry, but this request is invalid');
97
  }
98
-
99
- if ($_POST['activate'] == 0) {
100
- update_option('niteoCS_activation', 0);
101
- }
102
-
103
- if ($_POST['activate'] == 1) {
104
- update_option('niteoCS_activation', 1);
105
- }
106
- if ($_POST['activate'] == 2) {
107
- update_option('niteoCS_activation', 2);
108
- }
109
-
110
  }
111
  }
112
 
113
- if ( $this->cmp_status() == '1' || $this->cmp_status() == '2' ) {
114
  add_action('admin_bar_menu',array( $this, 'cmp_admin_bar' ), 1000 );
115
  }
116
  }
117
 
118
- function cmp_admin_options() {
 
 
 
 
 
 
 
 
119
 
 
120
  // include default options page
121
- require ('cmp-options.php');
122
  }
123
 
 
 
 
 
124
 
 
 
 
 
 
 
 
 
 
125
 
126
  function cmp_displayPage() {
127
 
@@ -154,6 +187,7 @@ class niteo_cmp {
154
  }
155
  }
156
 
 
157
  if ( $this->cmp_status() == 1 || $this->cmp_status() == 2 ) {
158
 
159
  if ( !is_user_logged_in() ) {
@@ -194,7 +228,16 @@ class niteo_cmp {
194
  require_once ($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php');
195
  die();
196
  }
 
 
197
 
 
 
 
 
 
 
 
198
  }
199
  }
200
  }
@@ -247,10 +290,10 @@ class niteo_cmp {
247
  // return installed theme dir
248
  function cmp_themeDirPath() {
249
  if ( $this->niteo_in_array_r($this->cmp_selectedTheme(), $this->cmp_plugin_premium() ) ) {
250
- return WP_PLUGIN_URL . '/cmp-premium-themes/';
251
  } else {
252
-
253
- return WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/themes/';
254
  }
255
 
256
  }
@@ -269,6 +312,10 @@ class niteo_cmp {
269
  $msg = __('Coming Soon Mode Active','cmp-coming-soon-maintenance');
270
  $class = ' coming-soon';
271
  }
 
 
 
 
272
  //Add the main siteadmin menu item
273
  $wp_admin_bar->add_menu( array(
274
  'id' => 'cs-admin-notice',
@@ -286,14 +333,13 @@ class niteo_cmp {
286
  // update options
287
  foreach ($options as $option) {
288
  update_option($option['name'], $option['value']);
289
-
290
  }
291
 
292
  // delete archive
293
  delete_option('niteoCS_archive');
294
  }
295
-
296
  }
 
297
  // archive plugin stuff when plugin is deactivated
298
  function cmp_deactivate() {
299
  //get all the options. store them in an array
@@ -307,7 +353,6 @@ class niteo_cmp {
307
  $i++;
308
  }
309
 
310
-
311
  //store the options all in one record, in case we ever reactivate the plugin
312
  update_option('niteoCS_archive', $options);
313
 
@@ -317,7 +362,10 @@ class niteo_cmp {
317
 
318
  }
319
 
 
 
320
  }
 
321
  // clean plugin stuff when plugin is deleted
322
  function cmp_plugin_delete() {
323
  delete_option('niteoCS_archive');
@@ -332,7 +380,6 @@ class niteo_cmp {
332
  return $premium_themes;
333
  }
334
 
335
-
336
  // theme updates function
337
  function cmp_check_update() {
338
 
@@ -343,6 +390,10 @@ class niteo_cmp {
343
  $headers = array('Version');
344
 
345
  foreach ( $this->theme_array as $theme_slug) {
 
 
 
 
346
  // check if update check transient is set
347
  if ( false === ( $updatecheck_transient = get_transient( $theme_slug.'_updatecheck' ) ) ) {
348
 
@@ -364,7 +415,6 @@ class niteo_cmp {
364
 
365
  // get remote version from remote server
366
  $request = wp_remote_post($this->remoteServer.'?action=get_metadata&slug='.$theme_slug, array('body' => array('action' => 'version')));
367
-
368
  // if no error, retrivee body
369
  if ( !is_wp_error($request) ) {
370
  // decode to json
@@ -703,13 +753,14 @@ class niteo_cmp {
703
 
704
  // validate email address
705
  if ( is_email( $email ) ) {
706
- $time = time();
 
707
  $subscribe_list = get_option('niteoCS_subscribers_list');
708
 
709
- // if no subscribe list created, create first item
710
  if ( !$subscribe_list ) {
711
  $subscribe_list = array();
712
- $new_email = array('timestamp' => $time, 'email' => $email);
713
  array_push( $subscribe_list, $new_email );
714
  update_option( 'niteoCS_subscribers_list', $subscribe_list );
715
  $response = __('Thank you, your sign-up request was successful!', 'cmp-coming-soon-maintenance');
@@ -717,7 +768,8 @@ class niteo_cmp {
717
  } else {
718
  // check if email don`t already exists
719
  if ( !$this->niteo_in_array_r( $email, $subscribe_list ) ) {
720
- $new_email = array('timestamp' => $time, 'email' => $email);
 
721
  array_push( $subscribe_list, $new_email );
722
  update_option('niteoCS_subscribers_list', $subscribe_list);
723
  $response = __('Thank you, your sign-up request was successful!', 'cmp-coming-soon-maintenance');
@@ -738,18 +790,33 @@ class niteo_cmp {
738
  function niteo_export_csv() {
739
  // load subscribers array
740
  $subscribers = get_option('niteoCS_subscribers_list');
741
- $csv = '';
742
 
743
- foreach ($subscribers as $subscriber) {
744
- $csv .= $subscriber['email'].';';
745
- }
 
 
 
 
 
 
 
 
 
 
746
 
747
- // set last download
748
- update_option('niteoCS_csv_export_time', time() );
 
 
 
749
 
750
- // echo comma separated string;
751
- echo $csv;
752
- wp_die();
 
 
 
753
  }
754
 
755
  function niteo_allow_zip_mime( $existing_mimes = array() ) {
@@ -895,7 +962,7 @@ class niteo_cmp {
895
  if ( isset($_GET['page']) && $_GET['page'] == 'cmp-settings' ) {
896
  if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
897
  $status = 'success';
898
- $message = __('Settings Saved', 'cmp-coming-soon-maintenance');
899
 
900
  echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
901
  }
@@ -925,13 +992,13 @@ add_action('admin_menu', array($cmpPlugin, 'cmp_adminMenu'), 10);
925
  add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
926
  add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
927
  add_action( 'admin_enqueue_scripts', array($cmpPlugin,'cmp_add_admin_style') );
928
-
929
  register_activation_hook(__FILE__, array($cmpPlugin, 'cmp_activate'));
930
  register_deactivation_hook(__FILE__, array($cmpPlugin, 'cmp_deactivate'));
931
  register_uninstall_hook(__FILE__, 'cmp_plugin_delete');
932
 
933
-
934
-
935
 
936
 
937
 
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
+ Version: 1.8.0
7
  Author: NiteoThemes
8
+ Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
10
  Domain Path: /languages
11
  License: GPL-2.0+
21
  var $theme_array = array();
22
  var $premium_installed = array();
23
  var $countdown_themes = array();
24
+ var $slider_themes = array();
25
 
26
  function __construct() {
27
+ $this->version = '1.8.0';
28
  $this->dev = false;
29
  $this->installedFolder = basename(dirname(__FILE__));
30
 
31
  // set array of themes with countdown
32
  $this->countdown_themes = array('frame', 'countdown');
33
 
34
+ // set array of themes with slider
35
+ $this->slider_themes = array('hardwork_premium', 'fifty');
36
+
37
  // get all installed themes [folder names under /themes] and put them to array
38
  $this->themes_standard = array_map('basename', glob( plugin_dir_path( __FILE__ ) . 'themes/*', GLOB_ONLYDIR));
39
 
45
  $this->theme_array = $this->themes_standard;
46
  }
47
  // set remote server URL for updates
48
+ $this->remoteServer = ($this->dev == true) ? 'https://niteothemes.com/updates/' : 'https://niteothemes.com/updates/';
49
  }
50
 
51
  function cmp() {
53
  }
54
 
55
  function cmp_adminInit() {
56
+ wp_register_style( 'cmp_style', plugins_url('/css/cmp-settings-style.css', __FILE__),'',$this->version);
57
+ wp_register_script('cmp_settings_js', plugins_url('/js/settings.min.js', __FILE__),array('webfont'),$this->version);
58
  wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
 
59
  wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
60
  }
61
 
62
  function cmp_add_admin_style() {
63
+ wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__),'',$this->version);
64
  wp_enqueue_style( 'cmp_admin_style' );
65
  }
66
 
67
+ function enqueue_admin_js($hook) {
68
+
69
+ if ( 'toplevel_page_cmp-settings' == $hook ) {
70
+ wp_enqueue_script('cmp_settings_js');
71
+ }
72
+
73
+ }
74
+
75
  function cmp_enqueueScripts() {
76
  // enqueue required admin scripts and styles
77
+ wp_enqueue_script( 'wp-color-picker');
78
+ wp_enqueue_script( 'webfont' );
79
+ wp_enqueue_media();
80
  wp_enqueue_style('cmp_style');
81
  wp_enqueue_style( 'wp-color-picker');
82
  wp_enqueue_style('font_awesome');
 
 
 
 
83
 
84
  // check for them updates, not sure where else this to put
85
  $this->cmp_check_update();
86
+ }
87
+
88
+ function sdt_remove_ver_css_js( $src, $handle ) {
89
+ $handles_remove_ver = array('font_awesome', 'webfont', 'countdown_flatpicker_js', 'countdown_flatpicker_css'); // <-- Adjust to your needs!
90
+ if ( in_array( $handle, $handles_remove_ver, true ) && strpos( $src, 'ver=' ) )
91
+ $src = remove_query_arg( 'ver', $src );
92
 
93
+ return $src;
94
  }
95
 
96
 
98
  function cmp_adminMenu() {
99
 
100
  /* Register our plugin page */
101
+ $page = add_menu_page('CMP Settings', 'CMP Settings', 'activate_plugins', 'cmp-settings', array($this, 'cmp_settings_page'), plugins_url('/img/cmp.png', __FILE__));
102
+ add_submenu_page('cmp-settings', 'CMP Settings', 'CMP Settings', 'manage_options', 'cmp-settings' );
103
+ add_submenu_page('cmp-settings', 'Subscribers', 'Subscribers', 'manage_options', 'cmp-subscribers', array($this, 'cmp_subs_page') );
104
+ add_submenu_page('cmp-settings', 'Help', 'Help', 'manage_options', 'cmp-help', array($this, 'cmp_help_page') );
105
+ // add_submenu_page('cmp-settings', 'About', 'About', 'manage_options', 'cmp-about', array($this, 'cmp_about_page') );
106
 
107
  /* Using registered $page handle to hook script load */
108
  add_action('admin_print_scripts-'.$page, array($this, 'cmp_enqueueScripts'));
109
+ // add subscribe form styles to header
110
+ add_action( 'admin_head', array($this, 'cmp_subs_style' ) );
111
 
112
  // check onces and wordpress rights, else DIE
113
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
114
 
115
+ if ( isset($_POST['activate']) && is_numeric($_POST['activate']) ) {
 
116
  //verify nonce and user rights
117
  if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
118
  die('Sorry, but this request is invalid');
119
  }
120
+ update_option('niteoCS_activation', sanitize_text_field($_POST['activate']));
 
 
 
 
 
 
 
 
 
 
 
121
  }
122
  }
123
 
124
+ if ( $this->cmp_status() == '1' || $this->cmp_status() == '2' || $this->cmp_status() == '3') {
125
  add_action('admin_bar_menu',array( $this, 'cmp_admin_bar' ), 1000 );
126
  }
127
  }
128
 
129
+ function cmp_subs_style() {
130
+ $page = ( isset($_GET['page'] ) ) ? esc_attr( $_GET['page'] ) : false;
131
+ if ( 'cmp-subscribers' != $page ) {
132
+ return;
133
+ }
134
+ echo '<style type="text/css" media="all">';
135
+ echo '.subscribers .column-ID { width: 5%; }';
136
+ echo '</style>';
137
+ }
138
 
139
+ function cmp_settings_page() {
140
  // include default options page
141
+ require ('cmp-settings.php');
142
  }
143
 
144
+ function cmp_subs_page() {
145
+ // include default options page
146
+ require ('cmp-subscribers.php');
147
+ }
148
 
149
+ function cmp_help_page() {
150
+ // include default options page
151
+ require ('cmp-help.php');
152
+ }
153
+
154
+ function cmp_about_page() {
155
+ // include default options page
156
+ require ('cmp-about.php');
157
+ }
158
 
159
  function cmp_displayPage() {
160
 
187
  }
188
  }
189
 
190
+ // if coming-soon or maintenance settings
191
  if ( $this->cmp_status() == 1 || $this->cmp_status() == 2 ) {
192
 
193
  if ( !is_user_logged_in() ) {
228
  require_once ($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php');
229
  die();
230
  }
231
+ }
232
+ }
233
 
234
+ // if redirect mode
235
+ if ( $this->cmp_status() == 3 && !is_user_logged_in() ) {
236
+ $redirect_url = get_option('niteoCS_URL_redirect');
237
+ // redirect
238
+ if ( $redirect_url != '') {
239
+ header('Location: '.esc_url($redirect_url));
240
+ die();
241
  }
242
  }
243
  }
290
  // return installed theme dir
291
  function cmp_themeDirPath() {
292
  if ( $this->niteo_in_array_r($this->cmp_selectedTheme(), $this->cmp_plugin_premium() ) ) {
293
+ return plugins_url( '/cmp-premium-themes/');
294
  } else {
295
+ return plugins_url( '/themes/', __FILE__ );
296
+
297
  }
298
 
299
  }
312
  $msg = __('Coming Soon Mode Active','cmp-coming-soon-maintenance');
313
  $class = ' coming-soon';
314
  }
315
+ elseif( $status == '3' ){
316
+ $msg = __('Redirect Mode Active','cmp-coming-soon-maintenance');
317
+ $class = ' redirect';
318
+ }
319
  //Add the main siteadmin menu item
320
  $wp_admin_bar->add_menu( array(
321
  'id' => 'cs-admin-notice',
333
  // update options
334
  foreach ($options as $option) {
335
  update_option($option['name'], $option['value']);
 
336
  }
337
 
338
  // delete archive
339
  delete_option('niteoCS_archive');
340
  }
 
341
  }
342
+
343
  // archive plugin stuff when plugin is deactivated
344
  function cmp_deactivate() {
345
  //get all the options. store them in an array
353
  $i++;
354
  }
355
 
 
356
  //store the options all in one record, in case we ever reactivate the plugin
357
  update_option('niteoCS_archive', $options);
358
 
362
 
363
  }
364
 
365
+ delete_option('niteoCS_archive', $options);
366
+
367
  }
368
+
369
  // clean plugin stuff when plugin is deleted
370
  function cmp_plugin_delete() {
371
  delete_option('niteoCS_archive');
380
  return $premium_themes;
381
  }
382
 
 
383
  // theme updates function
384
  function cmp_check_update() {
385
 
390
  $headers = array('Version');
391
 
392
  foreach ( $this->theme_array as $theme_slug) {
393
+
394
+ if ($this->dev == true) {
395
+ delete_transient($theme_slug.'_updatecheck' );
396
+ }
397
  // check if update check transient is set
398
  if ( false === ( $updatecheck_transient = get_transient( $theme_slug.'_updatecheck' ) ) ) {
399
 
415
 
416
  // get remote version from remote server
417
  $request = wp_remote_post($this->remoteServer.'?action=get_metadata&slug='.$theme_slug, array('body' => array('action' => 'version')));
 
418
  // if no error, retrivee body
419
  if ( !is_wp_error($request) ) {
420
  // decode to json
753
 
754
  // validate email address
755
  if ( is_email( $email ) ) {
756
+ $timestamp = time();
757
+ $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
758
  $subscribe_list = get_option('niteoCS_subscribers_list');
759
 
760
+ // if no subscribe list created, create first item and insert it into DB
761
  if ( !$subscribe_list ) {
762
  $subscribe_list = array();
763
+ $new_email = array('id' => '0', 'timestamp' => $timestamp, 'email' => $email, 'ip_address' => $ip_address);
764
  array_push( $subscribe_list, $new_email );
765
  update_option( 'niteoCS_subscribers_list', $subscribe_list );
766
  $response = __('Thank you, your sign-up request was successful!', 'cmp-coming-soon-maintenance');
768
  } else {
769
  // check if email don`t already exists
770
  if ( !$this->niteo_in_array_r( $email, $subscribe_list ) ) {
771
+ $count = count($subscribe_list);
772
+ $new_email = array('id' => $count, 'timestamp' => $timestamp, 'email' => $email, 'ip_address' => $ip_address);
773
  array_push( $subscribe_list, $new_email );
774
  update_option('niteoCS_subscribers_list', $subscribe_list);
775
  $response = __('Thank you, your sign-up request was successful!', 'cmp-coming-soon-maintenance');
790
  function niteo_export_csv() {
791
  // load subscribers array
792
  $subscribers = get_option('niteoCS_subscribers_list');
 
793
 
794
+ if( !empty($subscribers) ) {
795
+ $filename = 'subscribers-list-' . date('Y-m-d') . '.csv';
796
+ header('Content-Type: text/csv');
797
+ header('Content-Disposition: attachment;filename='.$filename);
798
+ $fp = fopen('php://output', 'w');
799
+ fputcsv($fp, array(__('Date','cmp-coming-soon-maintenance'),__('Email','cmp-coming-soon-maintenance')));
800
+ foreach ($subscribers as $key => $value) {
801
+ if ( isset( $value['ip_address'] ) ) {
802
+ unset($subscribers[$key]['ip_address']);
803
+ }
804
+ if ( isset( $value['id'] ) ) {
805
+ unset($subscribers[$key]['id']);
806
+ }
807
 
808
+ if ( isset( $value['timestamp'] ) ) {
809
+ $format="Y-m-d H:i:s";
810
+ $subscribers[$key]['timestamp'] = date_i18n($format, $subscribers[$key]['timestamp']);
811
+ }
812
+ }
813
 
814
+ foreach ( $subscribers as $key => $value ) {
815
+ fputcsv($fp, $value, $delimiter = ',', $enclosure = '"' );
816
+ }
817
+ fclose($fp);
818
+ }
819
+ die();
820
  }
821
 
822
  function niteo_allow_zip_mime( $existing_mimes = array() ) {
962
  if ( isset($_GET['page']) && $_GET['page'] == 'cmp-settings' ) {
963
  if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
964
  $status = 'success';
965
+ $message = __('CMP Settings Saved', 'cmp-coming-soon-maintenance');
966
 
967
  echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
968
  }
992
  add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
993
  add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
994
  add_action( 'admin_enqueue_scripts', array($cmpPlugin,'cmp_add_admin_style') );
995
+ add_action( 'admin_enqueue_scripts', array($cmpPlugin, 'enqueue_admin_js' ) );
996
  register_activation_hook(__FILE__, array($cmpPlugin, 'cmp_activate'));
997
  register_deactivation_hook(__FILE__, array($cmpPlugin, 'cmp_deactivate'));
998
  register_uninstall_hook(__FILE__, 'cmp_plugin_delete');
999
 
1000
+ add_filter( 'style_loader_src', array($cmpPlugin,'sdt_remove_ver_css_js'), 9999, 2 );
1001
+ add_filter( 'script_loader_src', array($cmpPlugin,'sdt_remove_ver_css_js'), 9999, 2 );
1002
 
1003
 
1004
 
readme.txt CHANGED
@@ -3,23 +3,24 @@ Contributors: NiteoThemes
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
5
  Requires at least: 3.0
6
- Tested up to: 4.7.4
7
- Stable tag: 1.7.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- New and free Wordpress plugin to create customized Coming Soon, Maintenance or Welcome landing pages.
12
 
13
  == Description ==
14
 
15
- CMP is new and free Wordpress plugin to create customized Coming Soon, Maintenance or Welcome landing page. Insert custom logo, choose from thousands of free hi-res stock Unsplash images, patterns, or just simply use custom media, edit your own texts, insert subscribe form, social network icons, customize colors and fonts types and SEO meta.
16
 
17
  <h3>Preview</h3>
18
- <a href="http://cmp.niteo.cz/?cmp_preview=true&theme=construct" target="_blank">Click for preview of Construct Theme >></a><br>
19
- <a href="http://cmp.niteo.cz/?cmp_preview=true&theme=hardwork" target="_blank">Click for preview of Hardwork Theme >></a>
20
- <a href="http://cmp.niteo.cz/?cmp_preview=true&theme=hardwork_premium" target="_blank">Click for preview of Hardwork Premium Theme >></a>
21
- <a href="http://cmp.niteo.cz/?cmp_preview=true&theme=frame" target="_blank">Click for preview of Frame Theme >></a>
22
- <a href="http://cmp.niteo.cz/?cmp_preview=true&theme=fifty" target="_blank">Click for preview of Fifty Theme >></a>
 
23
 
24
  <h3>Features</h3>
25
  <ul>
@@ -55,25 +56,29 @@ CMP is new and free Wordpress plugin to create customized Coming Soon, Maintenan
55
  <ul>
56
  <li>Navigate to the 'Add New' in the plugins dashboard</li>
57
  <li>Navigate to the 'Upload' area</li>
58
- <li>Download <code>cmp-coming-soon-maintenance.zip</code> and select <code>cmp-coming-soon-maintenance.zip</code> from your directory</li>
59
  <li>Click 'Install Now'</li>
60
  <li>Activate the plugin in the Plugin dashboard</li>
61
  <li>To Setup click Settings->CMP Settings and change the settings there</li>
62
  </ul>
63
 
 
 
 
 
 
 
 
 
 
 
64
 
65
  == Screenshots ==
66
  1. CMP - Coming Soon Construct Theme
67
- 2. CMP - Render Design
68
  3. CMP - Settings Page Overview
69
- 4. CMP - Settings Page Unsplash Detail
70
- 5. CMP - Coming Soon Construct Theme
71
- 6. CMP - Coming Soon Countdown Theme
72
- 7. CMP - Coming Soon Premium Fifty Theme
73
- 8. CMP - Coming Soon Premium Fifty Theme
74
- 9. CMP - Coming Soon Premium Frame Theme
75
- 10. CMP - Coming Soon Hardwork Theme
76
- 11. CMP - Coming Soon Hardwork Premium Theme
77
 
78
  == Frequently Asked Questions ==
79
  <h4>I can't see the landing page I`ve just created!</h4>
@@ -84,10 +89,10 @@ CMP is new and free Wordpress plugin to create customized Coming Soon, Maintenan
84
  <p>On the other hand if you have your website already up and running but you are doing only a short maintenance it`s better to send out response 503 HTTP Service unavailable code. By that way you make sure the search engines do not index your temporarily website while it`s down to maintenance and do not lower your website SEO score.</p>
85
 
86
  <h4>Is it a bug? Noone likes BUGS!</h4>
87
- <p>This is awkward and shame on us:(. Fortunately we are nice guys and if you let us know about it trough <a href="http://niteo.cz">NiteoThemes website</a> contact form we promise to fix it as soon as possible!</p>
88
 
89
  <h4>Features requests or you have new idea?</h4>
90
- <p>That`s perfect because we want to make our plugin great and to fit exactly your needs! Just let us know <a href="http://niteo.cz">NiteoThemes website</a> contact form and we might include it in next plugin update!</p>
91
 
92
 
93
  <h4>I really like your plugin and I want to support it!</h4>
@@ -96,12 +101,26 @@ CMP is new and free Wordpress plugin to create customized Coming Soon, Maintenan
96
 
97
 
98
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  <h4>1.7.0</h4>
100
  <ul>
101
- <li>Completely redesigned Theme Selector. You can now see Theme version, See Preview, display more photos, etc.</li>
102
- <li>Added Save Button to each section to enhance user experience.</li>
103
- <li>Changed order of some settings panels to bring more important settings to top of Settings page.</li>
104
- <li>Updated all Themes to reflect new settings and updated Theme`s style.css with some minor design changes.</li>
105
  <li>Updated Text Domain for International translations</li>
106
  </ul>
107
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
5
  Requires at least: 3.0
6
+ Tested up to: 4.8
7
+ Stable tag: 1.8.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Create and customize your own landing page for Coming soon Page or Maintenance mode including subscribe form with ease of few mouse clicks.
12
 
13
  == Description ==
14
 
15
+ Free plugin to create and customize your own Coming Soon or Maintenance landing page. Setup custom logos, background graphics, texts, subscribe form, your social networks, fonts and colors, and many more.
16
 
17
  <h3>Preview</h3>
18
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=construct" target="_blank">Click for preview of Construct Theme >></a><br>
19
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork" target="_blank">Click for preview of Hardwork Theme >></a>
20
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown" target="_blank">Click for preview of Countdown Theme >></a>
21
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork_premium" target="_blank">Click for preview of Hardwork Premium Theme >></a>
22
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=frame" target="_blank">Click for preview of Frame Theme >></a>
23
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=fifty" target="_blank">Click for preview of Fifty Theme >></a>
24
 
25
  <h3>Features</h3>
26
  <ul>
56
  <ul>
57
  <li>Navigate to the 'Add New' in the plugins dashboard</li>
58
  <li>Navigate to the 'Upload' area</li>
59
+ <li>Download <code>comingsoon.zip</code> and select <code>comingsoon.zip</code> from your directory</li>
60
  <li>Click 'Install Now'</li>
61
  <li>Activate the plugin in the Plugin dashboard</li>
62
  <li>To Setup click Settings->CMP Settings and change the settings there</li>
63
  </ul>
64
 
65
+ <h3>FTP Upload</h3>
66
+ <ul>
67
+ <li>Navigate to the 'Add New' in the plugins dashboard</li>
68
+ <li>Navigate to the 'Upload' area</li>
69
+ <li>Download <code>comingsoon.zip</code> and extract the <code>comingsoon.zip</code> zip file to your computer</li>
70
+ <li>Upload the extracted <code>comingsoon</code> directory to the <code>/wp-content/plugins/</code> directory</li>
71
+ <li>Activate the plugin in the Plugin dashboard</li>
72
+ <li>To Setup click Settings->CMP Settings and change the settings there</li>
73
+ </ul>
74
+
75
 
76
  == Screenshots ==
77
  1. CMP - Coming Soon Construct Theme
78
+ 2. CMP - Maintenance Hardwork Theme
79
  3. CMP - Settings Page Overview
80
+ 4. CMP - Settings Page Detail
81
+ 5. CMP - Settings Page Unsplash Detail
 
 
 
 
 
 
82
 
83
  == Frequently Asked Questions ==
84
  <h4>I can't see the landing page I`ve just created!</h4>
89
  <p>On the other hand if you have your website already up and running but you are doing only a short maintenance it`s better to send out response 503 HTTP Service unavailable code. By that way you make sure the search engines do not index your temporarily website while it`s down to maintenance and do not lower your website SEO score.</p>
90
 
91
  <h4>Is it a bug? Noone likes BUGS!</h4>
92
+ <p>This is awkward and shame on us:(. Fortunately we are nice guys and if you let us know about it trough <a href="http://niteothemes.com">NiteoThemes website</a> contact form we promise to fix it as soon as possible!</p>
93
 
94
  <h4>Features requests or you have new idea?</h4>
95
+ <p>That`s perfect because we want to make our plugin great and to fit exactly your needs! Just let us know <a href="http://niteothemes.com">NiteoThemes website</a> contact form and we might include it in next plugin update!</p>
96
 
97
 
98
  <h4>I really like your plugin and I want to support it!</h4>
101
 
102
 
103
  == Changelog ==
104
+ <h4>1.8.0</h4>
105
+ <h3>!Important Notice!</h3>
106
+ <p>Theme related settings - logo, graphic banner and font types will be lost after installation of this version! Make sure you set it up again in CMP Settings. Thank you for understanding :)</p>
107
+ <ul>
108
+ <li>New Feature: CMP Redirect Mode. You can select only redirect mode, and visitor will be redirected to specified URL.</li>
109
+ <li>New Feature: Favicon image/icon settings under SEO Settings.</li>
110
+ <li>New Feature: CMP Settings new sub-pages: View Subscribers, About.</li>
111
+ <li>New Feature: Subscribers can be listed, deleted or exported on a separate page now.</li>
112
+ <li>New Feature: Text logo is dislayed if not graphic logo is selected.</li>
113
+ <li>New Feature: IP Address of visitor added to subscribers list.</li>
114
+ <li>New Feature: CMP Settings sections are expansive on click.</li>
115
+ <li>Change: CMP Settings Page moved directly to WP-ADMIN menu.</li>
116
+ <li>Change: New TABS on CMP Settings: "Content" and "Theme Setup". All settings on "Content" tab is shared across all Themes. Settings on "Theme Setup" is Theme specific settings: Logo, Background media(image, colors, patterns, etc), Colors and Font types.</li>
117
+ <li>Many other small UI changes in CMP Settings page.</li>
118
+ </ul>
119
+
120
  <h4>1.7.0</h4>
121
  <ul>
122
+ <li>Completely redesigned Theme Selector. You can now see Theme version, see more details with big images, etc.</li>
123
+ <li>Added Save Button to each section to enhance Settings user experience.</li>
 
 
124
  <li>Updated Text Domain for International translations</li>
125
  </ul>
126
 
themes/construct/construct-defaults.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '2');
5
+
6
+ $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']', 'Fjalla One');
7
+ $niteoCS_font_content = get_option('niteoCS_font_content['.$themeslug.']', 'Average Sans');
8
+
9
+ $niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#f37004');
10
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#686868');
11
+ $niteoCS_background_color = get_option('niteoCS_background_color['.$themeslug.']', '#ffffff');
themes/construct/construct-settings.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
-
4
  // check onces and wordpress rights, else DIE
5
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
6
  if( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
@@ -8,34 +7,27 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
8
  }
9
  }
10
 
11
- // get options
12
- $niteoCS_active_color = get_option('niteoCS_active_color[construct]', '#f37004');
13
- $niteoCS_font_color = get_option('niteoCS_font_color[construct]', '#686868');
14
- $niteoCS_background_color = get_option('niteoCS_background_color[construct]', '#ffffff');
15
-
16
-
17
 
18
  if ( isset($_POST['niteoCS_active_color_construct']) ) {
19
  update_option('niteoCS_active_color[construct]', sanitize_hex_color( $_POST['niteoCS_active_color_construct']));
20
- $niteoCS_active_color = get_option('niteoCS_active_color[construct]');
21
  }
22
 
23
  if ( isset($_POST['niteoCS_font_color_construct']) ) {
24
  update_option('niteoCS_font_color[construct]', sanitize_hex_color($_POST['niteoCS_font_color_construct']));
25
- $niteoCS_font_color = get_option('niteoCS_font_color[construct]');
26
  }
27
 
28
  if ( isset($_POST['niteoCS_background_color_construct']) ) {
29
  update_option('niteoCS_background_color[construct]', sanitize_hex_color($_POST['niteoCS_background_color_construct']));
30
- $niteoCS_background_color = get_option('niteoCS_background_color[construct]');
31
  }
32
 
33
-
 
 
34
  ?>
35
 
36
- <div class="table-wrapper content">
37
  <h3><?php _e('Customize Colors', 'cmp-coming-soon-maintenance');?></h3>
38
- <table class="content">
39
  <tr>
40
  <th><h4><?php _e('Active Color', 'cmp-coming-soon-maintenance');?></h4></th>
41
  <td>
@@ -61,11 +53,14 @@ if ( isset($_POST['niteoCS_background_color_construct']) ) {
61
  </fieldset>
62
  </td>
63
  </tr>
 
 
 
 
 
 
64
  </table>
65
- <p class="cmp-submit">
66
- <?php wp_nonce_field('save_options','save_options_field'); ?>
67
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
68
- </p>
69
  </div>
70
 
71
  <script>
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
 
3
  // check onces and wordpress rights, else DIE
4
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
5
  if( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
7
  }
8
  }
9
 
 
 
 
 
 
 
10
 
11
  if ( isset($_POST['niteoCS_active_color_construct']) ) {
12
  update_option('niteoCS_active_color[construct]', sanitize_hex_color( $_POST['niteoCS_active_color_construct']));
 
13
  }
14
 
15
  if ( isset($_POST['niteoCS_font_color_construct']) ) {
16
  update_option('niteoCS_font_color[construct]', sanitize_hex_color($_POST['niteoCS_font_color_construct']));
 
17
  }
18
 
19
  if ( isset($_POST['niteoCS_background_color_construct']) ) {
20
  update_option('niteoCS_background_color[construct]', sanitize_hex_color($_POST['niteoCS_background_color_construct']));
 
21
  }
22
 
23
+ $niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#f37004');
24
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#686868');
25
+ $niteoCS_background_color = get_option('niteoCS_background_color['.$themeslug.']', '#ffffff');
26
  ?>
27
 
28
+ <div class="table-wrapper theme-setup">
29
  <h3><?php _e('Customize Colors', 'cmp-coming-soon-maintenance');?></h3>
30
+ <table class="theme-setup">
31
  <tr>
32
  <th><h4><?php _e('Active Color', 'cmp-coming-soon-maintenance');?></h4></th>
33
  <td>
53
  </fieldset>
54
  </td>
55
  </tr>
56
+ <tr><th>
57
+ <p class="cmp-submit">
58
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
59
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
60
+ </p>
61
+ </th></tr>
62
  </table>
63
+
 
 
 
64
  </div>
65
 
66
  <script>
themes/construct/construct-theme.php CHANGED
@@ -2,6 +2,10 @@
2
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['form_honeypot'] === '' && isset( $_POST['EMAIL'] ) && is_email( $_POST['EMAIL'] ) ) {
3
  $subscribe_response = $this->niteo_subscribe( $_POST['EMAIL'] );
4
  }
 
 
 
 
5
  ?>
6
 
7
  <!DOCTYPE html>
@@ -14,42 +18,33 @@
14
  <!-- SEO -->
15
  <meta name="description" content="<?php echo esc_html( stripslashes(get_option('niteoCS_descr', 'Just another Coming Soon Page')) ); ?>">
16
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- <?php
19
- // get saved style options
20
- $ver = '1.7';
21
- $active_color = get_option('niteoCS_active_color[construct]', '#f37004');
22
- $font_color = get_option('niteoCS_font_color[construct]', '#686868');
23
- $background_color = get_option('niteoCS_background_color[construct]', '#ffffff');
24
- $heading_font = get_option('niteoCS_font_headings', 'Fjalla One');
25
- $content_font = get_option('niteoCS_font_content', 'Average Sans');
26
- // get saved content options
27
- $logo_id = get_option('niteoCS_logo_id');
28
- $niteoCS_banner = get_option('niteoCS_banner', '2');
29
- $unplash_feed = get_option('niteoCS_unsplash_feed', '0');
30
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
31
  $subscribe = get_option('niteoCS_subscribe_type', '2');
32
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
33
  $copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
34
  $social_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
 
35
 
36
- // override options if theme preview isset
37
- if ( isset( $theme_preview ) && $theme_preview == 'construct') {
38
- $heading_font = 'Fjalla One';
39
- $content_font ='Average Sans';
40
- $logo_id = '4';
41
- $niteoCS_banner = '2';
42
- $body_title = 'SOMETHING IS HAPPENING!';
43
-
44
- }
45
-
46
- if ( $heading_font == 'custom' ) {
47
- $heading_font = get_option('niteoCS_font_headings_custom');
48
- }
49
-
50
- if ( $content_font == 'custom' ) {
51
- $content_font = get_option('niteoCS_font_content_custom');
52
- }
53
 
54
  // migrade social media to new option after update 1.4.0
55
  if ( !get_option('niteoCS_socialmedia') ) {
@@ -84,20 +79,29 @@
84
  }
85
  }
86
 
 
 
 
 
 
 
 
 
 
87
 
88
  if ( get_option( 'blog_public' ) == 0 ) {
89
  echo "<meta name='robots' content='noindex,nofollow' />";
90
- } ?>
91
-
92
- <?php
93
  if ( $enable_social === true ) { ?>
94
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
95
  <?php
96
  } ?>
97
- <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'construct/style.css?ver='.$ver;?>" type="text/css" media="all"></link>
98
 
99
  <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
100
- <?php wp_site_icon();?>
101
  <style>
102
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
103
  body{background-color:<?php echo esc_attr( $background_color ); ?>}
@@ -147,15 +151,12 @@
147
  } else {
148
  $size = 'full';
149
  }
150
- // get logo
151
- if ( $logo_id != '' ) {
152
- $logo_url = wp_get_attachment_image_src( $logo_id, $size);
153
- }
154
 
155
  switch ($niteoCS_banner) {
156
  // custom media
157
  case '0':
158
- $banner_id = get_option('niteoCS_banner_id');
159
  $background_class = 'image';
160
  if ( $banner_id != '' ) {
161
  $banner_ids = explode(',', $banner_id);
@@ -166,7 +167,7 @@
166
 
167
  } else {
168
  // set construct img
169
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'construct/img/construct_banner_'.$size.'.jpg';
170
  }
171
  break;
172
 
@@ -176,22 +177,22 @@
176
  switch ( $unplash_feed ) {
177
  // SINGLE IMAGE
178
  case '0':
179
- $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0', '') );
180
  $banner_url = $this->niteo_unsplash( $params );
181
  break;
182
  // category random
183
  case '1':
184
- $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category'), 'custom_str' => get_option('niteoCS_cat_keyword', '') );
185
  $banner_url = $this->niteo_unsplash( $params );
186
  break;
187
  // collection
188
  case '2':
189
- $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2', '') );
190
  $banner_url = $this->niteo_unsplash( $params );
191
  break;
192
  // random photo
193
  case '3':
194
- $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'cat' => get_option('niteoCS_unsplash_feat', '0') );
195
  $banner_url = $this->niteo_unsplash( $params );
196
  break;
197
 
@@ -204,14 +205,13 @@
204
  case '2':
205
  // default image
206
  $background_class = 'image';
207
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'construct/img/construct_banner_'.$size.'.jpg';
208
  break;
209
 
210
  case '3':
211
- // Pattern
212
  // Pattern
213
  $background_class = 'pattern';
214
- $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
215
 
216
  if ($niteoCS_banner_pattern != 'custom') {
217
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
@@ -219,7 +219,7 @@
219
  echo '<!-- Background pattern from Subtle Patterns --!>';
220
 
221
  } else {
222
- $banner_url = get_option('niteoCS_banner_pattern_custom');
223
  }
224
 
225
  break;
@@ -227,7 +227,7 @@
227
  // Pattern
228
  $background_class = 'color';
229
  $banner_url = '';
230
- $niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
231
  echo '<style>.banner.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
232
  break;
233
 
@@ -238,9 +238,28 @@
238
 
239
  <body>
240
  <section class="section section-logo">
241
- <?php if ( isset($logo_url[0]) ) { ?>
242
- <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
243
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  </section>
245
 
246
  <section class="section section-banner" id="banner-wrapper">
@@ -350,7 +369,7 @@
350
  <?php
351
  } ?>
352
 
353
- <script type='text/javascript' src='<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'construct/paraxify.min.js';?>'></script>
354
  </body>
355
 
356
  </html>
2
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['form_honeypot'] === '' && isset( $_POST['EMAIL'] ) && is_email( $_POST['EMAIL'] ) ) {
3
  $subscribe_response = $this->niteo_subscribe( $_POST['EMAIL'] );
4
  }
5
+
6
+ $ver = '1.7';
7
+ $themeslug = 'construct';
8
+
9
  ?>
10
 
11
  <!DOCTYPE html>
18
  <!-- SEO -->
19
  <meta name="description" content="<?php echo esc_html( stripslashes(get_option('niteoCS_descr', 'Just another Coming Soon Page')) ); ?>">
20
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
21
+ <?php
22
+ // get theme related settings
23
+ $active_color = get_option('niteoCS_active_color['.$themeslug.']', '#f37004');
24
+ $font_color = get_option('niteoCS_font_color['.$themeslug.']', '#686868');
25
+ $background_color = get_option('niteoCS_background_color['.$themeslug.']', '#ffffff');
26
+ $heading_font = get_option('niteoCS_font_headings['.$themeslug.']', 'Fjalla One');
27
+ $content_font = get_option('niteoCS_font_content['.$themeslug.']', 'Average Sans');
28
+ $logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
29
+
30
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '2');
31
+ $unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
32
+ if ( $heading_font == 'custom' ) {
33
+ $heading_font = get_option('niteoCS_font_headings_custom['.$themeslug.']');
34
+ }
35
+
36
+ if ( $content_font == 'custom' ) {
37
+ $content_font = get_option('niteoCS_font_content_custom['.$themeslug.']');
38
+ }
39
 
40
+ // get global settings
 
 
 
 
 
 
 
 
 
 
 
41
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
42
  $subscribe = get_option('niteoCS_subscribe_type', '2');
43
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
44
  $copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
45
  $social_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
46
+ $favicon_id = get_option('niteoCS_favicon_id');
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  // migrade social media to new option after update 1.4.0
50
  if ( !get_option('niteoCS_socialmedia') ) {
79
  }
80
  }
81
 
82
+ // display favicon
83
+ if ( $favicon_id && $favicon_id != '' ) {
84
+ $favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
85
+ if ( isset($favicon_url[0]) ){
86
+ echo '<link id="favicon" rel="shortcut icon" href="'.$favicon_url[0].'" type="image/x-icon"/>';
87
+ }
88
+ } else {
89
+ wp_site_icon();
90
+ }
91
 
92
  if ( get_option( 'blog_public' ) == 0 ) {
93
  echo "<meta name='robots' content='noindex,nofollow' />";
94
+ }
95
+
96
+
97
  if ( $enable_social === true ) { ?>
98
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
99
  <?php
100
  } ?>
101
+ <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/style.css?ver='.$ver;?>" type="text/css" media="all"></link>
102
 
103
  <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
104
+
105
  <style>
106
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
107
  body{background-color:<?php echo esc_attr( $background_color ); ?>}
151
  } else {
152
  $size = 'full';
153
  }
154
+
 
 
 
155
 
156
  switch ($niteoCS_banner) {
157
  // custom media
158
  case '0':
159
+ $banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
160
  $background_class = 'image';
161
  if ( $banner_id != '' ) {
162
  $banner_ids = explode(',', $banner_id);
167
 
168
  } else {
169
  // set construct img
170
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
171
  }
172
  break;
173
 
177
  switch ( $unplash_feed ) {
178
  // SINGLE IMAGE
179
  case '0':
180
+ $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
181
  $banner_url = $this->niteo_unsplash( $params );
182
  break;
183
  // category random
184
  case '1':
185
+ $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
186
  $banner_url = $this->niteo_unsplash( $params );
187
  break;
188
  // collection
189
  case '2':
190
+ $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
191
  $banner_url = $this->niteo_unsplash( $params );
192
  break;
193
  // random photo
194
  case '3':
195
+ $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
196
  $banner_url = $this->niteo_unsplash( $params );
197
  break;
198
 
205
  case '2':
206
  // default image
207
  $background_class = 'image';
208
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
209
  break;
210
 
211
  case '3':
 
212
  // Pattern
213
  $background_class = 'pattern';
214
+ $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
215
 
216
  if ($niteoCS_banner_pattern != 'custom') {
217
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
219
  echo '<!-- Background pattern from Subtle Patterns --!>';
220
 
221
  } else {
222
+ $banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
223
  }
224
 
225
  break;
227
  // Pattern
228
  $background_class = 'color';
229
  $banner_url = '';
230
+ $niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
231
  echo '<style>.banner.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
232
  break;
233
 
238
 
239
  <body>
240
  <section class="section section-logo">
241
+ <?php
242
+ switch ($logo_type) {
243
+ case 'graphic':
244
+ // get logo id
245
+ $logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
246
+ // get logo
247
+ if ( $logo_id != '' ) {
248
+ $logo_url = wp_get_attachment_image_src( $logo_id, $size);
249
+ }
250
+ if ( isset($logo_url[0]) ) { ?>
251
+ <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
252
+ <?php
253
+ }
254
+ break;
255
+ case 'text':
256
+ $text_logo = get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' )); ?>
257
+ <h1><?php echo esc_html($text_logo); ?></h1>
258
+ <?php
259
+ case 'disabled':
260
+ default:
261
+ break;
262
+ } ?>
263
  </section>
264
 
265
  <section class="section section-banner" id="banner-wrapper">
369
  <?php
370
  } ?>
371
 
372
+ <script type='text/javascript' src='<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug .'/paraxify.min.js';?>'></script>
373
  </body>
374
 
375
  </html>
themes/construct/style.css CHANGED
@@ -1,10 +1,10 @@
1
  /*
2
  Theme Name: Construct
3
- Theme URI: http://cmp.niteo.cz/?cmp_preview=true&theme=construct
4
  Author: Niteo
5
- Author URI: http://niteo.cz/
6
  Version: 1.7
7
- Details URI: {"1": "http:\/\/niteo.cz\/cmp-screenshots\/construct\/screenshot1.jpg"}
8
  Description: <p>Construct is clean and modern designed theme for CMP plugin. Construct features big paralax banner which can be set to any custom graphic, pattern or Unsplash library media. Add subscribe form, your customized social media icons and it can be used both Coming soon or Under Construction landing page.</p><h4>Main Features</h4><ul><li>Custom paralax banner</li><li>Subscribe form</li><li>Responsive design</li></ul>
9
 
10
  Normalizing styles have been helped along thanks to the fine work of
@@ -38,6 +38,7 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
38
  -moz-flex-grow: 1;}
39
  .section-logo {max-width: 500px; margin: 0 auto;}
40
  .section-logo img {max-width: 100%;max-height: 300px;}
 
41
  .section-banner{height: 300px;}
42
  .section-body p{width:70%;max-width: 900px;margin:1em auto;}
43
  .section-social{background-color: #f8f8f8;}
@@ -48,7 +49,7 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
48
  .social-list li{list-style: none;display: inline-block; padding: 0 5px;}
49
  .section-body form{max-width: 400px;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
50
  .section-body form br {display: none;}
51
- label {display: block;padding-bottom: 5px;}
52
  input[type="email"] {width:280px;background-color: #f8f8f8;text-indent: 15px;font-style: italic;border: 1px solid #dcdcdc; border-top-left-radius:5px;border-bottom-left-radius:5px;}
53
  input[type="submit"] {padding: 0;margin-left:-7px;width: 120px;color: white;font-weight:700;border: none;border-top-right-radius:5px;border-bottom-right-radius:5px;letter-spacing: 1px;cursor:pointer;}
54
  input[type="email"],
1
  /*
2
  Theme Name: Construct
3
+ Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=construct
4
  Author: Niteo
5
+ Author URI: https://niteothemes.com
6
  Version: 1.7
7
+ Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/construct\/screenshot1.jpg"}
8
  Description: <p>Construct is clean and modern designed theme for CMP plugin. Construct features big paralax banner which can be set to any custom graphic, pattern or Unsplash library media. Add subscribe form, your customized social media icons and it can be used both Coming soon or Under Construction landing page.</p><h4>Main Features</h4><ul><li>Custom paralax banner</li><li>Subscribe form</li><li>Responsive design</li></ul>
9
 
10
  Normalizing styles have been helped along thanks to the fine work of
38
  -moz-flex-grow: 1;}
39
  .section-logo {max-width: 500px; margin: 0 auto;}
40
  .section-logo img {max-width: 100%;max-height: 300px;}
41
+ .section-logo h1 {font-size: 2.5em; text-transform: uppercase;}
42
  .section-banner{height: 300px;}
43
  .section-body p{width:70%;max-width: 900px;margin:1em auto;}
44
  .section-social{background-color: #f8f8f8;}
49
  .social-list li{list-style: none;display: inline-block; padding: 0 5px;}
50
  .section-body form{max-width: 400px;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
51
  .section-body form br {display: none;}
52
+ label {display: block;padding-bottom: 5px;text-indent: 15px;}
53
  input[type="email"] {width:280px;background-color: #f8f8f8;text-indent: 15px;font-style: italic;border: 1px solid #dcdcdc; border-top-left-radius:5px;border-bottom-left-radius:5px;}
54
  input[type="submit"] {padding: 0;margin-left:-7px;width: 120px;color: white;font-weight:700;border: none;border-top-right-radius:5px;border-bottom-right-radius:5px;letter-spacing: 1px;cursor:pointer;}
55
  input[type="email"],
themes/countdown/countdown-defaults.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '1');
5
+ $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']', 'Raleway');
6
+ $niteoCS_font_content = get_option('niteoCS_font_content['.$themeslug.']', 'Raleway');
7
+
8
+ // get options
9
+ $niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#E85C4F');
10
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#ffffff');
11
+ $niteoCS_overlay_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
12
+ $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.4');
themes/countdown/countdown-settings.php CHANGED
@@ -7,11 +7,6 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
7
  die('Sorry, but this request is invalid');
8
  }
9
  }
10
- // register and enqueue admin needed scripts
11
- wp_register_script('countdown_flatpicker_js', $this->cmp_themeDirPath().'/countdown/js/flatpickr.min.js');
12
- wp_register_style( 'countdown_flatpicker_css', $this->cmp_themeDirPath().'/countdown/css/flatpickr.min.css');
13
- wp_enqueue_script('countdown_flatpicker_js');
14
- wp_enqueue_style( 'countdown_flatpicker_css');
15
 
16
 
17
  if (isset($_POST['niteoCS_active_color_countdown'])) {
@@ -30,112 +25,24 @@ if (isset($_POST['niteoCS_overlay_opacity_countdown'])) {
30
  update_option('niteoCS_overlay_opacity[countdown]', sanitize_text_field($_POST['niteoCS_overlay_opacity_countdown']));
31
  }
32
 
33
- if (isset($_POST['niteoCS_counter']) && is_numeric($_POST['niteoCS_counter'])) {
34
- update_option('niteoCS_counter', sanitize_text_field($_POST['niteoCS_counter']));
35
- }
36
-
37
- if (isset($_POST['niteoCS_counter_date'])) {
38
- update_option('niteoCS_counter_date', sanitize_text_field($_POST['niteoCS_counter_date']));
39
- }
40
-
41
- if (isset($_POST['niteoCS_countdown_action'])) {
42
- update_option('niteoCS_countdown_action', sanitize_text_field($_POST['niteoCS_countdown_action']));
43
- }
44
-
45
- if (isset($_POST['niteoCS_countdown_text'])) {
46
- update_option('niteoCS_countdown_text', sanitize_text_field($_POST['niteoCS_countdown_text']));
47
- }
48
-
49
- if (isset($_POST['niteoCS_countdown_redirect'])) {
50
- update_option('niteoCS_countdown_redirect', esc_url_raw($_POST['niteoCS_countdown_redirect']));
51
- }
52
 
53
  // get options
54
- $niteoCS_active_color = get_option('niteoCS_active_color[countdown]', '#E85C4F');
55
- $niteoCS_font_color = get_option('niteoCS_font_color[countdown]', '#ffffff');
56
- $niteoCS_overlay_color = get_option('niteoCS_overlay_color[countdown]', '#0a0a0a');
57
- $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity[countdown]', '0.0');
58
- $niteoCS_counter = get_option('niteoCS_counter', '0');
59
- $niteoCS_counter_date = get_option('niteoCS_counter_date');
60
- $niteoCS_countdown_action = get_option('niteoCS_countdown_action', 'no-action');
61
- $niteoCS_countdown_text = get_option('niteoCS_countdown_text');
62
- $niteoCS_countdown_redirect = get_option('niteoCS_countdown_redirect');
63
 
64
  ?>
65
 
66
  <style>
67
  #social-section tr:first-of-type {display: none!important;}
68
  .flatpickr-input {width: 50%;margin-bottom: 1em;}
69
- #niteoCS_countdown_text,
70
- #niteoCS_countdown_redirect {display: none;}
71
  </style>
72
 
73
- <div class="table-wrapper content">
74
- <h3><?php _e('Countdown Timer Setup', 'cmp');?></h3>
75
- <table class="content">
76
- <tr>
77
- <th>
78
- <fieldset>
79
- <legend class="screen-reader-text">
80
- <span><?php _e('Counter setup', 'cmp');?></span>
81
- </legend>
82
-
83
- <p>
84
- <label title="Enabled">
85
- <input type="radio" name="niteoCS_counter" value="1"<?php if ( $niteoCS_counter == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Enabled', 'cmp');?>
86
- </label>
87
- </p>
88
-
89
- <p>
90
- <label title="Disabled">
91
- <input type="radio" name="niteoCS_counter" value="0"<?php if ( $niteoCS_counter == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp');?>
92
- </label>
93
- </p>
94
-
95
- </fieldset>
96
- </th>
97
-
98
- <td id="counter-disabled">
99
- <p><?php _e('Countdown Timer is disabled.', 'cmp');?></p>
100
- </td>
101
-
102
- <td id="counter-enabled">
103
- <p><?php _e('Click on date input and set a date & time for a Countdown timer.', 'cmp');?></p>
104
- <fieldset>
105
- <legend class="screen-reader-text">
106
- <span><?php _e('Counter setup', 'cmp');?></span>
107
- </legend>
108
-
109
- <input type="text" name="niteoCS_counter_date" id="niteoCS_counter_date" placeholder="<?php _e('Select Date..','cmp');?>" value="<?php echo esc_attr( $niteoCS_counter_date); ?>" class="regular-text code"><br>
110
-
111
- <label for="niteoCS_countdown_action"><?php _e('Countdown action:', 'cmp');?></label>
112
- <select name="niteoCS_countdown_action">
113
- <option value="no-action" <?php if ( $niteoCS_countdown_action == 'no-action' ) { echo ' selected="selected"'; } ?>><?php _e('No action', 'cmp');?></option>
114
- <!-- <option value="display-text" <?php if ( $niteoCS_countdown_action == 'display-text' ) { echo ' selected="selected"'; } ?>><?php _e('Display custom text', 'cmp');?></option> -->
115
- <option value="disable-cmp" <?php if ( $niteoCS_countdown_action == 'disable-cmp' ) { echo ' selected="selected"'; } ?>><?php _e('Disable CMP Plugin Page', 'cmp');?></option>
116
- <option value="redirect" <?php if ( $niteoCS_countdown_action == 'redirect' ) { echo ' selected="selected"'; } ?>><?php _e('URL redirect', 'cmp');?></option>
117
- </select>
118
-
119
- <label for="niteoCS_countdown_text" id="niteoCS_countdown_text"><?php _e('Enter custom text', 'cmp');?>
120
- <input type="text" name="niteoCS_countdown_text" value="<?php echo esc_attr( $niteoCS_countdown_text); ?>" class="regular-text code"><br>
121
- </label>
122
-
123
- <label for="niteoCS_countdown_redirect" id="niteoCS_countdown_redirect"><?php _e('Enter redirect URL', 'cmp');?>
124
- <input type="text" name="niteoCS_countdown_redirect" value="<?php echo esc_url( $niteoCS_countdown_redirect); ?>" class="regular-text code"><br>
125
- </label>
126
- </fieldset>
127
- </td>
128
- </tr>
129
- </table>
130
- <p class="cmp-submit">
131
- <?php wp_nonce_field('save_options','save_options_field'); ?>
132
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
133
- </p>
134
- </div>
135
 
136
- <div class="table-wrapper content">
137
  <h3><?php _e('Customize Colors', 'cmp');?></h3>
138
- <table class="customization">
139
  <tr>
140
  <th><h4><?php _e('Active Color', 'cmp');?></h4></th>
141
  <td>
@@ -168,47 +75,20 @@ $niteoCS_countdown_redirect = get_option('niteoCS_countdown_redirect');
168
  </fieldset>
169
  </td>
170
  </tr>
 
 
 
 
 
 
171
  </table>
172
- <p class="cmp-submit">
173
- <?php wp_nonce_field('save_options','save_options_field'); ?>
174
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
175
- </p>
176
  </div>
177
 
178
 
179
  <script>
180
  jQuery(document).ready(function($){
181
 
182
- // enable-disable counter
183
- $('#csoptions input[name="niteoCS_counter"]').bind('change', function(){
184
- if ( jQuery('#csoptions input[name="niteoCS_counter"]:checked' ).val() == 0 ) {
185
- jQuery('#counter-disabled').css('display','block');
186
- jQuery('#counter-enabled').css('display','none');
187
-
188
- } else if ( jQuery('#csoptions input[name="niteoCS_counter"]:checked' ).val() == 1 ) {
189
- jQuery('#counter-disabled').css('display','none');
190
- jQuery('#counter-enabled').css('display','block');
191
- }
192
- });
193
- jQuery('#csoptions input[name="niteoCS_counter"]').trigger('change');
194
-
195
-
196
- // set countdown action
197
- $('#csoptions select[name="niteoCS_countdown_action"]').bind('change', function(){
198
- if ( jQuery('#csoptions select[name="niteoCS_countdown_action"]' ).val() == 'display-text' ) {
199
- jQuery('#niteoCS_countdown_text').css('display','block');
200
- jQuery('#niteoCS_countdown_redirect').css('display','none');
201
-
202
- } else if ( jQuery('#csoptions select[name="niteoCS_countdown_action"]' ).val() == 'redirect' ) {
203
- jQuery('#niteoCS_countdown_text').css('display','none');
204
- jQuery('#niteoCS_countdown_redirect').css('display','block');
205
- } else {
206
- jQuery('#niteoCS_countdown_text').css('display','none');
207
- jQuery('#niteoCS_countdown_redirect').css('display','none')
208
- }
209
- });
210
- jQuery('#csoptions select[name="niteoCS_countdown_action"]').trigger('change');
211
-
212
  // ini color picker
213
  jQuery('#niteoCS_font_color').wpColorPicker();
214
  jQuery('#niteoCS_background_color').wpColorPicker();
@@ -225,23 +105,5 @@ jQuery(document).ready(function($){
225
  }
226
  });
227
 
228
- <?php
229
- if ( $niteoCS_counter_date != '') { ?>
230
- var date = new Date(<?php echo esc_attr($niteoCS_counter_date);?>*1000);
231
- <?php
232
- } else { ?>
233
- var date = false;
234
- <?php
235
- } ?>
236
- // flatpicker
237
- $('#niteoCS_counter_date').flatpickr({
238
- minDate: 'today',
239
- defaultDate: date,
240
- enableTime: true,
241
- altInput: true,
242
- dateFormat: 'U'
243
- });
244
-
245
-
246
  });
247
  </script>
7
  die('Sorry, but this request is invalid');
8
  }
9
  }
 
 
 
 
 
10
 
11
 
12
  if (isset($_POST['niteoCS_active_color_countdown'])) {
25
  update_option('niteoCS_overlay_opacity[countdown]', sanitize_text_field($_POST['niteoCS_overlay_opacity_countdown']));
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  // get options
30
+ $niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#E85C4F');
31
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#ffffff');
32
+ $niteoCS_overlay_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
33
+ $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.4');
 
 
 
 
 
34
 
35
  ?>
36
 
37
  <style>
38
  #social-section tr:first-of-type {display: none!important;}
39
  .flatpickr-input {width: 50%;margin-bottom: 1em;}
 
 
40
  </style>
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ <div class="table-wrapper theme-setup">
44
  <h3><?php _e('Customize Colors', 'cmp');?></h3>
45
+ <table class="theme-setup">
46
  <tr>
47
  <th><h4><?php _e('Active Color', 'cmp');?></h4></th>
48
  <td>
75
  </fieldset>
76
  </td>
77
  </tr>
78
+ <tr><th>
79
+ <p class="cmp-submit">
80
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
81
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
82
+ </p>
83
+ </th></tr>
84
  </table>
85
+
 
 
 
86
  </div>
87
 
88
 
89
  <script>
90
  jQuery(document).ready(function($){
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  // ini color picker
93
  jQuery('#niteoCS_font_color').wpColorPicker();
94
  jQuery('#niteoCS_background_color').wpColorPicker();
105
  }
106
  });
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  });
109
  </script>
themes/countdown/countdown-theme.php CHANGED
@@ -15,66 +15,81 @@
15
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!')) ); ?></title>
16
 
17
  <?php
18
- // get saved style options
19
  $ver = '1.3';
20
- $niteoCS_active_color = get_option('niteoCS_active_color[countdown]', '#e82e1e');
21
- $niteoCS_font_color = get_option('niteoCS_font_color[countdown]', '#3a3a3a');
 
 
22
  $niteoCS_font_color_light = $this->hex2hsl($niteoCS_font_color, '20');
23
- $niteoCS_overlay_color = get_option('niteoCS_overlay_color[countdown]', '#0a0a0a');
24
- $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity[countdown]', '0.0');
25
  $background_overlay = $this->hex2rgba($niteoCS_overlay_color, $niteoCS_overlay_opacity);
26
- $content_font = get_option('niteoCS_font_content', 'Raleway');
27
- // get saved content options
28
- $logo_id = get_option('niteoCS_logo_id');
29
- $niteoCS_banner = get_option('niteoCS_banner', '3');
30
- $unplash_feed = get_option('niteoCS_unsplash_feed', '0');
 
 
 
 
 
 
 
 
 
31
  $subscribe = get_option('niteoCS_subscribe_type', '2');
32
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
33
- $niteoCS_counter = get_option('niteoCS_counter');
34
- $niteoCS_counter_date = get_option('niteoCS_counter_date', date("Y-m-d"));
35
  $countdown_action = get_option('niteoCS_countdown_action', 'no-action');
36
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
37
  $body = get_option('niteoCS_body');
38
  $copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
39
-
40
- if ( $content_font == 'custom' ) {
41
- $content_font = get_option('niteoCS_font_content_custom');
42
- }
43
-
44
  $socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
45
  $socialmedia = json_decode($socialmedia, true);
46
  $social_location = get_option('social_location', 'footer');
47
  $enable_social = false;
48
 
49
- foreach ($socialmedia as $social) {
 
50
 
51
- if ( $social['hidden'] == '0' && $social['active'] == '1') {
52
- $enable_social = true;
53
- //sort array by hidden, then order key
54
- function sort_social($a, $b){
55
- if ( $a['hidden'] == $b['hidden'] ) {
56
- if( $a['order'] == $b['order'] ) {
57
- return 0;
 
 
 
 
58
  }
59
- return $a['order'] < $b['order'] ? -1 : 1;
60
- } else {
61
- return $a['hidden'] > $b['hidden'] ? 1 : -1;
62
- }
63
- }
64
- uasort($socialmedia , 'sort_social');
65
- break;
66
- }
67
  }
68
 
69
  // override options if theme preview isset
70
  if ( isset( $theme_preview ) && $theme_preview == 'countdown' ) {
71
- $content_font ='Lato';
72
- $logo_id = '8';
73
- // $niteoCS_banner = '2';
74
  $niteoCS_subscribe_label = 'Type your email and get notified.';
75
  $body = '<h2>We are currently improving our site</h2>';
76
  }
77
 
 
 
 
 
 
 
 
 
 
78
 
79
  if ( get_option( 'blog_public' ) == 0 ) {
80
  echo "<meta name='robots' content='noindex,nofollow' />";
@@ -85,14 +100,13 @@
85
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
86
  <?php
87
  } ?>
88
- <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'countdown/style.css?v='.$ver;?>" type="text/css" media="all"></link>
89
 
90
- <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
91
-
92
- <?php wp_site_icon();?>
93
 
94
  <style>
95
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $niteoCS_font_color ); ?>;}
 
96
  a {color:<?php echo esc_attr( $niteoCS_font_color ); ?>;}
97
  input[type="submit"] {background-color: <?php echo esc_attr($niteoCS_active_color);?>;}
98
  ::-webkit-input-placeholder {color: <?php echo esc_attr($niteoCS_font_color_light);?>;}
@@ -161,15 +175,11 @@
161
  } else {
162
  $size = 'full';
163
  }
164
- // get logo
165
- if ( $logo_id != '' ) {
166
- $logo_url = wp_get_attachment_image_src( $logo_id, $size);
167
- }
168
 
169
  switch ($niteoCS_banner) {
170
  // custom media
171
  case '0':
172
- $banner_id = get_option('niteoCS_banner_id');
173
  $background_class = 'image';
174
  if ( $banner_id != '' ) {
175
  $banner_ids = explode(',', $banner_id);
@@ -180,7 +190,7 @@
180
 
181
  } else {
182
  // set construct img
183
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'countdown/img/countdown_banner_'.$size.'.jpg';
184
  }
185
  break;
186
 
@@ -190,22 +200,22 @@
190
  switch ( $unplash_feed ) {
191
  // SINGLE IMAGE
192
  case '0':
193
- $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0', '') );
194
  $banner_url = $this->niteo_unsplash( $params );
195
  break;
196
  // category random
197
  case '1':
198
- $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category'), 'custom_str' => get_option('niteoCS_cat_keyword', '') );
199
  $banner_url = $this->niteo_unsplash( $params );
200
  break;
201
  // collection
202
  case '2':
203
- $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2', '') );
204
  $banner_url = $this->niteo_unsplash( $params );
205
  break;
206
  // random photo
207
  case '3':
208
- $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'cat' => get_option('niteoCS_unsplash_feat', '0') );
209
  $banner_url = $this->niteo_unsplash( $params );
210
  break;
211
 
@@ -218,13 +228,13 @@
218
  case '2':
219
  // default image
220
  $background_class = 'image';
221
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'countdown/img/countdown_banner_'.$size.'.jpg';
222
  break;
223
 
224
  case '3':
225
  // Pattern
226
  $background_class = 'pattern';
227
- $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
228
 
229
  if ($niteoCS_banner_pattern != 'custom') {
230
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
@@ -232,7 +242,7 @@
232
  echo '<!-- Background pattern from Subtle Patterns --!>';
233
 
234
  } else {
235
- $banner_url = get_option('niteoCS_banner_pattern_custom');
236
  }
237
 
238
  break;
@@ -240,7 +250,7 @@
240
  // Pattern
241
  $background_class = 'color';
242
  $banner_url = '';
243
- $niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
244
  echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
245
  break;
246
 
@@ -279,16 +289,32 @@
279
  } ?>
280
 
281
  <div class="inner-content">
282
-
283
- <?php
284
- // display logo
285
- if ( isset($logo_url[0]) ) { ?>
286
- <div class="logo">
287
- <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
288
- </div>
289
  <?php
290
- }
291
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  // display body content
293
  if ($body_title != '') { ?>
294
  <h2 class="title">
15
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!')) ); ?></title>
16
 
17
  <?php
 
18
  $ver = '1.3';
19
+ $themeslug = 'countdown';
20
+ // get theme related settings
21
+ $niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#E85C4F');
22
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#ffffff');
23
  $niteoCS_font_color_light = $this->hex2hsl($niteoCS_font_color, '20');
24
+ $niteoCS_overlay_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
25
+ $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.4');
26
  $background_overlay = $this->hex2rgba($niteoCS_overlay_color, $niteoCS_overlay_opacity);
27
+ $content_font = get_option('niteoCS_font_content['.$themeslug.']', 'Raleway');
28
+ $heading_font = get_option('niteoCS_font_headings['.$themeslug.']', 'Raleway');
29
+ $logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
30
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '1');
31
+ $unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
32
+
33
+ if ( $heading_font == 'custom' ) {
34
+ $heading_font = get_option('niteoCS_font_headings_custom['.$themeslug.']');
35
+ }
36
+
37
+ if ( $content_font == 'custom' ) {
38
+ $content_font = get_option('niteoCS_font_content_custom['.$themeslug.']');
39
+ }
40
+ // get global settings
41
  $subscribe = get_option('niteoCS_subscribe_type', '2');
42
  $niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
43
+ $niteoCS_counter = get_option('niteoCS_counter', '1');
44
+ $niteoCS_counter_date = get_option('niteoCS_counter_date', time()+86400);
45
  $countdown_action = get_option('niteoCS_countdown_action', 'no-action');
46
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
47
  $body = get_option('niteoCS_body');
48
  $copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
49
+ $favicon_id = get_option('niteoCS_favicon_id');
50
+
 
 
 
51
  $socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
52
  $socialmedia = json_decode($socialmedia, true);
53
  $social_location = get_option('social_location', 'footer');
54
  $enable_social = false;
55
 
56
+ if (is_array($socialmedia)) {
57
+ foreach ($socialmedia as $social) {
58
 
59
+ if ( $social['hidden'] == '0' && $social['active'] == '1') {
60
+ $enable_social = true;
61
+ //sort array by hidden, then order key
62
+ function sort_social($a, $b){
63
+ if ( $a['hidden'] == $b['hidden'] ) {
64
+ if( $a['order'] == $b['order'] ) {
65
+ return 0;
66
+ }
67
+ return $a['order'] < $b['order'] ? -1 : 1;
68
+ } else {
69
+ return $a['hidden'] > $b['hidden'] ? 1 : -1;
70
  }
71
+ }
72
+ uasort($socialmedia , 'sort_social');
73
+ break;
74
+ }
75
+ }
 
 
 
76
  }
77
 
78
  // override options if theme preview isset
79
  if ( isset( $theme_preview ) && $theme_preview == 'countdown' ) {
 
 
 
80
  $niteoCS_subscribe_label = 'Type your email and get notified.';
81
  $body = '<h2>We are currently improving our site</h2>';
82
  }
83
 
84
+ // display favicon
85
+ if ( $favicon_id && $favicon_id != '' ) {
86
+ $favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
87
+ if ( isset($favicon_url[0]) ){
88
+ echo '<link id="favicon" rel="shortcut icon" href="'.$favicon_url[0].'" type="image/x-icon"/>';
89
+ }
90
+ } else {
91
+ wp_site_icon();
92
+ }
93
 
94
  if ( get_option( 'blog_public' ) == 0 ) {
95
  echo "<meta name='robots' content='noindex,nofollow' />";
100
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
101
  <?php
102
  } ?>
103
+ <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/style.css?v='.$ver;?>" type="text/css" media="all"></link>
104
 
105
+ <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
 
 
106
 
107
  <style>
108
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $niteoCS_font_color ); ?>;}
109
+ h1,h2,h3,h4,h5,h6 {font-family:'<?php echo esc_attr($heading_font);?>', 'sans-serif';}
110
  a {color:<?php echo esc_attr( $niteoCS_font_color ); ?>;}
111
  input[type="submit"] {background-color: <?php echo esc_attr($niteoCS_active_color);?>;}
112
  ::-webkit-input-placeholder {color: <?php echo esc_attr($niteoCS_font_color_light);?>;}
175
  } else {
176
  $size = 'full';
177
  }
 
 
 
 
178
 
179
  switch ($niteoCS_banner) {
180
  // custom media
181
  case '0':
182
+ $banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
183
  $background_class = 'image';
184
  if ( $banner_id != '' ) {
185
  $banner_ids = explode(',', $banner_id);
190
 
191
  } else {
192
  // set construct img
193
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
194
  }
195
  break;
196
 
200
  switch ( $unplash_feed ) {
201
  // SINGLE IMAGE
202
  case '0':
203
+ $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
204
  $banner_url = $this->niteo_unsplash( $params );
205
  break;
206
  // category random
207
  case '1':
208
+ $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
209
  $banner_url = $this->niteo_unsplash( $params );
210
  break;
211
  // collection
212
  case '2':
213
+ $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
214
  $banner_url = $this->niteo_unsplash( $params );
215
  break;
216
  // random photo
217
  case '3':
218
+ $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
219
  $banner_url = $this->niteo_unsplash( $params );
220
  break;
221
 
228
  case '2':
229
  // default image
230
  $background_class = 'image';
231
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
232
  break;
233
 
234
  case '3':
235
  // Pattern
236
  $background_class = 'pattern';
237
+ $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
238
 
239
  if ($niteoCS_banner_pattern != 'custom') {
240
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
242
  echo '<!-- Background pattern from Subtle Patterns --!>';
243
 
244
  } else {
245
+ $banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
246
  }
247
 
248
  break;
250
  // Pattern
251
  $background_class = 'color';
252
  $banner_url = '';
253
+ $niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
254
  echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
255
  break;
256
 
289
  } ?>
290
 
291
  <div class="inner-content">
292
+ <div class="logo">
 
 
 
 
 
 
293
  <?php
294
+ switch ($logo_type) {
295
+ case 'graphic':
296
+ // get logo id
297
+ $logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
298
+ // get logo
299
+ if ( $logo_id != '' ) {
300
+ $logo_url = wp_get_attachment_image_src( $logo_id, $size);
301
+ }
302
+ if ( isset($logo_url[0]) ) { ?>
303
+ <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
304
+ <?php
305
+ }
306
+ break;
307
+ case 'text':
308
+ $text_logo = get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' )); ?>
309
+ <h1><?php echo esc_html($text_logo); ?></h1>
310
+ <?php
311
+ case 'disabled':
312
+ default:
313
+ break;
314
+ } ?>
315
+ </div>
316
+
317
+ <?php
318
  // display body content
319
  if ($body_title != '') { ?>
320
  <h2 class="title">
themes/countdown/img/countdown_thumbnail.jpg CHANGED
Binary file
themes/countdown/style.css CHANGED
@@ -1,10 +1,10 @@
1
  /*
2
  Theme Name: Countdown
3
- Theme URI: http://cmp.niteo.cz/?cmp_preview=true&theme=countdown
4
  Author: Niteo
5
- Author URI: http://niteo.cz/
6
  Version: 1.3
7
- Details URI: {"1": "http:\/\/niteo.cz\/cmp-screenshots\/countdown\/screenshot1.jpg","2":"http:\/\/niteo.cz\/cmp-screenshots\/countdown\/screenshot2.jpg"}
8
  Description: <p>Countdown theme attracts attention with big counting clocks, which you can set to any expiration date. When timer hits zero you can set following actions: do-nothing, redirect to set URL or disable CMP plugin and display your normal page to visitors.</p><p>Social icons can be set to a footer with transparent icons or inside Countdown body with big beautiful eye attacting icons.</p><h4>Main Features</h4><ul><li>Counter setup with three predefined actions</li><li>Two designs for Socials icons</li><li>Subscribe Form</li><li>Responsive design</li></ul>
9
 
10
 
@@ -501,7 +501,7 @@ input[type="submit"] {
501
  .counter-wrap {
502
  position: relative;
503
  display: inline-block;
504
- width: calc(25% - 21px);
505
  background-color: #ffffff;
506
  }
507
 
1
  /*
2
  Theme Name: Countdown
3
+ Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown
4
  Author: Niteo
5
+ Author URI: https//niteothemes.com
6
  Version: 1.3
7
+ Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot1.jpg","2":"https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot2.jpg"}
8
  Description: <p>Countdown theme attracts attention with big counting clocks, which you can set to any expiration date. When timer hits zero you can set following actions: do-nothing, redirect to set URL or disable CMP plugin and display your normal page to visitors.</p><p>Social icons can be set to a footer with transparent icons or inside Countdown body with big beautiful eye attacting icons.</p><h4>Main Features</h4><ul><li>Counter setup with three predefined actions</li><li>Two designs for Socials icons</li><li>Subscribe Form</li><li>Responsive design</li></ul>
9
 
10
 
501
  .counter-wrap {
502
  position: relative;
503
  display: inline-block;
504
+ width: calc(25% - 22px);
505
  background-color: #ffffff;
506
  }
507
 
themes/hardwork/hardwork-defaults.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '4');
5
+ $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']', 'Playfair Display');
6
+ $niteoCS_font_content = get_option('niteoCS_font_content['.$themeslug.']', 'Montserrat');
7
+ $niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#ffffff');
8
+
9
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#494949');
10
+ $niteoCS_overlay_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
11
+ $niteoCS_overlay_opacity_hardwork = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.0');
themes/hardwork/hardwork-settings.php CHANGED
@@ -9,8 +9,6 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
9
  }
10
 
11
 
12
-
13
-
14
  if (isset($_POST['niteoCS_font_color_hardwork'])) {
15
  update_option('niteoCS_font_color[hardwork]', sanitize_hex_color($_POST['niteoCS_font_color_hardwork']));
16
  $niteoCS_font_color = get_option('niteoCS_font_color[hardwork]');
@@ -27,10 +25,9 @@ if (isset($_POST['niteoCS_overlay_opacity_hardwork'])) {
27
  $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity[hardwork]');
28
  }
29
 
30
- // get options
31
- $niteoCS_font_color = get_option('niteoCS_font_color[hardwork]', '#ffffff');
32
- $niteoCS_overlay_color = get_option('niteoCS_overlay_color[hardwork]', '#0a0a0a');
33
- $niteoCS_overlay_opacity_hardwork = get_option('niteoCS_overlay_opacity[hardwork]', '0.5');
34
 
35
  ?>
36
 
@@ -40,9 +37,9 @@ $niteoCS_overlay_opacity_hardwork = get_option('niteoCS_overlay_opacity[hardwork
40
  #copyright-section {display: none!important;}
41
  </style>
42
 
43
- <div class="table-wrapper content">
44
  <h3><?php _e('Customize Colors', 'cmp-coming-soon-maintenance');?></h3>
45
- <table class="content">
46
 
47
  <tr>
48
  <th><h4><?php _e('Font Color', 'cmp-coming-soon-maintenance');?></h4></th>
@@ -63,11 +60,14 @@ $niteoCS_overlay_opacity_hardwork = get_option('niteoCS_overlay_opacity[hardwork
63
  </fieldset>
64
  </td>
65
  </tr>
 
 
 
 
 
 
66
  </table>
67
- <p class="cmp-submit">
68
- <?php wp_nonce_field('save_options','save_options_field'); ?>
69
- <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
70
- </p>
71
  </div>
72
 
73
 
9
  }
10
 
11
 
 
 
12
  if (isset($_POST['niteoCS_font_color_hardwork'])) {
13
  update_option('niteoCS_font_color[hardwork]', sanitize_hex_color($_POST['niteoCS_font_color_hardwork']));
14
  $niteoCS_font_color = get_option('niteoCS_font_color[hardwork]');
25
  $niteoCS_overlay_opacity = get_option('niteoCS_overlay_opacity[hardwork]');
26
  }
27
 
28
+ $niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#494949');
29
+ $niteoCS_overlay_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
30
+ $niteoCS_overlay_opacity_hardwork = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.0');
 
31
 
32
  ?>
33
 
37
  #copyright-section {display: none!important;}
38
  </style>
39
 
40
+ <div class="table-wrapper theme-setup">
41
  <h3><?php _e('Customize Colors', 'cmp-coming-soon-maintenance');?></h3>
42
+ <table class="theme-setup">
43
 
44
  <tr>
45
  <th><h4><?php _e('Font Color', 'cmp-coming-soon-maintenance');?></h4></th>
60
  </fieldset>
61
  </td>
62
  </tr>
63
+ <tr><th>
64
+ <p class="cmp-submit">
65
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
66
+ <input type="submit" name="Submit" class="button cmp-button submit" value="<?php _e('Save All Changes', 'cmp-coming-soon-maintenance'); ?>" id="submitChanges" />
67
+ </p>
68
+ </th></tr>
69
  </table>
70
+
 
 
 
71
  </div>
72
 
73
 
themes/hardwork/hardwork-theme.php CHANGED
@@ -10,40 +10,38 @@
10
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
11
 
12
  <?php
13
- // get saved style options
14
  $ver = '1.8';
15
- $font_color = get_option('niteoCS_font_color[hardwork]', '#ffffff');
16
- $background_color = get_option('niteoCS_overlay_color[hardwork]', '#000000');
17
- $background_opa = get_option('niteoCS_overlay_opacity[hardwork]', '0.5');
18
- $heading_font = get_option('niteoCS_font_headings', 'Playfair Display');
19
- $content_font = get_option('niteoCS_font_content', 'Raleway');
20
- // get saved content options
21
- $logo_id = get_option('niteoCS_logo_id');
22
- $niteoCS_banner = get_option('niteoCS_banner', '2');
23
- $unplash_feed = get_option('niteoCS_unsplash_feed', '0');
 
 
 
 
 
 
 
 
 
 
 
24
  $social_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
25
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
26
  $body = get_option('niteoCS_body');
27
-
28
  // override options if theme preview isset
29
  if ( isset( $theme_preview ) && $theme_preview == 'hardwork' ) {
30
- $heading_font = 'Playfair Display';
31
- $content_font ='Raleway';
32
- $logo_id = '8';
33
- $niteoCS_banner = '2';
34
  $body_title = 'We will be back soon!';
35
  $body = '<p>Everti labores cu sea, ea eam choro semper, usu an quot vocibus euripidis. An vis porro insolens, ea graeci vulputate qui. Qui vidisse evertitur et, ea vis habemus fabellas. Everti labores cu sea, ea eam choro semper, usu an quot vocibus euripidis. An vis porro insolens, ea graeci vulputate qui. Qui vidisse evertitur et, ea vis habemus fabellas.</p>';
36
 
37
  }
38
 
39
- if ( $heading_font == 'custom' ) {
40
- $heading_font = get_option('niteoCS_font_headings_custom');
41
- }
42
-
43
- if ( $content_font == 'custom' ) {
44
- $content_font = get_option('niteoCS_font_content_custom');
45
- }
46
-
47
  // migrade social media to new option after update 1.4.0
48
  if ( !get_option('niteoCS_socialmedia') ) {
49
  $social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
@@ -77,6 +75,16 @@
77
  }
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
80
  if ( get_option( 'blog_public' ) == 0 ) {
81
  echo "<meta name='robots' content='noindex,nofollow' />";
82
  } ?>
@@ -86,11 +94,9 @@
86
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
87
  <?php
88
  } ?>
89
- <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/style.css?ver='.$ver ;?>" type="text/css" media="all"></link>
90
 
91
  <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
92
-
93
- <?php wp_site_icon();?>
94
 
95
  <style>
96
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
@@ -150,15 +156,11 @@
150
  } else {
151
  $size = 'full';
152
  }
153
- // get logo
154
- if ( $logo_id != '' ) {
155
- $logo_url = wp_get_attachment_image_src( $logo_id, $size);
156
- }
157
 
158
  switch ($niteoCS_banner) {
159
  // custom media
160
  case '0':
161
- $banner_id = get_option('niteoCS_banner_id');
162
  $background_class = 'image';
163
  if ( $banner_id != '' ) {
164
  $banner_ids = explode(',', $banner_id);
@@ -169,7 +171,7 @@
169
 
170
  } else {
171
  // set construct img
172
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/img/hardwork_banner_'.$size.'.jpg';
173
  }
174
  break;
175
 
@@ -179,22 +181,22 @@
179
  switch ( $unplash_feed ) {
180
  // SINGLE IMAGE
181
  case '0':
182
- $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0', '') );
183
  $banner_url = $this->niteo_unsplash( $params );
184
  break;
185
  // category random
186
  case '1':
187
- $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category'), 'custom_str' => get_option('niteoCS_cat_keyword', '') );
188
  $banner_url = $this->niteo_unsplash( $params );
189
  break;
190
  // collection
191
  case '2':
192
- $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2', '') );
193
  $banner_url = $this->niteo_unsplash( $params );
194
  break;
195
  // random photo
196
  case '3':
197
- $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'cat' => get_option('niteoCS_unsplash_feat', '0') );
198
  $banner_url = $this->niteo_unsplash( $params );
199
  break;
200
 
@@ -207,13 +209,13 @@
207
  case '2':
208
  // default image
209
  $background_class = 'image';
210
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/img/hardwork_banner_'.$size.'.jpg';
211
  break;
212
 
213
  case '3':
214
  // Pattern
215
  $background_class = 'pattern';
216
- $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
217
 
218
  if ($niteoCS_banner_pattern != 'custom') {
219
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
@@ -221,7 +223,7 @@
221
  echo '<!-- Background pattern from Subtle Patterns --!>';
222
 
223
  } else {
224
- $banner_url = get_option('niteoCS_banner_pattern_custom');
225
  }
226
 
227
  break;
@@ -229,7 +231,7 @@
229
  // Pattern
230
  $background_class = 'color';
231
  $banner_url = '';
232
- $niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
233
  echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
234
  break;
235
 
@@ -263,19 +265,38 @@
263
  ?>
264
 
265
  <section class="section section-body">
266
- <?php
267
- if ( isset($logo_url[0]) ) { ?>
268
  <div class="logo-wrapper">
269
- <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  </div>
271
- <?php
272
- }
273
 
 
 
274
  if ( $body_title != '' ) { ?>
275
  <h2><?php echo esc_html( $body_title );?></h2>
276
  <?php
277
  }
278
-
279
  echo apply_filters('the_content', stripslashes($body));?>
280
 
281
  </section>
10
  <title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
11
 
12
  <?php
 
13
  $ver = '1.8';
14
+ $themeslug = 'hardwork';
15
+ // get theme related settings
16
+ $font_color = get_option('niteoCS_font_color['.$themeslug.']', '#494949');
17
+ $background_color = get_option('niteoCS_overlay_color['.$themeslug.']', '#0a0a0a');
18
+ $background_opa = get_option('niteoCS_overlay_opacity['.$themeslug.']', '0.0');
19
+ $heading_font = get_option('niteoCS_font_headings['.$themeslug.']', 'Playfair Display');
20
+ $content_font = get_option('niteoCS_font_content['.$themeslug.']', 'Montserrat');
21
+ $logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
22
+ $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '4');
23
+ $unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
24
+
25
+ if ( $heading_font == 'custom' ) {
26
+ $heading_font = get_option('niteoCS_font_headings_custom['.$themeslug.']');
27
+ }
28
+
29
+ if ( $content_font == 'custom' ) {
30
+ $content_font = get_option('niteoCS_font_content_custom['.$themeslug.']');
31
+ }
32
+
33
+ // get global settings
34
  $social_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
35
  $body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
36
  $body = get_option('niteoCS_body');
37
+ $favicon_id = get_option('niteoCS_favicon_id');
38
  // override options if theme preview isset
39
  if ( isset( $theme_preview ) && $theme_preview == 'hardwork' ) {
 
 
 
 
40
  $body_title = 'We will be back soon!';
41
  $body = '<p>Everti labores cu sea, ea eam choro semper, usu an quot vocibus euripidis. An vis porro insolens, ea graeci vulputate qui. Qui vidisse evertitur et, ea vis habemus fabellas. Everti labores cu sea, ea eam choro semper, usu an quot vocibus euripidis. An vis porro insolens, ea graeci vulputate qui. Qui vidisse evertitur et, ea vis habemus fabellas.</p>';
42
 
43
  }
44
 
 
 
 
 
 
 
 
 
45
  // migrade social media to new option after update 1.4.0
46
  if ( !get_option('niteoCS_socialmedia') ) {
47
  $social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
75
  }
76
  }
77
 
78
+ // display favicon
79
+ if ( $favicon_id && $favicon_id != '' ) {
80
+ $favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
81
+ if ( isset($favicon_url[0]) ){
82
+ echo '<link id="favicon" rel="shortcut icon" href="'.$favicon_url[0].'" type="image/x-icon"/>';
83
+ }
84
+ } else {
85
+ wp_site_icon();
86
+ }
87
+
88
  if ( get_option( 'blog_public' ) == 0 ) {
89
  echo "<meta name='robots' content='noindex,nofollow' />";
90
  } ?>
94
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
95
  <?php
96
  } ?>
97
+ <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/style.css?ver='.$ver ;?>" type="text/css" media="all"></link>
98
 
99
  <link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
 
 
100
 
101
  <style>
102
  body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
156
  } else {
157
  $size = 'full';
158
  }
 
 
 
 
159
 
160
  switch ($niteoCS_banner) {
161
  // custom media
162
  case '0':
163
+ $banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
164
  $background_class = 'image';
165
  if ( $banner_id != '' ) {
166
  $banner_ids = explode(',', $banner_id);
171
 
172
  } else {
173
  // set construct img
174
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
175
  }
176
  break;
177
 
181
  switch ( $unplash_feed ) {
182
  // SINGLE IMAGE
183
  case '0':
184
+ $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
185
  $banner_url = $this->niteo_unsplash( $params );
186
  break;
187
  // category random
188
  case '1':
189
+ $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
190
  $banner_url = $this->niteo_unsplash( $params );
191
  break;
192
  // collection
193
  case '2':
194
+ $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
195
  $banner_url = $this->niteo_unsplash( $params );
196
  break;
197
  // random photo
198
  case '3':
199
+ $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
200
  $banner_url = $this->niteo_unsplash( $params );
201
  break;
202
 
209
  case '2':
210
  // default image
211
  $background_class = 'image';
212
+ $banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
213
  break;
214
 
215
  case '3':
216
  // Pattern
217
  $background_class = 'pattern';
218
+ $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
219
 
220
  if ($niteoCS_banner_pattern != 'custom') {
221
  $banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
223
  echo '<!-- Background pattern from Subtle Patterns --!>';
224
 
225
  } else {
226
+ $banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
227
  }
228
 
229
  break;
231
  // Pattern
232
  $background_class = 'color';
233
  $banner_url = '';
234
+ $niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#ffffff');
235
  echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
236
  break;
237
 
265
  ?>
266
 
267
  <section class="section section-body">
 
 
268
  <div class="logo-wrapper">
269
+ <?php
270
+ switch ($logo_type) {
271
+ case 'graphic':
272
+ // get logo id
273
+ $logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
274
+ // get logo
275
+ if ( $logo_id != '' ) {
276
+ $logo_url = wp_get_attachment_image_src( $logo_id, $size);
277
+ }
278
+ if ( isset($logo_url[0]) ) { ?>
279
+ <img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
280
+ <?php
281
+ }
282
+ break;
283
+ case 'text':
284
+ $text_logo = get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' )); ?>
285
+ <h1><?php echo esc_html($text_logo); ?></h1>
286
+ <?php
287
+ case 'disabled':
288
+ default:
289
+ break;
290
+ } ?>
291
  </div>
 
 
292
 
293
+ <?php
294
+ // display Title
295
  if ( $body_title != '' ) { ?>
296
  <h2><?php echo esc_html( $body_title );?></h2>
297
  <?php
298
  }
299
+ // display body
300
  echo apply_filters('the_content', stripslashes($body));?>
301
 
302
  </section>
themes/hardwork/style.css CHANGED
@@ -1,10 +1,10 @@
1
  /*
2
  Theme Name: Hardwork
3
- Theme URI: http://cmp.niteo.cz/?cmp_preview=true&theme=hardwork
4
  Author: Niteo
5
- Author URI: http://niteo.cz/
6
  Version: 1.8
7
- Details URI: {"1": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot1.jpg","2": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot2.jpg","3": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot3.jpg"}
8
  Description: <p>Hardwork is our default theme for CMP plugin. By default it is set to modern white screen with only one heading to display clear message: "This website is under construction, please come back later".</p><p>Set a fullscreen custom image or use any from thousands Unsplash Library media, set social icons, add custom texts with overlay color and you have beautiful colorful landing page both for Under construction or Coming soon page.</p><h4>Main Features</h4><ul><li>Fullscreen image with overlay color</li><li>Responsive design</li></ul>
9
 
10
  Normalizing styles have been helped along thanks to the fine work of
@@ -65,7 +65,8 @@ h1,h2,h3,h4,h5,h6{
65
 
66
 
67
  .section-body p {
68
- max-width: 70%;
 
69
  margin:1em auto;
70
  font-size: 1.1em;
71
  }
1
  /*
2
  Theme Name: Hardwork
3
+ Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork
4
  Author: Niteo
5
+ Author URI: https://niteothemes.com
6
  Version: 1.8
7
+ Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot1.jpg","2": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot2.jpg","3": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot3.jpg"}
8
  Description: <p>Hardwork is our default theme for CMP plugin. By default it is set to modern white screen with only one heading to display clear message: "This website is under construction, please come back later".</p><p>Set a fullscreen custom image or use any from thousands Unsplash Library media, set social icons, add custom texts with overlay color and you have beautiful colorful landing page both for Under construction or Coming soon page.</p><h4>Main Features</h4><ul><li>Fullscreen image with overlay color</li><li>Responsive design</li></ul>
9
 
10
  Normalizing styles have been helped along thanks to the fine work of
65
 
66
 
67
  .section-body p {
68
+ width: 70%;
69
+ max-width: 1170px;
70
  margin:1em auto;
71
  font-size: 1.1em;
72
  }